Skip to content

Commit cc744dd

Browse files
committed
Remove unused/unnecessary features
1 parent 8847bda commit cc744dd

File tree

61 files changed

+111
-215
lines changed

Some content is hidden

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

61 files changed

+111
-215
lines changed

compiler/rustc_ast/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
#![feature(rustdoc_internals)]
1414
#![feature(associated_type_bounds)]
1515
#![feature(box_patterns)]
16-
#![feature(const_trait_impl)]
1716
#![feature(if_let_guard)]
1817
#![feature(let_chains)]
1918
#![feature(min_specialization)]
2019
#![feature(negative_impls)]
2120
#![feature(stmt_expr_attributes)]
22-
#![recursion_limit = "256"]
2321
#![deny(rustc::untranslatable_diagnostic)]
2422
#![deny(rustc::diagnostic_outside_of_impl)]
2523

compiler/rustc_ast_lowering/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@
3333
#![allow(internal_features)]
3434
#![feature(rustdoc_internals)]
3535
#![doc(rust_logo)]
36-
#![feature(if_let_guard)]
3736
#![feature(box_patterns)]
3837
#![feature(let_chains)]
39-
#![recursion_limit = "256"]
4038
#![deny(rustc::untranslatable_diagnostic)]
4139
#![deny(rustc::diagnostic_outside_of_impl)]
4240

compiler/rustc_ast_passes/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(if_let_guard)]
1212
#![feature(iter_is_partitioned)]
1313
#![feature(let_chains)]
14-
#![recursion_limit = "256"]
1514
#![deny(rustc::untranslatable_diagnostic)]
1615
#![deny(rustc::diagnostic_outside_of_impl)]
1716

compiler/rustc_ast_pretty/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#![deny(rustc::untranslatable_diagnostic)]
55
#![deny(rustc::diagnostic_outside_of_impl)]
66
#![feature(box_patterns)]
7-
#![feature(let_chains)]
8-
#![recursion_limit = "256"]
97

108
mod helpers;
119
pub mod pp;

