about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/lib.rs2
-rw-r--r--src/librustc_data_structures/lib.rs2
-rw-r--r--src/librustc_mir/lib.rs2
-rw-r--r--src/librustc_traits/lib.rs2
-rw-r--r--src/libsyntax/feature_gate.rs13
-rw-r--r--src/test/compile-fail/closure-expected-type/expect-fn-supply-fn-multiple.rs1
-rw-r--r--src/test/compile-fail/closure-expected-type/expect-fn-supply-fn.rs2
-rw-r--r--src/test/compile-fail/underscore-lifetime-binders.rs2
-rw-r--r--src/test/compile-fail/underscore-lifetime-elison-mismatch.rs2
-rw-r--r--src/test/run-pass/impl-trait/lifetimes.rs1
-rw-r--r--src/test/run-pass/underscore-lifetimes.rs2
-rw-r--r--src/test/ui/error-codes/E0637.rs1
-rw-r--r--src/test/ui/error-codes/E0637.stderr6
-rw-r--r--src/test/ui/feature-gate-in_band_lifetimes-impl.rs1
-rw-r--r--src/test/ui/feature-gate-in_band_lifetimes-impl.stderr4
-rw-r--r--src/test/ui/feature-gate-underscore-lifetimes.rs20
-rw-r--r--src/test/ui/feature-gate-underscore-lifetimes.stderr11
-rw-r--r--src/test/ui/in-band-lifetimes/impl/assoc-type.rs1
-rw-r--r--src/test/ui/in-band-lifetimes/impl/assoc-type.stderr4
-rw-r--r--src/test/ui/in-band-lifetimes/impl/dyn-trait.rs1
-rw-r--r--src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr6
-rw-r--r--src/test/ui/in-band-lifetimes/impl/path-elided.rs1
-rw-r--r--src/test/ui/in-band-lifetimes/impl/path-elided.stderr2
-rw-r--r--src/test/ui/in-band-lifetimes/impl/path-underscore.rs1
-rw-r--r--src/test/ui/in-band-lifetimes/impl/ref-underscore.rs1
-rw-r--r--src/test/ui/in-band-lifetimes/impl/trait-elided.rs1
-rw-r--r--src/test/ui/in-band-lifetimes/impl/trait-elided.stderr2
-rw-r--r--src/test/ui/in-band-lifetimes/impl/trait-underscore.rs1
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.rs1
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr4
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.rs1
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr8
32 files changed, 27 insertions, 82 deletions
diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index ae8ae9404bc..dcad8132c2b 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -68,7 +68,7 @@
 #![feature(slice_patterns)]
 #![feature(specialization)]
 #![feature(unboxed_closures)]
-#![feature(underscore_lifetimes)]
+#![cfg_attr(stage0, feature(underscore_lifetimes))]
 #![cfg_attr(stage0, feature(universal_impl_trait))]
 #![feature(trace_macros)]
 #![feature(trusted_len)]
diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs
index 378a06dd912..622fb423b51 100644
--- a/src/librustc_data_structures/lib.rs
+++ b/src/librustc_data_structures/lib.rs
@@ -30,7 +30,7 @@
 #![cfg_attr(stage0, feature(i128_type, i128))]
 #![feature(specialization)]
 #![feature(optin_builtin_traits)]
-#![feature(underscore_lifetimes)]
+#![cfg_attr(stage0, feature(underscore_lifetimes))]
 #![feature(macro_vis_matcher)]
 #![feature(allow_internal_unstable)]
 #![cfg_attr(stage0, feature(universal_impl_trait))]
diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs
index 262e5f608ca..7af3a397666 100644
--- a/src/librustc_mir/lib.rs
+++ b/src/librustc_mir/lib.rs
@@ -37,7 +37,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
 #![feature(placement_in_syntax)]
 #![feature(collection_placement)]
 #![feature(nonzero)]
-#![feature(underscore_lifetimes)]
+#![cfg_attr(stage0, feature(underscore_lifetimes))]
 #![cfg_attr(stage0, feature(never_type))]
 #![feature(inclusive_range_fields)]
 
diff --git a/src/librustc_traits/lib.rs b/src/librustc_traits/lib.rs
index 0a21cc597e6..90f368edeec 100644
--- a/src/librustc_traits/lib.rs
+++ b/src/librustc_traits/lib.rs
@@ -15,7 +15,7 @@
 
 #![feature(crate_visibility_modifier)]
 #![cfg_attr(stage0, feature(match_default_bindings))]
