diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/type/pattern_types/assoc_const.default.stderr | 49 | ||||
| -rw-r--r-- | tests/ui/type/pattern_types/assoc_const.rs | 8 | ||||
| -rw-r--r-- | tests/ui/type/pattern_types/const_generics.rs | 4 | ||||
| -rw-r--r-- | tests/ui/type/pattern_types/transmute.rs | 4 |
4 files changed, 56 insertions, 9 deletions
diff --git a/tests/ui/type/pattern_types/assoc_const.default.stderr b/tests/ui/type/pattern_types/assoc_const.default.stderr index abda40e4681..c5d9691a029 100644 --- a/tests/ui/type/pattern_types/assoc_const.default.stderr +++ b/tests/ui/type/pattern_types/assoc_const.default.stderr @@ -1,3 +1,24 @@ +error[E0658]: wraparound pattern type ranges cause monomorphization time errors + --> $DIR/assoc_const.rs:17:19 + | +LL | fn foo<T: Foo>(_: pattern_type!(u32 is <T as Foo>::START..=<T as Foo>::END)) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #136574 <https://github.com/rust-lang/rust/issues/136574> for more information + = help: add `#![feature(generic_pattern_types)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: wraparound pattern type ranges cause monomorphization time errors + --> $DIR/assoc_const.rs:17:19 + | +LL | fn foo<T: Foo>(_: pattern_type!(u32 is <T as Foo>::START..=<T as Foo>::END)) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #136574 <https://github.com/rust-lang/rust/issues/136574> for more information + = help: add `#![feature(generic_pattern_types)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error: constant expression depends on a generic parameter --> $DIR/assoc_const.rs:17:19 | @@ -15,8 +36,29 @@ LL | fn foo<T: Foo>(_: pattern_type!(u32 is <T as Foo>::START..=<T as Foo>::END) = note: this may fail depending on what value the parameter takes = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +error[E0658]: wraparound pattern type ranges cause monomorphization time errors + --> $DIR/assoc_const.rs:22:19 + | +LL | fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #136574 <https://github.com/rust-lang/rust/issues/136574> for more information + = help: add `#![feature(generic_pattern_types)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: wraparound pattern type ranges cause monomorphization time errors + --> $DIR/assoc_const.rs:22:19 + | +LL | fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #136574 <https://github.com/rust-lang/rust/issues/136574> for more information + = help: add `#![feature(generic_pattern_types)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error: constant expression depends on a generic parameter - --> $DIR/assoc_const.rs:20:19 + --> $DIR/assoc_const.rs:22:19 | LL | fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -24,7 +66,7 @@ LL | fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {} = note: this may fail depending on what value the parameter takes error: constant expression depends on a generic parameter - --> $DIR/assoc_const.rs:20:19 + --> $DIR/assoc_const.rs:22:19 | LL | fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -32,5 +74,6 @@ LL | fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {} = note: this may fail depending on what value the parameter takes = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 4 previous errors +error: aborting due to 8 previous errors +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/type/pattern_types/assoc_const.rs b/tests/ui/type/pattern_types/assoc_const.rs index af0f7e4cbf3..87886587d51 100644 --- a/tests/ui/type/pattern_types/assoc_const.rs +++ b/tests/ui/type/pattern_types/assoc_const.rs @@ -1,8 +1,8 @@ #![feature(pattern_types)] #![feature(pattern_type_macro)] -#![cfg_attr(const_arg, feature(generic_const_exprs))] +#![cfg_attr(const_arg, feature(generic_const_exprs, generic_pattern_types))] #![expect(incomplete_features)] - +// gate-test-generic_pattern_types line to the test file. //@ revisions: default const_arg //@[const_arg] check-pass @@ -17,8 +17,12 @@ trait Foo { fn foo<T: Foo>(_: pattern_type!(u32 is <T as Foo>::START..=<T as Foo>::END)) {} //[default]~^ ERROR: constant expression depends on a generic parameter //[default]~| ERROR: constant expression depends on a generic parameter +//[default]~| ERROR: wraparound pattern type ranges cause monomorphization time errors +//[default]~| ERROR: wraparound pattern type ranges cause monomorphization time errors fn bar<T: Foo>(_: pattern_type!(u32 is T::START..=T::END)) {} //[default]~^ ERROR: constant expression depends on a generic parameter //[default]~| ERROR: constant expression depends on a generic parameter +//[default]~| ERROR: wraparound pattern type ranges cause monomorphization time errors +//[default]~| ERROR: wraparound pattern type ranges cause monomorphization time errors fn main() {} diff --git a/tests/ui/type/pattern_types/const_generics.rs b/tests/ui/type/pattern_types/const_generics.rs index 5cef0dc0305..79d46c010d7 100644 --- a/tests/ui/type/pattern_types/const_generics.rs +++ b/tests/ui/type/pattern_types/const_generics.rs @@ -1,7 +1,7 @@ //@ check-pass -#![feature(pattern_types)] -#![feature(pattern_type_macro)] +#![feature(pattern_types, generic_pattern_types, pattern_type_macro)] +#![expect(incomplete_features)] use std::pat::pattern_type; diff --git a/tests/ui/type/pattern_types/transmute.rs b/tests/ui/type/pattern_types/transmute.rs index cb76b2b938d..43dd62a19e7 100644 --- a/tests/ui/type/pattern_types/transmute.rs +++ b/tests/ui/type/pattern_types/transmute.rs @@ -1,5 +1,5 @@ -#![feature(pattern_types)] -#![feature(pattern_type_macro)] +#![feature(pattern_types, pattern_type_macro, generic_pattern_types)] +#![expect(incomplete_features)] use std::pat::pattern_type; |
