Skip to content

Commit 36f1ed6

Browse files
authored
Rollup merge of #85850 - bjorn3:less_feature_gates, r=jyn514
Remove unused feature gates The first commit removes a usage of a feature gate, but I don't expect it to be controversial as the feature gate was only used to workaround a limitation of rust in the past. (closures never being `Clone`) The second commit uses `#[allow_internal_unstable]` to avoid leaking the `trusted_step` feature gate usage from inside the index newtype macro. It didn't work for the `min_specialization` feature gate though. The third commit removes (almost) all feature gates from the compiler that weren't used anyway.
2 parents df9ea79 + 312f964 commit 36f1ed6

File tree

24 files changed

+2
-69
lines changed

24 files changed

+2
-69
lines changed

compiler/rustc_ast/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
#![feature(box_patterns)]
1313
#![cfg_attr(bootstrap, feature(const_fn_unsize))]
1414
#![feature(const_fn_transmute)]
15-
#![feature(const_panic)]
1615
#![feature(crate_visibility_modifier)]
1716
#![feature(iter_zip)]
1817
#![feature(label_break_value)]
1918
#![feature(nll)]
2019
#![feature(min_specialization)]
21-
#![feature(trusted_step)]
2220
#![recursion_limit = "256"]
2321

2422
#[macro_use]

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
77
#![feature(bindings_after_at)]
88
#![feature(iter_is_partitioned)]
9-
#![feature(box_syntax)]
109
#![feature(box_patterns)]
1110
#![recursion_limit = "256"]
1211

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2-
#![feature(assert_matches)]
32
#![feature(bool_to_option)]
43
#![feature(box_patterns)]
5-
#![feature(drain_filter)]
64
#![feature(try_blocks)]
75
#![feature(in_band_lifetimes)]
86
#![feature(nll)]
97
#![feature(associated_type_bounds)]
10-
#![feature(iter_zip)]
118
#![recursion_limit = "256"]
12-
#![feature(box_syntax)]
139

1410
//! This crate contains codegen code that is used by all codegen backends (LLVM and others).
1511
//! The backend-agnostic functions of this crate use functions defined in various traits that

compiler/rustc_data_structures/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010
#![feature(array_windows)]
1111
#![feature(control_flow_enum)]
1212
#![feature(in_band_lifetimes)]
13-
#![feature(unboxed_closures)]
1413
#![feature(generator_trait)]
15-
#![feature(fn_traits)]
1614
#![feature(min_specialization)]
1715
#![feature(auto_traits)]
1816
#![feature(nll)]
1917
#![feature(allow_internal_unstable)]
2018
#![feature(hash_raw_entry)]
21-
#![feature(stmt_expr_attributes)]
2219
#![feature(core_intrinsics)]
2320
#![feature(test)]
2421
#![feature(associated_type_bounds)]

compiler/rustc_data_structures/src/obligation_forest/mod.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ impl<O: ForestObligation> ObligationForest<O> {
597597
Some(rpos) => {
598598
// Cycle detected.
599599
processor.process_backedge(
600-
stack[rpos..].iter().map(GetObligation(&self.nodes)),
600+
stack[rpos..].iter().map(|&i| &self.nodes[i].obligation),
601601
PhantomData,
602602
);
603603
}
@@ -705,20 +705,3 @@ impl<O: ForestObligation> ObligationForest<O> {
705705
});
706706
}
707707
}
708-
709-
// I need a Clone closure.
710-
#[derive(Clone)]
711-
struct GetObligation<'a, O>(&'a [Node<O>]);
712-
713-
impl<'a, 'b, O> FnOnce<(&'b usize,)> for GetObligation<'a, O> {
714-
type Output = &'a O;
715-
extern "rust-call" fn call_once(self, args: (&'b usize,)) -> &'a O {
716-
&self.0[*args.0].obligation
717-
}
718-
}
719-
720-
impl<'a, 'b, O> FnMut<(&'b usize,)> for GetObligation<'a, O> {
721-
extern "rust-call" fn call_mut(&mut self, args: (&'b usize,)) -> &'a O {
722-
&self.0[*args.0].obligation
723-
}
724-
}

compiler/rustc_expand/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(bool_to_option)]
21
#![feature(crate_visibility_modifier)]
32
#![feature(decl_macro)]
43
#![feature(destructuring_assignment)]

compiler/rustc_hir/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html
44
55
#![feature(crate_visibility_modifier)]
6-
#![feature(const_panic)]
76
#![cfg_attr(bootstrap, feature(extended_key_value_attributes))]
87
#![feature(in_band_lifetimes)]
98
#![feature(once_cell)]
109
#![feature(min_specialization)]
11-
#![feature(trusted_step)]
1210
#![recursion_limit = "256"]
1311

1412
#[macro_use]

compiler/rustc_index/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#![feature(allow_internal_unstable)]
22
#![feature(bench_black_box)]
3-
#![feature(const_panic)]
43
#![feature(extend_one)]
54
#![feature(iter_zip)]
65
#![feature(unboxed_closures)]
76
#![feature(test)]
87
#![feature(fn_traits)]
9-
#![feature(trusted_step)]
108

119
pub mod bit_set;
1210
pub mod vec;

compiler/rustc_index/src/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl Idx for u32 {
6565
/// `u32::MAX`. You can also customize things like the `Debug` impl,
6666
/// what traits are derived, and so forth via the macro.
6767
#[macro_export]
68-
#[allow_internal_unstable(step_trait, rustc_attrs)]
68+
#[allow_internal_unstable(step_trait, rustc_attrs, trusted_step)]
6969
macro_rules! newtype_index {
7070
// ---- public rules ----
7171

compiler/rustc_infer/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
#![feature(bool_to_option)]
1717
#![feature(box_patterns)]
1818
#![feature(box_syntax)]
19-
#![feature(const_panic)]
2019
#![feature(extend_one)]
2120
#![feature(iter_zip)]
2221
#![feature(never_type)]
2322
#![feature(in_band_lifetimes)]
2423
#![feature(control_flow_enum)]
2524
#![feature(min_specialization)]
26-
#![feature(trusted_step)]
2725
#![recursion_limit = "512"] // For rustdoc
2826

2927
#[macro_use]

0 commit comments

Comments
 (0)