-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Summary
This bug is hidden most of the time but we get away with it in simple test cases so technically this test case "works" but only by accident.
Reproducer
I tried this code:
#[lang = "sized"]
trait Sized {}
trait Trait {
fn do_thing();
}
struct MyType;
impl Trait for MyType {
fn do_thing() {}
}
struct Wrapper<T: Trait> {
value: T,
}
impl<T: Trait> Wrapper<T> {
fn call_it() {
T::do_thing(); // <---------- this only works by accident... 'T' isnt getting monomorphized to MyType here
}
}
fn main() {
let _ = Wrapper::<MyType> { value: MyType };
Wrapper::<MyType>::call_it();
}
Does the code make use of any (1.49) nightly feature ?
- Nightly
Godbolt link
No response
Actual behavior
The current behavior is, it doesnt monomoprhize but there is only 1 impl anyway and it defaults
Expected behavior
I expected to see the type get monomorphized in the logs properly
GCC Version
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done