Skip to content

Commit abf2e00

Browse files
committed
Auto merge of #67853 - Centril:rollup-sx5zi9n, r=Centril
Rollup of 8 pull requests Successful merges: - #66913 (Suggest calling method when first argument is `self`) - #67531 (no longer promote non-pattern const functions) - #67773 (Add a test for #37333) - #67786 (Nix reexports from `rustc_span` in `syntax`) - #67789 (Cleanup linkchecker whitelist) - #67810 (Implement uncommon_codepoints lint.) - #67835 (tweak wording of mismatched delimiter errors) - #67845 (Also remove const-hack for abs) Failed merges: r? @ghost
2 parents e845e69 + 745f771 commit abf2e00

File tree

299 files changed

+758
-537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+758
-537
lines changed

Cargo.lock

+16
Original file line numberDiff line numberDiff line change
@@ -3642,6 +3642,7 @@ dependencies = [
36423642
"rustc_span",
36433643
"rustc_target",
36443644
"syntax",
3645+
"unicode-security",
36453646
]
36463647

36473648
[[package]]
@@ -4940,6 +4941,21 @@ dependencies = [
49404941
"smallvec 1.0.0",
49414942
]
49424943

4944+
[[package]]
4945+
name = "unicode-script"
4946+
version = "0.4.0"
4947+
source = "registry+https://github.com./rust-lang/crates.io-index"
4948+
checksum = "5b2c5c29e805da6817f5af6a627d65adb045cebf05cccd5a3493d6109454391c"
4949+
4950+
[[package]]
4951+
name = "unicode-security"
4952+
version = "0.0.2"
4953+
source = "registry+https://github.com./rust-lang/crates.io-index"
4954+
checksum = "c49d35967fa037b881acc34ef717c38c4b5560eba10e3685271b3f530bb19634"
4955+
dependencies = [
4956+
"unicode-script",
4957+
]
4958+
49434959
[[package]]
49444960
name = "unicode-segmentation"
49454961
version = "1.6.0"

src/libcore/num/mod.rs

