rust/compiler/rustc_hir_analysis
Matthias Krüger 174bbfb369
Rollup merge of #137686 - nbdd0121:asm_const, r=compiler-errors
Handle asm const similar to inline const

Previously, asm consts are handled similar to anon consts rather than inline consts. Anon consts are not good at dealing with lifetimes, because `type_of` has lifetimes erased already. Inline consts can deal with lifetimes because they live in an outer typeck context. And since `global_asm!` lacks an outer typeck context, we have implemented asm consts with anon consts while they're in fact more similar to inline consts.

This was changed in #137180, and this means that handling asm consts as inline consts are possible. While as `@compiler-errors` pointed out, `const` currently can't be used with any types with lifetime, this is about to change if #128464 is implemented. This PR is a preparatory PR for that feature.

As an unintentional side effect, fix #117877.

cc `@Amanieu`
r? `@compiler-errors`
2025-03-01 05:49:52 +01:00
..
src Rollup merge of #137686 - nbdd0121:asm_const, r=compiler-errors 2025-03-01 05:49:52 +01:00
Cargo.toml Upgrade the compiler to edition 2024 2025-02-22 00:01:48 +00:00
messages.ftl Don't require method impls for methods with Self:Sized bounds for impls for unsized types 2025-02-25 08:06:30 +00:00
README.md

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.