2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2014-11-06 00:06:41 -08:00
|
|
|
// Test that the self param space is not used in a conflicting
|
|
|
|
// manner by unboxed closures within a default method on a trait
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2014-11-06 00:06:41 -08:00
|
|
|
trait Tr {
|
|
|
|
fn foo(&self);
|
|
|
|
|
|
|
|
fn bar(&self) {
|
2015-02-01 12:44:15 -05:00
|
|
|
(|| { self.foo() })()
|
2014-11-06 00:06:41 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Tr for () {
|
|
|
|
fn foo(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
().bar();
|
|
|
|
}
|