Skip to content

Commit e95e084

Browse files
committed
Auto merge of #92106 - matthiaskrgr:rollup-zw6t1mu, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #91791 (Fix an ICE when lowering a float with missing exponent magnitude) - #91878 (Remove `in_band_lifetimes` from `rustc_infer`) - #91895 (Remove `in_band_lifetimes` for `rustc_monomorphize`) - #92029 (Explicitly set no ELF flags for .rustc section) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 41c3017 + 9415c67 commit e95e084

File tree

29 files changed

+104
-66
lines changed

29 files changed

+104
-66
lines changed

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,15 @@ pub fn create_compressed_metadata_file(
259259
let section = file.add_section(
260260
file.segment_name(StandardSegment::Data).to_vec(),
261261
b".rustc".to_vec(),
262-
SectionKind::Data,
262+
SectionKind::ReadOnlyData,
263263
);
264+
match file.format() {
265+
BinaryFormat::Elf => {
266+
// Explicitly set no flags to avoid SHF_ALLOC default for data section.
267+
file.section_mut(section).flags = SectionFlags::Elf { sh_flags: 0 };
268+
}
269+
_ => {}
270+
};
264271
let offset = file.append_section_data(section, &compressed, 1);
265272

266273
// For MachO and probably PE this is necessary to prevent the linker from throwing away the

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
134134
/// response*, then we don't typically replace free regions, as they
135135
/// must have been introduced from other parts of the system.
136136
trait CanonicalizeRegionMode {
137-
fn canonicalize_free_region(
137+
fn canonicalize_free_region<'tcx>(
138138
&self,
139139
canonicalizer: &mut Canonicalizer<'_, 'tcx>,
140140
r: ty::Region<'tcx>,
@@ -146,7 +146,7 @@ trait CanonicalizeRegionMode {
146146
struct CanonicalizeQueryResponse;
147147

148148
impl CanonicalizeRegionMode for CanonicalizeQueryResponse {
149-
fn canonicalize_free_region(
149+
fn canonicalize_free_region<'tcx>(
150150
&self,
151151
canonicalizer: &mut Canonicalizer<'_, 'tcx>,
152152
r: ty::Region<'tcx>,
@@ -203,7 +203,7 @@ impl CanonicalizeRegionMode for CanonicalizeQueryResponse {
203203
struct CanonicalizeUserTypeAnnotation;
204204

205205
impl CanonicalizeRegionMode for CanonicalizeUserTypeAnnotation {
206-
fn canonicalize_free_region(
206+
fn canonicalize_free_region<'tcx>(
207207
&self,
208208
canonicalizer: &mut Canonicalizer<'_, 'tcx>,
209209
r: ty::Region<'tcx>,
@@ -226,7 +226,7 @@ impl CanonicalizeRegionMode for CanonicalizeUserTypeAnnotation {
226226
struct CanonicalizeAllFreeRegions;
227227

228228
impl CanonicalizeRegionMode for CanonicalizeAllFreeRegions {
229-
fn canonicalize_free_region(
229+
fn canonicalize_free_region<'tcx>(
230230
&self,
231231
canonicalizer: &mut Canonicalizer<'_, 'tcx>,
232232
r: ty::Region<'tcx>,
@@ -242,7 +242,7 @@ impl CanonicalizeRegionMode for CanonicalizeAllFreeRegions {
242242
struct CanonicalizeFreeRegionsOtherThanStatic;
243243

244244
impl CanonicalizeRegionMode for CanonicalizeFreeRegionsOtherThanStatic {
245-
fn canonicalize_free_region(
245+
fn canonicalize_free_region<'tcx>(
246246
&self,
247247
canonicalizer: &mut Canonicalizer<'_, 'tcx>,
248248
r: ty::Region<'tcx>,

compiler/rustc_infer/src/infer/combine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ struct Generalization<'tcx> {
533533
needs_wf: bool,
534534
}
535535

536-
impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
536+
impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
537537
fn tcx(&self) -> TyCtxt<'tcx> {
538538
self.infcx.tcx
539539
}
@@ -827,7 +827,7 @@ struct ConstInferUnifier<'cx, 'tcx> {
827827
// We use `TypeRelation` here to propagate `RelateResult` upwards.
828828
//
829829
// Both inputs are expected to be the same.
830-
impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
830+
impl<'tcx> TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
831831
fn tcx(&self) -> TyCtxt<'tcx> {
832832
self.infcx.tcx
833833
}

compiler/rustc_infer/src/infer/equate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'combine, 'infcx, 'tcx> Equate<'combine, 'infcx, 'tcx> {
2323
}
2424
}
2525

26-
impl TypeRelation<'tcx> for Equate<'combine, 'infcx, 'tcx> {
26+
impl<'tcx> TypeRelation<'tcx> for Equate<'_, '_, 'tcx> {
2727
fn tag(&self) -> &'static str {
2828
"Equate"
2929
}

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub use need_type_info::TypeAnnotationNeeded;
8383

8484
pub mod nice_region_error;
8585

86-
pub(super) fn note_and_explain_region(
86+
pub(super) fn note_and_explain_region<'tcx>(
8787
tcx: TyCtxt<'tcx>,
8888
err: &mut DiagnosticBuilder<'_>,
8989
prefix: &str,
@@ -116,7 +116,7 @@ pub(super) fn note_and_explain_region(
116116
emit_msg_span(err, prefix, description, span, suffix);
117117
}
118118

119-
fn explain_free_region(
119+
fn explain_free_region<'tcx>(
120120
tcx: TyCtxt<'tcx>,
121121
err: &mut DiagnosticBuilder<'_>,
122122
prefix: &str,
@@ -128,7 +128,7 @@ fn explain_free_region(
128128
label_msg_span(err, prefix, description, span, suffix);
129129
}
130130

131-
fn msg_span_from_free_region(
131+
fn msg_span_from_free_region<'tcx>(
132132
tcx: TyCtxt<'tcx>,
133133
region: ty::Region<'tcx>,
134134
alt_span: Option<Span>,
@@ -145,7 +145,7 @@ fn msg_span_from_free_region(
145145
}
146146
}
147147

148-
fn msg_span_from_early_bound_and_free_regions(
148+
fn msg_span_from_early_bound_and_free_regions<'tcx>(
149149
tcx: TyCtxt<'tcx>,
150150
region: ty::Region<'tcx>,
151151
) -> (String, Span) {
@@ -226,7 +226,7 @@ fn label_msg_span(
226226
}
227227
}
228228

229-
pub fn unexpected_hidden_region_diagnostic(
229+
pub fn unexpected_hidden_region_diagnostic<'tcx>(
230230
tcx: TyCtxt<'tcx>,
231231
span: Span,
232232
hidden_ty: Ty<'tcx>,
@@ -316,7 +316,7 @@ pub fn unexpected_hidden_region_diagnostic(
316316
/// with the other type. A TyVar inference type is compatible with any type, and an IntVar or
317317
/// FloatVar inference type are compatible with themselves or their concrete types (Int and
318318
/// Float types, respectively). When comparing two ADTs, these rules apply recursively.
319-
pub fn same_type_modulo_infer(a: Ty<'tcx>, b: Ty<'ctx>) -> bool {
319+
pub fn same_type_modulo_infer<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
320320
match (&a.kind(), &b.kind()) {
321321
(&ty::Adt(did_a, substs_a), &ty::Adt(did_b, substs_b)) => {
322322
if did_a != did_b {

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/find_anon_type.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_middle::ty::{self, Region, TyCtxt};
2020
/// ```
2121
/// The function returns the nested type corresponding to the anonymous region
2222
/// for e.g., `&u8` and `Vec<&u8>`.
23-
pub(crate) fn find_anon_type(
23+
pub(crate) fn find_anon_type<'tcx>(
2424
tcx: TyCtxt<'tcx>,
2525
region: Region<'tcx>,
2626
br: &ty::BoundRegionKind,
@@ -50,7 +50,7 @@ pub(crate) fn find_anon_type(
5050

5151
// This method creates a FindNestedTypeVisitor which returns the type corresponding
5252
// to the anonymous region.
53-
fn find_component_for_bound_region(
53+
fn find_component_for_bound_region<'tcx>(
5454
tcx: TyCtxt<'tcx>,
5555
arg: &'tcx hir::Ty<'tcx>,
5656
br: &ty::BoundRegionKind,
@@ -83,7 +83,7 @@ struct FindNestedTypeVisitor<'tcx> {
8383
current_index: ty::DebruijnIndex,
8484
}
8585

86-
impl Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
86+
impl<'tcx> Visitor<'tcx> for FindNestedTypeVisitor<'tcx> {
8787
type Map = Map<'tcx>;
8888

8989
fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
@@ -207,7 +207,7 @@ struct TyPathVisitor<'tcx> {
207207
current_index: ty::DebruijnIndex,
208208
}
209209

210-
impl Visitor<'tcx> for TyPathVisitor<'tcx> {
210+
impl<'tcx> Visitor<'tcx> for TyPathVisitor<'tcx> {
211211
type Map = Map<'tcx>;
212212

213213
fn nested_visit_map(&mut self) -> NestedVisitorMap<Map<'tcx>> {

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/placeholder_error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::ty::{self, TyCtxt};
1313

1414
use std::fmt::{self, Write};
1515

16-
impl NiceRegionError<'me, 'tcx> {
16+
impl<'tcx> NiceRegionError<'_, 'tcx> {
1717
/// When given a `ConcreteFailure` for a function with arguments containing a named region and
1818
/// an anonymous region, emit a descriptive diagnostic error.
1919
pub(super) fn try_report_placeholder_conflict(&self) -> Option<DiagnosticBuilder<'tcx>> {

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
287287
}
288288

289289
pub fn suggest_new_region_bound(
290-
tcx: TyCtxt<'tcx>,
290+
tcx: TyCtxt<'_>,
291291
err: &mut DiagnosticBuilder<'_>,
292292
fn_returns: Vec<&rustc_hir::Ty<'_>>,
293293
lifetime_name: String,

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/trait_impl_difference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
8686
counter: usize,
8787
}
8888

89-
impl HighlightBuilder<'tcx> {
89+
impl<'tcx> HighlightBuilder<'tcx> {
9090
fn build(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> RegionHighlightMode {
9191
let mut builder =
9292
HighlightBuilder { highlight: RegionHighlightMode::default(), counter: 1, tcx };
@@ -186,7 +186,7 @@ struct TypeParamSpanVisitor<'tcx> {
186186
types: Vec<Span>,
187187
}
188188

189-
impl Visitor<'tcx> for TypeParamSpanVisitor<'tcx> {
189+
impl<'tcx> Visitor<'tcx> for TypeParamSpanVisitor<'tcx> {
190190
type Map = rustc_middle::hir::map::Map<'tcx>;
191191

192192
fn nested_visit_map(&mut self) -> hir::intravisit::NestedVisitorMap<Self::Map> {

compiler/rustc_infer/src/infer/glb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'combine, 'infcx, 'tcx> Glb<'combine, 'infcx, 'tcx> {
2323
}
2424
}
2525

26-
impl TypeRelation<'tcx> for Glb<'combine, 'infcx, 'tcx> {
26+
impl<'tcx> TypeRelation<'tcx> for Glb<'_, '_, 'tcx> {
2727
fn tag(&self) -> &'static str {
2828
"Glb"
2929
}

0 commit comments

Comments
 (0)