Skip to content

Commit 5713574

Browse files
committed
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
2 parents 7ea7cd1 + 37381d3 commit 5713574

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
111111

112112
let fn_def_id = cx.tcx.hir().local_def_id(hir_id);
113113

114-
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter().copied())
114+
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter())
115115
.filter(|p| !p.is_global())
116116
.filter_map(|obligation| {
117117
if let ty::PredicateKind::Trait(poly_trait_ref, _) = obligation.predicate.kind() {
@@ -173,14 +173,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
173173
!preds.is_empty() && {
174174
let ty_empty_region = cx.tcx.mk_imm_ref(cx.tcx.lifetimes.re_root_empty, ty);
175175
preds.iter().all(|t| {
176-
let ty_params = &t
177-
.skip_binder()
178-
.trait_ref
179-
.substs
180-
.iter()
181-
.skip(1)
182-
.cloned()
183-
.collect::<Vec<_>>();
176+
let ty_params = &t.skip_binder().trait_ref.substs.iter().skip(1).collect::<Vec<_>>();
184177
implements_trait(cx, ty_empty_region, t.def_id(), ty_params)
185178
})
186179
},

clippy_lints/src/write.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,12 @@ impl EarlyLintPass for Write {
279279
if let (Some(fmt_str), expr) = self.check_tts(cx, &mac.args.inner_tokens(), true) {
280280
if fmt_str.symbol == Symbol::intern("") {
281281
let mut applicability = Applicability::MachineApplicable;
282-
let suggestion = expr.map_or_else(
283-
move || {
284-
applicability = Applicability::HasPlaceholders;
285-
Cow::Borrowed("v")
286-
},
287-
move |expr| snippet_with_applicability(cx, expr.span, "v", &mut applicability),
288-
);
282+
let suggestion = if let Some(e) = expr {
283+
snippet_with_applicability(cx, e.span, "v", &mut applicability)
284+
} else {
285+
applicability = Applicability::HasPlaceholders;
286+
Cow::Borrowed("v")
287+
};
289288

290289
span_lint_and_sugg(
291290
cx,

src/driver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
22
#![feature(rustc_private)]
3-
#![feature(str_strip)]
43

54
// FIXME: switch to something more ergonomic here, once available.
65
// (Currently there is no way to opt into sysroot crates without `extern crate`.)

tests/compile-test.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ fn run_ui_cargo(config: &mut compiletest::Config) {
213213
Ok(result)
214214
}
215215

216+
if cargo::is_rustc_test_suite() {
217+
return;
218+
}
219+
216220
config.mode = TestMode::Ui;
217221
config.src_base = Path::new("tests").join("ui-cargo").canonicalize().unwrap();
218222

0 commit comments

Comments
 (0)