Test the multispan case in tests.ui/bounds-lifetime.rs.

This commit is contained in:
Nicholas Nethercote 2023-10-30 10:38:57 +11:00
parent 499b3098f8
commit 5b391b01ce
3 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ macro_rules! gate {
}
/// The unusual case, where the `has_feature` condition is non-standard.
macro_rules! gate_complex {
macro_rules! gate_alt {
($visitor:expr, $has_feature:expr, $name:expr, $span:expr, $explain:expr) => {{
if !$has_feature && !$span.allows_unstable($name) {
feature_err(&$visitor.sess.parse_sess, $name, $span, $explain).emit();

View File

@ -2,6 +2,6 @@ type A = for<'b, 'a: 'b> fn(); //~ ERROR lifetime bounds cannot be used in this
type B = for<'b, 'a: 'b,> fn(); //~ ERROR lifetime bounds cannot be used in this context
type C = for<'b, 'a: 'b +> fn(); //~ ERROR lifetime bounds cannot be used in this context
type D = for<'a, T> fn(); //~ ERROR only lifetime parameters can be used in this context
type E = dyn for<T> Fn(); //~ ERROR only lifetime parameters can be used in this context
type E = dyn for<T, U> Fn(); //~ ERROR only lifetime parameters can be used in this context
fn main() {}

View File

@ -28,8 +28,8 @@ LL | type D = for<'a, T> fn();
error[E0658]: only lifetime parameters can be used in this context
--> $DIR/bounds-lifetime.rs:5:18
|
LL | type E = dyn for<T> Fn();
| ^
LL | type E = dyn for<T, U> Fn();
| ^ ^
|
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable