Skip to content

Commit 41c3017

Browse files
committed
Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #91141 (Revert "Temporarily rename int_roundings functions to avoid conflicts") - #91984 (Remove `in_band_lifetimes` from `rustc_middle`) - #92028 (Sync portable-simd to fix libcore build for AVX-512 enabled targets) - #92042 (Enable `#[thread_local]` for all windows-msvc targets) - #92071 (Update example code for Vec::splice to change the length) - #92077 (rustdoc: Remove unused `collapsed` field) - #92081 (rustdoc: Remove unnecessary `need_backline` function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents a41a692 + 3340666 commit 41c3017

Some content is hidden

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

77 files changed

+228
-277
lines changed

compiler/rustc_macros/src/type_foldable.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
use quote::quote;
2+
use syn::parse_quote;
23

34
pub fn type_foldable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream {
45
if let syn::Data::Union(_) = s.ast().data {
56
panic!("cannot derive on union")
67
}
78

9+
if !s.ast().generics.lifetimes().any(|lt| lt.lifetime.ident == "tcx") {
10+
s.add_impl_generic(parse_quote! { 'tcx });
11+
}
12+
813
s.add_bounds(synstructure::AddBounds::Generics);
914
let body_visit = s.each(|bind| {
1015
quote! {

compiler/rustc_middle/src/dep_graph/dep_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ crate fn make_compile_codegen_unit(tcx: TyCtxt<'_>, name: Symbol) -> DepNode {
201201

202202
// WARNING: `construct` is generic and does not know that `CompileMonoItem` takes `MonoItem`s as keys.
203203
// Be very careful changing this type signature!
204-
crate fn make_compile_mono_item(tcx: TyCtxt<'tcx>, mono_item: &MonoItem<'tcx>) -> DepNode {
204+
crate fn make_compile_mono_item<'tcx>(tcx: TyCtxt<'tcx>, mono_item: &MonoItem<'tcx>) -> DepNode {
205205
DepNode::construct(tcx, DepKind::CompileMonoItem, mono_item)
206206
}
207207

@@ -264,7 +264,7 @@ impl DepNodeExt for DepNode {
264264
/// DepNode. Condition (2) might not be fulfilled if a DepNode
265265
/// refers to something from the previous compilation session that
266266
/// has been removed.
267-
fn extract_def_id(&self, tcx: TyCtxt<'tcx>) -> Option<DefId> {
267+
fn extract_def_id<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Option<DefId> {
268268
if self.kind.fingerprint_style(tcx) == FingerprintStyle::DefPathHash {
269269
Some(tcx.def_path_hash_to_def_id(DefPathHash(self.hash.into())))
270270
} else {

compiler/rustc_middle/src/infer/canonical.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct OriginalQueryValues<'tcx> {
7575
pub var_values: SmallVec<[GenericArg<'tcx>; 8]>,
7676
}
7777

78-
impl Default for OriginalQueryValues<'tcx> {
78+
impl<'tcx> Default for OriginalQueryValues<'tcx> {
7979
fn default() -> Self {
8080
let mut universe_map = SmallVec::default();
8181
universe_map.push(ty::UniverseIndex::ROOT);

compiler/rustc_middle/src/infer/unify_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl<'tcx> UnifyValue for ConstVarValue<'tcx> {
164164

165165
impl<'tcx> EqUnifyValue for &'tcx ty::Const<'tcx> {}
166166

167-
pub fn replace_if_possible<V, L>(
167+
pub fn replace_if_possible<'tcx, V, L>(
168168
table: &mut UnificationTable<InPlace<ty::ConstVid<'tcx>, V, L>>,
169169
c: &'tcx ty::Const<'tcx>,
170170
) -> &'tcx ty::Const<'tcx>

compiler/rustc_middle/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#![feature(let_else)]
4545
#![feature(min_specialization)]
4646
#![feature(trusted_len)]
47-
#![feature(in_band_lifetimes)]
4847
#![feature(crate_visibility_modifier)]
4948
#![feature(associated_type_bounds)]
5049
#![feature(rustc_attrs)]

compiler/rustc_middle/src/lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ pub fn struct_lint_level<'s, 'd>(
212212
) {
213213
// Avoid codegen bloat from monomorphization by immediately doing dyn dispatch of `decorate` to
214214
// the "real" work.
215-
fn struct_lint_level_impl(
215+
fn struct_lint_level_impl<'s, 'd>(
216216
sess: &'s Session,
217217
lint: &'static Lint,
218218
level: Level,

compiler/rustc_middle/src/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pub fn deprecation_message_and_lint(
228228
)
229229
}
230230

231-
pub fn early_report_deprecation(
231+
pub fn early_report_deprecation<'a>(
232232
lint_buffer: &'a mut LintBuffer,
233233
message: &str,
234234
suggestion: Option<Symbol>,

compiler/rustc_middle/src/mir/interpret/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl fmt::Display for InterpErrorInfo<'_> {
6363
}
6464
}
6565

66-
impl InterpErrorInfo<'tcx> {
66+
impl<'tcx> InterpErrorInfo<'tcx> {
6767
pub fn print_backtrace(&self) {
6868
if let Some(backtrace) = self.0.backtrace.as_ref() {
6969
print_backtrace(backtrace);

compiler/rustc_middle/src/mir/interpret/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub struct GlobalId<'tcx> {
145145
pub promoted: Option<mir::Promoted>,
146146
}
147147

148-
impl GlobalId<'tcx> {
148+
impl<'tcx> GlobalId<'tcx> {
149149
pub fn display(self, tcx: TyCtxt<'tcx>) -> String {
150150
let instance_name = with_no_trimmed_paths(|| tcx.def_path_str(self.instance.def.def_id()));
151151
if let Some(promoted) = self.promoted {
@@ -273,7 +273,7 @@ pub struct AllocDecodingSession<'s> {
273273

274274
impl<'s> AllocDecodingSession<'s> {
275275
/// Decodes an `AllocId` in a thread-safe way.
276-
pub fn decode_alloc_id<D>(&self, decoder: &mut D) -> Result<AllocId, D::Error>
276+
pub fn decode_alloc_id<'tcx, D>(&self, decoder: &mut D) -> Result<AllocId, D::Error>
277277
where
278278
D: TyDecoder<'tcx>,
279279
{
@@ -390,7 +390,7 @@ pub enum GlobalAlloc<'tcx> {
390390
Memory(&'tcx Allocation),
391391
}
392392

393-
impl GlobalAlloc<'tcx> {
393+
impl<'tcx> GlobalAlloc<'tcx> {
394394
/// Panics if the `GlobalAlloc` does not refer to an `GlobalAlloc::Memory`
395395
#[track_caller]
396396
#[inline]

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ impl SourceScope {
20332033
/// Finds the original HirId this MIR item came from.
20342034
/// This is necessary after MIR optimizations, as otherwise we get a HirId
20352035
/// from the function that was inlined instead of the function call site.
2036-
pub fn lint_root(
2036+
pub fn lint_root<'tcx>(
20372037
self,
20382038
source_scopes: &IndexVec<SourceScope, SourceScopeData<'tcx>>,
20392039
) -> Option<HirId> {
@@ -2543,7 +2543,7 @@ pub enum ConstantKind<'tcx> {
25432543
Val(interpret::ConstValue<'tcx>, Ty<'tcx>),
25442544
}
25452545

2546-
impl Constant<'tcx> {
2546+
impl<'tcx> Constant<'tcx> {
25472547
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
25482548
match self.literal.const_for_ty()?.val.try_to_scalar() {
25492549
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
@@ -2562,14 +2562,14 @@ impl Constant<'tcx> {
25622562
}
25632563
}
25642564

2565-
impl From<&'tcx ty::Const<'tcx>> for ConstantKind<'tcx> {
2565+
impl<'tcx> From<&'tcx ty::Const<'tcx>> for ConstantKind<'tcx> {
25662566
#[inline]
25672567
fn from(ct: &'tcx ty::Const<'tcx>) -> Self {
25682568
Self::Ty(ct)
25692569
}
25702570
}
25712571

2572-
impl ConstantKind<'tcx> {
2572+
impl<'tcx> ConstantKind<'tcx> {
25732573
/// Returns `None` if the constant is not trivially safe for use in the type system.
25742574
pub fn const_for_ty(&self) -> Option<&'tcx ty::Const<'tcx>> {
25752575
match self {
@@ -2851,7 +2851,7 @@ impl<'tcx> Display for ConstantKind<'tcx> {
28512851
}
28522852
}
28532853

2854-
fn pretty_print_const(
2854+
fn pretty_print_const<'tcx>(
28552855
c: &ty::Const<'tcx>,
28562856
fmt: &mut Formatter<'_>,
28572857
print_types: bool,
@@ -2866,7 +2866,7 @@ fn pretty_print_const(
28662866
})
28672867
}
28682868

2869-
fn pretty_print_const_value(
2869+
fn pretty_print_const_value<'tcx>(
28702870
val: interpret::ConstValue<'tcx>,
28712871
ty: Ty<'tcx>,
28722872
fmt: &mut Formatter<'_>,
@@ -2913,12 +2913,12 @@ impl<'a, 'b> graph::GraphSuccessors<'b> for Body<'a> {
29132913
type Iter = iter::Cloned<Successors<'b>>;
29142914
}
29152915

2916-
impl graph::GraphPredecessors<'graph> for Body<'tcx> {
2916+
impl<'tcx, 'graph> graph::GraphPredecessors<'graph> for Body<'tcx> {
29172917
type Item = BasicBlock;
29182918
type Iter = std::iter::Copied<std::slice::Iter<'graph, BasicBlock>>;
29192919
}
29202920

2921-
impl graph::WithPredecessors for Body<'tcx> {
2921+
impl<'tcx> graph::WithPredecessors for Body<'tcx> {
29222922
#[inline]
29232923
fn predecessors(&self, node: Self::Node) -> <Self as graph::GraphPredecessors<'_>>::Iter {
29242924
self.predecessors()[node].iter().copied()

0 commit comments

Comments
 (0)