Skip to content

Commit c393db6

Browse files
committed
Stabilize universal_impl_trait
1 parent 445fafa commit c393db6

31 files changed

+15
-108
lines changed

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

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

src/librustc/hir/lowering.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,17 +1143,6 @@ impl<'a> LoweringContext<'a> {
11431143
)
11441144
}
11451145
ImplTraitContext::Universal(def_id) => {
1146-
let has_feature = self.sess.features_untracked().universal_impl_trait;
1147-
if !t.span.allows_unstable() && !has_feature {
1148-
emit_feature_err(
1149-
&self.sess.parse_sess,
1150-
"universal_impl_trait",
1151-
t.span,
1152-
GateIssue::Language,
1153-
"`impl Trait` in argument position is experimental",
1154-
);
1155-
}
1156-
11571146
let def_node_id = self.next_id().node_id;
11581147

11591148
// Add a definition for the in-band TyParam

src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
#![feature(specialization)]
7171
#![feature(unboxed_closures)]
7272
#![feature(underscore_lifetimes)]
73-
#![feature(universal_impl_trait)]
73+
#![cfg_attr(stage0, feature(universal_impl_trait))]
7474
#![feature(trace_macros)]
7575
#![feature(trusted_len)]
7676
#![feature(catch_expr)]

src/librustc_data_structures/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#![feature(underscore_lifetimes)]
3535
#![feature(macro_vis_matcher)]
3636
#![feature(allow_internal_unstable)]
37-
#![feature(universal_impl_trait)]
37+
#![cfg_attr(stage0, feature(universal_impl_trait))]
3838

3939
#![cfg_attr(unix, feature(libc))]
4040
#![cfg_attr(test, feature(test))]

src/librustc_typeck/diagnostics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4600,7 +4600,6 @@ This error indicates that there is a mismatch between generic parameters and
46004600
impl Trait parameters in a trait declaration versus its impl.
46014601
46024602
```compile_fail,E0643
4603-
#![feature(universal_impl_trait)]
46044603
trait Foo {
46054604
fn foo(&self, _: &impl Iterator);
46064605
}

src/libsyntax/feature_gate.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,6 @@ declare_features! (
279279
// Allows `impl Trait` in function return types.
280280
(active, conservative_impl_trait, "1.12.0", Some(34511), None),
281281

282-
// Allows `impl Trait` in function arguments.
283-
(active, universal_impl_trait, "1.23.0", Some(34511), None),
284-
285282
// Allows exhaustive pattern matching on types that contain uninhabited types.
286283
(active, exhaustive_patterns, "1.13.0", None, None),
287284

@@ -566,6 +563,8 @@ declare_features! (
566563
// Copy/Clone closures (RFC 2132)
567564
(accepted, clone_closures, "1.26.0", Some(44490), None),
568565
(accepted, copy_closures, "1.26.0", Some(44490), None),
566+
// Allows `impl Trait` in function arguments.
567+
(accepted, universal_impl_trait, "1.26.0", Some(34511), None),
569568
);
570569

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

src/test/compile-fail/impl-trait/impl-generic-mismatch-ab.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(universal_impl_trait)]
1211
use std::fmt::Debug;
1312

1413
trait Foo {

src/test/compile-fail/impl-trait/impl-generic-mismatch.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(universal_impl_trait)]
1211
use std::fmt::Debug;
1312

1413
trait Foo {

src/test/compile-fail/impl-trait/where-allowed.rs

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

1111
//! A simple test for testing many permutations of allowedness of
1212
//! impl Trait
13-
#![feature(conservative_impl_trait, universal_impl_trait, dyn_trait)]
13+
#![feature(conservative_impl_trait, dyn_trait)]
1414
use std::fmt::Debug;
1515

1616
// Allowed

src/test/run-pass/impl-trait/example-calendar.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//[nll] compile-flags: -Znll -Zborrowck=mir
1313

1414
#![feature(conservative_impl_trait,
15-
universal_impl_trait,
1615
fn_traits,
1716
step_trait,
1817
unboxed_closures,

0 commit comments

Comments
 (0)