Add test for visibility on a trait item (currently wrong)

This commit is contained in:
David Tolnay 2021-08-20 13:33:38 -07:00 committed by Caleb Cartwright
parent f7872887e9
commit c8bd550c8d
4 changed files with 30 additions and 0 deletions

View File

@ -13,6 +13,14 @@ pub impl Foo for Bar {
// Comment 3
}
#[inherent]
impl Visible for Bar {
pub const C: i32;
pub type T;
pub fn f();
pub fn g() {}
}
pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y> where X: Foo<'a, Z> {
fn foo() { "hi" }
}

View File

@ -174,3 +174,10 @@ Send
+ DDDDDDDD
+ DDDDDDDDD
+ EEEEEEE;
trait Visible {
pub const C: i32;
pub type T;
pub fn f();
pub fn g() {}
}

View File

@ -21,6 +21,14 @@ pub impl Foo for Bar {
// Comment 3
}
#[inherent]
impl Visible for Bar {
pub const C: i32;
pub type T;
fn f();
pub fn g() {}
}
pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y>
where
X: Foo<'a, Z>,

View File

@ -211,3 +211,10 @@ where
+ DDDDDDDD
+ DDDDDDDDD
+ EEEEEEE;
trait Visible {
const C: i32;
pub type T;
fn f();
fn g() {}
}