-#![feature(underscore_lifetimes)]
+#![cfg_attr(stage0, feature(underscore_lifetimes))]
 
 #[macro_use]
 extern crate log;
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index ce8c613dc8b..526608d07aa 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -385,6 +385,9 @@ declare_features! (
     // allow `'_` placeholder lifetimes
     (active, underscore_lifetimes, "1.22.0", Some(44524), None),
 
+    // Default match binding modes (RFC 2005)
+    (active, match_default_bindings, "1.22.0", Some(42640), None),
+
     // Trait object syntax with `dyn` prefix
     (active, dyn_trait, "1.22.0", Some(44662), Some(Edition::Edition2018)),
 
@@ -562,6 +565,8 @@ declare_features! (
     (accepted, i128_type, "1.26.0", Some(35118), None),
     // Default match binding modes (RFC 2005)
     (accepted, match_default_bindings, "1.26.0", Some(42640), None),
+    // allow `'_` placeholder lifetimes
+    (accepted, underscore_lifetimes, "1.26.0", Some(44524), None),
 );
 
 // If you change this, please modify src/doc/unstable-book as well. You must
@@ -1792,14 +1797,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
 
         visit::walk_generic_param(self, param)
     }
-
-    fn visit_lifetime(&mut self, lt: &'a ast::Lifetime) {
-        if lt.ident.name == keywords::UnderscoreLifetime.name() {
-            gate_feature_post!(&self, underscore_lifetimes, lt.span,
-                               "underscore lifetimes are unstable");
-        }
-        visit::walk_lifetime(self, lt)
-    }
 }
 
 pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
diff --git a/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn-multiple.rs b/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn-multiple.rs
index f1b198a0591..124e55ea23a 100644
--- a/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn-multiple.rs
+++ b/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn-multiple.rs
@@ -10,7 +10,6 @@
 
 // must-compile-successfully
 
-#![feature(underscore_lifetimes)]
 #![allow(warnings)]
 
 type Different<'a, 'b> = &'a mut (&'a (), &'b ());
diff --git a/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn.rs b/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn.rs
index 645fd1f80ba..63284c98020 100644
--- a/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn.rs
+++ b/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(underscore_lifetimes)]
-
 fn with_closure_expecting_fn_with_free_region<F>(_: F)
     where F: for<'a> FnOnce(fn(&'a u32), &i32)
 {
diff --git a/src/test/compile-fail/underscore-lifetime-binders.rs b/src/test/compile-fail/underscore-lifetime-binders.rs
index 99b6e036f33..eb00ab5f67a 100644
--- a/src/test/compile-fail/underscore-lifetime-binders.rs
+++ b/src/test/compile-fail/underscore-lifetime-binders.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(underscore_lifetimes)]
-
 struct Foo<'a>(&'a u8);
 struct Baz<'a>(&'_ &'a u8); //~ ERROR missing lifetime specifier
 
diff --git a/src/test/compile-fail/underscore-lifetime-elison-mismatch.rs b/src/test/compile-fail/underscore-lifetime-elison-mismatch.rs
index a1c4e4a1fd9..b36c8eb324e 100644
--- a/src/test/compile-fail/underscore-lifetime-elison-mismatch.rs
+++ b/src/test/compile-fail/underscore-lifetime-elison-mismatch.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(underscore_lifetimes)]
-
 fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } //~ ERROR lifetime mismatch
 
 fn main() {}
diff --git a/src/test/run-pass/impl-trait/lifetimes.rs b/src/test/run-pass/impl-trait/lifetimes.rs
index 1b50ceefbe1..d126d795d90 100644
--- a/src/test/run-pass/impl-trait/lifetimes.rs
+++ b/src/test/run-pass/impl-trait/lifetimes.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(underscore_lifetimes)]
 #![allow(warnings)]
 
 use std::fmt::Debug;
diff --git a/src/test/run-pass/underscore-lifetimes.rs b/src/test/run-pass/underscore-lifetimes.rs
index ed0369353bc..4dd1a565c9f 100644
--- a/src/test/run-pass/underscore-lifetimes.rs
+++ b/src/test/run-pass/underscore-lifetimes.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(underscore_lifetimes)]
-
 struct Foo<'a>(&'a u8);
 
 fn foo(x: &u8) -> Foo<'_> {
