-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
For visiting, I've identified these two examples:
rust/src/librustc/traits/structural_impls.rs
Lines 256 to 274 in 5aa8f19
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool { | |
match t.kind { | |
ty::Bound(debruijn, bound_ty) if debruijn == self.binder_index => { | |
self.types.insert( | |
bound_ty.var.as_u32(), | |
match bound_ty.kind { | |
ty::BoundTyKind::Param(name) => name, | |
ty::BoundTyKind::Anon => { | |
Symbol::intern(&format!("^{}", bound_ty.var.as_u32())) | |
} | |
}, | |
); | |
} | |
_ => (), | |
}; | |
t.super_visit_with(self) | |
} |
Lines 976 to 990 in 5aa8f19
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool { | |
// if we are only looking for "constrained" region, we have to | |
// ignore the inputs to a projection, as they may not appear | |
// in the normalized form | |
if self.just_constrained { | |
match t.kind { | |
ty::Projection(..) | ty::Opaque(..) => { | |
return false; | |
} | |
_ => {} | |
} | |
} | |
t.super_visit_with(self) | |
} |
(the latter would need to handle
ty::ConstKind::Unevaluated
the same way ty::Projection
is handled, as "unevaluated" consts are effectively projections)
For folding, I've listed one missing fold_const
and two which are missing some recursion, in #70125 (comment).
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.