diff options
| author | David Tolnay <dtolnay@gmail.com> | 2021-08-20 13:33:38 -0700 |
|---|---|---|
| committer | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2021-08-22 12:06:18 -0500 |
| commit | c8bd550c8dc9b68d41696e044213a032b3d476d0 (patch) | |
| tree | 4ae3fb89bbd3a9a337f27688b759fad7cff09b1f | |
| parent | f7872887e941c2c312bbf664515078df3867c41f (diff) | |
| download | rust-c8bd550c8dc9b68d41696e044213a032b3d476d0.tar.gz rust-c8bd550c8dc9b68d41696e044213a032b3d476d0.zip | |
Add test for visibility on a trait item (currently wrong)
| -rw-r--r-- | tests/source/impls.rs | 8 | ||||
| -rw-r--r-- | tests/source/trait.rs | 7 | ||||
| -rw-r--r-- | tests/target/impls.rs | 8 | ||||
| -rw-r--r-- | tests/target/trait.rs | 7 |
4 files changed, 30 insertions, 0 deletions
diff --git a/tests/source/impls.rs b/tests/source/impls.rs index fb8701989fa..dcd1f0cd5b0 100644 --- a/tests/source/impls.rs +++ b/tests/source/impls.rs @@ -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" } } diff --git a/tests/source/trait.rs b/tests/source/trait.rs index 80ee0188a6b..b6db9e1590d 100644 --- a/tests/source/trait.rs +++ b/tests/source/trait.rs @@ -174,3 +174,10 @@ Send + DDDDDDDD + DDDDDDDDD + EEEEEEE; + +trait Visible { + pub const C: i32; + pub type T; + pub fn f(); + pub fn g() {} +} diff --git a/tests/target/impls.rs b/tests/target/impls.rs index bf63f924a33..f5eebe3b394 100644 --- a/tests/target/impls.rs +++ b/tests/target/impls.rs @@ -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>, diff --git a/tests/target/trait.rs b/tests/target/trait.rs index 620046a71b2..0313d8d9b84 100644 --- a/tests/target/trait.rs +++ b/tests/target/trait.rs @@ -211,3 +211,10 @@ where + DDDDDDDD + DDDDDDDDD + EEEEEEE; + +trait Visible { + const C: i32; + pub type T; + fn f(); + fn g() {} +} |
