-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE: symbol_names: unsupported constant of type 'str'
, -Cinstrument-coverage
#116303
Comments
Regression in nightly-2023-05-04 |
I tracked this down to the fact that rust/compiler/rustc_session/src/config.rs Lines 2769 to 2782 in 45a45c6
I can reproduce with just Conversely, if I modify the wrapper function So I believe this is actually an incompatibility between |
@rustbot claim |
With #127722, the original code causing the ICE should be updated as: #![feature(unsized_const_params)]
#[derive(PartialEq, Eq)]
struct MyStr(str);
impl std::marker::UnsizedConstParamTy for MyStr {}
fn function_with_my_str<const S: &'static MyStr>() -> &'static MyStr {
S
}
impl MyStr {
const fn new(s: &'static str) -> &'static MyStr {
unsafe { std::mem::transmute(s) }
}
}
pub fn main() {
let f = function_with_my_str::<{ MyStr::new("hello") }>();
} |
Also the |
Handle unsized consts with type `str` in v0 symbol mangling This PR fixes rust-lang#116303 by handling consts with type `str` in v0 symbol mangling as partial support for unsized consts. This PR is related to `#![feature(adt_const_params)]` (rust-lang#95174) and `#![feature(unsized_const_params)]` (rust-lang#128028). r? `@BoxyUwU`
Rollup merge of rust-lang#130344 - Jaic1:fix-116306, r=BoxyUwU Handle unsized consts with type `str` in v0 symbol mangling This PR fixes rust-lang#116303 by handling consts with type `str` in v0 symbol mangling as partial support for unsized consts. This PR is related to `#![feature(adt_const_params)]` (rust-lang#95174) and `#![feature(unsized_const_params)]` (rust-lang#128028). r? ``@BoxyUwU``
Code
rustc -Cinstrument-coverage
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: