diff options
| author | bors <bors@rust-lang.org> | 2023-12-26 17:30:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-26 17:30:42 +0000 |
| commit | a75fed74b62f95d1659ff70bea7895ed5c85bdba (patch) | |
| tree | 08e57fcd63aa95ee4a3f70859bab39cb5d9c1822 /tests | |
| parent | e1fadb2c35a6082867a037f012bfdfc5eb686211 (diff) | |
| parent | e16efbd23afe98d1bda104d850e0285591d3a5d8 (diff) | |
| download | rust-a75fed74b62f95d1659ff70bea7895ed5c85bdba.tar.gz rust-a75fed74b62f95d1659ff70bea7895ed5c85bdba.zip | |
Auto merge of #119042 - bvanjoi:fix-118697-2, r=compiler-errors
fallback `default` to `None` during ast-lowering for lifetime binder Fixes #118697 This is another attempt. It has a fallback, setting `default` to `None` and emit an error for non-lifetime binders during ast lowering. r? `@compiler-errors`
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/parser/issue-119042.rs | 7 | ||||
| -rw-r--r-- | tests/ui/traits/non_lifetime_binders/issue-118697.rs | 9 | ||||
| -rw-r--r-- | tests/ui/traits/non_lifetime_binders/issue-118697.stderr | 21 |
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/ui/parser/issue-119042.rs b/tests/ui/parser/issue-119042.rs new file mode 100644 index 00000000000..a4fee169d1c --- /dev/null +++ b/tests/ui/parser/issue-119042.rs @@ -0,0 +1,7 @@ +// check-pass + +macro_rules! a { ($ty:ty) => {} } + +a! { for<T = &i32> fn() } + +fn main() {} diff --git a/tests/ui/traits/non_lifetime_binders/issue-118697.rs b/tests/ui/traits/non_lifetime_binders/issue-118697.rs new file mode 100644 index 00000000000..a282d0c5a40 --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/issue-118697.rs @@ -0,0 +1,9 @@ +#![allow(incomplete_features)] +#![feature(non_lifetime_binders)] + +type T = dyn for<V = A(&())> Fn(()); +//~^ ERROR default parameter is not allowed in this binder +//~| ERROR cannot find type `A` in this scope +//~| ERROR late-bound type parameter not allowed on trait object types + +fn main() {} diff --git a/tests/ui/traits/non_lifetime_binders/issue-118697.stderr b/tests/ui/traits/non_lifetime_binders/issue-118697.stderr new file mode 100644 index 00000000000..52ce568d69d --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/issue-118697.stderr @@ -0,0 +1,21 @@ +error[E0412]: cannot find type `A` in this scope + --> $DIR/issue-118697.rs:4:22 + | +LL | type T = dyn for<V = A(&())> Fn(()); + | ^ not found in this scope + +error: default parameter is not allowed in this binder + --> $DIR/issue-118697.rs:4:22 + | +LL | type T = dyn for<V = A(&())> Fn(()); + | ^^^^^^ + +error: late-bound type parameter not allowed on trait object types + --> $DIR/issue-118697.rs:4:18 + | +LL | type T = dyn for<V = A(&())> Fn(()); + | ^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0412`. |
