rust/tests/ui/traits/stack-error-order-dependence.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
442 B
Rust
Raw Normal View History

2024-03-31 20:03:59 -05:00
//@ check-pass
// Regression test for <https://github.com/rust-lang/rust/issues/123303>.
pub trait Trait: Supertrait {}
trait Impossible {}
impl<F: ?Sized + Impossible> Trait for F {}
pub trait Supertrait {}
impl<T: ?Sized + Trait + Impossible> Supertrait for T {}
fn needs_supertrait<T: ?Sized + Supertrait>() {}
fn needs_trait<T: ?Sized + Trait>() {}
fn main() {
needs_supertrait::<dyn Trait>();
needs_trait::<dyn Trait>();
}