mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
Add regression test
This commit is contained in:
parent
6cbf0926d5
commit
f5f11e1197
@ -0,0 +1,28 @@
|
||||
//! This test demonstrates a bug where we accidentally
|
||||
//! detected opaque types in struct fields, but only if nested
|
||||
//! in projections of another opaque type.
|
||||
//@ check-pass
|
||||
|
||||
#![feature(impl_trait_in_assoc_type)]
|
||||
|
||||
struct Bar;
|
||||
|
||||
trait Trait: Sized {
|
||||
type Assoc2;
|
||||
type Assoc;
|
||||
fn foo() -> Self::Assoc;
|
||||
}
|
||||
|
||||
impl Trait for Bar {
|
||||
type Assoc2 = impl std::fmt::Debug;
|
||||
type Assoc = impl Iterator<Item = Foo>;
|
||||
fn foo() -> Self::Assoc {
|
||||
vec![Foo { field: () }].into_iter()
|
||||
}
|
||||
}
|
||||
|
||||
struct Foo {
|
||||
field: <Bar as Trait>::Assoc2,
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user