Skip to content

Commit 5951f8d

Browse files
committed
Auto merge of #46657 - nikomatsakis:resolve-lifetimes-query, r=arielb1
move `resolve_lifetimes` into a proper query Now that we made `resolve_lifetimes` into a query, elision errors no longer abort compilation, which affects some tests. Also, remove `dep_graph_crosscontaminate_tables` -- there is no a path in the dep-graph, though red-green handles it. The same scenario is (correctly) tested by issue-42602.rs in any case. r? @michaelwoerister
2 parents 9fe7aa3 + fdbd9b0 commit 5951f8d

23 files changed

+937
-647
lines changed

src/librustc/dep_graph/dep_node.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,10 @@ define_dep_nodes!( <'tcx>
588588
[] NativeLibraryKind(DefId),
589589
[input] LinkArgs,
590590

591-
[input] NamedRegion(DefIndex),
592-
[input] IsLateBound(DefIndex),
593-
[input] ObjectLifetimeDefaults(DefIndex),
591+
[] ResolveLifetimes(CrateNum),
592+
[] NamedRegion(DefIndex),
593+
[] IsLateBound(DefIndex),
594+
[] ObjectLifetimeDefaults(DefIndex),
594595

595596
[] Visibility(DefId),
596597
[] DepKind(CrateNum),

src/librustc/hir/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub use self::UnsafeSource::*;
2828
pub use self::Visibility::{Public, Inherited};
2929

3030
use hir::def::Def;
31-
use hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
31+
use hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
3232
use util::nodemap::{NodeMap, FxHashSet};
3333

3434
use syntax_pos::{Span, DUMMY_SP};
@@ -92,6 +92,16 @@ pub struct HirId {
9292
pub local_id: ItemLocalId,
9393
}
9494

95+
impl HirId {
96+
pub fn owner_def_id(self) -> DefId {
97+
DefId::local(self.owner)
98+
}
99+
100+
pub fn owner_local_def_id(self) -> LocalDefId {
101+
LocalDefId::from_def_id(DefId::local(self.owner))
102+
}
103+
}
104+
95105
impl serialize::UseSpecializedEncodable for HirId {
96106
fn default_encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
97107
let HirId {

0 commit comments

Comments
 (0)