|
| 1 | +// Regression test for ICE #122989 |
| 2 | +trait Traitor<const N: N<2> = 1, const N: N<2> = N> { |
| 3 | +//~^ ERROR the name `N` is already used for a generic parameter in this item's generic parameters |
| 4 | +//~| ERROR cycle detected when computing type of `Traitor::N` |
| 5 | +//~| ERROR cycle detected when computing type of `Traitor::N` |
| 6 | +//~| ERROR the trait `Traitor` cannot be made into an object |
| 7 | +//~| ERROR the trait `Traitor` cannot be made into an object |
| 8 | +//~| ERROR the trait `Traitor` cannot be made into an object |
| 9 | +//~| ERROR the trait `Traitor` cannot be made into an object |
| 10 | +//~| ERROR `(dyn N<2> + 'static)` is forbidden as the type of a const generic parameter |
| 11 | +//~| ERROR `(dyn N<2> + 'static)` is forbidden as the type of a const generic parameter |
| 12 | +//~| WARN trait objects without an explicit `dyn` are deprecated |
| 13 | +//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
| 14 | +//~| WARN trait objects without an explicit `dyn` are deprecated |
| 15 | +//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
| 16 | +//~| WARN trait objects without an explicit `dyn` are deprecated |
| 17 | +//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
| 18 | + fn N(&N) -> N<2> { |
| 19 | + //~^ ERROR the trait `Traitor` cannot be made into an object |
| 20 | + //~| WARN anonymous parameters are deprecated and will be removed in the next edition |
| 21 | + //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! |
| 22 | + //~| WARN trait objects without an explicit `dyn` are deprecated |
| 23 | + //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
| 24 | + //~| WARN trait objects without an explicit `dyn` are deprecated |
| 25 | + //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
| 26 | + M |
| 27 | + //~^ ERROR cannot find value `M` in this scope |
| 28 | + } |
| 29 | +} |
| 30 | + |
| 31 | +trait N<const N: Traitor<2> = 12> {} |
| 32 | +//~^ ERROR cycle detected when computing type of `N::N` |
| 33 | +//~| ERROR cycle detected when computing type of `N::N` |
| 34 | +//~| ERROR the trait `Traitor` cannot be made into an object |
| 35 | +//~| ERROR the trait `Traitor` cannot be made into an object |
| 36 | +//~| ERROR `(dyn Traitor<2, {const error}> + 'static)` is forbidden as the type of a const generic parameter |
| 37 | +//~| WARN trait objects without an explicit `dyn` are deprecated |
| 38 | +//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
| 39 | +//~| WARN trait objects without an explicit `dyn` are deprecated |
| 40 | +//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
| 41 | + |
| 42 | +fn main() {} |
0 commit comments