-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
const_generics: link fails with undefined reference, hidden symbol isn't defined #83972
Comments
Builds correctly with |
@Dirbaio searched nightlies: from nightly-2021-03-26 to nightly-2021-04-07 bisected with cargo-bisect-rustc v0.6.0Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start 2021-03-26 |
The code I originally found this in does require The error also disappears when removing the braces in |
Verbose:
|
I'm seeing a similar error: #97186, with a very similar example! It seems that Passing |
#![feature(generic_const_exprs)]
pub trait Foo {
fn foo(&self);
}
pub struct FooImpl<const N: usize>;
impl<const N: usize> Foo for FooImpl<N> {
fn foo(&self) {}
}
pub trait Bar: 'static {
type Foo: Foo;
fn get() -> &'static Self::Foo;
}
struct BarImpl;
impl Bar for BarImpl {
type Foo = FooImpl<{{ 4 }}>;
fn get() -> &'static Self::Foo {
&FooImpl
}
}
pub fn boom<B: Bar>() {
B::get().foo();
}
fn main() {
boom::<BarImpl>();
} still an issue but the repro is slightly different (added some |
jup, should definitely be fixed |
This code (playground)
fails to link with
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: