Skip to content

Commit 77e2e84

Browse files
authored
Rollup merge of rust-lang#58719 - Centril:deny-elided_lifetimes_in_paths, r=oli-obk
librustc_codegen_llvm: #![deny(elided_lifetimes_in_paths)] As part of the Rust 2018 transition, remove `#![allow(elided_lifetimes_in_paths)]` from `librustc_codegen_llvm`. r? @oli-obk
2 parents 2019d96 + 9661a81 commit 77e2e84

22 files changed

+73
-69
lines changed

src/librustc_codegen_llvm/allocator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_allocator::{ALLOCATOR_METHODS, AllocatorTy};
99
use crate::ModuleLlvm;
1010
use crate::llvm::{self, False, True};
1111

12-
pub(crate) unsafe fn codegen(tcx: TyCtxt, mods: &mut ModuleLlvm, kind: AllocatorKind) {
12+
pub(crate) unsafe fn codegen(tcx: TyCtxt<'_, '_, '_>, mods: &mut ModuleLlvm, kind: AllocatorKind) {
1313
let llcx = &*mods.llcx;
1414
let llmod = mods.llmod();
1515
let usize = match &tcx.sess.target.target.target_pointer_width[..] {

src/librustc_codegen_llvm/attributes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ pub fn from_fn_attrs(
308308
}
309309
}
310310

311-
pub fn provide(providers: &mut Providers) {
311+
pub fn provide(providers: &mut Providers<'_>) {
312312
providers.target_features_whitelist = |tcx, cnum| {
313313
assert_eq!(cnum, LOCAL_CRATE);
314314
if tcx.sess.opts.actually_rustdoc {
@@ -328,7 +328,7 @@ pub fn provide(providers: &mut Providers) {
328328
provide_extern(providers);
329329
}
330330

331-
pub fn provide_extern(providers: &mut Providers) {
331+
pub fn provide_extern(providers: &mut Providers<'_>) {
332332
providers.wasm_import_module_map = |tcx, cnum| {
333333
// Build up a map from DefId to a `NativeLibrary` structure, where
334334
// `NativeLibrary` internally contains information about
@@ -362,7 +362,7 @@ pub fn provide_extern(providers: &mut Providers) {
362362
};
363363
}
364364

365-
fn wasm_import_module(tcx: TyCtxt, id: DefId) -> Option<CString> {
365+
fn wasm_import_module(tcx: TyCtxt<'_, '_, '_>, id: DefId) -> Option<CString> {
366366
tcx.wasm_import_module_map(id.krate)
367367
.get(&id)
368368
.map(|s| CString::new(&s[..]).unwrap())

src/librustc_codegen_llvm/back/archive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ enum Addition {
4242
},
4343
}
4444

45-
fn is_relevant_child(c: &Child) -> bool {
45+
fn is_relevant_child(c: &Child<'_>) -> bool {
4646
match c.name() {
4747
Some(name) => !name.contains("SYMDEF"),
4848
None => false,

src/librustc_codegen_llvm/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ fn exec_linker(sess: &Session, cmd: &mut Command, out_filename: &Path, tmpdir: &
808808
}
809809

810810
impl<'a> fmt::Display for Escape<'a> {
811-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
811+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
812812
if self.is_like_msvc {
813813
// This is "documented" at
814814
// https://msdn.microsoft.com/en-us/library/4xdcbak7.aspx

src/librustc_codegen_llvm/back/rpath.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct RPathConfig<'a> {
1515
pub get_install_prefix_lib_path: &'a mut dyn FnMut() -> PathBuf,
1616
}
1717

18-
pub fn get_rpath_flags(config: &mut RPathConfig) -> Vec<String> {
18+
pub fn get_rpath_flags(config: &mut RPathConfig<'_>) -> Vec<String> {
1919
// No rpath on windows
2020
if !config.has_rpath {
2121
return Vec::new();
@@ -52,7 +52,7 @@ fn rpaths_to_flags(rpaths: &[String]) -> Vec<String> {
5252
ret
5353
}
5454

55-
fn get_rpaths(config: &mut RPathConfig, libs: &[PathBuf]) -> Vec<String> {
55+
fn get_rpaths(config: &mut RPathConfig<'_>, libs: &[PathBuf]) -> Vec<String> {
5656
debug!("output: {:?}", config.out_filename.display());
5757
debug!("libs:");
5858
for libpath in libs {
@@ -86,12 +86,12 @@ fn get_rpaths(config: &mut RPathConfig, libs: &[PathBuf]) -> Vec<String> {
8686
rpaths
8787
}
8888

89-
fn get_rpaths_relative_to_output(config: &mut RPathConfig,
89+
fn get_rpaths_relative_to_output(config: &mut RPathConfig<'_>,
9090
libs: &[PathBuf]) -> Vec<String> {
9191
libs.iter().map(|a| get_rpath_relative_to_output(config, a)).collect()
9292
}
9393

94-
fn get_rpath_relative_to_output(config: &mut RPathConfig, lib: &Path) -> String {
94+
fn get_rpath_relative_to_output(config: &mut RPathConfig<'_>, lib: &Path) -> String {
9595
// Mac doesn't appear to support $ORIGIN
9696
let prefix = if config.is_like_osx {
9797
"@loader_path"
@@ -127,7 +127,7 @@ fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
127127
} else {
128128
let mut ita = path.components();
129129
let mut itb = base.components();
130-
let mut comps: Vec<Component> = vec![];
130+
let mut comps: Vec<Component<'_>> = vec![];
131131
loop {
132132
match (ita.next(), itb.next()) {
133133
(None, None) => break,
@@ -154,7 +154,7 @@ fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
154154
}
155155

156156

157-
fn get_install_prefix_rpath(config: &mut RPathConfig) -> String {
157+
fn get_install_prefix_rpath(config: &mut RPathConfig<'_>) -> String {
158158
let path = (config.get_install_prefix_lib_path)();
159159
let path = env::current_dir().unwrap().join(&path);
160160
// FIXME (#9639): This needs to handle non-utf8 paths

src/librustc_codegen_llvm/back/wasm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn rewrite_imports(path: &Path, import_map: &FxHashMap<String, String>) {
6060
fs::write(path, &ret.data).expect("failed to write wasm output");
6161

6262
fn rewrite_import_section(
63-
wasm: &mut WasmDecoder,
63+
wasm: &mut WasmDecoder<'_>,
6464
import_map: &FxHashMap<String, String>,
6565
)
6666
-> Vec<u8>
@@ -75,7 +75,7 @@ pub fn rewrite_imports(path: &Path, import_map: &FxHashMap<String, String>) {
7575
return dst.data
7676
}
7777

78-
fn rewrite_import_entry(wasm: &mut WasmDecoder,
78+
fn rewrite_import_entry(wasm: &mut WasmDecoder<'_>,
7979
dst: &mut WasmEncoder,
8080
import_map: &FxHashMap<String, String>) {
8181
// More info about the binary format here is available at:

src/librustc_codegen_llvm/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn write_output_file(
8383
}
8484

8585
pub fn create_target_machine(
86-
tcx: TyCtxt,
86+
tcx: TyCtxt<'_, '_, '_>,
8787
find_features: bool,
8888
) -> &'static mut llvm::TargetMachine {
8989
target_machine_factory(tcx.sess, tcx.backend_optimization_level(LOCAL_CRATE), find_features)()

src/librustc_codegen_llvm/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,17 @@ pub fn compile_codegen_unit<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
172172
let mono_items = cx.codegen_unit
173173
.items_in_deterministic_order(cx.tcx);
174174
for &(mono_item, (linkage, visibility)) in &mono_items {
175-
mono_item.predefine::<Builder>(&cx, linkage, visibility);
175+
mono_item.predefine::<Builder<'_, '_, '_>>(&cx, linkage, visibility);
176176
}
177177

178178
// ... and now that we have everything pre-defined, fill out those definitions.
179179
for &(mono_item, _) in &mono_items {
180-
mono_item.define::<Builder>(&cx);
180+
mono_item.define::<Builder<'_, '_, '_>>(&cx);
181181
}
182182

183183
// If this codegen unit contains the main function, also create the
184184
// wrapper here
185-
maybe_create_entry_wrapper::<Builder>(&cx);
185+
maybe_create_entry_wrapper::<Builder<'_, '_, '_>>(&cx);
186186

187187
// Run replace-all-uses-with for statics that need it
188188
for &(old_g, new_g) in cx.statics_to_rauw().borrow().iter() {

src/librustc_codegen_llvm/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
456456
fn checked_binop(
457457
&mut self,
458458
oop: OverflowOp,
459-
ty: Ty,
459+
ty: Ty<'_>,
460460
lhs: Self::Value,
461461
rhs: Self::Value,
462462
) -> (Self::Value, Self::Value) {

src/librustc_codegen_llvm/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub fn is_pie_binary(sess: &Session) -> bool {
144144
}
145145

146146
pub unsafe fn create_module(
147-
tcx: TyCtxt,
147+
tcx: TyCtxt<'_, '_, '_>,
148148
llcx: &'ll llvm::Context,
149149
mod_name: &str,
150150
) -> &'ll llvm::Module {

0 commit comments

Comments
 (0)