Rollup merge of #124570 - nnethercote:misc-cleanups, r=michaelwoerister
Miscellaneous cleanups A mix of small cleanups made while looking at various things. r? `@wesleywiser`
This commit is contained in:
commit
df59800b08
6 changed files with 50 additions and 62 deletions
|
|
@ -1,9 +1,3 @@
|
|||
/*!
|
||||
|
||||
Rust MIR: a lowered representation of Rust.
|
||||
|
||||
*/
|
||||
|
||||
#![allow(internal_features)]
|
||||
#![allow(rustc::diagnostic_outside_of_impl)]
|
||||
#![feature(rustdoc_internals)]
|
||||
|
|
|
|||
|
|
@ -1,21 +1,22 @@
|
|||
// tidy-alphabetical-start
|
||||
#![allow(internal_features)]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||
#![doc(rust_logo)]
|
||||
#![feature(rustdoc_internals)]
|
||||
#![allow(internal_features)]
|
||||
#![feature(coroutines)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(error_iter)]
|
||||
#![feature(extract_if)]
|
||||
#![feature(coroutines)]
|
||||
#![feature(if_let_guard)]
|
||||
#![feature(iter_from_coroutine)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(if_let_guard)]
|
||||
#![feature(proc_macro_internals)]
|
||||
#![feature(macro_metavar_expr)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(trusted_len)]
|
||||
#![feature(try_blocks)]
|
||||
#![feature(never_type)]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
#![feature(proc_macro_internals)]
|
||||
#![feature(rustdoc_internals)]
|
||||
#![feature(trusted_len)]
|
||||
// tidy-alphabetical-end
|
||||
|
||||
extern crate proc_macro;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
use crate::creader::CrateMetadataRef;
|
||||
use decoder::Metadata;
|
||||
pub(crate) use decoder::{CrateMetadata, CrateNumMap, MetadataBlob};
|
||||
use decoder::{DecodeContext, Metadata};
|
||||
use def_path_hash_map::DefPathHashMapRef;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_macros::{Decodable, Encodable, TyDecodable, TyEncodable};
|
||||
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
|
||||
use rustc_middle::middle::lib_features::FeatureStability;
|
||||
use table::TableBuilder;
|
||||
|
||||
use encoder::EncodeContext;
|
||||
pub use encoder::{encode_metadata, rendered_const, EncodedMetadata};
|
||||
use rustc_ast as ast;
|
||||
use rustc_ast::expand::StrippedCfgItem;
|
||||
use rustc_attr as attr;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::{CtorKind, DefKind, DocLinkResMap};
|
||||
|
|
@ -18,10 +16,13 @@ use rustc_hir::definitions::DefKey;
|
|||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::IndexVec;
|
||||
use rustc_macros::{Decodable, Encodable, TyDecodable, TyEncodable};
|
||||
use rustc_macros::{MetadataDecodable, MetadataEncodable};
|
||||
use rustc_middle::metadata::ModChild;
|
||||
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
|
||||
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
|
||||
use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
|
||||
use rustc_middle::middle::lib_features::FeatureStability;
|
||||
use rustc_middle::middle::resolve_bound_vars::ObjectLifetimeDefault;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::trivially_parameterized_over_tcx;
|
||||
|
|
@ -33,20 +34,14 @@ use rustc_serialize::opaque::FileEncoder;
|
|||
use rustc_session::config::SymbolManglingVersion;
|
||||
use rustc_session::cstore::{CrateDepKind, ForeignModule, LinkagePreference, NativeLib};
|
||||
use rustc_span::edition::Edition;
|
||||
use rustc_span::hygiene::{ExpnIndex, MacroKind};
|
||||
use rustc_span::hygiene::{ExpnIndex, MacroKind, SyntaxContextData};
|
||||
use rustc_span::symbol::{Ident, Symbol};
|
||||
use rustc_span::{self, ExpnData, ExpnHash, ExpnId, Span};
|
||||
use rustc_target::abi::{FieldIdx, VariantIdx};
|
||||
use rustc_target::spec::{PanicStrategy, TargetTriple};
|
||||
|
||||
use std::marker::PhantomData;
|
||||
use std::num::NonZero;
|
||||
|
||||
use decoder::DecodeContext;
|
||||
pub(crate) use decoder::{CrateMetadata, CrateNumMap, MetadataBlob};
|
||||
use encoder::EncodeContext;
|
||||
pub use encoder::{encode_metadata, rendered_const, EncodedMetadata};
|
||||
use rustc_span::hygiene::SyntaxContextData;
|
||||
use table::TableBuilder;
|
||||
|
||||
mod decoder;
|
||||
mod def_path_hash_map;
|
||||
|
|
|
|||
|
|
@ -22,46 +22,46 @@
|
|||
//!
|
||||
//! This API is completely unstable and subject to change.
|
||||
|
||||
// tidy-alphabetical-start
|
||||
#![allow(internal_features)]
|
||||
#![allow(rustc::diagnostic_outside_of_impl)]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
#![allow(rustc::untranslatable_diagnostic)]
|
||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||
#![doc(rust_logo)]
|
||||
#![feature(min_exhaustive_patterns)]
|
||||
#![feature(rustdoc_internals)]
|
||||
#![feature(allocator_api)]
|
||||
#![feature(array_windows)]
|
||||
#![feature(assert_matches)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(closure_track_caller)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(const_option)]
|
||||
#![feature(const_type_name)]
|
||||
#![feature(discriminant_kind)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(coroutines)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(discriminant_kind)]
|
||||
#![feature(extern_types)]
|
||||
#![feature(extract_if)]
|
||||
#![feature(if_let_guard)]
|
||||
#![feature(intra_doc_pointers)]
|
||||
#![feature(iter_from_coroutine)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(macro_metavar_expr)]
|
||||
#![feature(min_exhaustive_patterns)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(negative_impls)]
|
||||
#![feature(never_type)]
|
||||
#![feature(extern_types)]
|
||||
#![feature(new_uninit)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(trusted_len)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(strict_provenance)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![feature(trait_upcasting)]
|
||||
#![feature(try_blocks)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(extract_if)]
|
||||
#![feature(intra_doc_pointers)]
|
||||
#![feature(yeet_expr)]
|
||||
#![feature(const_option)]
|
||||
#![feature(ptr_alignment_type)]
|
||||
#![feature(macro_metavar_expr)]
|
||||
#![allow(internal_features)]
|
||||
#![allow(rustc::potential_query_instability)]
|
||||
#![allow(rustc::diagnostic_outside_of_impl)]
|
||||
#![allow(rustc::untranslatable_diagnostic)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(rustdoc_internals)]
|
||||
#![feature(strict_provenance)]
|
||||
#![feature(trait_upcasting)]
|
||||
#![feature(trusted_len)]
|
||||
#![feature(try_blocks)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(yeet_expr)]
|
||||
// tidy-alphabetical-end
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
|
|
|||
|
|
@ -42,12 +42,9 @@ use std::collections::hash_map::Entry;
|
|||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(passes_diagnostic_diagnostic_on_unimplemented_only_for_traits)]
|
||||
pub struct DiagnosticOnUnimplementedOnlyForTraits;
|
||||
struct DiagnosticOnUnimplementedOnlyForTraits;
|
||||
|
||||
pub(crate) fn target_from_impl_item<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
impl_item: &hir::ImplItem<'_>,
|
||||
) -> Target {
|
||||
fn target_from_impl_item<'tcx>(tcx: TyCtxt<'tcx>, impl_item: &hir::ImplItem<'_>) -> Target {
|
||||
match impl_item.kind {
|
||||
hir::ImplItemKind::Const(..) => Target::AssocConst,
|
||||
hir::ImplItemKind::Fn(..) => {
|
||||
|
|
@ -99,7 +96,7 @@ struct CheckAttrVisitor<'tcx> {
|
|||
}
|
||||
|
||||
impl<'tcx> CheckAttrVisitor<'tcx> {
|
||||
pub fn dcx(&self) -> &'tcx DiagCtxt {
|
||||
fn dcx(&self) -> &'tcx DiagCtxt {
|
||||
self.tcx.dcx()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,8 +149,9 @@ impl<'ast, 'tcx> LanguageItemCollector<'ast, 'tcx> {
|
|||
}
|
||||
};
|
||||
|
||||
// When there's a duplicate lang item, something went very wrong and there's no value in recovering or doing anything.
|
||||
// Give the user the one message to let them debug the mess they created and then wish them farewell.
|
||||
// When there's a duplicate lang item, something went very wrong and there's no value
|
||||
// in recovering or doing anything. Give the user the one message to let them debug the
|
||||
// mess they created and then wish them farewell.
|
||||
self.tcx.dcx().emit_fatal(DuplicateLangItem {
|
||||
local_span: item_span,
|
||||
lang_item_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue