Skip to content

Commit

Permalink
move resolve_lifetimes into a proper query
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikomatsakis committed Dec 11, 2017
1 parent d737ea7 commit b7794c0
Show file tree
Hide file tree
Showing 23 changed files with 283 additions and 237 deletions.
7 changes: 4 additions & 3 deletions src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,10 @@ define_dep_nodes!( <'tcx>
[] NativeLibraryKind(DefId),
[input] LinkArgs,

[input] NamedRegion(DefIndex),
[input] IsLateBound(DefIndex),
[input] ObjectLifetimeDefaults(DefIndex),
[] ResolveLifetimes(CrateNum),
[] NamedRegion(DefIndex),
[] IsLateBound(DefIndex),
[] ObjectLifetimeDefaults(DefIndex),

[] Visibility(DefId),
[] DepKind(CrateNum),
Expand Down
12 changes: 11 additions & 1 deletion src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub use self::UnsafeSource::*;
pub use self::Visibility::{Public, Inherited};

use hir::def::Def;
use hir::def_id::{DefId, DefIndex, CRATE_DEF_INDEX};
use hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
use util::nodemap::{NodeMap, FxHashSet};

use syntax_pos::{Span, DUMMY_SP};
Expand Down Expand Up @@ -92,6 +92,16 @@ pub struct HirId {
pub local_id: ItemLocalId,
}

impl HirId {
pub fn owner_def_id(self) -> DefId {
DefId::local(self.owner)
}

pub fn owner_local_def_id(self) -> LocalDefId {
LocalDefId::from_def_id(DefId::local(self.owner))
}
}

impl serialize::UseSpecializedEncodable for HirId {
fn default_encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
let HirId {
Expand Down
Loading

0 comments on commit b7794c0

Please sign in to comment.