Rollup merge of #127037 - oli-obk:define_opaque_types18, r=davidtwco

Remove some duplicated tests

probably some parallel PR development that happened here, copying over the same examples from issues.
This commit is contained in:
Matthias Krüger 2024-07-04 18:16:23 +02:00 committed by GitHub
commit e62956dea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 0 additions and 61 deletions

View File

@ -1,29 +0,0 @@
//@ check-pass
// See https://doc.rust-lang.org/1.77.0/nightly-rustc/rustc_lint/opaque_hidden_inferred_bound/static.OPAQUE_HIDDEN_INFERRED_BOUND.html#example
#![feature(type_alias_impl_trait)]
#![allow(dead_code)]
trait Duh {}
impl Duh for i32 {}
trait Trait {
type Assoc: Duh;
}
impl<R: Duh, F: FnMut() -> R> Trait for F {
type Assoc = R;
}
type Sendable = impl Send;
type Foo = impl Trait<Assoc = Sendable>;
//~^ WARNING opaque type `Foo` does not satisfy its associated type bounds
fn foo() -> Foo {
|| 42
}
fn main() {}

View File

@ -1,13 +0,0 @@
warning: opaque type `Foo` does not satisfy its associated type bounds
--> $DIR/tait-in-function-return-type-issue-101903.rs:22:23
|
LL | type Assoc: Duh;
| --- this associated type bound is unsatisfied for `Sendable`
...
LL | type Foo = impl Trait<Assoc = Sendable>;
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(opaque_hidden_inferred_bound)]` on by default
warning: 1 warning emitted

View File

@ -1,19 +0,0 @@
//@ check-pass
//@ compile-flags: -Zvalidate-mir
trait Duh {}
impl Duh for i32 {}
trait Trait {
type Assoc: Duh;
}
impl<R: Duh, F: FnMut() -> R> Trait for F {
type Assoc = R;
}
fn foo() -> impl Trait<Assoc = impl Send> {
|| 42
}
fn main() {}