diff --git a/src/test/ui/error-codes/E0637.rs b/src/test/ui/error-codes/E0637.rs
index 455529b088a..ee6a978d169 100644
--- a/src/test/ui/error-codes/E0637.rs
+++ b/src/test/ui/error-codes/E0637.rs
@@ -7,7 +7,6 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
-#![feature(underscore_lifetimes)]
 
 struct Foo<'a: '_>(&'a u8); //~ ERROR invalid lifetime bound name: `'_`
 fn foo<'a: '_>(_: &'a u8) {} //~ ERROR invalid lifetime bound name: `'_`
diff --git a/src/test/ui/error-codes/E0637.stderr b/src/test/ui/error-codes/E0637.stderr
index b8c926efb45..245729376df 100644
--- a/src/test/ui/error-codes/E0637.stderr
+++ b/src/test/ui/error-codes/E0637.stderr
@@ -1,17 +1,17 @@
 error[E0637]: invalid lifetime bound name: `'_`
-  --> $DIR/E0637.rs:12:16
+  --> $DIR/E0637.rs:11:16
    |
 LL | struct Foo<'a: '_>(&'a u8); //~ ERROR invalid lifetime bound name: `'_`
    |                ^^ `'_` is a reserved lifetime name
 
 error[E0637]: invalid lifetime bound name: `'_`
-  --> $DIR/E0637.rs:13:12
+  --> $DIR/E0637.rs:12:12
    |
 LL | fn foo<'a: '_>(_: &'a u8) {} //~ ERROR invalid lifetime bound name: `'_`
    |            ^^ `'_` is a reserved lifetime name
 
 error[E0637]: invalid lifetime bound name: `'_`
-  --> $DIR/E0637.rs:16:10
+  --> $DIR/E0637.rs:15:10
    |
 LL | impl<'a: '_> Bar<'a> { //~ ERROR invalid lifetime bound name: `'_`
    |          ^^ `'_` is a reserved lifetime name
diff --git a/src/test/ui/feature-gate-in_band_lifetimes-impl.rs b/src/test/ui/feature-gate-in_band_lifetimes-impl.rs
index a02b3e80009..3eb2ac1b008 100644
--- a/src/test/ui/feature-gate-in_band_lifetimes-impl.rs
+++ b/src/test/ui/feature-gate-in_band_lifetimes-impl.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![allow(warnings)]
-#![feature(underscore_lifetimes)]
 
 trait MyTrait<'a> { }
 
diff --git a/src/test/ui/feature-gate-in_band_lifetimes-impl.stderr b/src/test/ui/feature-gate-in_band_lifetimes-impl.stderr
index e32a06c3ce4..95bf81f41f8 100644
--- a/src/test/ui/feature-gate-in_band_lifetimes-impl.stderr
+++ b/src/test/ui/feature-gate-in_band_lifetimes-impl.stderr
@@ -1,11 +1,11 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/feature-gate-in_band_lifetimes-impl.rs:16:26
+  --> $DIR/feature-gate-in_band_lifetimes-impl.rs:15:26
    |
 LL | impl<'a> MyTrait<'a> for &u32 { }
    |                          ^ expected lifetime parameter
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/feature-gate-in_band_lifetimes-impl.rs:19:18
+  --> $DIR/feature-gate-in_band_lifetimes-impl.rs:18:18
    |
 LL | impl<'a> MyTrait<'_> for &'a f32 { }
    |                  ^^ expected lifetime parameter
diff --git a/src/test/ui/feature-gate-underscore-lifetimes.rs b/src/test/ui/feature-gate-underscore-lifetimes.rs
deleted file mode 100644
index 9da50c5c877..00000000000
--- a/src/test/ui/feature-gate-underscore-lifetimes.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct Foo<'a>(&'a u8);
-
-fn foo(x: &u8) -> Foo<'_> { //~ ERROR underscore lifetimes are unstable
-    Foo(x)
-}
-
-fn main() {
-    let x = 5;
-    let _ = foo(&x);
-}
diff --git a/src/test/ui/feature-gate-underscore-lifetimes.stderr b/src/test/ui/feature-gate-underscore-lifetimes.stderr
deleted file mode 100644
index c1cddcd763e..00000000000
--- a/src/test/ui/feature-gate-underscore-lifetimes.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0658]: underscore lifetimes are unstable (see issue #44524)
-  --> $DIR/feature-gate-underscore-lifetimes.rs:13:23
-   |
-LL | fn foo(x: &u8) -> Foo<'_> { //~ ERROR underscore lifetimes are unstable
-   |                       ^^
-   |
-   = help: add #![feature(underscore_lifetimes)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/in-band-lifetimes/impl/assoc-type.rs b/src/test/ui/in-band-lifetimes/impl/assoc-type.rs
index 54f38b2e729..ab35331b279 100644
--- a/src/test/ui/in-band-lifetimes/impl/assoc-type.rs
+++ b/src/test/ui/in-band-lifetimes/impl/assoc-type.rs
@@ -14,7 +14,6 @@
 #![allow(warnings)]
 
 #![feature(in_band_lifetimes)]
-#![feature(underscore_lifetimes)]
 
 trait MyTrait {
     type Output;
diff --git a/src/test/ui/in-band-lifetimes/impl/assoc-type.stderr b/src/test/ui/in-band-lifetimes/impl/assoc-type.stderr
index 909b86daef0..59b2cfd2226 100644
--- a/src/test/ui/in-band-lifetimes/impl/assoc-type.stderr
+++ b/src/test/ui/in-band-lifetimes/impl/assoc-type.stderr
@@ -1,11 +1,11 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/assoc-type.rs:24:19
+  --> $DIR/assoc-type.rs:23:19
    |
 LL |     type Output = &i32;
    |                   ^ expected lifetime parameter
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/assoc-type.rs:29:20
+  --> $DIR/assoc-type.rs:28:20
    |
 LL |     type Output = &'_ i32;
    |                    ^^ expected lifetime parameter
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs b/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs
index e839248b0e3..a504bae2e60 100644
--- a/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs
+++ b/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs
@@ -15,7 +15,6 @@
 
 #![feature(dyn_trait)]
 #![feature(in_band_lifetimes)]
-#![feature(underscore_lifetimes)]
 
 use std::fmt::Debug;
 
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr b/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr
index 0054ca3d1a5..9d6a318c075 100644
--- a/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr
+++ b/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr
@@ -1,11 +1,11 @@
 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/dyn-trait.rs:34:16
+  --> $DIR/dyn-trait.rs:33:16
    |
 LL |     static_val(x); //~ ERROR cannot infer
    |                ^
    |
-note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 33:1...
-  --> $DIR/dyn-trait.rs:33:1
+note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 32:1...
+  --> $DIR/dyn-trait.rs:32:1
    |
 LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/in-band-lifetimes/impl/path-elided.rs b/src/test/ui/in-band-lifetimes/impl/path-elided.rs
index fa1b4523889..8a758b124ba 100644
--- a/src/test/ui/in-band-lifetimes/impl/path-elided.rs
+++ b/src/test/ui/in-band-lifetimes/impl/path-elided.rs
@@ -10,7 +10,6 @@
 #![allow(warnings)]
 
 #![feature(in_band_lifetimes)]
-#![feature(underscore_lifetimes)]
 
 trait MyTrait { }
 
diff --git a/src/test/ui/in-band-lifetimes/impl/path-elided.stderr b/src/test/ui/in-band-lifetimes/impl/path-elided.stderr
index 19e69c61a03..6c1d72411bf 100644
--- a/src/test/ui/in-band-lifetimes/impl/path-elided.stderr
+++ b/src/test/ui/in-band-lifetimes/impl/path-elided.stderr
@@ -1,5 +1,5 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/path-elided.rs:19:18
+  --> $DIR/path-elided.rs:18:18
    |
 LL | impl MyTrait for Foo {
    |                  ^^^ expected lifetime parameter
diff --git a/src/test/ui/in-band-lifetimes/impl/path-underscore.rs b/src/test/ui/in-band-lifetimes/impl/path-underscore.rs
index 56f2d93d9e0..756991d97a5 100644
--- a/src/test/ui/in-band-lifetimes/impl/path-underscore.rs
+++ b/src/test/ui/in-band-lifetimes/impl/path-underscore.rs
@@ -15,7 +15,6 @@
 #![allow(warnings)]
 
 #![feature(in_band_lifetimes)]
-#![feature(underscore_lifetimes)]
 
 trait MyTrait { }
 
diff --git a/src/test/ui/in-band-lifetimes/impl/ref-underscore.rs b/src/test/ui/in-band-lifetimes/impl/ref-underscore.rs
index 1b1035abeba..99708afff35 100644
--- a/src/test/ui/in-band-lifetimes/impl/ref-underscore.rs
+++ b/src/test/ui/in-band-lifetimes/impl/ref-underscore.rs
@@ -15,7 +15,6 @@
 #![allow(warnings)]
 
 #![feature(in_band_lifetimes)]
-#![feature(underscore_lifetimes)]
 
 trait MyTrait { }
 
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-elided.rs b/src/test/ui/in-band-lifetimes/impl/trait-elided.rs
index 7594d66e078..e0709ab6dd0 100644
--- a/src/test/ui/in-band-lifetimes/impl/trait-elided.rs
+++ b/src/test/ui/in-band-lifetimes/impl/trait-elided.rs
@@ -10,7 +10,6 @@
 #![allow(warnings)]
 
 #![feature(in_band_lifetimes)]
-#![feature(underscore_lifetimes)]
 
 trait MyTrait<'a> { }
 
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-elided.stderr b/src/test/ui/in-band-lifetimes/impl/trait-elided.stderr
index bb301882868..fe3ded8e04c 100644
--- a/src/test/ui/in-band-lifetimes/impl/trait-elided.stderr
+++ b/src/test/ui/in-band-lifetimes/impl/trait-elided.stderr
@@ -1,5 +1,5 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/trait-elided.rs:17:6
+  --> $DIR/trait-elided.rs:16:6
    |
 LL | impl MyTrait for u32 {
    |      ^^^^^^^ expected lifetime parameter
diff --git a/src/test/ui/in-band-lifetimes/impl/trait-underscore.rs b/src/test/ui/in-band-lifetimes/impl/trait-underscore.rs
index 077e33c1efd..971fd1fe759 100644
--- a/src/test/ui/in-band-lifetimes/impl/trait-underscore.rs
+++ b/src/test/ui/in-band-lifetimes/impl/trait-underscore.rs
@@ -16,7 +16,6 @@
 #![allow(warnings)]
 
 #![feature(in_band_lifetimes)]
-#![feature(underscore_lifetimes)]
 
 trait MyTrait<'a> { }
 
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.rs b/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.rs
index d10541ad33b..e573ad8fc1f 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.rs
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.rs
@@ -14,7 +14,6 @@
 // cc #48468
 
 #![feature(dyn_trait)]
-#![feature(underscore_lifetimes)]
 
 use std::fmt::Debug;
 
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr
index a88ecb18dd6..6d777841f03 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr
@@ -1,11 +1,11 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/dyn-trait-underscore-in-struct.rs:22:24
+  --> $DIR/dyn-trait-underscore-in-struct.rs:21:24
    |
 LL |     x: Box<dyn Debug + '_>, //~ ERROR missing lifetime specifier
    |                        ^^ expected lifetime parameter
 
 error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
-  --> $DIR/dyn-trait-underscore-in-struct.rs:22:12
+  --> $DIR/dyn-trait-underscore-in-struct.rs:21:12
    |
 LL |     x: Box<dyn Debug + '_>, //~ ERROR missing lifetime specifier
    |            ^^^^^^^^^^^^^^
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs b/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs
index c2476220100..9640d346597 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs
@@ -14,7 +14,6 @@
 // cc #48468
 
 #![feature(dyn_trait)]
-#![feature(underscore_lifetimes)]
 
 fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
index cb3035f42a0..f1e59aed54a 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
@@ -1,11 +1,11 @@
 error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
-  --> $DIR/dyn-trait-underscore.rs:21:20
+  --> $DIR/dyn-trait-underscore.rs:20:20
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |                    ^^^^
    |
-note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 19:1...
-  --> $DIR/dyn-trait-underscore.rs:19:1
+note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 18:1...
+  --> $DIR/dyn-trait-underscore.rs:18:1
    |
 LL | / fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
 LL | |     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
@@ -13,7 +13,7 @@ LL | |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
 LL | | }
    | |_^
 note: ...so that reference does not outlive borrowed content
-  --> $DIR/dyn-trait-underscore.rs:21:14
+  --> $DIR/dyn-trait-underscore.rs:20:14
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |              ^^^^^