+6-18
Original file line numberDiff line numberDiff line change
@@ -1997,27 +1997,15 @@ $EndFeature, "
19971997
```"),
19981998
#[stable(feature = "rust1", since = "1.0.0")]
19991999
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
2000+
#[allow_internal_unstable(const_if_match)]
20002001
#[inline]
20012002
#[rustc_inherit_overflow_checks]
20022003
pub const fn abs(self) -> Self {
2003-
// Note that the #[inline] above means that the overflow
2004-
// semantics of the subtraction depend on the crate we're being
2005-
// inlined into.
2006-
2007-
// sign is -1 (all ones) for negative numbers, 0 otherwise.
2008-
let sign = self >> ($BITS - 1);
2009-
// For positive self, sign == 0 so the expression is simply
2010-
// (self ^ 0) - 0 == self == abs(self).
2011-
//
2012-
// For negative self, self ^ sign == self ^ all_ones.
2013-
// But all_ones ^ self == all_ones - self == -1 - self.
2014-
// So for negative numbers, (self ^ sign) - sign is
2015-
// (-1 - self) - -1 == -self == abs(self).
2016-
//
2017-
// The subtraction overflows when self is min_value(), because
2018-
// (-1 - min_value()) - -1 is max_value() - -1 which overflows.
2019-
// This is exactly when we want self.abs() to overflow.
2020-
(self ^ sign) - sign
2004+
if self.is_negative() {
2005+
-self
2006+
} else {
2007+
self
2008+
}
20212009
}
20222010
}
20232011

src/libcore/time.rs

-3
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ impl Duration {
172172
/// ```
173173
#[stable(feature = "duration", since = "1.3.0")]
174174
#[inline]
175-
#[rustc_promotable]
176175
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
177176
pub const fn from_millis(millis: u64) -> Duration {
178177
Duration {
@@ -195,7 +194,6 @@ impl Duration {
195194
/// ```
196195
#[stable(feature = "duration_from_micros", since = "1.27.0")]
197196
#[inline]
198-
#[rustc_promotable]
199197
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
200198
pub const fn from_micros(micros: u64) -> Duration {
201199
Duration {
@@ -218,7 +216,6 @@ impl Duration {
218216
/// ```
219217
#[stable(feature = "duration_extras", since = "1.27.0")]
220218
#[inline]
221-
#[rustc_promotable]
222219
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
223220
pub const fn from_nanos(nanos: u64) -> Duration {
224221
Duration {

src/librustc/arena.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ macro_rules! arena_types {
9494
>
9595
>,
9696
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
97-
syntax::symbol::Symbol,
97+
rustc_span::symbol::Symbol,
9898
rustc::hir::def_id::DefId,
9999
>,
100100
[few] resolve_lifetimes: rustc::middle::resolve_lifetime::ResolveLifetimes,
@@ -105,7 +105,7 @@ macro_rules! arena_types {
105105
[few] privacy_access_levels: rustc::middle::privacy::AccessLevels,
106106
[few] target_features_whitelist: rustc_data_structures::fx::FxHashMap<
107107
String,
108-
Option<syntax::symbol::Symbol>
108+
Option<rustc_span::symbol::Symbol>
109109
>,
110110
[few] wasm_import_module_map: rustc_data_structures::fx::FxHashMap<
111111
rustc::hir::def_id::DefId,

src/librustc/hir/check_attr.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ use crate::lint::builtin::UNUSED_ATTRIBUTES;
1212
use crate::ty::query::Providers;
1313
use crate::ty::TyCtxt;
1414

15+
use rustc_error_codes::*;
16+
use rustc_span::symbol::sym;
1517
use rustc_span::Span;
16-
use std::fmt::{self, Display};
17-
use syntax::{attr, symbol::sym};
18+
use syntax::attr;
1819

19-
use rustc_error_codes::*;
20+
use std::fmt::{self, Display};
2021

2122
#[derive(Copy, Clone, PartialEq)]
2223
pub(crate) enum MethodKind {

src/librustc/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use crate::session::Session;
1111
use crate::util::nodemap::FxHashMap;
1212
use rustc_data_structures::svh::Svh;
1313
use rustc_index::vec::IndexVec;
14+
use rustc_span::source_map::SourceMap;
1415
use rustc_span::Span;
1516
use std::iter::repeat;
1617
use syntax::ast::NodeId;
17-
use syntax::source_map::SourceMap;
1818

1919
use crate::ich::StableHashingContext;
2020
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ use crate::util::nodemap::FxHashMap;
1717
use rustc_data_structures::svh::Svh;
1818
use rustc_index::vec::IndexVec;
1919
use rustc_span::hygiene::MacroKind;
20+
use rustc_span::source_map::Spanned;
2021
use rustc_span::{Span, DUMMY_SP};
2122
use rustc_target::spec::abi::Abi;
2223
use syntax::ast::{self, Name, NodeId};
23-
use syntax::source_map::Spanned;
2424

2525
pub mod blocks;
2626
mod collector;

src/librustc/hir/print.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
use rustc_span::source_map::{SourceMap, Spanned};
2+
use rustc_span::symbol::kw;
13
use rustc_span::{self, BytePos, FileName};
24
use rustc_target::spec::abi::Abi;
35
use syntax::ast;
46
use syntax::print::pp::Breaks::{Consistent, Inconsistent};
57
use syntax::print::pp::{self, Breaks};
68
use syntax::print::pprust::{self, Comments, PrintState};
79
use syntax::sess::ParseSess;
8-
use syntax::source_map::{SourceMap, Spanned};
9-
use syntax::symbol::kw;
1010
use syntax::util::parser::{self, AssocOp, Fixity};
1111

1212
use crate::hir;

src/librustc/ich/hcx.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use crate::ty::{fast_reject, TyCtxt};
99

1010
use std::cmp::Ord;
1111

12+
use rustc_span::source_map::SourceMap;
13+
use rustc_span::symbol::Symbol;
1214
use rustc_span::{BytePos, SourceFile};
1315
use syntax::ast;
14-
use syntax::source_map::SourceMap;
15-
use syntax::symbol::Symbol;
1616

1717
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1818
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};

src/librustc/ich/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ pub use self::hcx::{
44
hash_stable_trait_impls, NodeIdHashingMode, StableHashingContext, StableHashingContextProvider,
55
};
66
crate use rustc_data_structures::fingerprint::Fingerprint;
7+
use rustc_span::symbol::{sym, Symbol};
78
pub use rustc_span::CachingSourceMapView;
8-
use syntax::symbol::{sym, Symbol};
99

1010
mod hcx;
1111

src/librustc/infer/canonical/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ use crate::ty::{self, BoundVar, List, Region, TyCtxt};
3030
use rustc_index::vec::IndexVec;
3131
use rustc_macros::HashStable;
3232
use rustc_serialize::UseSpecializedDecodable;
33+
use rustc_span::source_map::Span;
3334
use smallvec::SmallVec;
3435
use std::ops::Index;
35-
use syntax::source_map::Span;
3636

3737
mod canonicalizer;
3838

src/librustc/infer/error_reporting/need_type_info.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use crate::infer::InferCtxt;
66
use crate::ty::print::Print;
77
use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
88
use errors::{Applicability, DiagnosticBuilder};
9+
use rustc_span::source_map::DesugaringKind;
10+
use rustc_span::symbol::kw;
911
use rustc_span::Span;
1012
use std::borrow::Cow;
11-
use syntax::source_map::DesugaringKind;
12-
use syntax::symbol::kw;
1313

1414
use rustc_error_codes::*;
1515

src/librustc/infer/error_reporting/nice_region_error/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::infer::InferCtxt;
44
use crate::ty::{self, TyCtxt};
55
use crate::util::common::ErrorReported;
66
use errors::DiagnosticBuilder;
7-
use syntax::source_map::Span;
7+
use rustc_span::source_map::Span;
88

99
mod different_lifetimes;
1010
mod find_anon_type;

src/librustc/infer/type_variable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::hir::def_id::DefId;
22
use crate::ty::{self, Ty, TyVid};
3+
use rustc_span::symbol::Symbol;
34
use rustc_span::Span;
4-
use syntax::symbol::Symbol;
55

66
use rustc_data_structures::snapshot_vec as sv;
77
use rustc_data_structures::unify as ut;

src/librustc/infer/unify_key.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::ty::{self, FloatVarValue, InferConst, IntVarValue, Ty, TyCtxt};
22
use rustc_data_structures::unify::InPlace;
33
use rustc_data_structures::unify::{EqUnifyValue, NoError, UnificationTable, UnifyKey, UnifyValue};
4+
use rustc_span::symbol::Symbol;
45
use rustc_span::{Span, DUMMY_SP};
5-
use syntax::symbol::Symbol;
66

77
use std::cell::RefMut;
88
use std::cmp;

src/librustc/lint/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use crate::middle::stability;
99
use crate::session::Session;
1010
use errors::{pluralize, Applicability, DiagnosticBuilder};
1111
use rustc_session::declare_lint;
12+
use rustc_span::edition::Edition;
13+
use rustc_span::source_map::Span;
14+
use rustc_span::symbol::Symbol;
1215
use syntax::ast;
1316
use syntax::early_buffered_lints::{ILL_FORMED_ATTRIBUTE_INPUT, META_VARIABLE_MISUSE};
14-
use syntax::edition::Edition;
15-
use syntax::source_map::Span;
16-
use syntax::symbol::Symbol;
1717

1818
declare_lint! {
1919
pub EXCEEDING_BITSHIFTS,

src/librustc/lint/internal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::lint::{
88
use errors::Applicability;
99
use rustc_data_structures::fx::FxHashMap;
1010
use rustc_session::declare_tool_lint;
11+
use rustc_span::symbol::{sym, Symbol};
1112
use syntax::ast::{Ident, Item, ItemKind};
12-
use syntax::symbol::{sym, Symbol};
1313

1414
declare_tool_lint! {
1515
pub rustc::DEFAULT_HASH_TYPES,

src/librustc/lint/levels.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ use crate::session::Session;
99
use crate::util::nodemap::FxHashMap;
1010
use errors::{Applicability, DiagnosticBuilder};
1111
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
12+
use rustc_span::source_map::MultiSpan;
13+
use rustc_span::symbol::{sym, Symbol};
1214
use syntax::ast;
1315
use syntax::attr;
1416
use syntax::feature_gate;
1517
use syntax::print::pprust;
16-
use syntax::source_map::MultiSpan;
17-
use syntax::symbol::{sym, Symbol};
1818

1919
use rustc_error_codes::*;
2020

src/librustc/lint/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ use crate::ty::TyCtxt;
3333
use crate::util::nodemap::NodeMap;
3434
use errors::{DiagnosticBuilder, DiagnosticId};
3535
use rustc_span::hygiene::MacroKind;
36+
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
37+
use rustc_span::symbol::Symbol;
3638
use rustc_span::Span;
3739
use syntax::ast;
38-
use syntax::source_map::{DesugaringKind, ExpnKind, MultiSpan};
39-
use syntax::symbol::Symbol;
4040

4141
pub use crate::lint::context::{
4242
check_ast_crate, check_crate, late_lint_mod, BufferedEarlyLint, CheckLintNameResult,

src/librustc/middle/cstore.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ use rustc_data_structures::svh::Svh;
1212

1313
use rustc_data_structures::sync::{self, MetadataRef};
1414
use rustc_macros::HashStable;
15+
use rustc_span::symbol::Symbol;
1516
use rustc_span::Span;
1617
use rustc_target::spec::Target;
1718
use std::any::Any;
1819
use std::path::{Path, PathBuf};
1920
use syntax::ast;
2021
use syntax::expand::allocator::AllocatorKind;
21-
use syntax::symbol::Symbol;
2222

2323
pub use self::NativeLibraryKind::*;
2424
pub use rustc_session::utils::NativeLibraryKind;

src/librustc/middle/lang_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ use crate::util::nodemap::FxHashMap;
1919
use crate::hir;
2020
use crate::hir::itemlikevisit::ItemLikeVisitor;
2121
use rustc_macros::HashStable;
22+
use rustc_span::symbol::{sym, Symbol};
2223
use rustc_span::Span;
2324
use syntax::ast;
24-
use syntax::symbol::{sym, Symbol};
2525

2626
use rustc_error_codes::*;
2727

src/librustc/middle/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub mod free_region;
55
pub mod lang_items;
66
pub mod lib_features {
77
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
8-
use syntax::symbol::Symbol;
8+
use rustc_span::symbol::Symbol;
99

1010
#[derive(HashStable)]
1111
pub struct LibFeatures {

src/librustc/middle/recursion_limit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// just peeks and looks for that attribute.
77

88
use crate::session::Session;
9+
use rustc_span::symbol::{sym, Symbol};
910
use syntax::ast;
10-
use syntax::symbol::{sym, Symbol};
1111

1212
use rustc_data_structures::sync::Once;
1313

src/librustc/middle/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ use crate::ty::{self, TyCtxt};
1313
use crate::util::nodemap::{FxHashMap, FxHashSet};
1414
use errors::DiagnosticBuilder;
1515
use rustc_feature::GateIssue;
16+
use rustc_span::symbol::{sym, Symbol};
1617
use rustc_span::{MultiSpan, Span};
1718
use syntax::ast::CRATE_NODE_ID;
1819
use syntax::attr::{self, ConstStability, Deprecation, RustcDeprecation, Stability};
1920
use syntax::errors::Applicability;
2021
use syntax::feature_gate::feature_err_issue;
21-
use syntax::symbol::{sym, Symbol};
2222

2323
use std::num::NonZeroU32;
2424

src/librustc/middle/weak_lang_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use crate::hir::intravisit;
99
use crate::hir::intravisit::{NestedVisitorMap, Visitor};
1010
use crate::ty::TyCtxt;
1111
use rustc_data_structures::fx::FxHashSet;
12+
use rustc_span::symbol::{sym, Symbol};
1213
use rustc_span::Span;
1314
use rustc_target::spec::PanicStrategy;
1415
use syntax::ast;
15-
use syntax::symbol::{sym, Symbol};
1616

1717
use rustc_error_codes::*;
1818

src/librustc/mir/interpret/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use backtrace::Backtrace;
1111
use errors::DiagnosticBuilder;
1212
use hir::GeneratorKind;
1313
use rustc_macros::HashStable;
14+
use rustc_span::symbol::Symbol;
1415
use rustc_span::{Pos, Span};
1516
use rustc_target::spec::abi::Abi;
1617
use std::{any::Any, env, fmt};
17-
use syntax::symbol::Symbol;
1818

1919
use rustc_error_codes::*;
2020

src/librustc/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use rustc_index::bit_set::BitMatrix;
2727
use rustc_index::vec::{Idx, IndexVec};
2828
use rustc_macros::HashStable;
2929
use rustc_serialize::{Decodable, Encodable};
30+
use rustc_span::symbol::Symbol;
3031
use rustc_span::{Span, DUMMY_SP};
3132
use smallvec::SmallVec;
3233
use std::borrow::Cow;
@@ -36,7 +37,6 @@ use std::slice;
3637
use std::{iter, mem, option, u32};
3738
pub use syntax::ast::Mutability;
3839
use syntax::ast::Name;
39-
use syntax::symbol::Symbol;
4040

4141
pub use crate::mir::cache::{BodyAndCache, ReadOnlyBodyAndCache};
4242
pub use crate::mir::interpret::AssertMessage;

0 commit comments

Comments
 (0)