Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup some known-bug issues #130718

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/ui/async-await/in-trait/async-generics-and-bounds.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ check-fail
//@ known-bug: #102682
//@ known-bug: #130935
//@ edition: 2021

jackh726 marked this conversation as resolved.
Show resolved Hide resolved
use std::fmt::Debug;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0311]: the parameter type `T` may not live long enough
--> $DIR/async-generics-and-bounds.rs:9:5
--> $DIR/async-generics-and-bounds.rs:8:5
|
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -13,7 +13,7 @@ LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: Debug + Sized, U: Has
| ++++ ++ ++ +++++++

error[E0311]: the parameter type `U` may not live long enough
--> $DIR/async-generics-and-bounds.rs:9:5
--> $DIR/async-generics-and-bounds.rs:8:5
|
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/async-await/in-trait/async-generics.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ check-fail
//@ known-bug: #102682
//@ known-bug: #130935
//@ edition: 2021

trait MyTrait<T, U> {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/async-await/in-trait/async-generics.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0311]: the parameter type `T` may not live long enough
--> $DIR/async-generics.rs:6:5
--> $DIR/async-generics.rs:5:5
|
LL | async fn foo(&self) -> &(T, U);
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
Expand All @@ -13,7 +13,7 @@ LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: 'a;
| ++++ ++ ++ +++++++++++

error[E0311]: the parameter type `U` may not live long enough
--> $DIR/async-generics.rs:6:5
--> $DIR/async-generics.rs:5:5
|
LL | async fn foo(&self) -> &(T, U);
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/coherence/auxiliary/parametrized-trait.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
pub trait Trait0<T, U, V> {}
pub trait Trait1<T, U> {}
pub trait Trait2<T, U> {
type Assoc;
}
2 changes: 1 addition & 1 deletion tests/ui/coherence/occurs-check/associated-type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ revisions: old next
//@[next] compile-flags: -Znext-solver

// A regression test for #105787
// A (partial) regression test for #105787

