Skip to content

Commit

Permalink
Fix sync fallout
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed May 31, 2020
1 parent e6f5dd5 commit 37381d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
8 changes: 1 addition & 7 deletions clippy_lints/src/needless_pass_by_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +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)
.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)
})
},
Expand Down
13 changes: 6 additions & 7 deletions clippy_lints/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ fn run_ui_toml(config: &mut compiletest::Config) {
}

fn run_ui_cargo(config: &mut compiletest::Config) {
if cargo::is_rustc_test_suite() {
return;
}
fn run_tests(
config: &compiletest::Config,
filter: &Option<String>,
Expand Down Expand Up @@ -216,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();

Expand Down

0 comments on commit 37381d3

Please sign in to comment.