Skip to content

Commit

Permalink
Auto merge of #67853 - Centril:rollup-sx5zi9n, r=Centril
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Jan 4, 2020
2 parents e845e69 + 745f771 commit abf2e00
Show file tree
Hide file tree
Showing 299 changed files with 758 additions and 537 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock
Expand Up @@ -3642,6 +3642,7 @@ dependencies = [
"rustc_span",
"rustc_target",
"syntax",
"unicode-security",
]

[[package]]
Expand Down Expand Up @@ -4940,6 +4941,21 @@ dependencies = [
"smallvec 1.0.0",
]

[[package]]
name = "unicode-script"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b2c5c29e805da6817f5af6a627d65adb045cebf05cccd5a3493d6109454391c"

[[package]]
name = "unicode-security"
version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c49d35967fa037b881acc34ef717c38c4b5560eba10e3685271b3f530bb19634"
dependencies = [
"unicode-script",
]

[[package]]
name = "unicode-segmentation"
version = "1.6.0"
Expand Down
24 changes: 6 additions & 18 deletions src/libcore/num/mod.rs
Expand Up @@ -1997,27 +1997,15 @@ $EndFeature, "
```"),
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
#[allow_internal_unstable(const_if_match)]
#[inline]
#[rustc_inherit_overflow_checks]
pub const fn abs(self) -> Self {
// Note that the #[inline] above means that the overflow
// semantics of the subtraction depend on the crate we're being
// inlined into.

// sign is -1 (all ones) for negative numbers, 0 otherwise.
let sign = self >> ($BITS - 1);
// For positive self, sign == 0 so the expression is simply
// (self ^ 0) - 0 == self == abs(self).
//
// For negative self, self ^ sign == self ^ all_ones.
// But all_ones ^ self == all_ones - self == -1 - self.
// So for negative numbers, (self ^ sign) - sign is
// (-1 - self) - -1 == -self == abs(self).
//
// The subtraction overflows when self is min_value(), because
// (-1 - min_value()) - -1 is max_value() - -1 which overflows.
// This is exactly when we want self.abs() to overflow.
(self ^ sign) - sign
if self.is_negative() {
-self
} else {
self
}
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/libcore/time.rs
Expand Up @@ -172,7 +172,6 @@ impl Duration {
/// ```
#[stable(feature = "duration", since = "1.3.0")]
#[inline]
#[rustc_promotable]
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
pub const fn from_millis(millis: u64) -> Duration {
Duration {
Expand All @@ -195,7 +194,6 @@ impl Duration {
/// ```
#[stable(feature = "duration_from_micros", since = "1.27.0")]
#[inline]
#[rustc_promotable]
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
pub const fn from_micros(micros: u64) -> Duration {
Duration {
Expand All @@ -218,7 +216,6 @@ impl Duration {
/// ```
#[stable(feature = "duration_extras", since = "1.27.0")]
#[inline]
#[rustc_promotable]
#[rustc_const_stable(feature = "duration_consts", since = "1.32.0")]
pub const fn from_nanos(nanos: u64) -> Duration {
Duration {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/arena.rs
Expand Up @@ -94,7 +94,7 @@ macro_rules! arena_types {
>
>,
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
syntax::symbol::Symbol,
rustc_span::symbol::Symbol,
rustc::hir::def_id::DefId,
>,
[few] resolve_lifetimes: rustc::middle::resolve_lifetime::ResolveLifetimes,
Expand All @@ -105,7 +105,7 @@ macro_rules! arena_types {
[few] privacy_access_levels: rustc::middle::privacy::AccessLevels,
[few] target_features_whitelist: rustc_data_structures::fx::FxHashMap<
String,
Option<syntax::symbol::Symbol>
Option<rustc_span::symbol::Symbol>
>,
[few] wasm_import_module_map: rustc_data_structures::fx::FxHashMap<
rustc::hir::def_id::DefId,
Expand Down
7 changes: 4 additions & 3 deletions src/librustc/hir/check_attr.rs
Expand Up @@ -12,11 +12,12 @@ use crate::lint::builtin::UNUSED_ATTRIBUTES;
use crate::ty::query::Providers;
use crate::ty::TyCtxt;

use rustc_error_codes::*;
use rustc_span::symbol::sym;
use rustc_span::Span;
use std::fmt::{self, Display};
use syntax::{attr, symbol::sym};
use syntax::attr;

use rustc_error_codes::*;
use std::fmt::{self, Display};

#[derive(Copy, Clone, PartialEq)]
pub(crate) enum MethodKind {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/collector.rs
Expand Up @@ -11,10 +11,10 @@ use crate::session::Session;
use crate::util::nodemap::FxHashMap;
use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec;
use rustc_span::source_map::SourceMap;
use rustc_span::Span;
use std::iter::repeat;
use syntax::ast::NodeId;
use syntax::source_map::SourceMap;

use crate::ich::StableHashingContext;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/mod.rs
Expand Up @@ -17,10 +17,10 @@ use crate::util::nodemap::FxHashMap;
use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec;
use rustc_span::hygiene::MacroKind;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, DUMMY_SP};
use rustc_target::spec::abi::Abi;
use syntax::ast::{self, Name, NodeId};
use syntax::source_map::Spanned;

pub mod blocks;
mod collector;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/print.rs
@@ -1,12 +1,12 @@
use rustc_span::source_map::{SourceMap, Spanned};
use rustc_span::symbol::kw;
use rustc_span::{self, BytePos, FileName};
use rustc_target::spec::abi::Abi;
use syntax::ast;
use syntax::print::pp::Breaks::{Consistent, Inconsistent};
use syntax::print::pp::{self, Breaks};
use syntax::print::pprust::{self, Comments, PrintState};
use syntax::sess::ParseSess;
use syntax::source_map::{SourceMap, Spanned};
use syntax::symbol::kw;
use syntax::util::parser::{self, AssocOp, Fixity};

use crate::hir;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/ich/hcx.rs
Expand Up @@ -9,10 +9,10 @@ use crate::ty::{fast_reject, TyCtxt};

use std::cmp::Ord;

use rustc_span::source_map::SourceMap;
use rustc_span::symbol::Symbol;
use rustc_span::{BytePos, SourceFile};
use syntax::ast;
use syntax::source_map::SourceMap;
use syntax::symbol::Symbol;

use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ich/mod.rs
Expand Up @@ -4,8 +4,8 @@ pub use self::hcx::{
hash_stable_trait_impls, NodeIdHashingMode, StableHashingContext, StableHashingContextProvider,
};
crate use rustc_data_structures::fingerprint::Fingerprint;
use rustc_span::symbol::{sym, Symbol};
pub use rustc_span::CachingSourceMapView;
use syntax::symbol::{sym, Symbol};

mod hcx;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/canonical/mod.rs
Expand Up @@ -30,9 +30,9 @@ use crate::ty::{self, BoundVar, List, Region, TyCtxt};
use rustc_index::vec::IndexVec;
use rustc_macros::HashStable;
use rustc_serialize::UseSpecializedDecodable;
use rustc_span::source_map::Span;
use smallvec::SmallVec;
use std::ops::Index;
use syntax::source_map::Span;

mod canonicalizer;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/infer/error_reporting/need_type_info.rs
Expand Up @@ -6,10 +6,10 @@ use crate::infer::InferCtxt;
use crate::ty::print::Print;
use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
use errors::{Applicability, DiagnosticBuilder};
use rustc_span::source_map::DesugaringKind;
use rustc_span::symbol::kw;
use rustc_span::Span;
use std::borrow::Cow;
use syntax::source_map::DesugaringKind;
use syntax::symbol::kw;

use rustc_error_codes::*;

Expand Down
Expand Up @@ -4,7 +4,7 @@ use crate::infer::InferCtxt;
use crate::ty::{self, TyCtxt};
use crate::util::common::ErrorReported;
use errors::DiagnosticBuilder;
use syntax::source_map::Span;
use rustc_span::source_map::Span;

mod different_lifetimes;
mod find_anon_type;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/type_variable.rs
@@ -1,7 +1,7 @@
use crate::hir::def_id::DefId;
use crate::ty::{self, Ty, TyVid};
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use syntax::symbol::Symbol;

use rustc_data_structures::snapshot_vec as sv;
use rustc_data_structures::unify as ut;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/unify_key.rs
@@ -1,8 +1,8 @@
use crate::ty::{self, FloatVarValue, InferConst, IntVarValue, Ty, TyCtxt};
use rustc_data_structures::unify::InPlace;
use rustc_data_structures::unify::{EqUnifyValue, NoError, UnificationTable, UnifyKey, UnifyValue};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
use syntax::symbol::Symbol;

use std::cell::RefMut;
use std::cmp;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/lint/builtin.rs
Expand Up @@ -9,11 +9,11 @@ use crate::middle::stability;
use crate::session::Session;
use errors::{pluralize, Applicability, DiagnosticBuilder};
use rustc_session::declare_lint;
use rustc_span::edition::Edition;
use rustc_span::source_map::Span;
use rustc_span::symbol::Symbol;
use syntax::ast;
use syntax::early_buffered_lints::{ILL_FORMED_ATTRIBUTE_INPUT, META_VARIABLE_MISUSE};
use syntax::edition::Edition;
use syntax::source_map::Span;
use syntax::symbol::Symbol;

declare_lint! {
pub EXCEEDING_BITSHIFTS,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/internal.rs
Expand Up @@ -8,8 +8,8 @@ use crate::lint::{
use errors::Applicability;
use rustc_data_structures::fx::FxHashMap;
use rustc_session::declare_tool_lint;
use rustc_span::symbol::{sym, Symbol};
use syntax::ast::{Ident, Item, ItemKind};
use syntax::symbol::{sym, Symbol};

declare_tool_lint! {
pub rustc::DEFAULT_HASH_TYPES,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/lint/levels.rs
Expand Up @@ -9,12 +9,12 @@ use crate::session::Session;
use crate::util::nodemap::FxHashMap;
use errors::{Applicability, DiagnosticBuilder};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_span::source_map::MultiSpan;
use rustc_span::symbol::{sym, Symbol};
use syntax::ast;
use syntax::attr;
use syntax::feature_gate;
use syntax::print::pprust;
use syntax::source_map::MultiSpan;
use syntax::symbol::{sym, Symbol};

use rustc_error_codes::*;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/lint/mod.rs
Expand Up @@ -33,10 +33,10 @@ use crate::ty::TyCtxt;
use crate::util::nodemap::NodeMap;
use errors::{DiagnosticBuilder, DiagnosticId};
use rustc_span::hygiene::MacroKind;
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use syntax::ast;
use syntax::source_map::{DesugaringKind, ExpnKind, MultiSpan};
use syntax::symbol::Symbol;

pub use crate::lint::context::{
check_ast_crate, check_crate, late_lint_mod, BufferedEarlyLint, CheckLintNameResult,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/cstore.rs
Expand Up @@ -12,13 +12,13 @@ use rustc_data_structures::svh::Svh;

use rustc_data_structures::sync::{self, MetadataRef};
use rustc_macros::HashStable;
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use rustc_target::spec::Target;
use std::any::Any;
use std::path::{Path, PathBuf};
use syntax::ast;
use syntax::expand::allocator::AllocatorKind;
use syntax::symbol::Symbol;

pub use self::NativeLibraryKind::*;
pub use rustc_session::utils::NativeLibraryKind;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/lang_items.rs
Expand Up @@ -19,9 +19,9 @@ use crate::util::nodemap::FxHashMap;
use crate::hir;
use crate::hir::itemlikevisit::ItemLikeVisitor;
use rustc_macros::HashStable;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use syntax::ast;
use syntax::symbol::{sym, Symbol};

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/mod.rs
Expand Up @@ -5,7 +5,7 @@ pub mod free_region;
pub mod lang_items;
pub mod lib_features {
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use syntax::symbol::Symbol;
use rustc_span::symbol::Symbol;

#[derive(HashStable)]
pub struct LibFeatures {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/recursion_limit.rs
Expand Up @@ -6,8 +6,8 @@
// just peeks and looks for that attribute.

use crate::session::Session;
use rustc_span::symbol::{sym, Symbol};
use syntax::ast;
use syntax::symbol::{sym, Symbol};

use rustc_data_structures::sync::Once;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/stability.rs
Expand Up @@ -13,12 +13,12 @@ use crate::ty::{self, TyCtxt};
use crate::util::nodemap::{FxHashMap, FxHashSet};
use errors::DiagnosticBuilder;
use rustc_feature::GateIssue;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{MultiSpan, Span};
use syntax::ast::CRATE_NODE_ID;
use syntax::attr::{self, ConstStability, Deprecation, RustcDeprecation, Stability};
use syntax::errors::Applicability;
use syntax::feature_gate::feature_err_issue;
use syntax::symbol::{sym, Symbol};

use std::num::NonZeroU32;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/weak_lang_items.rs
Expand Up @@ -9,10 +9,10 @@ use crate::hir::intravisit;
use crate::hir::intravisit::{NestedVisitorMap, Visitor};
use crate::ty::TyCtxt;
use rustc_data_structures::fx::FxHashSet;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use rustc_target::spec::PanicStrategy;
use syntax::ast;
use syntax::symbol::{sym, Symbol};

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/interpret/error.rs
Expand Up @@ -11,10 +11,10 @@ use backtrace::Backtrace;
use errors::DiagnosticBuilder;
use hir::GeneratorKind;
use rustc_macros::HashStable;
use rustc_span::symbol::Symbol;
use rustc_span::{Pos, Span};
use rustc_target::spec::abi::Abi;
use std::{any::Any, env, fmt};
use syntax::symbol::Symbol;

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/mod.rs
Expand Up @@ -27,6 +27,7 @@ use rustc_index::bit_set::BitMatrix;
use rustc_index::vec::{Idx, IndexVec};
use rustc_macros::HashStable;
use rustc_serialize::{Decodable, Encodable};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
use smallvec::SmallVec;
use std::borrow::Cow;
Expand All @@ -36,7 +37,6 @@ use std::slice;
use std::{iter, mem, option, u32};
pub use syntax::ast::Mutability;
use syntax::ast::Name;
use syntax::symbol::Symbol;

pub use crate::mir::cache::{BodyAndCache, ReadOnlyBodyAndCache};
pub use crate::mir::interpret::AssertMessage;
Expand Down

0 comments on commit abf2e00

Please sign in to comment.