// Using the higher ranked projection hack to prevent us from replacing the projection
// with an inference variable.
Expand Down
15 changes: 15 additions & 0 deletions tests/ui/coherence/orphan-check-alias.classic.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
warning[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`B`)
--> $DIR/orphan-check-alias.rs:21:6
|
LL | impl<T> foreign::Trait2<B, T> for <T as Id>::Assoc {
| ^ type parameter `T` must be covered by another type when it appears before the first local type (`B`)
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124559 <https://github.com/rust-lang/rust/issues/124559>
= 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
= 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
= note: `#[warn(uncovered_param_in_projection)]` on by default

warning: 1 warning emitted

For more information about this error, try `rustc --explain E0210`.
15 changes: 15 additions & 0 deletions tests/ui/coherence/orphan-check-alias.next.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
warning[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`B`)
--> $DIR/orphan-check-alias.rs:21:6
|
LL | impl<T> foreign::Trait2<B, T> for <T as Id>::Assoc {
| ^ type parameter `T` must be covered by another type when it appears before the first local type (`B`)
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124559 <https://github.com/rust-lang/rust/issues/124559>
= 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
= 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
= note: `#[warn(uncovered_param_in_projection)]` on by default

warning: 1 warning emitted

For more information about this error, try `rustc --explain E0210`.
25 changes: 25 additions & 0 deletions tests/ui/coherence/orphan-check-alias.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Alias might not cover type parameters.

//@ revisions: classic next
//@[next] compile-flags: -Znext-solver

//@ aux-crate:foreign=parametrized-trait.rs
//@ edition:2021

//@ known-bug: #99554
//@ check-pass

trait Id {
type Assoc;
}

impl<T> Id for T {
type Assoc = T;
}

pub struct B;
impl<T> foreign::Trait2<B, T> for <T as Id>::Assoc {
type Assoc = usize;
}

fn main() {}
2 changes: 1 addition & 1 deletion tests/ui/generic-associated-types/bugs/issue-100013.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ check-fail
//@ known-bug: unknown
//@ known-bug: #100013
//@ edition: 2021

// We really should accept this, but we need implied bounds between the regions
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/generic-associated-types/bugs/issue-87735.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ check-fail
//@ known-bug: #87735, #88526
//@ known-bug: unknown

// This should pass, but we need an extension of implied bounds (probably).

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/generic-associated-types/bugs/issue-91762.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ check-fail
//@ known-bug: unknown
//@ known-bug: #91762

// We almost certainly want this to pass, but
// it's particularly difficult currently, because we need a way of specifying
Expand Down
4 changes: 3 additions & 1 deletion tests/ui/never_type/exhaustive_patterns.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ check-fail
//@ known-bug: #104034

#![feature(exhaustive_patterns, never_type)]

Expand All @@ -17,5 +16,8 @@ fn foo() -> Either<(), !> {
}

fn main() {
// We can't treat this a irrefutable, because `Either::B` could become
// inhabited in the future because it's private.
let Either::A(()) = foo();
//~^ error refutable pattern in local binding
}
4 changes: 2 additions & 2 deletions tests/ui/never_type/exhaustive_patterns.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0005]: refutable pattern in local binding
--> $DIR/exhaustive_patterns.rs:20:9
--> $DIR/exhaustive_patterns.rs:21:9
|
LL | let Either::A(()) = foo();
| ^^^^^^^^^^^^^ pattern `Either::B(_)` not covered
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Either<(), !>` defined here
--> $DIR/exhaustive_patterns.rs:10:6
--> $DIR/exhaustive_patterns.rs:9:6
|
LL | enum Either<A, B> {
| ^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Trait<for<'a> fn(<_ as WithAssoc1<'a>>::Assoc, <_ as WithAssoc2<'a>>::Assoc)>` for type `(_, _)`
--> $DIR/issue-102048.rs:39:1
--> $DIR/issue-102048.rs:44:1
|
LL | / impl<T, U> Trait<for<'a> fn(<T as WithAssoc1<'a>>::Assoc, <U as WithAssoc2<'a>>::Assoc)> for (T, U)
LL | | where
Expand Down
9 changes: 7 additions & 2 deletions tests/ui/traits/next-solver/coherence/issue-102048.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
// that to `i32`. We then try to unify `i32` from `impl1` with `u32` from `impl2` which fails,
// causing coherence to consider these two impls distinct.

//@ compile-flags: -Znext-solver
//@ revisions: classic next
//@[next] compile-flags: -Znext-solver

//@[classic] known-bug: #102048
//@[classic] check-pass

pub trait Trait<T> {}

pub trait WithAssoc1<'a> {
Expand All @@ -37,7 +42,7 @@ where

// impl 2
impl<T, U> Trait<for<'a> fn(<U as WithAssoc1<'a>>::Assoc, u32)> for (T, U) where
U: for<'a> WithAssoc1<'a> //~^ ERROR conflicting implementations of trait
U: for<'a> WithAssoc1<'a> //[next]~^ ERROR conflicting implementations of trait
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0119]: conflicting implementations of trait `Yay` for type `Alias`
--> $DIR/implied_lifetime_wf_check.rs:26:1
|
LL | impl Yay for <() as HideIt>::Assoc {}
| ---------------------------------- first implementation here
LL | #[cfg(error)]
LL | impl Yay for i32 {}
| ^^^^^^^^^^^^^^^^ conflicting implementation for `Alias`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0119`.
12 changes: 7 additions & 5 deletions tests/ui/type-alias-impl-trait/implied_lifetime_wf_check.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#![feature(type_alias_impl_trait)]

//@ known-bug: #99840
// this should not compile
//@ check-pass
//@ revisions: pass error

//@[pass] check-pass
//@[error] check-fail

type Alias = impl Sized;

Expand All @@ -21,7 +22,8 @@ impl HideIt for () {
pub trait Yay {}

impl Yay for <() as HideIt>::Assoc {}
// impl Yay for i32 {} // this already errors
// impl Yay for u32 {} // this also already errors
#[cfg(error)]
impl Yay for i32 {}
//[error]~^ error conflicting implementations

fn main() {}
Loading