Skip to content

Commit 3739357

Browse files
committed
Stabilize impl_header_lifetime_elision in 2015
It's already stable in 2018; this finishes the stabilization.
1 parent 89be71a commit 3739357

27 files changed

+37
-141
lines changed

src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
#![feature(doc_spotlight)]
8888
#![feature(extern_types)]
8989
#![feature(fundamental)]
90-
#![feature(impl_header_lifetime_elision)]
90+
#![cfg_attr(stage0, feature(impl_header_lifetime_elision))]
9191
#![feature(intrinsics)]
9292
#![feature(lang_items)]
9393
#![feature(link_llvm_intrinsics)]

src/libcore/tests/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#![feature(flt2dec)]
2020
#![feature(fmt_internals)]
2121
#![feature(hashmap_internals)]
22-
#![feature(impl_header_lifetime_elision)]
22+
#![cfg_attr(stage0, feature(impl_header_lifetime_elision))]
2323
#![feature(pattern)]
2424
#![feature(range_is_empty)]
2525
#![feature(raw)]

src/librustc/hir/lowering.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,8 @@ pub struct LoweringContext<'a> {
125125

126126
// Whether or not in-band lifetimes are being collected. This is used to
127127
// indicate whether or not we're in a place where new lifetimes will result
128-
// in in-band lifetime definitions, such a function or an impl header.
129-
// This will always be false unless the `in_band_lifetimes` or
130-
// `impl_header_lifetime_elision` feature is enabled.
128+
// in in-band lifetime definitions, such a function or an impl header,
129+
// including implicit lifetimes from `impl_header_lifetime_elision`.
131130
is_collecting_in_band_lifetimes: bool,
132131

133132
// Currently in-scope lifetimes defined in impl headers, fn headers, or HRTB.
@@ -709,12 +708,8 @@ impl<'a> LoweringContext<'a> {
709708
assert!(self.lifetimes_to_define.is_empty());
710709
let old_anonymous_lifetime_mode = self.anonymous_lifetime_mode;
711710

712-
if self.sess.features_untracked().impl_header_lifetime_elision {
713-
self.anonymous_lifetime_mode = anonymous_lifetime_mode;
714-
self.is_collecting_in_band_lifetimes = true;
715-
} else if self.sess.features_untracked().in_band_lifetimes {
716-
self.is_collecting_in_band_lifetimes = true;
717-
}
711+
self.anonymous_lifetime_mode = anonymous_lifetime_mode;
712+
self.is_collecting_in_band_lifetimes = true;
718713

719714
let (in_band_ty_params, res) = f(self);
720715

src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
#![feature(step_trait)]
6868
#![feature(integer_atomics)]
6969
#![feature(test)]
70-
#![feature(impl_header_lifetime_elision)]
70+
#![cfg_attr(stage0, feature(impl_header_lifetime_elision))]
7171
#![feature(in_band_lifetimes)]
7272
#![feature(macro_at_most_once_rep)]
7373
#![feature(crate_visibility_modifier)]

src/librustc_data_structures/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
html_root_url = "https://doc.rust-lang.org/nightly/")]
2222

2323
#![feature(in_band_lifetimes)]
24-
#![feature(impl_header_lifetime_elision)]
24+
#![cfg_attr(stage0, feature(impl_header_lifetime_elision))]
2525
#![feature(unboxed_closures)]
2626
#![feature(fn_traits)]
2727
#![feature(unsize)]

src/librustc_mir/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
1616

1717
#![feature(nll)]
1818
#![feature(in_band_lifetimes)]
19-
#![feature(impl_header_lifetime_elision)]
19+
#![cfg_attr(stage0, feature(impl_header_lifetime_elision))]
2020
#![feature(slice_patterns)]
2121
#![feature(slice_sort_by_cached_key)]
2222
#![feature(box_patterns)]

src/libsyntax/feature_gate.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,6 @@ declare_features! (
462462

463463
(active, abi_amdgpu_kernel, "1.29.0", Some(51575), None),
464464

465-
// impl<I:Iterator> Iterator for &mut Iterator
466-
// impl Debug for Foo<'_>
467-
(active, impl_header_lifetime_elision, "1.30.0", Some(15872), Some(Edition::Edition2018)),
468-
469465
// Support for arbitrary delimited token streams in non-macro attributes
470466
(active, unrestricted_attribute_tokens, "1.30.0", Some(44690), None),
471467

@@ -684,6 +680,9 @@ declare_features! (
684680
(accepted, min_const_fn, "1.31.0", Some(53555), None),
685681
// Scoped lints
686682
(accepted, tool_lints, "1.31.0", Some(44690), None),
683+
// impl<I:Iterator> Iterator for &mut Iterator
684+
// impl Debug for Foo<'_>
685+
(accepted, impl_header_lifetime_elision, "1.31.0", Some(15872), None),
687686
);
688687

689688
// If you change this, please modify src/doc/unstable-book as well. You must

src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision-with-in_band.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision-with-in_band.stderr

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)