-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
adt_const_params: ICE when using reference to user-defined unsized type as const generic #119299
Comments
Regression in nightly-2023-06-03 found 9 bors merge commits in the specified range |
Minimized: #![feature(adt_const_params)]
#![allow(incomplete_features)]
use std::marker::ConstParamTy;
#[derive(Eq, PartialEq)]
struct Wrapper(*const ());
impl ConstParamTy for &'static Wrapper {}
fn take_const<const W: &'static Wrapper>() {}
fn main() {
const W: &Wrapper = &Wrapper(&());
take_const::<W>();
} You can't |
Indeed, what should happen here is that the code errors because you can't Cc @lcnr |
Ah, in fact this is a duplicate of #112124. |
Code
Removing the pointer from
ConstStrU
unbreaks the code.Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: