diff options
Diffstat (limited to 'tests')
19 files changed, 178 insertions, 165 deletions
diff --git a/tests/ui/associated-type-bounds/hrtb.rs b/tests/ui/associated-type-bounds/hrtb.rs index 1bf574f2e65..8ff7faec3a0 100644 --- a/tests/ui/associated-type-bounds/hrtb.rs +++ b/tests/ui/associated-type-bounds/hrtb.rs @@ -1,4 +1,7 @@ //@ check-pass +//@ revisions: current next +//@[next] compile-flags: -Znext-solver +//@ ignore-compare-mode-next-solver (explicit revisions) trait A<'a> {} trait B<'b> {} diff --git a/tests/ui/associated-type-bounds/supertrait-defines-ty.rs b/tests/ui/associated-type-bounds/supertrait-defines-ty.rs index ed1c1fa6f03..1c09ff3d3fb 100644 --- a/tests/ui/associated-type-bounds/supertrait-defines-ty.rs +++ b/tests/ui/associated-type-bounds/supertrait-defines-ty.rs @@ -1,4 +1,7 @@ //@ check-pass +//@ revisions: current next +//@[next] compile-flags: -Znext-solver +//@ ignore-compare-mode-next-solver (explicit revisions) // Make sure that we don't look into associated type bounds when looking for // supertraits that define an associated type. Fixes #76593. diff --git a/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr b/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr index 192b5eebdaa..4f1d339bc99 100644 --- a/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr +++ b/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr @@ -1,8 +1,8 @@ -error[E0275]: overflow evaluating the requirement `Loop == _` +error[E0271]: type mismatch resolving `Loop normalizes-to _` --> $DIR/inherent-impls-overflow.rs:10:6 | LL | impl Loop {} - | ^^^^ + | ^^^^ types differ error: type parameter `T` is only used recursively --> $DIR/inherent-impls-overflow.rs:14:24 @@ -36,4 +36,5 @@ LL | impl Poly0<()> {} error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0275`. +Some errors have detailed explanations: E0271, E0275. +For more information about an error, try `rustc --explain E0271`. diff --git a/tests/ui/lazy-type-alias/inherent-impls-overflow.rs b/tests/ui/lazy-type-alias/inherent-impls-overflow.rs index 1397695a3fe..0d5ec7d1530 100644 --- a/tests/ui/lazy-type-alias/inherent-impls-overflow.rs +++ b/tests/ui/lazy-type-alias/inherent-impls-overflow.rs @@ -9,7 +9,7 @@ type Loop = Loop; //[current]~ ERROR overflow normalizing the type alias `Loop` impl Loop {} //[current]~^ ERROR overflow normalizing the type alias `Loop` -//[next]~^^ ERROR overflow evaluating the requirement `Loop == _` +//[next]~^^ ERROR type mismatch resolving `Loop normalizes-to _` type Poly0<T> = Poly1<(T,)>; //[current]~^ ERROR overflow normalizing the type alias `Poly0<(((((((...,),),),),),),)>` diff --git a/tests/ui/macros/macro-stmt-2.rs b/tests/ui/macros/macro-stmt-2.rs new file mode 100644 index 00000000000..663d8ddc484 --- /dev/null +++ b/tests/ui/macros/macro-stmt-2.rs @@ -0,0 +1,11 @@ +//@ check-pass +// +// This shows a tricky case for #124141, where `declare!(_x)` was incorrectly +// being categorised as a `StmtKind::Expr` instead of a `StmtKind::MacCall` in +// `parse_stmt_mac`. + +macro_rules! as_stmt { ($s:stmt) => { $s }; } + +macro_rules! declare { ($name:ident) => { let $name = 0u32; }; } + +fn main() { as_stmt!(declare!(_x)); } diff --git a/tests/ui/macros/nonterminal-matching.rs b/tests/ui/macros/nonterminal-matching.rs index ca95e8fac05..b0a7f3e4650 100644 --- a/tests/ui/macros/nonterminal-matching.rs +++ b/tests/ui/macros/nonterminal-matching.rs @@ -16,7 +16,7 @@ macro complex_nonterminal($nt_item: item) { struct S; } - n!(a $nt_item b); //~ ERROR no rules expected item `enum E {}` + n!(a $nt_item b); //~ ERROR no rules expected `item` metavariable } simple_nonterminal!(a, 'a, (x, y, z)); // OK @@ -32,7 +32,7 @@ macro_rules! foo { (expr $x:expr) => { bar!(expr $x); }; //~ ERROR: no rules expected expression `3` (literal $x:literal) => { bar!(literal $x); }; //~ ERROR: no rules expected literal `4` (path $x:path) => { bar!(path $x); }; //~ ERROR: no rules expected `path` metavariable - (stmt $x:stmt) => { bar!(stmt $x); }; //~ ERROR: no rules expected statement `let abc = 0` + (stmt $x:stmt) => { bar!(stmt $x); }; //~ ERROR: no rules expected `stmt` metavariable } macro_rules! bar { diff --git a/tests/ui/macros/nonterminal-matching.stderr b/tests/ui/macros/nonterminal-matching.stderr index ba2b3e213ad..2d9252fbfc1 100644 --- a/tests/ui/macros/nonterminal-matching.stderr +++ b/tests/ui/macros/nonterminal-matching.stderr @@ -1,4 +1,4 @@ -error: no rules expected item `enum E {}` +error: no rules expected `item` metavariable --> $DIR/nonterminal-matching.rs:19:10 | LL | macro n(a $nt_item b) { @@ -10,7 +10,7 @@ LL | n!(a $nt_item b); LL | complex_nonterminal!(enum E {}); | ------------------------------- in this macro invocation | -note: while trying to match item `enum E {}` +note: while trying to match `item` metavariable --> $DIR/nonterminal-matching.rs:15:15 | LL | macro n(a $nt_item b) { @@ -89,7 +89,7 @@ LL | (path a::b::c) => {}; = help: try using `:tt` instead in the macro definition = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) -error: no rules expected statement `let abc = 0` +error: no rules expected `stmt` metavariable --> $DIR/nonterminal-matching.rs:35:35 | LL | (stmt $x:stmt) => { bar!(stmt $x); }; diff --git a/tests/ui/proc-macro/expand-to-derive.stdout b/tests/ui/proc-macro/expand-to-derive.stdout index 81fc52ea22d..3a16f23ecf2 100644 --- a/tests/ui/proc-macro/expand-to-derive.stdout +++ b/tests/ui/proc-macro/expand-to-derive.stdout @@ -44,52 +44,58 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Group { delimiter: Brace, stream: TokenStream [ - Punct { - ch: '#', - spacing: Alone, - span: $DIR/expand-to-derive.rs:27:5: 27:6 (#0), - }, - Group { - delimiter: Bracket, - stream: TokenStream [ - Ident { - ident: "rustc_dummy", - span: $DIR/expand-to-derive.rs:27:28: 27:39 (#0), - }, - ], - span: $DIR/expand-to-derive.rs:27:6: 27:41 (#0), - }, - Ident { - ident: "struct", - span: $DIR/expand-to-derive.rs:28:5: 28:11 (#0), - }, - Ident { - ident: "Inner", - span: $DIR/expand-to-derive.rs:28:12: 28:17 (#0), - }, Group { - delimiter: Brace, + delimiter: None, stream: TokenStream [ - Ident { - ident: "other_inner_field", - span: $DIR/expand-to-derive.rs:30:9: 30:26 (#0), - }, Punct { - ch: ':', + ch: '#', spacing: Alone, - span: $DIR/expand-to-derive.rs:30:26: 30:27 (#0), + span: $DIR/expand-to-derive.rs:27:5: 27:6 (#0), + }, + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + ident: "rustc_dummy", + span: $DIR/expand-to-derive.rs:27:28: 27:39 (#0), + }, + ], + span: $DIR/expand-to-derive.rs:27:6: 27:41 (#0), }, Ident { - ident: "u8", - span: $DIR/expand-to-derive.rs:30:28: 30:30 (#0), + ident: "struct", + span: $DIR/expand-to-derive.rs:28:5: 28:11 (#0), }, - Punct { - ch: ',', - spacing: Alone, - span: $DIR/expand-to-derive.rs:30:30: 30:31 (#0), + Ident { + ident: "Inner", + span: $DIR/expand-to-derive.rs:28:12: 28:17 (#0), + }, + Group { + delimiter: Brace, + stream: TokenStream [ + Ident { + ident: "other_inner_field", + span: $DIR/expand-to-derive.rs:30:9: 30:26 (#0), + }, + Punct { + ch: ':', + spacing: Alone, + span: $DIR/expand-to-derive.rs:30:26: 30:27 (#0), + }, + Ident { + ident: "u8", + span: $DIR/expand-to-derive.rs:30:28: 30:30 (#0), + }, + Punct { + ch: ',', + spacing: Alone, + span: $DIR/expand-to-derive.rs:30:30: 30:31 (#0), + }, + ], + span: $DIR/expand-to-derive.rs:28:18: 31:6 (#0), }, ], - span: $DIR/expand-to-derive.rs:28:18: 31:6 (#0), + span: $DIR/expand-to-derive.rs:19:17: 19:22 (#3), }, Literal { kind: Integer, diff --git a/tests/ui/proc-macro/nodelim-groups.rs b/tests/ui/proc-macro/nodelim-groups.rs index 9acdc7023c0..8b0324214b9 100644 --- a/tests/ui/proc-macro/nodelim-groups.rs +++ b/tests/ui/proc-macro/nodelim-groups.rs @@ -19,4 +19,17 @@ macro_rules! expand_it { fn main() { expand_it!(1 + (25) + 1); expand_it!(("hello".len()) ("world".len())); + f(); +} + +// The key thing here is to produce a single `None`-delimited `Group`, even +// though there is multiple levels of macros. +macro_rules! m5 { ($e:expr) => { print_bang_consume!($e) }; } +macro_rules! m4 { ($e:expr) => { m5!($e); } } +macro_rules! m3 { ($e:expr) => { m4!($e); } } +macro_rules! m2 { ($e:expr) => { m3!($e); } } +macro_rules! m1 { ($e:expr) => { m2!($e); } } + +fn f() { + m1!(123); } diff --git a/tests/ui/proc-macro/nodelim-groups.stdout b/tests/ui/proc-macro/nodelim-groups.stdout index cdf851b535a..61001035c26 100644 --- a/tests/ui/proc-macro/nodelim-groups.stdout +++ b/tests/ui/proc-macro/nodelim-groups.stdout @@ -165,3 +165,18 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ span: $DIR/nodelim-groups.rs:16:52: 16:59 (#8), }, ] +PRINT-BANG INPUT (DISPLAY): 123 +PRINT-BANG INPUT (DEBUG): TokenStream [ + Group { + delimiter: None, + stream: TokenStream [ + Literal { + kind: Integer, + symbol: "123", + suffix: None, + span: $DIR/nodelim-groups.rs:34:9: 34:12 (#0), + }, + ], + span: $DIR/nodelim-groups.rs:27:54: 27:56 (#16), + }, +] diff --git a/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.rs b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.rs index 3238f028362..28fd66cd169 100644 --- a/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.rs +++ b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.rs @@ -6,9 +6,11 @@ trait Overflow { type Assoc; } -impl<T> Overflow for T { - type Assoc = <T as Overflow>::Assoc; - //~^ ERROR: overflow +impl<T> Overflow for T +where + (T,): Overflow +{ + type Assoc = <(T,) as Overflow>::Assoc; } diff --git a/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr index 294fa0d7613..34a45e93630 100644 --- a/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr +++ b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr @@ -1,19 +1,15 @@ -error[E0275]: overflow evaluating the requirement `<T as Overflow>::Assoc == _` - --> $DIR/trait_ref_is_knowable-norm-overflow.rs:10:18 - | -LL | type Assoc = <T as Overflow>::Assoc; - | ^^^^^^^^^^^^^^^^^^^^^^ - error[E0119]: conflicting implementations of trait `Trait` - --> $DIR/trait_ref_is_knowable-norm-overflow.rs:18:1 + --> $DIR/trait_ref_is_knowable-norm-overflow.rs:20:1 | LL | impl<T: Copy> Trait for T {} | ------------------------- first implementation here LL | struct LocalTy; LL | impl Trait for <LocalTy as Overflow>::Assoc {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + | + = note: overflow evaluating the requirement `_ == <LocalTy as Overflow>::Assoc` + = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`trait_ref_is_knowable_norm_overflow`) -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0119, E0275. -For more information about an error, try `rustc --explain E0119`. +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/traits/next-solver/cycles/cyclic-normalization-to-error-nalgebra.rs b/tests/ui/traits/next-solver/cycles/cyclic-normalization-to-error-nalgebra.rs new file mode 100644 index 00000000000..ec478aa02b7 --- /dev/null +++ b/tests/ui/traits/next-solver/cycles/cyclic-normalization-to-error-nalgebra.rs @@ -0,0 +1,21 @@ +// Regression test for trait-system-refactor-initiative#114. +// +// We previously treated the cycle when trying to use the +// `<R as DimMin<C>>::Output: DimMin` where-bound when +// normalizing `<R as DimMin<C>>::Output` as ambiguous, causing +// this to error. + +//@ check-pass +//@ compile-flags: -Znext-solver +//@ ignore-compare-mode-next-solver + +pub trait DimMin<D> { + type Output; +} +pub fn repro<R: DimMin<C>, C>() +where + <R as DimMin<C>>::Output: DimMin<C, Output = <R as DimMin<C>>::Output>, +{ +} + +fn main() {} diff --git a/tests/ui/traits/next-solver/cycles/unproductive-in-coherence.rs b/tests/ui/traits/next-solver/cycles/unproductive-in-coherence.rs new file mode 100644 index 00000000000..46dd6adf662 --- /dev/null +++ b/tests/ui/traits/next-solver/cycles/unproductive-in-coherence.rs @@ -0,0 +1,21 @@ +// If we treat known inductive cycles as errors, this test compiles +// as normalizing `Overflow::Assoc<Overflow>` fails. +// +// As coherence already uses the new solver on stable, this change +// would require an FCP. + +trait Trait { + type Assoc<T: Trait>; +} + +struct Overflow; +impl Trait for Overflow { + type Assoc<T: Trait> = <T as Trait>::Assoc<Overflow>; +} + +trait Overlap<T, WfHack> {} +impl<T: Trait, U: Copy> Overlap<T::Assoc<T>, U> for T {} +impl<U> Overlap<u32, U> for Overflow {} +//~^ ERROR conflicting implementations of trait `Overlap<<Overflow as Trait>::Assoc<Overflow>, _>` for type `Overflow` + +fn main() {} diff --git a/tests/ui/traits/next-solver/cycles/unproductive-in-coherence.stderr b/tests/ui/traits/next-solver/cycles/unproductive-in-coherence.stderr new file mode 100644 index 00000000000..6605a28d547 --- /dev/null +++ b/tests/ui/traits/next-solver/cycles/unproductive-in-coherence.stderr @@ -0,0 +1,11 @@ +error[E0119]: conflicting implementations of trait `Overlap<<Overflow as Trait>::Assoc<Overflow>, _>` for type `Overflow` + --> $DIR/unproductive-in-coherence.rs:18:1 + | +LL | impl<T: Trait, U: Copy> Overlap<T::Assoc<T>, U> for T {} + | ----------------------------------------------------- first implementation here +LL | impl<U> Overlap<u32, U> for Overflow {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Overflow` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.rs b/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.rs index 0f01a453b33..94a9484ecdc 100644 --- a/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.rs +++ b/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.rs @@ -13,12 +13,7 @@ fn needs_bar<S: Bar>() {} fn test<T: Foo1<Assoc1 = <T as Foo2>::Assoc2> + Foo2<Assoc2 = <T as Foo1>::Assoc1>>() { needs_bar::<T::Assoc1>(); - //~^ ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` - //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` - //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` - //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` - //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1: Sized` - //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar` + //~^ ERROR the trait bound `<T as Foo1>::Assoc1: Bar` is not satisfied } fn main() {} diff --git a/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.stderr b/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.stderr index 2b0e57966fe..6f5111a6193 100644 --- a/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.stderr +++ b/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.stderr @@ -1,59 +1,19 @@ -error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` +error[E0277]: the trait bound `<T as Foo1>::Assoc1: Bar` is not satisfied --> $DIR/recursive-self-normalization-2.rs:15:17 | LL | needs_bar::<T::Assoc1>(); - | ^^^^^^^^^ - -error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar` - --> $DIR/recursive-self-normalization-2.rs:15:17 - | -LL | needs_bar::<T::Assoc1>(); - | ^^^^^^^^^ + | ^^^^^^^^^ the trait `Bar` is not implemented for `<T as Foo1>::Assoc1` | note: required by a bound in `needs_bar` --> $DIR/recursive-self-normalization-2.rs:12:17 | LL | fn needs_bar<S: Bar>() {} | ^^^ required by this bound in `needs_bar` - -error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1: Sized` - --> $DIR/recursive-self-normalization-2.rs:15:17 - | -LL | needs_bar::<T::Assoc1>(); - | ^^^^^^^^^ - | -note: required by an implicit `Sized` bound in `needs_bar` - --> $DIR/recursive-self-normalization-2.rs:12:14 - | -LL | fn needs_bar<S: Bar>() {} - | ^ required by the implicit `Sized` requirement on this type parameter in `needs_bar` -help: consider relaxing the implicit `Sized` restriction - | -LL | fn needs_bar<S: Bar + ?Sized>() {} - | ++++++++ - -error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` - --> $DIR/recursive-self-normalization-2.rs:15:5 - | -LL | needs_bar::<T::Assoc1>(); - | ^^^^^^^^^^^^^^^^^^^^^^ - -error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` - --> $DIR/recursive-self-normalization-2.rs:15:5 - | -LL | needs_bar::<T::Assoc1>(); - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` - --> $DIR/recursive-self-normalization-2.rs:15:17 - | -LL | needs_bar::<T::Assoc1>(); - | ^^^^^^^^^ +help: consider further restricting the associated type | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +LL | fn test<T: Foo1<Assoc1 = <T as Foo2>::Assoc2> + Foo2<Assoc2 = <T as Foo1>::Assoc1>>() where <T as Foo1>::Assoc1: Bar { + | ++++++++++++++++++++++++++++++ -error: aborting due to 6 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0275`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/next-solver/overflow/recursive-self-normalization.rs b/tests/ui/traits/next-solver/overflow/recursive-self-normalization.rs index f435b48737e..f441ac499f9 100644 --- a/tests/ui/traits/next-solver/overflow/recursive-self-normalization.rs +++ b/tests/ui/traits/next-solver/overflow/recursive-self-normalization.rs @@ -9,12 +9,7 @@ fn needs_bar<S: Bar>() {} fn test<T: Foo<Assoc = <T as Foo>::Assoc>>() { needs_bar::<T::Assoc>(); - //~^ ERROR overflow evaluating the requirement `<T as Foo>::Assoc == _` - //~| ERROR overflow evaluating the requirement `<T as Foo>::Assoc == _` - //~| ERROR overflow evaluating the requirement `<T as Foo>::Assoc == _` - //~| ERROR overflow evaluating the requirement `<T as Foo>::Assoc == _` - //~| ERROR overflow evaluating the requirement `<T as Foo>::Assoc: Sized` - //~| ERROR overflow evaluating the requirement `<T as Foo>::Assoc: Bar` + //~^ ERROR the trait bound `<T as Foo>::Assoc: Bar` is not satisfied } fn main() {} diff --git a/tests/ui/traits/next-solver/overflow/recursive-self-normalization.stderr b/tests/ui/traits/next-solver/overflow/recursive-self-normalization.stderr index af8504dcaee..c5518234687 100644 --- a/tests/ui/traits/next-solver/overflow/recursive-self-normalization.stderr +++ b/tests/ui/traits/next-solver/overflow/recursive-self-normalization.stderr @@ -1,59 +1,19 @@ -error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` +error[E0277]: the trait bound `<T as Foo>::Assoc: Bar` is not satisfied --> $DIR/recursive-self-normalization.rs:11:17 | LL | needs_bar::<T::Assoc>(); - | ^^^^^^^^ - -error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc: Bar` - --> $DIR/recursive-self-normalization.rs:11:17 - | -LL | needs_bar::<T::Assoc>(); - | ^^^^^^^^ + | ^^^^^^^^ the trait `Bar` is not implemented for `<T as Foo>::Assoc` | note: required by a bound in `needs_bar` --> $DIR/recursive-self-normalization.rs:8:17 | LL | fn needs_bar<S: Bar>() {} | ^^^ required by this bound in `needs_bar` - -error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc: Sized` - --> $DIR/recursive-self-normalization.rs:11:17 - | -LL | needs_bar::<T::Assoc>(); - | ^^^^^^^^ - | -note: required by an implicit `Sized` bound in `needs_bar` - --> $DIR/recursive-self-normalization.rs:8:14 - | -LL | fn needs_bar<S: Bar>() {} - | ^ required by the implicit `Sized` requirement on this type parameter in `needs_bar` -help: consider relaxing the implicit `Sized` restriction - | -LL | fn needs_bar<S: Bar + ?Sized>() {} - | ++++++++ - -error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` - --> $DIR/recursive-self-normalization.rs:11:5 - | -LL | needs_bar::<T::Assoc>(); - | ^^^^^^^^^^^^^^^^^^^^^ - -error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` - --> $DIR/recursive-self-normalization.rs:11:5 - | -LL | needs_bar::<T::Assoc>(); - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` - --> $DIR/recursive-self-normalization.rs:11:17 - | -LL | needs_bar::<T::Assoc>(); - | ^^^^^^^^ +help: consider further restricting the associated type | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +LL | fn test<T: Foo<Assoc = <T as Foo>::Assoc>>() where <T as Foo>::Assoc: Bar { + | ++++++++++++++++++++++++++++ -error: aborting due to 6 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0275`. +For more information about this error, try `rustc --explain E0277`. |
