Lower index bounds checking to PtrMetadata, this time with the right fake borrow semantics 馃樃 by compiler-errors 路 Pull Request #135748 路 rust-lang/rust (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I don't really know what this has to do with error tainting?

Lowering this directly to a mir::Const::Ty causes ICEs even on code that's expected to pass, like when doing reads on a slice of &[(); T::ASSOC_CONST] when GCE is enabled (seetests/ui/const-generics/issues/issue-89146.rs) .

Anyways, this ICE is unrelated, and I'm going to fix it separately. I'm tracking that work in #135753. Either that one lands first, which will cause a conflict on this, or this one lands first and I'll fix the approach in this PR -- I don't think it needs to block this PR in any case.