Skip to content

Commit 5cd82b8

Browse files
authored
Unrolled build for rust-lang#124570
Rollup merge of rust-lang#124570 - nnethercote:misc-cleanups, r=michaelwoerister Miscellaneous cleanups A mix of small cleanups made while looking at various things. r? `@wesleywiser`
2 parents e8fbd99 + 3ac816a commit 5cd82b8

File tree

6 files changed

+47
-59
lines changed

6 files changed

+47
-59
lines changed

compiler/rustc_const_eval/src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/*!
2-
3-
Rust MIR: a lowered representation of Rust.
4-
5-
*/
6-
71
#![allow(internal_features)]
82
#![allow(rustc::diagnostic_outside_of_impl)]
93
#![feature(rustdoc_internals)]

compiler/rustc_metadata/src/lib.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1+
// tidy-alphabetical-start
2+
#![allow(internal_features)]
3+
#![allow(rustc::potential_query_instability)]
14
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
25
#![doc(rust_logo)]
3-
#![feature(rustdoc_internals)]
4-
#![allow(internal_features)]
6+
#![feature(coroutines)]
57
#![feature(decl_macro)]
68
#![feature(error_iter)]
79
#![feature(extract_if)]
8-
#![feature(coroutines)]
10+
#![feature(if_let_guard)]
911
#![feature(iter_from_coroutine)]
1012
#![feature(let_chains)]
11-
#![feature(if_let_guard)]
12-
#![feature(proc_macro_internals)]
1313
#![feature(macro_metavar_expr)]
1414
#![feature(min_specialization)]
15-
#![feature(trusted_len)]
16-
#![feature(try_blocks)]
1715
#![feature(never_type)]
18-
#![allow(rustc::potential_query_instability)]
16+
#![feature(proc_macro_internals)]
17+
#![feature(rustdoc_internals)]
18+
#![feature(trusted_len)]
19+
// tidy-alphabetical-end
1920

2021
extern crate proc_macro;
2122

compiler/rustc_metadata/src/rmeta/mod.rs

+10-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
use crate::creader::CrateMetadataRef;
2-
use decoder::Metadata;
2+
pub(crate) use decoder::{CrateMetadata, CrateNumMap, MetadataBlob};
3+
use decoder::{DecodeContext, Metadata};
34
use def_path_hash_map::DefPathHashMapRef;
4-
use rustc_data_structures::fx::FxHashMap;
5-
use rustc_macros::{Decodable, Encodable, TyDecodable, TyEncodable};
6-
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
7-
use rustc_middle::middle::lib_features::FeatureStability;
8-
use table::TableBuilder;
9-
5+
use encoder::EncodeContext;
6+
pub use encoder::{encode_metadata, rendered_const, EncodedMetadata};
107
use rustc_ast as ast;
118
use rustc_ast::expand::StrippedCfgItem;
129
use rustc_attr as attr;
10+
use rustc_data_structures::fx::FxHashMap;
1311
use rustc_data_structures::svh::Svh;
1412
use rustc_hir as hir;
1513
use rustc_hir::def::{CtorKind, DefKind, DocLinkResMap};
@@ -18,10 +16,13 @@ use rustc_hir::definitions::DefKey;
1816
use rustc_hir::lang_items::LangItem;
1917
use rustc_index::bit_set::BitSet;
2018
use rustc_index::IndexVec;
19+
use rustc_macros::{Decodable, Encodable, TyDecodable, TyEncodable};
2120
use rustc_macros::{MetadataDecodable, MetadataEncodable};
2221
use rustc_middle::metadata::ModChild;
2322
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
23+
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
2424
use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
25+
use rustc_middle::middle::lib_features::FeatureStability;
2526
use rustc_middle::middle::resolve_bound_vars::ObjectLifetimeDefault;
2627
use rustc_middle::mir;
2728
use rustc_middle::trivially_parameterized_over_tcx;
@@ -33,20 +34,14 @@ use rustc_serialize::opaque::FileEncoder;
3334
use rustc_session::config::SymbolManglingVersion;
3435
use rustc_session::cstore::{CrateDepKind, ForeignModule, LinkagePreference, NativeLib};
3536
use rustc_span::edition::Edition;
36-
use rustc_span::hygiene::{ExpnIndex, MacroKind};
37+
use rustc_span::hygiene::{ExpnIndex, MacroKind, SyntaxContextData};
3738
use rustc_span::symbol::{Ident, Symbol};
3839
use rustc_span::{self, ExpnData, ExpnHash, ExpnId, Span};
3940
use rustc_target::abi::{FieldIdx, VariantIdx};
4041
use rustc_target::spec::{PanicStrategy, TargetTriple};
41-
4242
use std::marker::PhantomData;
4343
use std::num::NonZero;
44-
45-
use decoder::DecodeContext;
46-
pub(crate) use decoder::{CrateMetadata, CrateNumMap, MetadataBlob};
47-
use encoder::EncodeContext;
48-
pub use encoder::{encode_metadata, rendered_const, EncodedMetadata};
49-
use rustc_span::hygiene::SyntaxContextData;
44+
use table::TableBuilder;
5045

5146
mod decoder;
5247
mod def_path_hash_map;

compiler/rustc_middle/src/lib.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -22,46 +22,46 @@
2222
//!
2323
//! This API is completely unstable and subject to change.
2424
25+
// tidy-alphabetical-start
26+
#![allow(internal_features)]
27+
#![allow(rustc::diagnostic_outside_of_impl)]
28+
#![allow(rustc::potential_query_instability)]
29+
#![allow(rustc::untranslatable_diagnostic)]
2530
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2631
#![doc(rust_logo)]
27-
#![feature(min_exhaustive_patterns)]
28-
#![feature(rustdoc_internals)]
2932
#![feature(allocator_api)]
3033
#![feature(array_windows)]
3134
#![feature(assert_matches)]
3235
#![feature(box_patterns)]
3336
#![feature(closure_track_caller)]
34-
#![feature(core_intrinsics)]
37+
#![feature(const_option)]
3538
#![feature(const_type_name)]
36-
#![feature(discriminant_kind)]
39+
#![feature(core_intrinsics)]
3740
#![feature(coroutines)]
38-
#![feature(stmt_expr_attributes)]
41+
#![feature(decl_macro)]
42+
#![feature(discriminant_kind)]
43+
#![feature(extern_types)]
44+
#![feature(extract_if)]
3945
#![feature(if_let_guard)]
46+
#![feature(intra_doc_pointers)]
4047
#![feature(iter_from_coroutine)]
48+
#![feature(let_chains)]
49+
#![feature(macro_metavar_expr)]
50+
#![feature(min_exhaustive_patterns)]
51+
#![feature(min_specialization)]
4152
#![feature(negative_impls)]
4253
#![feature(never_type)]
43-
#![feature(extern_types)]
4454
#![feature(new_uninit)]
45-
#![feature(let_chains)]
46-
#![feature(min_specialization)]
47-
#![feature(trusted_len)]
48-
#![feature(type_alias_impl_trait)]
49-
#![feature(strict_provenance)]
55+
#![feature(ptr_alignment_type)]
5056
#![feature(rustc_attrs)]
51-
#![feature(control_flow_enum)]
57+
#![feature(rustdoc_internals)]
58+
#![feature(strict_provenance)]
5259
#![feature(trait_upcasting)]
60+
#![feature(trusted_len)]
5361
#![feature(try_blocks)]
54-
#![feature(decl_macro)]
55-
#![feature(extract_if)]
56-
#![feature(intra_doc_pointers)]
62+
#![feature(type_alias_impl_trait)]
5763
#![feature(yeet_expr)]
58-
#![feature(const_option)]
59-
#![feature(ptr_alignment_type)]
60-
#![feature(macro_metavar_expr)]
61-
#![allow(internal_features)]
62-
#![allow(rustc::potential_query_instability)]
63-
#![allow(rustc::diagnostic_outside_of_impl)]
64-
#![allow(rustc::untranslatable_diagnostic)]
64+
// tidy-alphabetical-end
6565

6666
#[macro_use]
6767
extern crate tracing;

compiler/rustc_passes/src/check_attr.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@ use std::collections::hash_map::Entry;
4242

4343
#[derive(LintDiagnostic)]
4444
#[diag(passes_diagnostic_diagnostic_on_unimplemented_only_for_traits)]
45-
pub struct DiagnosticOnUnimplementedOnlyForTraits;
45+
struct DiagnosticOnUnimplementedOnlyForTraits;
4646

47-
pub(crate) fn target_from_impl_item<'tcx>(
48-
tcx: TyCtxt<'tcx>,
49-
impl_item: &hir::ImplItem<'_>,
50-
) -> Target {
47+
fn target_from_impl_item<'tcx>(tcx: TyCtxt<'tcx>, impl_item: &hir::ImplItem<'_>) -> Target {
5148
match impl_item.kind {
5249
hir::ImplItemKind::Const(..) => Target::AssocConst,
5350
hir::ImplItemKind::Fn(..) => {
@@ -99,7 +96,7 @@ struct CheckAttrVisitor<'tcx> {
9996
}
10097

10198
impl<'tcx> CheckAttrVisitor<'tcx> {
102-
pub fn dcx(&self) -> &'tcx DiagCtxt {
99+
fn dcx(&self) -> &'tcx DiagCtxt {
103100
self.tcx.dcx()
104101
}
105102

compiler/rustc_passes/src/lang_items.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ impl<'ast, 'tcx> LanguageItemCollector<'ast, 'tcx> {
149149
}
150150
};
151151

152-
// When there's a duplicate lang item, something went very wrong and there's no value in recovering or doing anything.
153-
// Give the user the one message to let them debug the mess they created and then wish them farewell.
152+
// When there's a duplicate lang item, something went very wrong and there's no value
153+
// in recovering or doing anything. Give the user the one message to let them debug the
154+
// mess they created and then wish them farewell.
154155
self.tcx.dcx().emit_fatal(DuplicateLangItem {
155156
local_span: item_span,
156157
lang_item_name,

0 commit comments

Comments
 (0)