Skip to content

Commit 43d508b

Browse files
authored
Rollup merge of #93077 - lcnr:write_substs, r=oli-obk
remove `List::is_noop` think that `is_noop` is actually less clear than just using `is_empty`
2 parents fe93f08 + 4bd571c commit 43d508b

File tree

4 files changed

+4
-8
lines changed
  • compiler
    • rustc_codegen_cranelift/src/intrinsics
    • rustc_middle/src/ty
    • rustc_trait_selection/src/traits/specialize
    • rustc_typeck/src/check/fn_ctxt

4 files changed

+4
-8
lines changed

compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ macro call_intrinsic_match {
9090
match $intrinsic {
9191
$(
9292
sym::$name => {
93-
assert!($substs.is_noop());
93+
assert!($substs.is_empty());
9494
if let [$(ref $arg),*] = *$args {
9595
let ($($arg,)*) = (
9696
$(codegen_operand($fx, $arg),)*

compiler/rustc_middle/src/ty/subst.rs

-4
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ impl<'a, 'tcx> InternalSubsts<'tcx> {
275275
}
276276
}
277277

278-
pub fn is_noop(&self) -> bool {
279-
self.is_empty()
280-
}
281-
282278
#[inline]
283279
pub fn types(&'a self) -> impl DoubleEndedIterator<Item = Ty<'tcx>> + 'a {
284280
self.iter()

compiler/rustc_trait_selection/src/traits/specialize/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ crate fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Option<St
484484
let mut types_without_default_bounds = FxHashSet::default();
485485
let sized_trait = tcx.lang_items().sized_trait();
486486

487-
if !substs.is_noop() {
487+
if !substs.is_empty() {
488488
types_without_default_bounds.extend(substs.types());
489489
w.push('<');
490490
w.push_str(

compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
182182
// `foo.bar::<u32>(...)` -- the `Self` type here will be the
183183
// type of `foo` (possibly adjusted), but we don't want to
184184
// include that. We want just the `[_, u32]` part.
185-
if !method.substs.is_noop() {
185+
if !method.substs.is_empty() {
186186
let method_generics = self.tcx.generics_of(method.def_id);
187187
if !method_generics.params.is_empty() {
188188
let user_type_annotation = self.infcx.probe(|_| {
@@ -211,7 +211,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
211211
}
212212

213213
pub fn write_substs(&self, node_id: hir::HirId, substs: SubstsRef<'tcx>) {
214-
if !substs.is_noop() {
214+
if !substs.is_empty() {
215215
debug!("write_substs({:?}, {:?}) in fcx {}", node_id, substs, self.tag());
216216

217217
self.typeck_results.borrow_mut().node_substs_mut().insert(node_id, substs);

0 commit comments

Comments
 (0)