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