mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Remove in_band_lifetimes
from rustc_symbol_mangling
This commit is contained in:
parent
c5ecc15704
commit
6c4fd615df
@ -13,7 +13,7 @@ use tracing::debug;
|
||||
use std::fmt::{self, Write};
|
||||
use std::mem::{self, discriminant};
|
||||
|
||||
pub(super) fn mangle(
|
||||
pub(super) fn mangle<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
instance: Instance<'tcx>,
|
||||
instantiating_crate: Option<CrateNum>,
|
||||
@ -199,7 +199,7 @@ struct SymbolPrinter<'tcx> {
|
||||
// `PrettyPrinter` aka pretty printing of e.g. types in paths,
|
||||
// symbol names should have their own printing machinery.
|
||||
|
||||
impl Printer<'tcx> for &mut SymbolPrinter<'tcx> {
|
||||
impl<'tcx> Printer<'tcx> for &mut SymbolPrinter<'tcx> {
|
||||
type Error = fmt::Error;
|
||||
|
||||
type Path = Self;
|
||||
@ -345,7 +345,7 @@ impl Printer<'tcx> for &mut SymbolPrinter<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl PrettyPrinter<'tcx> for &mut SymbolPrinter<'tcx> {
|
||||
impl<'tcx> PrettyPrinter<'tcx> for &mut SymbolPrinter<'tcx> {
|
||||
fn region_should_not_be_omitted(&self, _region: ty::Region<'_>) -> bool {
|
||||
false
|
||||
}
|
||||
|
@ -90,7 +90,6 @@
|
||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||
#![feature(never_type)]
|
||||
#![feature(nll)]
|
||||
#![feature(in_band_lifetimes)]
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
#[macro_use]
|
||||
@ -116,7 +115,7 @@ pub mod test;
|
||||
/// This function computes the symbol name for the given `instance` and the
|
||||
/// given instantiating crate. That is, if you know that instance X is
|
||||
/// instantiated in crate Y, this is the symbol name this instance would have.
|
||||
pub fn symbol_name_for_instance_in_crate(
|
||||
pub fn symbol_name_for_instance_in_crate<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
instance: Instance<'tcx>,
|
||||
instantiating_crate: CrateNum,
|
||||
@ -131,7 +130,7 @@ pub fn provide(providers: &mut Providers) {
|
||||
// The `symbol_name` query provides the symbol name for calling a given
|
||||
// instance from the local crate. In particular, it will also look up the
|
||||
// correct symbol name of instances from upstream crates.
|
||||
fn symbol_name_provider(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> ty::SymbolName<'tcx> {
|
||||
fn symbol_name_provider<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> ty::SymbolName<'tcx> {
|
||||
let symbol_name = compute_symbol_name(tcx, instance, || {
|
||||
// This closure determines the instantiating crate for instances that
|
||||
// need an instantiating-crate-suffix for their symbol name, in order
|
||||
@ -151,14 +150,14 @@ fn symbol_name_provider(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> ty::Symb
|
||||
}
|
||||
|
||||
/// This function computes the typeid for the given function ABI.
|
||||
pub fn typeid_for_fnabi(tcx: TyCtxt<'tcx>, fn_abi: &FnAbi<'tcx, Ty<'tcx>>) -> String {
|
||||
pub fn typeid_for_fnabi<'tcx>(tcx: TyCtxt<'tcx>, fn_abi: &FnAbi<'tcx, Ty<'tcx>>) -> String {
|
||||
v0::mangle_typeid_for_fnabi(tcx, fn_abi)
|
||||
}
|
||||
|
||||
/// Computes the symbol name for the given instance. This function will call
|
||||
/// `compute_instantiating_crate` if it needs to factor the instantiating crate
|
||||
/// into the symbol name.
|
||||
fn compute_symbol_name(
|
||||
fn compute_symbol_name<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
instance: Instance<'tcx>,
|
||||
compute_instantiating_crate: impl FnOnce() -> CrateNum,
|
||||
|
@ -31,7 +31,7 @@ struct SymbolNamesTest<'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
}
|
||||
|
||||
impl SymbolNamesTest<'tcx> {
|
||||
impl SymbolNamesTest<'_> {
|
||||
fn process_attrs(&mut self, def_id: LocalDefId) {
|
||||
let tcx = self.tcx;
|
||||
for attr in tcx.get_attrs(def_id.to_def_id()).iter() {
|
||||
@ -59,7 +59,7 @@ impl SymbolNamesTest<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl hir::itemlikevisit::ItemLikeVisitor<'tcx> for SymbolNamesTest<'tcx> {
|
||||
impl<'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for SymbolNamesTest<'tcx> {
|
||||
fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
|
||||
self.process_attrs(item.def_id);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ use std::fmt::Write;
|
||||
use std::iter;
|
||||
use std::ops::Range;
|
||||
|
||||
pub(super) fn mangle(
|
||||
pub(super) fn mangle<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
instance: Instance<'tcx>,
|
||||
instantiating_crate: Option<CrateNum>,
|
||||
@ -56,7 +56,7 @@ pub(super) fn mangle(
|
||||
std::mem::take(&mut cx.out)
|
||||
}
|
||||
|
||||
pub(super) fn mangle_typeid_for_fnabi(
|
||||
pub(super) fn mangle_typeid_for_fnabi<'tcx>(
|
||||
_tcx: TyCtxt<'tcx>,
|
||||
fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
|
||||
) -> String {
|
||||
@ -118,7 +118,7 @@ struct SymbolMangler<'tcx> {
|
||||
consts: FxHashMap<&'tcx ty::Const<'tcx>, usize>,
|
||||
}
|
||||
|
||||
impl SymbolMangler<'tcx> {
|
||||
impl<'tcx> SymbolMangler<'tcx> {
|
||||
fn push(&mut self, s: &str) {
|
||||
self.out.push_str(s);
|
||||
}
|
||||
@ -250,7 +250,7 @@ impl SymbolMangler<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl Printer<'tcx> for &mut SymbolMangler<'tcx> {
|
||||
impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
|
||||
type Error = !;
|
||||
|
||||
type Path = Self;
|
||||
|
Loading…
Reference in New Issue
Block a user