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
This commit is contained in:
bors
2021-12-19 12:36:56 +00:00
77 changed files with 228 additions and 277 deletions

View File

@@ -63,7 +63,7 @@ impl fmt::Display for InterpErrorInfo<'_> {
}
}
impl InterpErrorInfo<'tcx> {
impl<'tcx> InterpErrorInfo<'tcx> {
pub fn print_backtrace(&self) {
if let Some(backtrace) = self.0.backtrace.as_ref() {
print_backtrace(backtrace);

View File

@@ -145,7 +145,7 @@ pub struct GlobalId<'tcx> {
pub promoted: Option<mir::Promoted>,
}
impl GlobalId<'tcx> {
impl<'tcx> GlobalId<'tcx> {
pub fn display(self, tcx: TyCtxt<'tcx>) -> String {
let instance_name = with_no_trimmed_paths(|| tcx.def_path_str(self.instance.def.def_id()));
if let Some(promoted) = self.promoted {
@@ -273,7 +273,7 @@ pub struct AllocDecodingSession<'s> {
impl<'s> AllocDecodingSession<'s> {
/// Decodes an `AllocId` in a thread-safe way.
pub fn decode_alloc_id<D>(&self, decoder: &mut D) -> Result<AllocId, D::Error>
pub fn decode_alloc_id<'tcx, D>(&self, decoder: &mut D) -> Result<AllocId, D::Error>
where
D: TyDecoder<'tcx>,
{
@@ -390,7 +390,7 @@ pub enum GlobalAlloc<'tcx> {
Memory(&'tcx Allocation),
}
impl GlobalAlloc<'tcx> {
impl<'tcx> GlobalAlloc<'tcx> {
/// Panics if the `GlobalAlloc` does not refer to an `GlobalAlloc::Memory`
#[track_caller]
#[inline]

View File

@@ -2033,7 +2033,7 @@ impl SourceScope {
/// Finds the original HirId this MIR item came from.
/// This is necessary after MIR optimizations, as otherwise we get a HirId
/// from the function that was inlined instead of the function call site.
pub fn lint_root(
pub fn lint_root<'tcx>(
self,
source_scopes: &IndexVec<SourceScope, SourceScopeData<'tcx>>,
) -> Option<HirId> {
@@ -2543,7 +2543,7 @@ pub enum ConstantKind<'tcx> {
Val(interpret::ConstValue<'tcx>, Ty<'tcx>),
}
impl Constant<'tcx> {
impl<'tcx> Constant<'tcx> {
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
match self.literal.const_for_ty()?.val.try_to_scalar() {
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
@@ -2562,14 +2562,14 @@ impl Constant<'tcx> {
}
}
impl From<&'tcx ty::Const<'tcx>> for ConstantKind<'tcx> {
impl<'tcx> From<&'tcx ty::Const<'tcx>> for ConstantKind<'tcx> {
#[inline]
fn from(ct: &'tcx ty::Const<'tcx>) -> Self {
Self::Ty(ct)
}
}
impl ConstantKind<'tcx> {
impl<'tcx> ConstantKind<'tcx> {
/// Returns `None` if the constant is not trivially safe for use in the type system.
pub fn const_for_ty(&self) -> Option<&'tcx ty::Const<'tcx>> {
match self {
@@ -2851,7 +2851,7 @@ impl<'tcx> Display for ConstantKind<'tcx> {
}
}
fn pretty_print_const(
fn pretty_print_const<'tcx>(
c: &ty::Const<'tcx>,
fmt: &mut Formatter<'_>,
print_types: bool,
@@ -2866,7 +2866,7 @@ fn pretty_print_const(
})
}
fn pretty_print_const_value(
fn pretty_print_const_value<'tcx>(
val: interpret::ConstValue<'tcx>,
ty: Ty<'tcx>,
fmt: &mut Formatter<'_>,
@@ -2913,12 +2913,12 @@ impl<'a, 'b> graph::GraphSuccessors<'b> for Body<'a> {
type Iter = iter::Cloned<Successors<'b>>;
}
impl graph::GraphPredecessors<'graph> for Body<'tcx> {
impl<'tcx, 'graph> graph::GraphPredecessors<'graph> for Body<'tcx> {
type Item = BasicBlock;
type Iter = std::iter::Copied<std::slice::Iter<'graph, BasicBlock>>;
}
impl graph::WithPredecessors for Body<'tcx> {
impl<'tcx> graph::WithPredecessors for Body<'tcx> {
#[inline]
fn predecessors(&self, node: Self::Node) -> <Self as graph::GraphPredecessors<'_>>::Iter {
self.predecessors()[node].iter().copied()

View File

@@ -431,7 +431,7 @@ pub struct CodegenUnitNameBuilder<'tcx> {
cache: FxHashMap<CrateNum, String>,
}
impl CodegenUnitNameBuilder<'tcx> {
impl<'tcx> CodegenUnitNameBuilder<'tcx> {
pub fn new(tcx: TyCtxt<'tcx>) -> Self {
CodegenUnitNameBuilder { tcx, cache: Default::default() }
}

View File

@@ -167,8 +167,8 @@ fn dump_matched_mir_node<'tcx, F>(
/// Returns the file basename portion (without extension) of a filename path
/// where we should dump a MIR representation output files.
fn dump_file_basename(
tcx: TyCtxt<'_>,
fn dump_file_basename<'tcx>(
tcx: TyCtxt<'tcx>,
pass_num: Option<&dyn Display>,
pass_name: &str,
disambiguator: &dyn Display,
@@ -251,8 +251,8 @@ fn create_dump_file_with_basename(
/// bit of MIR-related data. Used by `mir-dump`, but also by other
/// bits of code (e.g., NLL inference) that dump graphviz data or
/// other things, and hence takes the extension as an argument.
pub fn create_dump_file(
tcx: TyCtxt<'_>,
pub fn create_dump_file<'tcx>(
tcx: TyCtxt<'tcx>,
extension: &str,
pass_num: Option<&dyn Display>,
pass_name: &str,
@@ -419,7 +419,7 @@ struct ExtraComments<'tcx> {
comments: Vec<String>,
}
impl ExtraComments<'tcx> {
impl<'tcx> ExtraComments<'tcx> {
fn push(&mut self, lines: &str) {
for line in lines.split('\n') {
self.comments.push(line.to_string());
@@ -427,7 +427,7 @@ impl ExtraComments<'tcx> {
}
}
fn use_verbose(ty: &&TyS<'tcx>, fn_def: bool) -> bool {
fn use_verbose<'tcx>(ty: &&TyS<'tcx>, fn_def: bool) -> bool {
match ty.kind() {
ty::Int(_) | ty::Uint(_) | ty::Bool | ty::Char | ty::Float(_) => false,
// Unit type
@@ -439,7 +439,7 @@ fn use_verbose(ty: &&TyS<'tcx>, fn_def: bool) -> bool {
}
}
impl Visitor<'tcx> for ExtraComments<'tcx> {
impl<'tcx> Visitor<'tcx> for ExtraComments<'tcx> {
fn visit_constant(&mut self, constant: &Constant<'tcx>, location: Location) {
self.super_constant(constant, location);
let Constant { span, user_ty, literal } = constant;
@@ -762,7 +762,7 @@ pub fn write_allocations<'tcx>(
/// After the hex dump, an ascii dump follows, replacing all unprintable characters (control
/// characters or characters whose value is larger than 127) with a `.`
/// This also prints relocations adequately.
pub fn display_allocation<Tag, Extra>(
pub fn display_allocation<'a, 'tcx, Tag, Extra>(
tcx: TyCtxt<'tcx>,
alloc: &'a Allocation<Tag, Extra>,
) -> RenderAllocation<'a, 'tcx, Tag, Extra> {
@@ -775,7 +775,9 @@ pub struct RenderAllocation<'a, 'tcx, Tag, Extra> {
alloc: &'a Allocation<Tag, Extra>,
}
impl<Tag: Provenance, Extra> std::fmt::Display for RenderAllocation<'a, 'tcx, Tag, Extra> {
impl<'a, 'tcx, Tag: Provenance, Extra> std::fmt::Display
for RenderAllocation<'a, 'tcx, Tag, Extra>
{
fn fmt(&self, w: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let RenderAllocation { tcx, alloc } = *self;
write!(w, "size: {}, align: {})", alloc.size().bytes(), alloc.align.bytes())?;
@@ -818,7 +820,7 @@ fn write_allocation_newline(
/// The `prefix` argument allows callers to add an arbitrary prefix before each line (even if there
/// is only one line). Note that your prefix should contain a trailing space as the lines are
/// printed directly after it.
fn write_allocation_bytes<Tag: Provenance, Extra>(
fn write_allocation_bytes<'tcx, Tag: Provenance, Extra>(
tcx: TyCtxt<'tcx>,
alloc: &Allocation<Tag, Extra>,
w: &mut dyn std::fmt::Write,

View File

@@ -300,7 +300,7 @@ pub fn reachable<'a, 'tcx>(
}
/// Returns a `BitSet` containing all basic blocks reachable from the `START_BLOCK`.
pub fn reachable_as_bitset(body: &Body<'tcx>) -> BitSet<BasicBlock> {
pub fn reachable_as_bitset<'tcx>(body: &Body<'tcx>) -> BitSet<BasicBlock> {
let mut iter = preorder(body);
(&mut iter).for_each(drop);
iter.visited

View File

@@ -965,7 +965,7 @@ macro_rules! visit_place_fns {
}
}
fn process_projection(
fn process_projection<'a>(
&mut self,
projection: &'a [PlaceElem<'tcx>],
location: Location,