2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2021-03-04 10:35:11 -03:00
|
|
|
// compile-flags:-Zmir-opt-level=3
|
2017-09-06 22:06:50 -04:00
|
|
|
pub trait Foo {
|
|
|
|
fn bar(&self) -> usize { 2 }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo for () {
|
|
|
|
fn bar(&self) -> usize { 3 }
|
|
|
|
}
|
|
|
|
|
2017-09-06 23:10:08 -04:00
|
|
|
// Test a case where MIR would inline the default trait method
|
|
|
|
// instead of bailing out. Issue #40473.
|
2017-09-06 22:06:50 -04:00
|
|
|
fn main() {
|
|
|
|
let result = ().bar();
|
|
|
|
assert_eq!(result, 3);
|
|
|
|
}
|