diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index f4703b22ecb..55c9b4d9ba1 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -90,7 +90,7 @@ macro call_intrinsic_match { match $intrinsic { $( sym::$name => { - assert!($substs.is_noop()); + assert!($substs.is_empty()); if let [$(ref $arg),*] = *$args { let ($($arg,)*) = ( $(codegen_operand($fx, $arg),)* diff --git a/compiler/rustc_middle/src/ty/subst.rs b/compiler/rustc_middle/src/ty/subst.rs index ab33fbcca15..63e9b58584c 100644 --- a/compiler/rustc_middle/src/ty/subst.rs +++ b/compiler/rustc_middle/src/ty/subst.rs @@ -275,10 +275,6 @@ impl<'a, 'tcx> InternalSubsts<'tcx> { } } - pub fn is_noop(&self) -> bool { - self.is_empty() - } - #[inline] pub fn types(&'a self) -> impl DoubleEndedIterator> + 'a { self.iter() diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs index cd2e0f18e0c..195a4a4a653 100644 --- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs @@ -484,7 +484,7 @@ crate fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Option FnCtxt<'a, 'tcx> { // `foo.bar::(...)` -- the `Self` type here will be the // type of `foo` (possibly adjusted), but we don't want to // include that. We want just the `[_, u32]` part. - if !method.substs.is_noop() { + if !method.substs.is_empty() { let method_generics = self.tcx.generics_of(method.def_id); if !method_generics.params.is_empty() { let user_type_annotation = self.infcx.probe(|_| { @@ -211,7 +211,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } pub fn write_substs(&self, node_id: hir::HirId, substs: SubstsRef<'tcx>) { - if !substs.is_noop() { + if !substs.is_empty() { debug!("write_substs({:?}, {:?}) in fcx {}", node_id, substs, self.tag()); self.typeck_results.borrow_mut().node_substs_mut().insert(node_id, substs);