rust/compiler/rustc_mir_build
Matthias Krüger 7357cfbf3d
Rollup merge of #105147 - nbdd0121:inline_const_unsafe, r=oli-obk
Allow unsafe through inline const

Handle similar to closures.

Address https://github.com/rust-lang/rust/pull/104087#issuecomment-1324173328

Note that this PR does not fix the issue for `unsafe { [0; function_requiring_unsafe()] }`. This is fundamentally unfixable for MIR unsafeck IMO.

This PR also does not fix unsafety checking for inline const in pattern position. It actually breaks it, allowing unsafe functions to be used in inline const in pattern position without unsafe blocks. Inline const in pattern position is not visible in MIR so ignored by MIR unsafety checking (currently it is also not checked by borrow checker, which is the reason why it's considered an incomplete feature).

`@rustbot` label: +T-lang +F-inline_const
2022-12-13 19:57:09 +01:00
..
src Rollup merge of #105147 - nbdd0121:inline_const_unsafe, r=oli-obk 2022-12-13 19:57:09 +01:00
Cargo.toml interpret: use Either over Result when it is not representing an error condition 2022-11-18 10:18:32 +01:00