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

Lines changed: 16 additions & 0 deletions
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

Lines changed: 6 additions & 18 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)