pub err: &'tcx Const<'tcx>,
}
-pub struct LocalTableInContext<'a, V: 'a> {
+pub struct LocalTableInContext<'a, V> {
local_id_root: Option<DefId>,
data: &'a ItemLocalMap<V>
}
if let Some(local_id_root) = local_id_root {
if hir_id.owner != local_id_root.index {
ty::tls::with(|tcx| {
- let node_id = tcx.hir().hir_to_node_id(hir_id);
-
bug!("node {} with HirId::owner {:?} cannot be placed in \
TypeckTables with local_id_root {:?}",
- tcx.hir().node_to_string(node_id),
+ tcx.hir().node_to_string(hir_id),
DefId::local(hir_id.owner),
local_id_root)
});
}
}
-pub struct LocalTableInContextMut<'a, V: 'a> {
+pub struct LocalTableInContextMut<'a, V> {
local_id_root: Option<DefId>,
data: &'a mut ItemLocalMap<V>
}
pub fn node_type(&self, id: hir::HirId) -> Ty<'tcx> {
self.node_type_opt(id).unwrap_or_else(||
bug!("node_type: no type for node `{}`",
- tls::with(|tcx| tcx.hir().hir_to_string(id)))
+ tls::with(|tcx| tcx.hir().node_to_string(id)))
)
}
) -> Option<Ty<'tcx>> {
// HACK: `type_of_def_id()` will fail on these (#55796), so return None
let hir_id = self.hir().as_local_hir_id(scope_def_id).unwrap();
- match self.hir().get_by_hir_id(hir_id) {
+ match self.hir().get(hir_id) {
Node::Item(item) => {
match item.node {
ItemKind::Fn(..) => { /* type_of_def_id() will work */ }
/// An entry in an interner.
-struct Interned<'tcx, T: 'tcx+?Sized>(&'tcx T);
+struct Interned<'tcx, T: ?Sized>(&'tcx T);
impl<'tcx, T: 'tcx+?Sized> Clone for Interned<'tcx, T> {
fn clone(&self) -> Self {
}
impl<'tcx> Borrow<[CanonicalVarInfo]> for Interned<'tcx, List<CanonicalVarInfo>> {
- fn borrow<'a>(&'a self) -> &'a [CanonicalVarInfo] {
+ fn borrow(&self) -> &[CanonicalVarInfo] {
&self.0[..]
}
}
impl<'tcx> Borrow<[ProjectionKind]>
for Interned<'tcx, List<ProjectionKind>> {
- fn borrow<'a>(&'a self) -> &'a [ProjectionKind] {
+ fn borrow(&self) -> &[ProjectionKind] {
&self.0[..]
}
}
impl<'tcx> Borrow<RegionKind> for Interned<'tcx, RegionKind> {
- fn borrow<'a>(&'a self) -> &'a RegionKind {
+ fn borrow(&self) -> &RegionKind {
&self.0
}
}