diff options
| author | bors <bors@rust-lang.org> | 2020-06-07 12:55:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-06-07 12:55:08 +0000 |
| commit | 67ec96c8f97ae810f72ccc08c8bf0c371ff11305 (patch) | |
| tree | 70d219f25692cbf37078482832a03e905461fe8a /clippy_lints/src | |
| parent | 5699672b5b69e829a8a51fc339e65f8c057bdf9e (diff) | |
| parent | d9aa26a14dca32e0c4f2718ad1d3322f0de1674d (diff) | |
Auto merge of #5691 - flip1995:rustup, r=matthiaskrgr
Rustup changelog: none
Diffstat (limited to 'clippy_lints/src')
| -rw-r--r-- | clippy_lints/src/future_not_send.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/lib.rs | 4 | ||||
| -rw-r--r-- | clippy_lints/src/utils/mod.rs | 5 | ||||
| -rw-r--r-- | clippy_lints/src/write.rs | 2 |
4 files changed, 9 insertions, 4 deletions
diff --git a/clippy_lints/src/future_not_send.rs b/clippy_lints/src/future_not_send.rs index 0a02aa7533c..17dd3cd5493 100644 --- a/clippy_lints/src/future_not_send.rs +++ b/clippy_lints/src/future_not_send.rs @@ -95,7 +95,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FutureNotSend { let trait_ref = trait_pred.to_poly_trait_ref(); db.note(&*format!( "`{}` doesn't implement `{}`", - trait_ref.self_ty(), + trait_ref.skip_binder().self_ty(), trait_ref.print_only_trait_path(), )); } diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 7e9a52fe69f..6f8923b2660 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -16,8 +16,6 @@ // FIXME: switch to something more ergonomic here, once available. // (Currently there is no way to opt into sysroot crates without `extern crate`.) #[allow(unused_extern_crates)] -extern crate fmt_macros; -#[allow(unused_extern_crates)] extern crate rustc_ast; #[allow(unused_extern_crates)] extern crate rustc_ast_pretty; @@ -48,6 +46,8 @@ extern crate rustc_mir; #[allow(unused_extern_crates)] extern crate rustc_parse; #[allow(unused_extern_crates)] +extern crate rustc_parse_format; +#[allow(unused_extern_crates)] extern crate rustc_session; #[allow(unused_extern_crates)] extern crate rustc_span; diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 9a6750c51ab..06638e7187b 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -325,6 +325,11 @@ pub fn implements_trait<'a, 'tcx>( trait_id: DefId, ty_params: &[GenericArg<'tcx>], ) -> bool { + // Do not check on infer_types to avoid panic in evaluate_obligation. + if ty.has_infer_types() { + return false; + } + let ty = cx.tcx.erase_regions(&ty); let ty_params = cx.tcx.mk_substs(ty_params.iter()); cx.tcx.type_implements_trait((trait_id, ty, ty_params, cx.param_env)) } diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs index 22ce484b24e..732f4b28e06 100644 --- a/clippy_lints/src/write.rs +++ b/clippy_lints/src/write.rs @@ -369,7 +369,7 @@ impl Write { tts: &TokenStream, is_write: bool, ) -> (Option<StrLit>, Option<Expr>) { - use fmt_macros::{ + use rustc_parse_format::{ AlignUnknown, ArgumentImplicitlyIs, ArgumentIs, ArgumentNamed, CountImplied, FormatSpec, ParseMode, Parser, Piece, }; |
