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