compiler/rustc_attr/src/builtin.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,7 @@ pub fn eval_condition(
671671
!eval_condition(mis[0].meta_item().unwrap(), sess, features, eval)
672672
}
673673
sym::target => {
674-
if let Some(features) = features
675-
&& !features.cfg_target_compact
676-
{
674+
if let Some(&Features { cfg_target_compact: false, .. }) = features {
677675
feature_err(
678676
sess,
679677
sym::cfg_target_compact,

compiler/rustc_attr/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#![allow(internal_features)]
88
#![feature(rustdoc_internals)]
99
#![doc(rust_logo)]
10-
#![feature(let_chains)]
1110
#![deny(rustc::untranslatable_diagnostic)]
1211
#![deny(rustc::diagnostic_outside_of_impl)]
1312

compiler/rustc_borrowck/src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@
88
#![feature(let_chains)]
99
#![feature(min_specialization)]
1010
#![feature(never_type)]
11-
#![feature(lazy_cell)]
1211
#![feature(rustc_attrs)]
1312
#![feature(stmt_expr_attributes)]
14-
#![feature(trusted_step)]
15-
#![feature(try_blocks)]
16-
#![recursion_limit = "256"]
1713

1814
#[macro_use]
1915
extern crate rustc_middle;

compiler/rustc_borrowck/src/nll.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,18 @@ pub(super) fn dump_mir_results<'tcx>(
243243
});
244244

245245
// Also dump the inference graph constraints as a graphviz file.
246-
let _: io::Result<()> = try {
247-
let mut file = create_dump_file(infcx.tcx, "regioncx.all.dot", false, "nll", &0, body)?;
248-
regioncx.dump_graphviz_raw_constraints(&mut file)?;
249-
};
246+
let _: io::Result<()> = (|| {
247+
let mut file =
248+
create_dump_file(infcx.tcx, "regioncx.all.dot", false, "nll", &0 as _, body)?;
249+
regioncx.dump_graphviz_raw_constraints(&mut file)
250+
})();
250251

251252
// Also dump the inference graph constraints as a graphviz file.
252-
let _: io::Result<()> = try {
253-
let mut file = create_dump_file(infcx.tcx, "regioncx.scc.dot", false, "nll", &0, body)?;
254-
regioncx.dump_graphviz_scc_constraints(&mut file)?;
255-
};
253+
let _: io::Result<()> = (|| {
254+
let mut file =
255+
create_dump_file(infcx.tcx, "regioncx.scc.dot", false, "nll", &0 as _, body)?;
256+
regioncx.dump_graphviz_scc_constraints(&mut file)
257+
})();
256258
}
257259

258260
#[allow(rustc::diagnostic_outside_of_impl)]

compiler/rustc_builtin_macros/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
#![feature(rustdoc_internals)]
66
#![doc(rust_logo)]
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
8-
#![feature(array_windows)]
98
#![feature(box_patterns)]
109
#![feature(decl_macro)]
1110
#![feature(if_let_guard)]
12-
#![feature(is_sorted)]
1311
#![feature(let_chains)]
1412
#![feature(lint_reasons)]
1513
#![feature(proc_macro_internals)]
1614
#![feature(proc_macro_quote)]
17-
#![recursion_limit = "256"]
1815

1916
extern crate proc_macro;
2017

compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ fn encode_mappings_for_function(
222222
function_coverage: &FunctionCoverage<'_>,
223223
) -> Vec<u8> {
224224
let counter_regions = function_coverage.counter_regions();
225-
if counter_regions.is_empty() {
225+
if counter_regions.len() == 0 {
226226
return Vec::new();
227227
}
228228

compiler/rustc_codegen_llvm/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
#![feature(rustdoc_internals)]
99
#![doc(rust_logo)]
1010
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
11-
#![feature(exact_size_is_empty)]
1211
#![feature(extern_types)]
1312
#![feature(hash_raw_entry)]
1413
#![feature(iter_intersperse)]
1514
#![feature(let_chains)]
1615
#![feature(min_specialization)]
17-
#![feature(never_type)]
1816
#![feature(impl_trait_in_assoc_type)]
19-
#![recursion_limit = "256"]
2017
#![deny(rustc::untranslatable_diagnostic)]
2118
#![deny(rustc::diagnostic_outside_of_impl)]
2219

compiler/rustc_codegen_ssa/src/back/linker.rs

+18-13
Original file line numberDiff line numberDiff line change
@@ -685,18 +685,19 @@ impl<'a> Linker for GccLinker<'a> {
685685

686686
if self.sess.target.is_like_osx {
687687
// Write a plain, newline-separated list of symbols
688-
let res: io::Result<()> = try {
688+
let res: io::Result<()> = (|| {
689689
let mut f = BufWriter::new(File::create(&path)?);
690690
for sym in symbols {
691691
debug!(" _{sym}");
692692
writeln!(f, "_{sym}")?;
693693
}
694-
};
694+
Ok(())
695+
})();
695696
if let Err(error) = res {
696697
self.sess.dcx().emit_fatal(errors::LibDefWriteFailure { error });
697698
}
698699
} else if is_windows {
699-
let res: io::Result<()> = try {
700+
let res: io::Result<()> = (|| {
700701
let mut f = BufWriter::new(File::create(&path)?);
701702

702703
// .def file similar to MSVC one but without LIBRARY section
@@ -706,13 +707,14 @@ impl<'a> Linker for GccLinker<'a> {
706707
debug!(" _{symbol}");
707708
writeln!(f, " {symbol}")?;
708709
}
709-
};
710+
Ok(())
711+
})();
710712
if let Err(error) = res {
711713
self.sess.dcx().emit_fatal(errors::LibDefWriteFailure { error });
712714
}
713715
} else {
714716
// Write an LD version script
715-
let res: io::Result<()> = try {
717+
let res: io::Result<()> = (|| {
716718
let mut f = BufWriter::new(File::create(&path)?);
717719
writeln!(f, "{{")?;
718720
if !symbols.is_empty() {
@@ -722,8 +724,8 @@ impl<'a> Linker for GccLinker<'a> {
722724
writeln!(f, " {sym};")?;
723725
}
724726
}
725-
writeln!(f, "\n local:\n *;\n}};")?;
726-
};
727+
writeln!(f, "\n local:\n *;\n}};")
728+
})();
727729
if let Err(error) = res {
728730
self.sess.dcx().emit_fatal(errors::VersionScriptWriteFailure { error });
729731
}
@@ -992,7 +994,7 @@ impl<'a> Linker for MsvcLinker<'a> {
992994
}
993995

994996
let path = tmpdir.join("lib.def");
995-
let res: io::Result<()> = try {
997+
let res: io::Result<()> = (|| {
996998
let mut f = BufWriter::new(File::create(&path)?);
997999

9981000
// Start off with the standard module name header and then go
@@ -1003,7 +1005,8 @@ impl<'a> Linker for MsvcLinker<'a> {
10031005
debug!(" _{symbol}");
10041006
writeln!(f, " {symbol}")?;
10051007
}
1006-
};
1008+
Ok(())
1009+
})();
10071010
if let Err(error) = res {
10081011
self.sess.dcx().emit_fatal(errors::LibDefWriteFailure { error });
10091012
}
@@ -1679,14 +1682,15 @@ impl<'a> Linker for AixLinker<'a> {
16791682

16801683
fn export_symbols(&mut self, tmpdir: &Path, _crate_type: CrateType, symbols: &[String]) {
16811684
let path = tmpdir.join("list.exp");
1682-
let res: io::Result<()> = try {
1685+
let res: io::Result<()> = (|| {
16831686
let mut f = BufWriter::new(File::create(&path)?);
16841687
// FIXME: use llvm-nm to generate export list.
16851688
for symbol in symbols {
16861689
debug!(" _{symbol}");
16871690
writeln!(f, " {symbol}")?;
16881691
}
1689-
};
1692+
Ok(())
1693+
})();
16901694
if let Err(e) = res {
16911695
self.sess.dcx().fatal(format!("failed to write export file: {e}"));
16921696
}
@@ -1988,12 +1992,13 @@ impl<'a> Linker for BpfLinker<'a> {
19881992

19891993
fn export_symbols(&mut self, tmpdir: &Path, _crate_type: CrateType, symbols: &[String]) {
19901994
let path = tmpdir.join("symbols");
1991-
let res: io::Result<()> = try {
1995+
let res: io::Result<()> = (|| {
19921996
let mut f = BufWriter::new(File::create(&path)?);
19931997
for sym in symbols {
19941998
writeln!(f, "{sym}")?;
19951999
}
1996-
};
2000+
Ok(())
2001+
})();
19972002
if let Err(error) = res {
19982003
self.sess.dcx().emit_fatal(errors::SymbolFileWriteFailure { error });
19992004
} else {

compiler/rustc_codegen_ssa/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
#![feature(if_let_guard)]
88
#![feature(let_chains)]
99
#![feature(negative_impls)]
10-
#![feature(never_type)]
1110
#![feature(strict_provenance)]
12-
#![feature(try_blocks)]
13-
#![recursion_limit = "256"]
1411

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

compiler/rustc_const_eval/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@ Rust MIR: a lowered representation of Rust.
1111
#![feature(assert_matches)]
1212
#![feature(box_patterns)]
1313
#![feature(decl_macro)]
14-
#![feature(exact_size_is_empty)]
1514
#![feature(let_chains)]
16-
#![feature(map_try_insert)]
17-
#![feature(min_specialization)]
1815
#![feature(slice_ptr_get)]
19-
#![feature(option_get_or_insert_default)]
2016
#![feature(never_type)]
2117
#![feature(trait_alias)]
22-
#![feature(trusted_len)]
23-
#![feature(trusted_step)]
2418
#![feature(try_blocks)]
2519
#![feature(yeet_expr)]
2620
#![feature(if_let_guard)]
27-
#![recursion_limit = "256"]
2821

2922
#[macro_use]
3023
extern crate tracing;

compiler/rustc_data_structures/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#![feature(allocator_api)]
1919
#![feature(array_windows)]
2020
#![feature(auto_traits)]
21-
#![feature(cell_leak)]
2221
#![feature(cfg_match)]
2322
#![feature(core_intrinsics)]
2423
#![feature(extend_one)]

compiler/rustc_driver_impl/src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
#![feature(rustdoc_internals)]
1010
#![allow(internal_features)]
1111
#![feature(decl_macro)]
12-
#![feature(lazy_cell)]
1312
#![feature(let_chains)]
1413
#![feature(panic_update_hook)]
15-
#![feature(result_flattening)]
16-
#![recursion_limit = "256"]
1714
#![deny(rustc::untranslatable_diagnostic)]
1815
#![deny(rustc::diagnostic_outside_of_impl)]
1916

@@ -1249,7 +1246,7 @@ pub fn catch_fatal_errors<F: FnOnce() -> R, R>(f: F) -> Result<R, ErrorGuarantee
12491246
/// Variant of `catch_fatal_errors` for the `interface::Result` return type
12501247
/// that also computes the exit code.
12511248
pub fn catch_with_exit_code(f: impl FnOnce() -> interface::Result<()>) -> i32 {
1252-
match catch_fatal_errors(f).flatten() {
1249+
match catch_fatal_errors(f).and_then(std::convert::identity) {
12531250
Ok(()) => EXIT_SUCCESS,
12541251
Err(_) => EXIT_FAILURE,
12551252
}

compiler/rustc_error_messages/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![doc(rust_logo)]
22
#![feature(rustdoc_internals)]
3-
#![feature(let_chains)]
43
#![feature(lazy_cell)]
54
#![feature(rustc_attrs)]
65
#![feature(type_alias_impl_trait)]

compiler/rustc_errors/src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
#![feature(array_windows)]
99
#![feature(associated_type_defaults)]
1010
#![feature(box_into_inner)]
11+
#![feature(box_patterns)]
1112
#![feature(extract_if)]
12-
#![feature(if_let_guard)]
1313
#![feature(let_chains)]
1414
#![feature(negative_impls)]
1515
#![feature(never_type)]
1616
#![feature(rustc_attrs)]
17-
#![feature(yeet_expr)]
18-
#![feature(try_blocks)]
19-
#![feature(box_patterns)]
2017
#![feature(error_reporter)]
2118
#![allow(incomplete_features)]
2219
#![allow(internal_features)]

0 commit comments

Comments
 (0)