diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-24 17:10:39 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-25 23:46:28 +0200 |
| commit | 272513868f0dbc76fc3d0f10adda86a013d51b5e (patch) | |
| tree | 061bdb45a0866f35c4023b337c241f6a9a50e96b /tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs | |
| parent | 5dddba5084374003c6fc43fd0cfbfd78c9b05f14 (diff) | |
| download | rust-272513868f0dbc76fc3d0f10adda86a013d51b5e.tar.gz rust-272513868f0dbc76fc3d0f10adda86a013d51b5e.zip | |
Update ui tests with new macro early erroring
Diffstat (limited to 'tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs')
| -rw-r--r-- | tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs b/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs index 3dcdb0cad94..35e964eacec 100644 --- a/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs +++ b/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.rs @@ -4,18 +4,19 @@ // Setting the edition to 2018 since we don't regress `demo! { dyn const }` in Rust <2018. //@ edition:2018 +trait Trait {} + macro_rules! demo { - ($ty:ty) => { compile_error!("ty"); }; - //~^ ERROR ty - //~| ERROR ty - (impl $c:ident Trait) => {}; - (dyn $c:ident Trait) => {}; + (impl $c:ident Trait) => { impl $c Trait {} }; + //~^ ERROR inherent + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + (dyn $c:ident Trait) => { dyn $c Trait {} }; //~ ERROR macro expansion } demo! { impl const Trait } //~^ ERROR const trait impls are experimental demo! { dyn const Trait } -//~^ ERROR const trait impls are experimental fn main() {} |
