Skip to content

Commit ec74d35

Browse files
committed
Stabilize min_const_fn
1 parent b8bea5a commit ec74d35

File tree

68 files changed

+143
-223
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

+143
-223
lines changed

src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
#![feature(box_syntax)]
8787
#![feature(cfg_target_has_atomic)]
8888
#![feature(coerce_unsized)]
89-
#![feature(min_const_fn)]
89+
#![cfg_attr(stage0, feature(min_const_fn))]
9090
#![feature(core_intrinsics)]
9191
#![feature(custom_attribute)]
9292
#![feature(dropck_eyepatch)]

src/liballoc/tests/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(allocator_api)]
1212
#![feature(alloc_system)]
1313
#![feature(box_syntax)]
14-
#![feature(min_const_fn)]
14+
#![cfg_attr(stage0, feature(min_const_fn))]
1515
#![feature(drain_filter)]
1616
#![feature(exact_size_is_empty)]
1717
#![feature(pattern)]

src/librustc/lib.rs

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

4343
#![feature(box_patterns)]
4444
#![feature(box_syntax)]
45-
#![feature(min_const_fn)]
45+
#![cfg_attr(stage0, feature(min_const_fn))]
4646
#![feature(core_intrinsics)]
4747
#![feature(drain_filter)]
4848
#![cfg_attr(windows, feature(libc))]

src/librustc/ty/constness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
6565
_ => true,
6666
}
6767
} else {
68-
// users enabling the `const_fn` can do what they want
68+
// users enabling the `const_fn` feature gate can do what they want
6969
!self.sess.features_untracked().const_fn
7070
}
7171
}

src/librustc_target/lib.rs

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

2424
#![feature(box_syntax)]
25-
#![feature(min_const_fn)]
25+
#![cfg_attr(stage0, feature(min_const_fn))]
2626
#![feature(nll)]
2727
#![feature(slice_patterns)]
2828

src/libstd/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
#![feature(cfg_target_vendor)]
251251
#![feature(char_error_internals)]
252252
#![feature(compiler_builtins_lib)]
253-
#![feature(min_const_fn)]
253+
#![cfg_attr(stage0, feature(min_const_fn))]
254254
#![feature(const_int_ops)]
255255
#![feature(const_ip)]
256256
#![feature(const_raw_ptr_deref)]

src/libsyntax/attr/builtin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ pub struct Stability {
107107
pub level: StabilityLevel,
108108
pub feature: Symbol,
109109
pub rustc_depr: Option<RustcDeprecation>,
110-
/// `None` means the function is stable but needs to be allowed by the
111-
/// `min_const_fn` feature
110+
/// `None` means the function is stable but needs to be a stable const fn, too
112111
/// `Some` contains the feature gate required to be able to use the function
113112
/// as const fn
114113
pub const_stability: Option<Symbol>,

src/libsyntax/feature_gate.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,9 +1806,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
18061806
if header.asyncness.is_async() {
18071807
gate_feature_post!(&self, async_await, span, "async fn is unstable");
18081808
}
1809-
if header.constness.node == ast::Constness::Const {
1810-
gate_feature_post!(&self, min_const_fn, span, "const fn is unstable");
1811-
}
18121809
// stability of const fn methods are covered in
18131810
// visit_trait_item and visit_impl_item below; this is
18141811
// because default methods don't pass through this
@@ -1863,11 +1860,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
18631860
}
18641861

18651862
match ii.node {
1866-
ast::ImplItemKind::Method(ref sig, _) => {
1867-
if sig.header.constness.node == ast::Constness::Const {
1868-
gate_feature_post!(&self, min_const_fn, ii.span, "const fn is unstable");
1869-
}
1870-
}
1863+
ast::ImplItemKind::Method(..) => {}
18711864
ast::ImplItemKind::Existential(..) => {
18721865
gate_feature_post!(
18731866
&self,

src/test/codegen-units/item-collection/unreferenced-const-fn.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
// NB: We do not expect *any* monomorphization to be generated here.
1515

16-
#![feature(min_const_fn)]
1716
#![deny(dead_code)]
1817
#![crate_type = "rlib"]
1918

src/test/codegen/link-dead-code.rs

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

1111
// compile-flags:-Clink-dead-code
1212

13-
#![feature(min_const_fn)]
1413
#![crate_type = "rlib"]
1514

1615
// This test makes sure that, when -Clink-dead-code is specified, we generate

0 commit comments

Comments
 (0)