Skip to content

Commit 37381d3

Browse files
committed
Fix sync fallout
1 parent e6f5dd5 commit 37381d3

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +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-
.collect::<Vec<_>>();
176+
let ty_params = &t.skip_binder().trait_ref.substs.iter().skip(1).collect::<Vec<_>>();
183177
implements_trait(cx, ty_empty_region, t.def_id(), ty_params)
184178
})
185179
},

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,

tests/compile-test.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ fn run_ui_toml(config: &mut compiletest::Config) {
153153
}
154154

155155
fn run_ui_cargo(config: &mut compiletest::Config) {
156-
if cargo::is_rustc_test_suite() {
157-
return;
158-
}
159156
fn run_tests(
160157
config: &compiletest::Config,
161158
filter: &Option<String>,
@@ -216,6 +213,10 @@ fn run_ui_cargo(config: &mut compiletest::Config) {
216213
Ok(result)
217214
}
218215

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

0 commit comments

Comments
 (0)