// Issue #14603: Check for references to type parameters from the // outer scope (in this case, the trait) used on items in an inner // scope (in this case, the enum). trait TraitA { fn outer(&self) { enum Foo { Variance(A) //~^ ERROR can't use generic parameters from outer function } } } trait TraitB { fn outer(&self) { struct Foo(A); //~^ ERROR can't use generic parameters from outer function } } trait TraitC { fn outer(&self) { struct Foo { a: A } //~^ ERROR can't use generic parameters from outer function } } trait TraitD { fn outer(&self) { fn foo(a: A) { } //~^ ERROR can't use generic parameters from outer function } } fn main() { }