2024-03-18 22:50:23 -05:00
|
|
|
trait Trait<const N: Trait = bar> {
|
2024-03-23 00:52:17 -05:00
|
|
|
//~^ 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 {
|
2024-06-04 03:10:08 -05:00
|
|
|
//~^ 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!
|
2024-03-23 00:52:17 -05:00
|
|
|
bar
|
2024-06-04 03:10:08 -05:00
|
|
|
//~^ ERROR cannot find value `bar` in this scope
|
2024-03-18 22:50:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|