Skip to content

Commit c5ecc15

Browse files
committed
Auto merge of #91962 - matthiaskrgr:rollup-2g082jw, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #91880 (fix clippy::single_char_pattern perf findings) - #91885 (Remove `in_band_lifetimes` from `rustc_codegen_ssa`) - #91898 (Make `TyS::is_suggestable` check for non-suggestable types structually) - #91915 (Add another regression test for unnormalized fn args with Self) - #91916 (Fix a bunch of typos) - #91918 (Constify `bool::then{,_some}`) - #91920 (Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3ee016a + 990cf5b commit c5ecc15

File tree

92 files changed

+283
-210
lines changed

Some content is hidden

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

92 files changed

+283
-210
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,8 +2226,8 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
22262226
continue;
22272227
}
22282228

2229-
let canonical = f.replace("-", "_");
2230-
let canonical_name = name.replace("-", "_");
2229+
let canonical = f.replace('-', "_");
2230+
let canonical_name = name.replace('-', "_");
22312231

22322232
let is_rust_object =
22332233
canonical.starts_with(&canonical_name) && looks_like_rust_object_file(&f);

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn is_reachable_non_generic_provider_extern(tcx: TyCtxt<'_>, def_id: DefId) -> b
154154
tcx.reachable_non_generics(def_id.krate).contains_key(&def_id)
155155
}
156156

