rust/compiler/rustc_mir_build/src
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
..
builder Fix some use items that import more than necessary. 2025-02-24 09:30:42 +11:00
thir Rollup merge of #137686 - nbdd0121:asm_const, r=compiler-errors 2025-03-01 05:49:52 +01:00
check_tail_calls.rs Rollup merge of #135973 - WaffleLapkin:tail-track-caller-fix, r=compiler-errors 2025-02-07 12:01:56 +01:00
check_unsafety.rs Make a fake body to store typeck results for global_asm 2025-02-22 00:12:07 +00:00
errors.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
lib.rs Remove the mir_build hook. 2025-01-31 15:15:01 +11:00