Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #49875

Merged
merged 40 commits into from
Apr 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7719f53
Replace `structurally_resolved_type` in casts check.
leoyvens Feb 16, 2018
7353ef7
Replace `structurally_resolve_type` in unary expr check.
leoyvens Feb 18, 2018
0a5a5c3
revert making casts atomic, test order dependency
leoyvens Mar 22, 2018
5152a6f
Stabilize `Option::filter`.
tmccombs Apr 2, 2018
c7ac32a
Remove uses of option_filter feature
tmccombs Apr 5, 2018
20c499d
Fix ICE with impl Trait
sinkuu Apr 6, 2018
d985344
proc_macro: Generalize `FromIterator` impl
alexcrichton Apr 6, 2018
b9e04e5
Print region in case of ICE
sinkuu Apr 8, 2018
5edfb53
Properly look for uninhabitedness of variants in niche-filling check
nox Apr 1, 2018
eacfb33
Convert sort_by_key to sort_by_cached_key
varkor Mar 30, 2018
d3fe534
Convert sort_unstable_by_key to sort_by_cached_key
varkor Mar 30, 2018
5cd0504
Convert sort_unstable_by to sort_by_cached_key
varkor Mar 30, 2018
57eedba
Convert sort_by to sort_by_cached_key
varkor Mar 30, 2018
1aa6152
Add trivial early return for sort_by_cached_key
varkor Mar 31, 2018
2cc52f0
Use cmp::Reverse instead of subtraction
varkor Mar 31, 2018
e7aa139
Use sort_by_cached_key for partitioning
varkor Apr 1, 2018
a1d90a2
in which the non-shorthand patterns lint keeps its own counsel in macros
zackmdavis Apr 3, 2018
d326beb
Stop emitting color codes on TERM=dumb
Mark-Simulacrum Apr 9, 2018
f62c210
add regression test for issue #16223: fixed by NLL
Robbepop Apr 9, 2018
dab317f
Small nits to make couple of tests pass on mips targets.
Apr 3, 2018
1e5145d
Update ui test references.
Apr 5, 2018
0a94344
Add ignores for powerpc and s390x to target-feature-wrong.rs and upda…
Apr 10, 2018
18e9532
Add --enable-debug flag to musl CI build script
alecmocatta Apr 10, 2018
6e0089e
Do not uppercase-lint no_mangle statics
varkor Apr 10, 2018
5e53746
Fix "fp" feature for AArch64
Amanieu Apr 10, 2018
a648267
fixed typo
memoryleak47 Apr 10, 2018
77777b4
Rollup merge of #49525 - varkor:sort_by_cached_key-conversion, r=scot…
kennytm Apr 11, 2018
5ee5de1
Rollup merge of #49575 - tmccombs:option-filter-stabilize, r=withoutb…
kennytm Apr 11, 2018
63c4d50
Rollup merge of #49614 - zackmdavis:the_phantom_menace, r=petrochenkov
kennytm Apr 11, 2018
1bdb9a5
Rollup merge of #49665 - draganmladjenovic:mips_tests, r=nikomatsakis
kennytm Apr 11, 2018
f4b9fda
Rollup merge of #49781 - Robbepop:master, r=nikomatsakis
kennytm Apr 11, 2018
6eb66fc
Rollup merge of #49795 - nox:niche-with-uninhabited-fields, r=eddyb
kennytm Apr 11, 2018
4dbca4c
Rollup merge of #49809 - Mark-Simulacrum:no-color-for-dumb, r=alexcri…
kennytm Apr 11, 2018
0629309
Rollup merge of #49856 - varkor:no_mangle-statics-unlinted, r=michael…
kennytm Apr 11, 2018
7a70928
Rollup merge of #49863 - memoryleak47:andorid, r=oli-obk
kennytm Apr 11, 2018
dfdcf63
Rollup merge of #49857 - Amanieu:aarch64_fp, r=alexcrichton
kennytm Apr 11, 2018
57b15f6
Rollup merge of #49849 - alecmocatta:master, r=alexcrichton
kennytm Apr 11, 2018
574c050
Rollup merge of #49734 - alexcrichton:generalize-token-stream, r=niko…
kennytm Apr 11, 2018
484e6f0
Rollup merge of #49730 - sinkuu:fix_ice_49556, r=cramertj
kennytm Apr 11, 2018
9f6e5ae
Rollup merge of #48270 - leodasvacas:refactor-casts, r=nikomatsakis
kennytm Apr 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,9 @@ pub fn stream_cargo(
cargo.arg("--message-format").arg("json")
.stdout(Stdio::piped());

if stderr_isatty() && build.ci_env == CiEnv::None {
if stderr_isatty() && build.ci_env == CiEnv::None &&
// if the terminal is reported as dumb, then we don't want to enable color for rustc
env::var_os("TERM").map(|t| t != *"dumb").unwrap_or(true) {
// since we pass message-format=json to cargo, we need to tell the rustc
// wrapper to give us colored output if necessary. This is because we
// only want Cargo's JSON output, not rustcs.
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if [ ! -d $MUSL ]; then
fi

cd $MUSL
./configure --disable-shared --prefix=/musl-$TAG $@
./configure --enable-optimize --enable-debug --disable-shared --prefix=/musl-$TAG $@
if [ "$TAG" = "i586" -o "$TAG" = "i686" ]; then
hide_output make -j$(nproc) AR=ar RANLIB=ranlib
else
Expand Down
1 change: 1 addition & 0 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,7 @@ impl<T> [T] {
let sz_usize = mem::size_of::<(K, usize)>();

let len = self.len();
if len < 2 { return }
if sz_u8 < sz_u16 && len <= ( u8::MAX as usize) { return sort_by_key!( u8, self, f) }
if sz_u16 < sz_u32 && len <= (u16::MAX as usize) { return sort_by_key!(u16, self, f) }
if sz_u32 < sz_usize && len <= (u32::MAX as usize) { return sort_by_key!(u32, self, f) }
Expand Down
4 changes: 1 addition & 3 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,6 @@ impl<T> Option<T> {
/// # Examples
///
/// ```rust
/// #![feature(option_filter)]
///
/// fn is_even(n: &i32) -> bool {
/// n % 2 == 0
/// }
Expand All @@ -639,7 +637,7 @@ impl<T> Option<T> {
/// assert_eq!(Some(4).filter(is_even), Some(4));
/// ```
#[inline]
#[unstable(feature = "option_filter", issue = "45860")]
#[stable(feature = "option_filter", since = "1.27.0")]
pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self {
if let Some(x) = self {
if predicate(&x) {
Expand Down
11 changes: 9 additions & 2 deletions src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,16 @@ impl From<TokenTree> for TokenStream {
#[unstable(feature = "proc_macro", issue = "38356")]
impl iter::FromIterator<TokenTree> for TokenStream {
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
trees.into_iter().map(TokenStream::from).collect()
}
}

#[unstable(feature = "proc_macro", issue = "38356")]
impl iter::FromIterator<TokenStream> for TokenStream {
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
let mut builder = tokenstream::TokenStreamBuilder::new();
for tree in trees {
builder.push(tree.to_internal());
for stream in streams {
builder.push(stream.0);
}
TokenStream(builder.build())
}
Expand Down
8 changes: 6 additions & 2 deletions src/librustc/infer/anon_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,14 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ReverseMapper<'cx, 'gcx, 'tcx>
match r {
// ignore bound regions that appear in the type (e.g., this
// would ignore `'r` in a type like `for<'r> fn(&'r u32)`.
ty::ReLateBound(..) => return r,
ty::ReLateBound(..) |

// ignore `'static`, as that can appear anywhere
ty::ReStatic => return r,
ty::ReStatic |

// ignore `ReScope`, as that can appear anywhere
// See `src/test/run-pass/issue-49556.rs` for example.
ty::ReScope(..) => return r,

_ => { }
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
self.msg_span_from_early_bound_and_free_regions(region)
},
ty::ReStatic => ("the static lifetime".to_owned(), None),
_ => bug!(),
_ => bug!("{:?}", region),
}
}

Expand Down
1 change: 1 addition & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#![feature(refcell_replace_swap)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_patterns)]
#![feature(slice_sort_by_cached_key)]
#![feature(specialization)]
#![feature(unboxed_closures)]
#![feature(trace_macros)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ pub fn used_crates(tcx: TyCtxt, prefer: LinkagePreference)
.collect::<Vec<_>>();
let mut ordering = tcx.postorder_cnums(LOCAL_CRATE);
Lrc::make_mut(&mut ordering).reverse();
libs.sort_by_key(|&(a, _)| {
libs.sort_by_cached_key(|&(a, _)| {
ordering.iter().position(|x| *x == a)
});
libs
Expand Down
3 changes: 1 addition & 2 deletions src/librustc/ty/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use syntax::ast;
pub enum IntTy {
U(ast::UintTy),
I,
Ivar,
CEnum,
Bool,
Char
Expand Down Expand Up @@ -64,7 +63,7 @@ impl<'tcx> CastTy<'tcx> {
ty::TyBool => Some(CastTy::Int(IntTy::Bool)),
ty::TyChar => Some(CastTy::Int(IntTy::Char)),
ty::TyInt(_) => Some(CastTy::Int(IntTy::I)),
ty::TyInfer(ty::InferTy::IntVar(_)) => Some(CastTy::Int(IntTy::Ivar)),
ty::TyInfer(ty::InferTy::IntVar(_)) => Some(CastTy::Int(IntTy::I)),
ty::TyInfer(ty::InferTy::FloatVar(_)) => Some(CastTy::Float),
ty::TyUint(u) => Some(CastTy::Int(IntTy::U(u))),
ty::TyFloat(_) => Some(CastTy::Float),
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1471,10 +1471,10 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {

// Find one non-ZST variant.
'variants: for (v, fields) in variants.iter().enumerate() {
if fields.iter().any(|f| f.abi == Abi::Uninhabited) {
continue 'variants;
}
for f in fields {
if f.abi == Abi::Uninhabited {
continue 'variants;
}
if !f.is_zst() {
if dataful_variant.is_none() {
dataful_variant = Some(v);
Expand Down
11 changes: 3 additions & 8 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#![cfg_attr(unix, feature(libc))]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)]
#![feature(set_stdio)]
#![feature(rustc_stack_internals)]

Expand Down Expand Up @@ -82,7 +83,6 @@ use rustc_trans_utils::trans_crate::TransCrate;
use serialize::json::ToJson;

use std::any::Any;
use std::cmp::Ordering::Equal;
use std::cmp::max;
use std::default::Default;
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
Expand Down Expand Up @@ -1176,13 +1176,8 @@ Available lint options:

fn sort_lints(sess: &Session, lints: Vec<(&'static Lint, bool)>) -> Vec<&'static Lint> {
let mut lints: Vec<_> = lints.into_iter().map(|(x, _)| x).collect();
lints.sort_by(|x: &&Lint, y: &&Lint| {
match x.default_level(sess).cmp(&y.default_level(sess)) {
// The sort doesn't case-fold but it's doubtful we care.
Equal => x.name.cmp(y.name),
r => r,
}
});
// The sort doesn't case-fold but it's doubtful we care.
lints.sort_by_cached_key(|x: &&Lint| (x.default_level(sess), x.name));
lints
}

Expand Down
3 changes: 3 additions & 0 deletions src/librustc_lint/bad_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals {
fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
match it.node {
hir::ItemStatic(..) => {
if attr::find_by_name(&it.attrs, "no_mangle").is_some() {
return;
}
NonUpperCaseGlobals::check_upper_case(cx, "static variable", it.name, it.span);
}
hir::ItemConst(..) => {
Expand Down
6 changes: 6 additions & 0 deletions src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonShorthandFieldPatterns {
}
if let PatKind::Binding(_, _, name, None) = fieldpat.node.pat.node {
if name.node == fieldpat.node.name {
if let Some(_) = fieldpat.span.ctxt().outer().expn_info() {
// Don't lint if this is a macro expansion: macro authors
// shouldn't have to worry about this kind of style issue
// (Issue #49588)
return;
}
let mut err = cx.struct_span_lint(NON_SHORTHAND_FIELD_PATTERNS,
fieldpat.span,
&format!("the `{}:` in this pattern is redundant",
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,15 +1414,15 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> {
let mut all_impls: Vec<_> = visitor.impls.into_iter().collect();

// Bring everything into deterministic order for hashing
all_impls.sort_unstable_by_key(|&(trait_def_id, _)| {
all_impls.sort_by_cached_key(|&(trait_def_id, _)| {
tcx.def_path_hash(trait_def_id)
});

let all_impls: Vec<_> = all_impls
.into_iter()
.map(|(trait_def_id, mut impls)| {
// Bring everything into deterministic order for hashing
impls.sort_unstable_by_key(|&def_index| {
impls.sort_by_cached_key(|&def_index| {
tcx.hir.definitions().def_path_hash(def_index)
});

Expand Down
1 change: 1 addition & 0 deletions src/librustc_metadata/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#![feature(macro_lifetime_matcher)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)]
#![feature(specialization)]
#![feature(rustc_private)]

Expand Down
1 change: 1 addition & 0 deletions src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
*/

#![feature(slice_patterns)]
#![feature(slice_sort_by_cached_key)]
#![feature(from_ref)]
#![feature(box_patterns)]
#![feature(box_syntax)]
Expand Down
12 changes: 5 additions & 7 deletions src/librustc_mir/monomorphize/partitioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ use rustc::ty::{self, TyCtxt, InstanceDef};
use rustc::ty::item_path::characteristic_def_id_of_type;
use rustc::util::nodemap::{FxHashMap, FxHashSet};
use std::collections::hash_map::Entry;
use std::cmp;
use syntax::ast::NodeId;
use syntax::symbol::{Symbol, InternedString};
use rustc::mir::mono::MonoItem;
use monomorphize::item::{MonoItemExt, InstantiationMode};
use core::usize;

pub use rustc::mir::mono::CodegenUnit;

Expand Down Expand Up @@ -189,11 +189,9 @@ pub trait CodegenUnitExt<'tcx> {
}, item.symbol_name(tcx))
}

let items: Vec<_> = self.items().iter().map(|(&i, &l)| (i, l)).collect();
let mut items : Vec<_> = items.iter()
.map(|il| (il, item_sort_key(tcx, il.0))).collect();
items.sort_by(|&(_, ref key1), &(_, ref key2)| key1.cmp(key2));
items.into_iter().map(|(&item_linkage, _)| item_linkage).collect()
let mut items: Vec<_> = self.items().iter().map(|(&i, &l)| (i, l)).collect();
items.sort_by_cached_key(|&(i, _)| item_sort_key(tcx, i));
items
}
}

Expand Down Expand Up @@ -509,7 +507,7 @@ fn merge_codegen_units<'tcx>(initial_partitioning: &mut PreInliningPartitioning<
// Merge the two smallest codegen units until the target size is reached.
while codegen_units.len() > target_cgu_count {
// Sort small cgus to the back
codegen_units.sort_by_key(|cgu| usize::MAX - cgu.size_estimate());
codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate()));
let mut smallest = codegen_units.pop().unwrap();
let second_smallest = codegen_units.last_mut().unwrap();

Expand Down
17 changes: 8 additions & 9 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]

#![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)]

#[macro_use]
extern crate log;
Expand Down Expand Up @@ -1149,13 +1150,9 @@ impl<'a> ModuleData<'a> {

fn for_each_child_stable<F: FnMut(Ident, Namespace, &'a NameBinding<'a>)>(&self, mut f: F) {
let resolutions = self.resolutions.borrow();
let mut resolutions = resolutions.iter().map(|(&(ident, ns), &resolution)| {
// Pre-compute keys for sorting
(ident.name.as_str(), ns, ident, resolution)
})
.collect::<Vec<_>>();
resolutions.sort_unstable_by_key(|&(str, ns, ..)| (str, ns));
for &(_, ns, ident, resolution) in resolutions.iter() {
let mut resolutions = resolutions.iter().collect::<Vec<_>>();
resolutions.sort_by_cached_key(|&(&(ident, ns), _)| (ident.name.as_str(), ns));
for &(&(ident, ns), &resolution) in resolutions.iter() {
resolution.borrow().binding.map(|binding| f(ident, ns, binding));
}
}
Expand Down Expand Up @@ -3340,7 +3337,9 @@ impl<'a> Resolver<'a> {
let is_mod = |def| match def { Def::Mod(..) => true, _ => false };
let mut candidates =
self.lookup_import_candidates(name, TypeNS, is_mod);
candidates.sort_by_key(|c| (c.path.segments.len(), c.path.to_string()));
candidates.sort_by_cached_key(|c| {
(c.path.segments.len(), c.path.to_string())
});
if let Some(candidate) = candidates.get(0) {
format!("Did you mean `{}`?", candidate.path)
} else {
Expand Down Expand Up @@ -3578,7 +3577,7 @@ impl<'a> Resolver<'a> {

let name = path[path.len() - 1].name;
// Make sure error reporting is deterministic.
names.sort_by_key(|name| name.as_str());
names.sort_by_cached_key(|name| name.as_str());
match find_best_match_for_name(names.iter(), &name.as_str(), None) {
Some(found) if found != name => Some(found),
_ => None,
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ use std::ffi::CString;
use std::str;
use std::sync::Arc;
use std::time::{Instant, Duration};
use std::{i32, usize};
use std::i32;
use std::cmp;
use std::sync::mpsc;
use syntax_pos::Span;
use syntax_pos::symbol::InternedString;
Expand Down Expand Up @@ -830,7 +831,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
// a bit more efficiently.
let codegen_units = {
let mut codegen_units = codegen_units;
codegen_units.sort_by_key(|cgu| usize::MAX - cgu.size_estimate());
codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate()));
codegen_units
};

Expand Down
1 change: 1 addition & 0 deletions src/librustc_trans/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#![feature(libc)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)]
#![feature(optin_builtin_traits)]
#![feature(inclusive_range_fields)]
#![feature(underscore_lifetimes)]
Expand Down
1 change: 1 addition & 0 deletions src/librustc_trans/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
("x86", "pclmulqdq") => "pclmul",
("x86", "rdrand") => "rdrnd",
("x86", "bmi1") => "bmi",
("aarch64", "fp") => "fp-armv8",
("aarch64", "fp16") => "fullfp16",
(_, s) => s,
}
Expand Down
6 changes: 1 addition & 5 deletions src/librustc_typeck/check/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,7 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
ty::TypeVariants::TyInfer(t) => {
match t {
ty::InferTy::IntVar(_) |
ty::InferTy::FloatVar(_) |
ty::InferTy::FreshIntTy(_) |
ty::InferTy::FreshFloatTy(_) => {
Err(CastError::NeedDeref)
}
ty::InferTy::FloatVar(_) => Err(CastError::NeedDeref),
_ => Err(CastError::NeedViaPtr),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
.collect();

// sort them by the name so we have a stable result
names.sort_by_key(|n| n.as_str());
names.sort_by_cached_key(|n| n.as_str());
names
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ This API is completely unstable and subject to change.
#![feature(crate_visibility_modifier)]
#![feature(from_ref)]
#![feature(exhaustive_patterns)]
#![feature(option_filter)]
#![feature(quote)]
#![feature(refcell_replace_swap)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_patterns)]
#![feature(slice_sort_by_cached_key)]
#![feature(dyn_trait)]

#[macro_use] extern crate log;
Expand Down
4 changes: 1 addition & 3 deletions src/librustdoc/clean/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,9 +1437,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
// involved (impls rarely have more than a few bounds) means that it
// shouldn't matter in practice.
fn unstable_debug_sort<T: Debug>(&self, vec: &mut Vec<T>) {
vec.sort_unstable_by(|first, second| {
format!("{:?}", first).cmp(&format!("{:?}", second))
});
vec.sort_by_cached_key(|x| format!("{:?}", x))
}

fn is_fn_ty(&self, tcx: &TyCtxt, ty: &Type) -> bool {
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![feature(box_syntax)]
#![feature(fs_read_write)]
#![feature(set_stdio)]
#![feature(slice_sort_by_cached_key)]
#![feature(test)]
#![feature(unicode)]
#![feature(vec_remove_item)]
Expand Down
Loading