mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
c5598d6a9e
avoid `{type error}` being leaked in user-facing messages, particularly when using the `adt_const_params` feature
29 lines
1.9 KiB
Rust
29 lines
1.9 KiB
Rust
trait Trait<const N: Trait = bar> {
|
|
//~^ ERROR cannot find value `bar` in this scope
|
|
//~| ERROR cycle detected when computing type of `Trait::N`
|
|
//~| ERROR the trait `Trait` cannot be made into an object
|
|
//~| ERROR the trait `Trait` cannot be made into an object
|
|
//~| ERROR the trait `Trait` cannot be made into an object
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
|
|
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
|
|
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
|
fn fnc<const N: Trait = u32>(&self) -> Trait {
|
|
//~^ ERROR the name `N` is already used for a generic parameter in this item's generic parameters
|
|
//~| ERROR expected value, found builtin type `u32`
|
|
//~| ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
|
//~| ERROR associated item referring to unboxed trait object for its own trait
|
|
//~| ERROR the trait `Trait` cannot be made into an object
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
|
|
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
|
|
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
|
|
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
|
bar
|
|
//~^ ERROR cannot find value `bar` in this scope
|
|
}
|
|
}
|
|
|
|
fn main() {}
|