Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove List::is_noop #93077

Merged
merged 1 commit into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),)*
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_middle/src/ty/subst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = Ty<'tcx>> + 'a {
self.iter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ crate fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Option<St
let mut types_without_default_bounds = FxHashSet::default();
let sized_trait = tcx.lang_items().sized_trait();

if !substs.is_noop() {
if !substs.is_empty() {
types_without_default_bounds.extend(substs.types());
w.push('<');
w.push_str(
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// `foo.bar::<u32>(...)` -- 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(|_| {
Expand Down Expand Up @@ -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);
Expand Down