157-
fn exported_symbols_provider_local(
157+
fn exported_symbols_provider_local<'tcx>(
158158
tcx: TyCtxt<'tcx>,
159159
cnum: CrateNum,
160160
) -> &'tcx [(ExportedSymbol<'tcx>, SymbolExportLevel)] {

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ fn get_argc_argv<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
486486

487487
pub fn codegen_crate<B: ExtraBackendMethods>(
488488
backend: B,
489-
tcx: TyCtxt<'tcx>,
489+
tcx: TyCtxt<'_>,
490490
target_cpu: String,
491491
metadata: EncodedMetadata,
492492
need_metadata_module: bool,

compiler/rustc_codegen_ssa/src/coverageinfo/map.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ impl<'tcx> FunctionCoverage<'tcx> {
150150
/// Generate an array of CounterExpressions, and an iterator over all `Counter`s and their
151151
/// associated `Regions` (from which the LLVM-specific `CoverageMapGenerator` will create
152152
/// `CounterMappingRegion`s.
153-
pub fn get_expressions_and_counter_regions<'a>(
154-
&'a self,
155-
) -> (Vec<CounterExpression>, impl Iterator<Item = (Counter, &'a CodeRegion)>) {
153+
pub fn get_expressions_and_counter_regions(
154+
&self,
155+
) -> (Vec<CounterExpression>, impl Iterator<Item = (Counter, &CodeRegion)>) {
156156
assert!(
157157
self.source_hash != 0 || !self.is_used,
158158
"No counters provided the source_hash for used function: {:?}",
@@ -168,7 +168,7 @@ impl<'tcx> FunctionCoverage<'tcx> {
168168
(counter_expressions, counter_regions)
169169
}
170170

171-
fn counter_regions<'a>(&'a self) -> impl Iterator<Item = (Counter, &'a CodeRegion)> {
171+
fn counter_regions(&self) -> impl Iterator<Item = (Counter, &CodeRegion)> {
172172
self.counters.iter_enumerated().filter_map(|(index, entry)| {
173173
// Option::map() will return None to filter out missing counters. This may happen
174174
// if, for example, a MIR-instrumented counter is removed during an optimization.
@@ -177,8 +177,8 @@ impl<'tcx> FunctionCoverage<'tcx> {
177177
}
178178

179179
fn expressions_with_regions(
180-
&'a self,
181-
) -> (Vec<CounterExpression>, impl Iterator<Item = (Counter, &'a CodeRegion)>) {
180+
&self,
181+
) -> (Vec<CounterExpression>, impl Iterator<Item = (Counter, &CodeRegion)>) {
182182
let mut counter_expressions = Vec::with_capacity(self.expressions.len());
183183
let mut expression_regions = Vec::with_capacity(self.expressions.len());
184184
let mut new_indexes = IndexVec::from_elem_n(None, self.expressions.len());
@@ -336,7 +336,7 @@ impl<'tcx> FunctionCoverage<'tcx> {
336336
(counter_expressions, expression_regions.into_iter())
337337
}
338338

339-
fn unreachable_regions<'a>(&'a self) -> impl Iterator<Item = (Counter, &'a CodeRegion)> {
339+
fn unreachable_regions(&self) -> impl Iterator<Item = (Counter, &CodeRegion)> {
340340
self.unreachable_regions.iter().map(|region| (Counter::zero(), region))
341341
}
342342

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ fn push_debuginfo_type_name<'tcx>(
376376
// format (natvis) is able to understand enums and render the active variant correctly in the
377377
// debugger. For more information, look in `src/etc/natvis/intrinsic.natvis` and
378378
// `EnumMemberDescriptionFactor::create_member_descriptions`.
379-
fn msvc_enum_fallback(
379+
fn msvc_enum_fallback<'tcx>(
380380
tcx: TyCtxt<'tcx>,
381381
ty: Ty<'tcx>,
382382
def: &AdtDef,
@@ -496,7 +496,7 @@ pub fn compute_debuginfo_vtable_name<'tcx>(
496496
vtable_name
497497
}
498498

499-
pub fn push_item_name(tcx: TyCtxt<'tcx>, def_id: DefId, qualified: bool, output: &mut String) {
499+
pub fn push_item_name(tcx: TyCtxt<'_>, def_id: DefId, qualified: bool, output: &mut String) {
500500
let def_key = tcx.def_key(def_id);
501501
if qualified {
502502
if let Some(parent) = def_key.parent {
@@ -509,7 +509,7 @@ pub fn push_item_name(tcx: TyCtxt<'tcx>, def_id: DefId, qualified: bool, output:
509509
}
510510

511511
fn push_unqualified_item_name(
512-
tcx: TyCtxt<'tcx>,
512+
tcx: TyCtxt<'_>,
513513
def_id: DefId,
514514
disambiguated_data: DisambiguatedDefPathData,
515515
output: &mut String,

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![feature(bool_to_option)]
33
#![feature(box_patterns)]
44
#![feature(try_blocks)]
5-
#![feature(in_band_lifetimes)]
65
#![feature(let_else)]
76
#![feature(once_cell)]
87
#![feature(nll)]

compiler/rustc_codegen_ssa/src/mir/analyze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct LocalAnalyzer<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
7373
locals: IndexVec<mir::Local, LocalKind>,
7474
}
7575

76-
impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
76+
impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
7777
fn assign(&mut self, local: mir::Local, location: Location) {
7878
let kind = &mut self.locals[local];
7979
match *kind {

compiler/rustc_codegen_ssa/src/mir/operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub struct OperandRef<'tcx, V> {
4747
pub layout: TyAndLayout<'tcx>,
4848
}
4949

50-
impl<V: CodegenObject> fmt::Debug for OperandRef<'tcx, V> {
50+
impl<V: CodegenObject> fmt::Debug for OperandRef<'_, V> {
5151
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5252
write!(f, "OperandRef({:?} @ {:?})", self.val, self.layout)
5353
}

compiler/rustc_codegen_ssa/src/traits/type_.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub trait DerivedTypeMethods<'tcx>: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {
9797
}
9898
}
9999

100-
impl<T> DerivedTypeMethods<'tcx> for T where Self: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {}
100+
impl<'tcx, T> DerivedTypeMethods<'tcx> for T where Self: BaseTypeMethods<'tcx> + MiscMethods<'tcx> {}
101101

102102
pub trait LayoutTypeMethods<'tcx>: Backend<'tcx> {
103103
fn backend_type(&self, layout: TyAndLayout<'tcx>) -> Self::Type;
@@ -135,4 +135,4 @@ pub trait ArgAbiMethods<'tcx>: HasCodegen<'tcx> {
135135

136136
pub trait TypeMethods<'tcx>: DerivedTypeMethods<'tcx> + LayoutTypeMethods<'tcx> {}
137137

138-
impl<T> TypeMethods<'tcx> for T where Self: DerivedTypeMethods<'tcx> + LayoutTypeMethods<'tcx> {}
138+
impl<'tcx, T> TypeMethods<'tcx> for T where Self: DerivedTypeMethods<'tcx> + LayoutTypeMethods<'tcx> {}

compiler/rustc_driver/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ Available lint options:
872872

873873
let print_lints = |lints: Vec<&Lint>| {
874874
for lint in lints {
875-
let name = lint.name_lower().replace("_", "-");
875+
let name = lint.name_lower().replace('_', "-");
876876
println!(
877877
" {} {:7.7} {}",
878878
padded(&name),
@@ -908,10 +908,10 @@ Available lint options:
908908

909909
let print_lint_groups = |lints: Vec<(&'static str, Vec<LintId>)>| {
910910
for (name, to) in lints {
911-
let name = name.to_lowercase().replace("_", "-");
911+
let name = name.to_lowercase().replace('_', "-");
912912
let desc = to
913913
.into_iter()
914-
.map(|x| x.to_string().replace("_", "-"))
914+
.map(|x| x.to_string().replace('_', "-"))
915915
.collect::<Vec<String>>()
916916
.join(", ");
917917
println!(" {} {}", padded(&name), desc);
@@ -960,7 +960,7 @@ fn print_flag_list<T>(
960960
println!(
961961
" {} {:>width$}=val -- {}",
962962
cmdline_opt,
963-
name.replace("_", "-"),
963+
name.replace('_', "-"),
964964
desc,
965965
width = max_len
966966
);
@@ -1015,7 +1015,7 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
10151015
.iter()
10161016
.map(|&(name, ..)| ('C', name))
10171017
.chain(DB_OPTIONS.iter().map(|&(name, ..)| ('Z', name)))
1018-
.find(|&(_, name)| *opt == name.replace("_", "-"))
1018+
.find(|&(_, name)| *opt == name.replace('_', "-"))
10191019
.map(|(flag, _)| format!("{}. Did you mean `-{} {}`?", e, flag, opt)),
10201020
_ => None,
10211021
};

0 commit comments

Comments
 (0)