librustc_codegen_ssa: deny(elided_lifetimes_in_paths)
This commit is contained in:
parent
c1911babed
commit
1d34f2c228
@ -159,7 +159,7 @@ impl Command {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Command {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.command().fmt(f)
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ pub struct LinkerInfo {
|
||||
}
|
||||
|
||||
impl LinkerInfo {
|
||||
pub fn new(tcx: TyCtxt) -> LinkerInfo {
|
||||
pub fn new(tcx: TyCtxt<'_, '_, '_>) -> LinkerInfo {
|
||||
LinkerInfo {
|
||||
exports: tcx.sess.crate_types.borrow().iter().map(|&c| {
|
||||
(c, exported_symbols(tcx, c))
|
||||
@ -1052,7 +1052,7 @@ impl<'a> Linker for WasmLd<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn exported_symbols(tcx: TyCtxt, crate_type: CrateType) -> Vec<String> {
|
||||
fn exported_symbols(tcx: TyCtxt<'_, '_, '_>, crate_type: CrateType) -> Vec<String> {
|
||||
if let Some(ref exports) = tcx.sess.target.target.options.override_export_symbols {
|
||||
return exports.clone()
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ pub type ExportedSymbols = FxHashMap<
|
||||
Arc<Vec<(String, SymbolExportLevel)>>,
|
||||
>;
|
||||
|
||||
pub fn threshold(tcx: TyCtxt) -> SymbolExportLevel {
|
||||
pub fn threshold(tcx: TyCtxt<'_, '_, '_>) -> SymbolExportLevel {
|
||||
crates_export_threshold(&tcx.sess.crate_types.borrow())
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ fn upstream_monomorphizations_for_provider<'a, 'tcx>(
|
||||
.cloned()
|
||||
}
|
||||
|
||||
fn is_unreachable_local_definition_provider(tcx: TyCtxt, def_id: DefId) -> bool {
|
||||
fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> bool {
|
||||
if let Some(node_id) = tcx.hir().as_local_node_id(def_id) {
|
||||
!tcx.reachable_set(LOCAL_CRATE).0.contains(&node_id)
|
||||
} else {
|
||||
@ -351,7 +351,7 @@ fn is_unreachable_local_definition_provider(tcx: TyCtxt, def_id: DefId) -> bool
|
||||
}
|
||||
}
|
||||
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
pub fn provide(providers: &mut Providers<'_>) {
|
||||
providers.reachable_non_generics = reachable_non_generics_provider;
|
||||
providers.is_reachable_non_generic = is_reachable_non_generic_provider_local;
|
||||
providers.exported_symbols = exported_symbols_provider_local;
|
||||
@ -359,12 +359,12 @@ pub fn provide(providers: &mut Providers) {
|
||||
providers.is_unreachable_local_definition = is_unreachable_local_definition_provider;
|
||||
}
|
||||
|
||||
pub fn provide_extern(providers: &mut Providers) {
|
||||
pub fn provide_extern(providers: &mut Providers<'_>) {
|
||||
providers.is_reachable_non_generic = is_reachable_non_generic_provider_extern;
|
||||
providers.upstream_monomorphizations_for = upstream_monomorphizations_for_provider;
|
||||
}
|
||||
|
||||
fn symbol_export_level(tcx: TyCtxt, sym_def_id: DefId) -> SymbolExportLevel {
|
||||
fn symbol_export_level(tcx: TyCtxt<'_, '_, '_>, sym_def_id: DefId) -> SymbolExportLevel {
|
||||
// We export anything that's not mangled at the "C" layer as it probably has
|
||||
// to do with ABI concerns. We do not, however, apply such treatment to
|
||||
// special symbols in the standard library for various plumbing between
|
||||
|
@ -321,7 +321,7 @@ fn need_pre_lto_bitcode_for_incr_comp(sess: &Session) -> bool {
|
||||
|
||||
pub fn start_async_codegen<B: ExtraBackendMethods>(
|
||||
backend: B,
|
||||
tcx: TyCtxt,
|
||||
tcx: TyCtxt<'_, '_, '_>,
|
||||
time_graph: Option<TimeGraph>,
|
||||
metadata: EncodedMetadata,
|
||||
coordinator_receive: Receiver<Box<dyn Any + Send>>,
|
||||
@ -947,7 +947,7 @@ enum MainThreadWorkerState {
|
||||
|
||||
fn start_executing_work<B: ExtraBackendMethods>(
|
||||
backend: B,
|
||||
tcx: TyCtxt,
|
||||
tcx: TyCtxt<'_, '_, '_>,
|
||||
crate_info: &CrateInfo,
|
||||
shared_emitter: SharedEmitter,
|
||||
codegen_worker_send: Sender<Message<B>>,
|
||||
@ -1683,7 +1683,7 @@ impl SharedEmitter {
|
||||
}
|
||||
|
||||
impl Emitter for SharedEmitter {
|
||||
fn emit(&mut self, db: &DiagnosticBuilder) {
|
||||
fn emit(&mut self, db: &DiagnosticBuilder<'_>) {
|
||||
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
|
||||
msg: db.message(),
|
||||
code: db.code.clone(),
|
||||
@ -1822,7 +1822,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
|
||||
}
|
||||
|
||||
pub fn submit_pre_codegened_module_to_llvm(&self,
|
||||
tcx: TyCtxt,
|
||||
tcx: TyCtxt<'_, '_, '_>,
|
||||
module: ModuleCodegen<B::Module>) {
|
||||
self.wait_for_signal_to_codegen_item();
|
||||
self.check_for_errors(tcx.sess);
|
||||
@ -1832,7 +1832,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
|
||||
submit_codegened_module_to_llvm(&self.backend, tcx, module, cost);
|
||||
}
|
||||
|
||||
pub fn codegen_finished(&self, tcx: TyCtxt) {
|
||||
pub fn codegen_finished(&self, tcx: TyCtxt<'_, '_, '_>) {
|
||||
self.wait_for_signal_to_codegen_item();
|
||||
self.check_for_errors(tcx.sess);
|
||||
drop(self.coordinator_send.send(Box::new(Message::CodegenComplete::<B>)));
|
||||
@ -1871,7 +1871,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
|
||||
|
||||
pub fn submit_codegened_module_to_llvm<B: ExtraBackendMethods>(
|
||||
_backend: &B,
|
||||
tcx: TyCtxt,
|
||||
tcx: TyCtxt<'_, '_, '_>,
|
||||
module: ModuleCodegen<B::Module>,
|
||||
cost: u64
|
||||
) {
|
||||
@ -1884,7 +1884,7 @@ pub fn submit_codegened_module_to_llvm<B: ExtraBackendMethods>(
|
||||
|
||||
pub fn submit_post_lto_module_to_llvm<B: ExtraBackendMethods>(
|
||||
_backend: &B,
|
||||
tcx: TyCtxt,
|
||||
tcx: TyCtxt<'_, '_, '_>,
|
||||
module: CachedModuleCodegen
|
||||
) {
|
||||
let llvm_work_item = WorkItem::CopyPostLtoArtifacts(module);
|
||||
@ -1896,7 +1896,7 @@ pub fn submit_post_lto_module_to_llvm<B: ExtraBackendMethods>(
|
||||
|
||||
pub fn submit_pre_lto_module_to_llvm<B: ExtraBackendMethods>(
|
||||
_backend: &B,
|
||||
tcx: TyCtxt,
|
||||
tcx: TyCtxt<'_, '_, '_>,
|
||||
module: CachedModuleCodegen
|
||||
) {
|
||||
let filename = pre_lto_bitcode_filename(&module.name);
|
||||
@ -1921,7 +1921,7 @@ pub fn pre_lto_bitcode_filename(module_name: &str) -> String {
|
||||
format!("{}.{}", module_name, PRE_LTO_BC_EXT)
|
||||
}
|
||||
|
||||
fn msvc_imps_needed(tcx: TyCtxt) -> bool {
|
||||
fn msvc_imps_needed(tcx: TyCtxt<'_, '_, '_>) -> bool {
|
||||
// This should never be true (because it's not supported). If it is true,
|
||||
// something is wrong with commandline arg validation.
|
||||
assert!(!(tcx.sess.opts.cg.linker_plugin_lto.enabled() &&
|
||||
|
@ -370,7 +370,7 @@ pub fn from_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
pub fn to_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
|
||||
bx: &mut Bx,
|
||||
val: Bx::Value,
|
||||
layout: layout::TyLayout,
|
||||
layout: layout::TyLayout<'_>,
|
||||
) -> Bx::Value {
|
||||
if let layout::Abi::Scalar(ref scalar) = layout.abi {
|
||||
return to_immediate_scalar(bx, val, scalar);
|
||||
@ -802,7 +802,7 @@ fn assert_and_save_dep_graph<'ll, 'tcx>(tcx: TyCtxt<'ll, 'tcx, 'tcx>) {
|
||||
}
|
||||
|
||||
impl CrateInfo {
|
||||
pub fn new(tcx: TyCtxt) -> CrateInfo {
|
||||
pub fn new(tcx: TyCtxt<'_, '_, '_>) -> CrateInfo {
|
||||
let mut info = CrateInfo {
|
||||
panic_runtime: None,
|
||||
compiler_builtins: None,
|
||||
@ -880,7 +880,7 @@ impl CrateInfo {
|
||||
return info
|
||||
}
|
||||
|
||||
fn load_wasm_imports(&mut self, tcx: TyCtxt, cnum: CrateNum) {
|
||||
fn load_wasm_imports(&mut self, tcx: TyCtxt<'_, '_, '_>, cnum: CrateNum) {
|
||||
self.wasm_imports.extend(tcx.wasm_import_module_map(cnum).iter().map(|(&id, module)| {
|
||||
let instance = Instance::mono(tcx, id);
|
||||
let import_name = tcx.symbol_name(instance);
|
||||
@ -890,13 +890,13 @@ impl CrateInfo {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_codegened_item(tcx: TyCtxt, id: DefId) -> bool {
|
||||
fn is_codegened_item(tcx: TyCtxt<'_, '_, '_>, id: DefId) -> bool {
|
||||
let (all_mono_items, _) =
|
||||
tcx.collect_and_partition_mono_items(LOCAL_CRATE);
|
||||
all_mono_items.contains(&id)
|
||||
}
|
||||
|
||||
pub fn provide_both(providers: &mut Providers) {
|
||||
pub fn provide_both(providers: &mut Providers<'_>) {
|
||||
providers.backend_optimization_level = |tcx, cratenum| {
|
||||
let for_speed = match tcx.sess.opts.optimize {
|
||||
// If globally no optimisation is done, #[optimize] has no effect.
|
||||
|
@ -134,7 +134,7 @@ mod temp_stable_hash_impls {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn langcall(tcx: TyCtxt,
|
||||
pub fn langcall(tcx: TyCtxt<'_, '_, '_>,
|
||||
span: Option<Span>,
|
||||
msg: &str,
|
||||
li: LangItem)
|
||||
|
@ -11,7 +11,6 @@
|
||||
#![allow(dead_code)]
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(explicit_outlives_requirements)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
#![recursion_limit="256"]
|
||||
|
||||
|
@ -48,7 +48,7 @@ pub struct OperandRef<'tcx, V> {
|
||||
}
|
||||
|
||||
impl<V: CodegenObject> fmt::Debug for OperandRef<'tcx, V> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "OperandRef({:?} @ {:?})", self.val, self.layout)
|
||||
}
|
||||
}
|
||||
|
@ -32,13 +32,18 @@ impl<'tcx, T> Backend<'tcx> for T where
|
||||
}
|
||||
|
||||
pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Send {
|
||||
fn new_metadata(&self, sess: TyCtxt, mod_name: &str) -> Self::Module;
|
||||
fn new_metadata(&self, sess: TyCtxt<'_, '_, '_>, mod_name: &str) -> Self::Module;
|
||||
fn write_metadata<'b, 'gcx>(
|
||||
&self,
|
||||
tcx: TyCtxt<'b, 'gcx, 'gcx>,
|
||||
metadata: &mut Self::Module,
|
||||
) -> EncodedMetadata;
|
||||
fn codegen_allocator(&self, tcx: TyCtxt, mods: &mut Self::Module, kind: AllocatorKind);
|
||||
fn codegen_allocator(
|
||||
&self,
|
||||
tcx: TyCtxt<'_, '_, '_>,
|
||||
mods: &mut Self::Module,
|
||||
kind: AllocatorKind
|
||||
);
|
||||
fn compile_codegen_unit<'a, 'tcx: 'a>(
|
||||
&self,
|
||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
|
@ -100,7 +100,7 @@ pub trait BuilderMethods<'a, 'tcx: 'a>:
|
||||
fn checked_binop(
|
||||
&mut self,
|
||||
oop: OverflowOp,
|
||||
ty: Ty,
|
||||
ty: Ty<'_>,
|
||||
lhs: Self::Value,
|
||||
rhs: Self::Value,
|
||||
) -> (Self::Value, Self::Value);
|
||||
|
@ -22,12 +22,12 @@ pub trait DebugInfoMethods<'tcx>: BackendTypes {
|
||||
instance: Instance<'tcx>,
|
||||
sig: ty::FnSig<'tcx>,
|
||||
llfn: Self::Value,
|
||||
mir: &mir::Mir,
|
||||
mir: &mir::Mir<'_>,
|
||||
) -> FunctionDebugContext<Self::DIScope>;
|
||||
|
||||
fn create_mir_scopes(
|
||||
&self,
|
||||
mir: &mir::Mir,
|
||||
mir: &mir::Mir<'_>,
|
||||
debug_context: &FunctionDebugContext<Self::DIScope>,
|
||||
) -> IndexVec<mir::SourceScope, MirDebugScope<Self::DIScope>>;
|
||||
fn extend_scope_to_file(
|
||||
|
Loading…
x
Reference in New Issue
Block a user