From e6e6bd27d563b9a53687433feb3d4d4672dafd66 Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Wed, 28 Mar 2018 17:25:39 +0200 Subject: [PATCH] Stabilize underscore lifetimes --- src/librustc/lib.rs | 2 +- src/librustc_data_structures/lib.rs | 2 +- src/librustc_mir/lib.rs | 2 +- src/librustc_traits/lib.rs | 2 +- src/libsyntax/feature_gate.rs | 13 +++++------- .../expect-fn-supply-fn-multiple.rs | 1 - .../expect-fn-supply-fn.rs | 2 -- .../underscore-lifetime-binders.rs | 2 -- .../underscore-lifetime-elison-mismatch.rs | 2 -- src/test/run-pass/impl-trait/lifetimes.rs | 1 - src/test/run-pass/underscore-lifetimes.rs | 2 -- src/test/ui/error-codes/E0637.rs | 1 - src/test/ui/error-codes/E0637.stderr | 6 +++--- .../ui/feature-gate-in_band_lifetimes-impl.rs | 1 - ...feature-gate-in_band_lifetimes-impl.stderr | 4 ++-- .../ui/feature-gate-underscore-lifetimes.rs | 20 ------------------- .../feature-gate-underscore-lifetimes.stderr | 11 ---------- .../ui/in-band-lifetimes/impl/assoc-type.rs | 1 - .../in-band-lifetimes/impl/assoc-type.stderr | 4 ++-- .../ui/in-band-lifetimes/impl/dyn-trait.rs | 1 - .../in-band-lifetimes/impl/dyn-trait.stderr | 6 +++--- .../ui/in-band-lifetimes/impl/path-elided.rs | 1 - .../in-band-lifetimes/impl/path-elided.stderr | 2 +- .../in-band-lifetimes/impl/path-underscore.rs | 1 - .../in-band-lifetimes/impl/ref-underscore.rs | 1 - .../ui/in-band-lifetimes/impl/trait-elided.rs | 1 - .../impl/trait-elided.stderr | 2 +- .../impl/trait-underscore.rs | 1 - .../dyn-trait-underscore-in-struct.rs | 1 - .../dyn-trait-underscore-in-struct.stderr | 4 ++-- .../dyn-trait-underscore.rs | 1 - .../dyn-trait-underscore.stderr | 8 ++++---- 32 files changed, 27 insertions(+), 82 deletions(-) delete mode 100644 src/test/ui/feature-gate-underscore-lifetimes.rs delete mode 100644 src/test/ui/feature-gate-underscore-lifetimes.stderr diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index ae8ae9404bc87..dcad8132c2b24 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 378a06dd9120a..622fb423b51e4 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 262e5f608ca64..7af3a397666e8 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 0a21cc597e63b..90f368edeeca6 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 ce8c613dc8bb6..526608d07aae7 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 f1b198a059176..124e55ea23a00 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 645fd1f80babf..63284c98020fc 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) 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 99b6e036f33ea..eb00ab5f67afe 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 a1c4e4a1fd935..b36c8eb324e10 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 1b50ceefbe1ae..d126d795d909a 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 ed0369353bcd3..4dd1a565c9f14 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 455529b088a2e..ee6a978d169a3 100644 --- a/src/test/ui/error-codes/E0637.rs +++ b/src/test/ui/error-codes/E0637.rs @@ -7,7 +7,6 @@ // , 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 b8c926efb45a2..245729376df36 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 a02b3e800097e..3eb2ac1b00851 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 e32a06c3ce456..95bf81f41f808 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 9da50c5c87719..0000000000000 --- 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 or the MIT license -// , 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 c1cddcd763eb7..0000000000000 --- 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 54f38b2e729b1..ab35331b279b0 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 909b86daef0fc..59b2cfd2226db 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 e839248b0e317..a504bae2e6007 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 0054ca3d1a5bf..9d6a318c07513 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) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 fa1b45238895f..8a758b124ba53 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 19e69c61a0337..6c1d72411bf57 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 56f2d93d9e0a9..756991d97a535 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 1b1035abeba36..99708afff351c 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 7594d66e07839..e0709ab6dd07d 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 bb301882868a4..fe3ded8e04c33 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 077e33c1efde2..971fd1fe759bb 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 d10541ad33b52..e573ad8fc1f09 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 a88ecb18dd6fe..6d777841f0319 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, //~ 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, //~ 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 c24762201004b..9640d3465978f 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(items: &[T]) -> Box> { // ^^^^^^^^^^^^^^^^^^^^^ 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 cb3035f42a04a..f1e59aed54a36 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(items: &[T]) -> Box> { 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 | ^^^^^