mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-21 20:23:21 +00:00
Auto merge of #5665 - flip1995:rustup, r=matthiaskrgr
Rustup
r? @matthiaskrgr
I finally got to doing the rustup. Sorry for taking so long, I was busy the last few days.
@ebroto FYI: I had to add b6c58f0
to make Clippy pass the rustc test suite.
changelog: none
This commit is contained in:
commit
5713574991
@ -111,7 +111,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
|
||||
|
||||
let fn_def_id = cx.tcx.hir().local_def_id(hir_id);
|
||||
|
||||
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter().copied())
|
||||
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter())
|
||||
.filter(|p| !p.is_global())
|
||||
.filter_map(|obligation| {
|
||||
if let ty::PredicateKind::Trait(poly_trait_ref, _) = obligation.predicate.kind() {
|
||||
@ -173,14 +173,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
|
||||
!preds.is_empty() && {
|
||||
let ty_empty_region = cx.tcx.mk_imm_ref(cx.tcx.lifetimes.re_root_empty, ty);
|
||||
preds.iter().all(|t| {
|
||||
let ty_params = &t
|
||||
.skip_binder()
|
||||
.trait_ref
|
||||
.substs
|
||||
.iter()
|
||||
.skip(1)
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
let ty_params = &t.skip_binder().trait_ref.substs.iter().skip(1).collect::<Vec<_>>();
|
||||
implements_trait(cx, ty_empty_region, t.def_id(), ty_params)
|
||||
})
|
||||
},
|
||||
|
@ -279,13 +279,12 @@ impl EarlyLintPass for Write {
|
||||
if let (Some(fmt_str), expr) = self.check_tts(cx, &mac.args.inner_tokens(), true) {
|
||||
if fmt_str.symbol == Symbol::intern("") {
|
||||
let mut applicability = Applicability::MachineApplicable;
|
||||
let suggestion = expr.map_or_else(
|
||||
move || {
|
||||
applicability = Applicability::HasPlaceholders;
|
||||
Cow::Borrowed("v")
|
||||
},
|
||||
move |expr| snippet_with_applicability(cx, expr.span, "v", &mut applicability),
|
||||
);
|
||||
let suggestion = if let Some(e) = expr {
|
||||
snippet_with_applicability(cx, e.span, "v", &mut applicability)
|
||||
} else {
|
||||
applicability = Applicability::HasPlaceholders;
|
||||
Cow::Borrowed("v")
|
||||
};
|
||||
|
||||
span_lint_and_sugg(
|
||||
cx,
|
||||
|
@ -1,6 +1,5 @@
|
||||
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(str_strip)]
|
||||
|
||||
// FIXME: switch to something more ergonomic here, once available.
|
||||
// (Currently there is no way to opt into sysroot crates without `extern crate`.)
|
||||
|
@ -213,6 +213,10 @@ fn run_ui_cargo(config: &mut compiletest::Config) {
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
if cargo::is_rustc_test_suite() {
|
||||
return;
|
||||
}
|
||||
|
||||
config.mode = TestMode::Ui;
|
||||
config.src_base = Path::new("tests").join("ui-cargo").canonicalize().unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user