Skip to content

Commit 5b391b0

Browse files
committed
Test the multispan case in tests.ui/bounds-lifetime.rs.
1 parent 499b309 commit 5b391b0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ macro_rules! gate {
3030
}
3131

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

tests/ui/bounds-lifetime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ type A = for<'b, 'a: 'b> fn(); //~ ERROR lifetime bounds cannot be used in this
22
type B = for<'b, 'a: 'b,> fn(); //~ ERROR lifetime bounds cannot be used in this context
33
type C = for<'b, 'a: 'b +> fn(); //~ ERROR lifetime bounds cannot be used in this context
44
type D = for<'a, T> fn(); //~ ERROR only lifetime parameters can be used in this context
5-
type E = dyn for<T> Fn(); //~ ERROR only lifetime parameters can be used in this context
5+
type E = dyn for<T, U> Fn(); //~ ERROR only lifetime parameters can be used in this context
66

77
fn main() {}

tests/ui/bounds-lifetime.stderr

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

0 commit comments

Comments
 (0)