2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-08-07 12:23:11 -05:00
|
|
|
trait Foo: Sized {
|
2014-05-19 16:27:03 -05:00
|
|
|
fn bar(&self);
|
|
|
|
fn baz(&self) { }
|
|
|
|
fn bah(_: Option<Self>) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
struct BarTy {
|
2015-03-25 19:06:52 -05:00
|
|
|
x : isize,
|
2014-05-19 16:27:03 -05:00
|
|
|
y : f64,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl BarTy {
|
|
|
|
fn a() {}
|
|
|
|
fn b(&self) {}
|
|
|
|
}
|
|
|
|
|
2014-12-18 16:46:26 -06:00
|
|
|
// If these fail, it's necessary to update rustc_resolve and the cfail tests.
|
2014-06-25 14:47:34 -05:00
|
|
|
impl Foo for *const BarTy {
|
2014-05-19 16:27:03 -05:00
|
|
|
fn bar(&self) {
|
|
|
|
self.baz();
|
|
|
|
BarTy::a();
|
2014-06-25 14:47:34 -05:00
|
|
|
Foo::bah(None::<*const BarTy>);
|
2014-05-19 16:27:03 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-18 16:46:26 -06:00
|
|
|
// If these fail, it's necessary to update rustc_resolve and the cfail tests.
|
2014-05-19 16:27:03 -05:00
|
|
|
impl<'a> Foo for &'a BarTy {
|
|
|
|
fn bar(&self) {
|
|
|
|
self.baz();
|
|
|
|
self.x;
|
|
|
|
self.y;
|
|
|
|
BarTy::a();
|
|
|
|
Foo::bah(None::<&BarTy>);
|
|
|
|
self.b();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-18 16:46:26 -06:00
|
|
|
// If these fail, it's necessary to update rustc_resolve and the cfail tests.
|
2014-05-19 16:27:03 -05:00
|
|
|
impl<'a> Foo for &'a mut BarTy {
|
|
|
|
fn bar(&self) {
|
|
|
|
self.baz();
|
|
|
|
self.x;
|
|
|
|
self.y;
|
|
|
|
BarTy::a();
|
|
|
|
Foo::bah(None::<&mut BarTy>);
|
|
|
|
self.b();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-18 16:46:26 -06:00
|
|
|
// If these fail, it's necessary to update rustc_resolve and the cfail tests.
|
2014-05-19 16:27:03 -05:00
|
|
|
impl Foo for Box<BarTy> {
|
|
|
|
fn bar(&self) {
|
|
|
|
self.baz();
|
|
|
|
Foo::bah(None::<Box<BarTy>>);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-18 16:46:26 -06:00
|
|
|
// If these fail, it's necessary to update rustc_resolve and the cfail tests.
|
2015-03-25 19:06:52 -05:00
|
|
|
impl Foo for *const isize {
|
2014-05-19 16:27:03 -05:00
|
|
|
fn bar(&self) {
|
|
|
|
self.baz();
|
2015-03-25 19:06:52 -05:00
|
|
|
Foo::bah(None::<*const isize>);
|
2014-05-19 16:27:03 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-18 16:46:26 -06:00
|
|
|
// If these fail, it's necessary to update rustc_resolve and the cfail tests.
|
2015-03-25 19:06:52 -05:00
|
|
|
impl<'a> Foo for &'a isize {
|
2014-05-19 16:27:03 -05:00
|
|
|
fn bar(&self) {
|
|
|
|
self.baz();
|
2015-03-25 19:06:52 -05:00
|
|
|
Foo::bah(None::<&isize>);
|
2014-05-19 16:27:03 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-18 16:46:26 -06:00
|
|
|
// If these fail, it's necessary to update rustc_resolve and the cfail tests.
|
2015-03-25 19:06:52 -05:00
|
|
|
impl<'a> Foo for &'a mut isize {
|
2014-05-19 16:27:03 -05:00
|
|
|
fn bar(&self) {
|
|
|
|
self.baz();
|
2015-03-25 19:06:52 -05:00
|
|
|
Foo::bah(None::<&mut isize>);
|
2014-05-19 16:27:03 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-18 16:46:26 -06:00
|
|
|
// If these fail, it's necessary to update rustc_resolve and the cfail tests.
|
2015-03-25 19:06:52 -05:00
|
|
|
impl Foo for Box<isize> {
|
2014-05-19 16:27:03 -05:00
|
|
|
fn bar(&self) {
|
|
|
|
self.baz();
|
2015-03-25 19:06:52 -05:00
|
|
|
Foo::bah(None::<Box<isize>>);
|
2014-05-19 16:27:03 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|