-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
STR
$ cat mirline.rs
pub trait Foo {
fn bar(&self) {}
}
impl Foo for () {
fn bar(&self) { println!("Hello, World!"); }
}
pub fn main() {
().bar();
}
$ rustc mirline.rs -Z mir-opt-level=2
$ ./mirline
Expected Result
Code should print "Hello, World!"
Actual Result
Code does not print anything, because the empty default implementation is inlined.
cc @Aatch
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.