Skip to content

Commit 0f5b52e

Browse files
committed
Stabilize conservative_impl_trait
1 parent c393db6 commit 0f5b52e

File tree

68 files changed

+62
-240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+62
-240
lines changed

src/Cargo.lock

Lines changed: 3 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/doc/unstable-book/src/language-features/conservative-impl-trait.md

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

src/libcore/tests/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#![cfg_attr(stage0, feature(inclusive_range_syntax))]
2828
#![feature(iterator_try_fold)]
2929
#![feature(iterator_flatten)]
30-
#![feature(conservative_impl_trait)]
30+
#![cfg_attr(stage0, feature(conservative_impl_trait))]
3131
#![feature(iter_rfind)]
3232
#![feature(iter_rfold)]
3333
#![feature(iterator_repeat_with)]

src/librustc/diagnostics.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,8 +1789,6 @@ allowed as function return types.
17891789
Erroneous code example:
17901790
17911791
```compile_fail,E0562
1792-
#![feature(conservative_impl_trait)]
1793-
17941792
fn main() {
17951793
let count_to_ten: impl Iterator<Item=usize> = 0..10;
17961794
// error: `impl Trait` not allowed outside of function and inherent method
@@ -1804,8 +1802,6 @@ fn main() {
18041802
Make sure `impl Trait` only appears in return-type position.
18051803
18061804
```
1807-
#![feature(conservative_impl_trait)]
1808-
18091805
fn count_to_n(n: usize) -> impl Iterator<Item=usize> {
18101806
0..n
18111807
}
@@ -2081,8 +2077,6 @@ appear within the `impl Trait` itself.
20812077
Erroneous code example:
20822078
20832079
```compile-fail,E0909
2084-
#![feature(conservative_impl_trait)]
2085-
20862080
use std::cell::Cell;
20872081
20882082
trait Trait<'a> { }
@@ -2109,8 +2103,6 @@ type. For example, changing the return type to `impl Trait<'y> + 'x`
21092103
would work:
21102104
21112105
```
2112-
#![feature(conservative_impl_trait)]
2113-
21142106
use std::cell::Cell;
21152107
21162108
trait Trait<'a> { }

src/librustc/hir/lowering.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,20 +1108,9 @@ impl<'a> LoweringContext<'a> {
11081108
hir::TyTraitObject(bounds, lifetime_bound)
11091109
}
11101110
TyKind::ImplTrait(ref bounds) => {
1111-
use syntax::feature_gate::{emit_feature_err, GateIssue};
11121111
let span = t.span;
11131112
match itctx {
11141113
ImplTraitContext::Existential => {
1115-
let has_feature = self.sess.features_untracked().conservative_impl_trait;
1116-
if !t.span.allows_unstable() && !has_feature {
1117-
emit_feature_err(
1118-
&self.sess.parse_sess,
1119-
"conservative_impl_trait",
1120-
t.span,
1121-
GateIssue::Language,
1122-
"`impl Trait` in return position is experimental",
1123-
);
1124-
}
11251114
let def_index = self.resolver.definitions().opt_def_index(t.id).unwrap();
11261115
let hir_bounds = self.lower_bounds(bounds, itctx);
11271116
let (lifetimes, lifetime_defs) =

src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#![feature(box_patterns)]
4545
#![feature(box_syntax)]
46-
#![feature(conservative_impl_trait)]
46+
#![cfg_attr(stage0, feature(conservative_impl_trait))]
4747
#![feature(const_fn)]
4848
#![cfg_attr(stage0, feature(copy_closures, clone_closures))]
4949
#![feature(core_intrinsics)]

src/librustc_data_structures/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#![feature(unsize)]
2929
#![feature(i128_type)]
3030
#![feature(i128)]
31-
#![feature(conservative_impl_trait)]
31+
#![cfg_attr(stage0, feature(conservative_impl_trait))]
3232
#![feature(specialization)]
3333
#![feature(optin_builtin_traits)]
3434
#![feature(underscore_lifetimes)]

src/librustc_errors/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#![allow(unused_attributes)]
1818
#![feature(range_contains)]
1919
#![cfg_attr(unix, feature(libc))]
20-
#![feature(conservative_impl_trait)]
20+
#![cfg_attr(stage0, feature(conservative_impl_trait))]
2121
#![feature(i128_type)]
2222
#![feature(optin_builtin_traits)]
2323

src/librustc_incremental/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
html_root_url = "https://doc.rust-lang.org/nightly/")]
1616
#![deny(warnings)]
1717

18-
#![feature(conservative_impl_trait)]
18+
#![cfg_attr(stage0, feature(conservative_impl_trait))]
1919
#![feature(fs_read_write)]
2020
#![feature(i128_type)]
2121
#![cfg_attr(stage0, feature(inclusive_range_syntax))]

src/librustc_metadata/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#![deny(warnings)]
1515

1616
#![feature(box_patterns)]
17-
#![feature(conservative_impl_trait)]
17+
#![cfg_attr(stage0, feature(conservative_impl_trait))]
1818
#![feature(fs_read_write)]
1919
#![feature(i128_type)]
2020
#![feature(libc)]

0 commit comments

Comments
 (0)