Skip to content

Commit 65196ca

Browse files
authored
Rollup merge of #130718 - jackh726:known-bug-cleanup, r=compiler-errors
Cleanup some known-bug issues I went through most of the known-bug tests (except those under `tests/crashes`) and made sure the issue had the `S-bug-has-test` label and checked that the linked issue was open. This is a bunch of cleanups, mainly issues that have been closed and the tests should have been updated. Importantly, there are many known-bug tests linking to #110395. This *probably* isn't right - that is a tracking issue. But I don't really know what the "right" thing to do here. Probably, most that are actually *supposed* to be tests for const trait need to be linked to *that* tracking issue. And any other tests that were mislabeled need to be handled accordingly e.g. #130482. cc `@fee1-dead`
2 parents a3f76a2 + e5e1fad commit 65196ca

18 files changed

+100
-23
lines changed

tests/ui/async-await/in-trait/async-generics-and-bounds.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//@ check-fail
2-
//@ known-bug: #102682
1+
//@ known-bug: #130935
32
//@ edition: 2021
43

54
use std::fmt::Debug;

tests/ui/async-await/in-trait/async-generics-and-bounds.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0311]: the parameter type `T` may not live long enough
2-
--> $DIR/async-generics-and-bounds.rs:9:5
2+
--> $DIR/async-generics-and-bounds.rs:8:5
33
|
44
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
55
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: Debug + Sized, U: Has
1313
| ++++ ++ ++ +++++++
1414

1515
error[E0311]: the parameter type `U` may not live long enough
16-
--> $DIR/async-generics-and-bounds.rs:9:5
16+
--> $DIR/async-generics-and-bounds.rs:8:5
1717
|
1818
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
1919
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/async-await/in-trait/async-generics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//@ check-fail
2-
//@ known-bug: #102682
1+
//@ known-bug: #130935
32
//@ edition: 2021
43

54
trait MyTrait<T, U> {

tests/ui/async-await/in-trait/async-generics.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0311]: the parameter type `T` may not live long enough
2-
--> $DIR/async-generics.rs:6:5
2+
--> $DIR/async-generics.rs:5:5
33
|
44
LL | async fn foo(&self) -> &(T, U);
55
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: 'a;
1313
| ++++ ++ ++ +++++++++++
1414

1515
error[E0311]: the parameter type `U` may not live long enough
16-
--> $DIR/async-generics.rs:6:5
16+
--> $DIR/async-generics.rs:5:5
1717
|
1818
LL | async fn foo(&self) -> &(T, U);
1919
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
pub trait Trait0<T, U, V> {}
22
pub trait Trait1<T, U> {}
3+
pub trait Trait2<T, U> {
4+
type Assoc;
5+
}

tests/ui/coherence/occurs-check/associated-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ revisions: old next
22
//@[next] compile-flags: -Znext-solver
33

4-
// A regression test for #105787
4+
// A (partial) regression test for #105787
55

66
// Using the higher ranked projection hack to prevent us from replacing the projection
77
// with an inference variable.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
warning[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`B`)
2+
--> $DIR/orphan-check-alias.rs:21:6
3+
|
4+
LL | impl<T> foreign::Trait2<B, T> for <T as Id>::Assoc {
5+
| ^ type parameter `T` must be covered by another type when it appears before the first local type (`B`)
6+
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #124559 <https://github.com/rust-lang/rust/issues/124559>
9+
= note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
10+
= note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
11+
= note: `#[warn(uncovered_param_in_projection)]` on by default
12+
13+
warning: 1 warning emitted
14+
15+
For more information about this error, try `rustc --explain E0210`.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
warning[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`B`)
2+
--> $DIR/orphan-check-alias.rs:21:6
3+
|
4+
LL | impl<T> foreign::Trait2<B, T> for <T as Id>::Assoc {
5+
| ^ type parameter `T` must be covered by another type when it appears before the first local type (`B`)
6+
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #124559 <https://github.com/rust-lang/rust/issues/124559>
9+
= note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
10+
= note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
11+
= note: `#[warn(uncovered_param_in_projection)]` on by default
12+
13+
warning: 1 warning emitted
14+
15+
For more information about this error, try `rustc --explain E0210`.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Alias might not cover type parameters.
2+
3+
//@ revisions: classic next
4+
//@[next] compile-flags: -Znext-solver
5+
6+
//@ aux-crate:foreign=parametrized-trait.rs
7+
//@ edition:2021
8+
9+
//@ known-bug: #99554
10+
//@ check-pass
11+
12+
trait Id {
13+
type Assoc;
14+
}
15+
16+
impl<T> Id for T {
17+
type Assoc = T;
18+
}
19+
20+
pub struct B;
21+
impl<T> foreign::Trait2<B, T> for <T as Id>::Assoc {
22+
type Assoc = usize;
23+
}
24+
25+
fn main() {}

tests/ui/generic-associated-types/bugs/issue-100013.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-fail
2-
//@ known-bug: unknown
2+
//@ known-bug: #100013
33
//@ edition: 2021
44

55
// We really should accept this, but we need implied bounds between the regions

0 commit comments

Comments
 (0)