Auto merge of #92805 - BoxyUwU:revert-lazy-anon-const-substs, r=lcnr

partially revertish `lazily "compute" anon const default substs`

reverts #87280 except for some of the changes around `ty::Unevaluated` having a visitor and a generic for promoted
why revert: <https://github.com/rust-lang/rust/pull/92805#issuecomment-1010736049>

r? `@lcnr`
This commit is contained in:
bors 2022-01-16 11:19:21 +00:00
commit 7be8693984
123 changed files with 405 additions and 886 deletions

View file

@ -152,8 +152,8 @@ declare_lint! {
declare_lint_pass!(BoxPointers => [BOX_POINTERS]);
impl BoxPointers {
fn check_heap_type<'tcx>(&self, cx: &LateContext<'tcx>, span: Span, ty: Ty<'tcx>) {
for leaf in ty.walk(cx.tcx) {
fn check_heap_type(&self, cx: &LateContext<'_>, span: Span, ty: Ty<'_>) {
for leaf in ty.walk() {
if let GenericArgKind::Type(leaf_ty) = leaf.unpack() {
if leaf_ty.is_box() {
cx.struct_span_lint(BOX_POINTERS, span, |lint| {
@ -1662,7 +1662,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
ConstEquate(..) |
TypeWellFormedFromEnv(..) => continue,
};
if predicate.is_global(cx.tcx) {
if predicate.is_global() {
cx.struct_span_lint(TRIVIAL_BOUNDS, span, |lint| {
lint.build(&format!(
"{} bound {} does not depend on any type \