diff options
| author | bors <bors@rust-lang.org> | 2023-10-05 03:00:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-05 03:00:30 +0000 |
| commit | 5236c8e1fa25c45f11f02ae72fc27f64d86ba606 (patch) | |
| tree | a6996549a75b072383fa395656c8c98b308b65a1 /tests | |
| parent | b781645332971d028d1d17c475fa2c40919132ba (diff) | |
| parent | 06d9602d3310c2001f1fa9c15e2d502cad36dfc5 (diff) | |
| download | rust-5236c8e1fa25c45f11f02ae72fc27f64d86ba606.tar.gz rust-5236c8e1fa25c45f11f02ae72fc27f64d86ba606.zip | |
Auto merge of #116273 - compiler-errors:refine2, r=tmandry
Only trigger `refining_impl_trait` lint on reachable traits Public but unreachable traits don't matter 😸 r? `@tmandry`
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/async-await/in-trait/missing-feature-flag.stderr | 12 | ||||
| -rw-r--r-- | tests/ui/impl-trait/in-trait/refine.rs | 11 |
2 files changed, 17 insertions, 6 deletions
diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.stderr b/tests/ui/async-await/in-trait/missing-feature-flag.stderr index f6aba1fcdbf..87a7e85bfbb 100644 --- a/tests/ui/async-await/in-trait/missing-feature-flag.stderr +++ b/tests/ui/async-await/in-trait/missing-feature-flag.stderr @@ -7,6 +7,12 @@ LL | async fn foo(_: T) -> &'static str; LL | impl<T> MyTrait<T> for MyStruct {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation +error[E0308]: mismatched types + --> $DIR/missing-feature-flag.rs:16:42 + | +LL | async fn foo(_: i32) -> &'static str {} + | ^^ expected `&str`, found `()` + error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/missing-feature-flag.rs:16:5 | @@ -18,12 +24,6 @@ LL | async fn foo(_: i32) -> &'static str {} | = note: to specialize, `foo` in the parent `impl` must be marked `default` -error[E0308]: mismatched types - --> $DIR/missing-feature-flag.rs:16:42 - | -LL | async fn foo(_: i32) -> &'static str {} - | ^^ expected `&str`, found `()` - error: aborting due to 3 previous errors Some errors have detailed explanations: E0046, E0308, E0520. diff --git a/tests/ui/impl-trait/in-trait/refine.rs b/tests/ui/impl-trait/in-trait/refine.rs index a91f9b3e722..f00478b0bb9 100644 --- a/tests/ui/impl-trait/in-trait/refine.rs +++ b/tests/ui/impl-trait/in-trait/refine.rs @@ -45,4 +45,15 @@ impl Late for D { //~^ ERROR impl method signature does not match trait method signature } +mod unreachable { + pub trait UnreachablePub { + fn bar() -> impl Sized; + } + + struct E; + impl UnreachablePub for E { + fn bar() {} + } +} + fn main() {} |
