Rollup merge of #136291 - lcnr:compare-mode, r=oli-obk

some test suite cleanups

found while checking `compare-mode next-solver`

r? `@oli-obk`

<sub> [lcnr](https://github.com/rust-lang/rust/commits?author=lcnr) authored and JJ_EMPTY_STRING committed </sub>
This commit is contained in:
Jacob Pratt 2025-01-31 00:25:38 -05:00 committed by GitHub
commit 55512db4aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 10 additions and 44 deletions

View File

@ -3,8 +3,6 @@
//! Unfortunately we don't even reach opaque type collection, as we ICE in typeck before that.
//! See #109281 for the original report.
//@ edition:2018
//@ error-pattern: expected generic lifetime parameter, found `'a`
#![feature(type_alias_impl_trait)]
use std::future::Future;
@ -24,6 +22,7 @@ impl<'x, T: 'x> Trait<'x> for (T,) {
impl Foo<'_> {
fn make_fut(&self) -> Box<dyn for<'a> Trait<'a, Thing = Fut<'a>>> {
Box::new((async { () },))
//~^ ERROR expected generic lifetime parameter, found `'a`
}
}

View File

@ -1,5 +1,5 @@
error[E0792]: expected generic lifetime parameter, found `'a`
--> $DIR/issue-90014-tait2.rs:26:9
--> $DIR/issue-90014-tait2.rs:24:9
|
LL | type Fut<'a> = impl Future<Output = ()>;
| -- this generic parameter must be used with a generic lifetime parameter

View File

@ -1,14 +0,0 @@
//@ check-pass
// https://github.com/rust-lang/rust/issues/129541
#[derive(Clone)]
struct Test {
field: std::borrow::Cow<'static, [Self]>,
}
#[derive(Clone)]
struct Hello {
a: <[Hello] as std::borrow::ToOwned>::Owned,
}
fn main(){}

View File

@ -1,23 +0,0 @@
// Regression test for #129541
//@ check-pass
trait Bound {}
trait Normalize {
type Assoc;
}
impl<T: Bound> Normalize for T {
type Assoc = T;
}
impl<T: Bound> Normalize for [T] {
type Assoc = T;
}
impl Bound for Hello {}
struct Hello {
a: <[Hello] as Normalize>::Assoc,
}
fn main() {}

View File

@ -1,5 +1,6 @@
// Regression test for #129541
//@ revisions: unique multiple
//@ check-pass
trait Bound {}
@ -7,6 +8,10 @@ trait Normalize {
type Assoc;
}
#[cfg(multiple)]
impl<T: Bound> Normalize for T {
type Assoc = T;
}
impl<T: Bound> Normalize for [T] {
type Assoc = T;
}

View File

@ -1,5 +1,4 @@
// Check that we test WF conditions for fn arguments. Because the
// current code is so goofy, this is only a warning for now.
// Check that we test WF conditions for fn arguments.
#![feature(rustc_attrs)]
#![allow(dead_code)]

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `Self: Eq` is not satisfied
--> $DIR/wf-trait-default-fn-ret.rs:11:22
--> $DIR/wf-trait-default-fn-ret.rs:10:22
|
LL | fn bar(&self) -> Bar<Self> {
| ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
note: required by a bound in `Bar`
--> $DIR/wf-trait-default-fn-ret.rs:8:14
--> $DIR/wf-trait-default-fn-ret.rs:7:14
|
LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
| ^^ required by this bound in `Bar`