Skip to content

Commit

Permalink
Fix build breakage in rustc 9cb18a92a 2018-03-02 - extra argument to …
Browse files Browse the repository at this point in the history
…infcx.fresh_substs_for_item. Bump version to 0.1.7
  • Loading branch information
davidlattimore committed Mar 3, 2018
1 parent a939128 commit 1a31cb5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "rerast"
version = "0.1.6"
version = "0.1.7"
license = "Apache-2.0"
description = "An AST (abstract syntax tree) based search replace tool for code written in Rust"
repository = "https://github.com/google/rerast"
Expand Down
11 changes: 5 additions & 6 deletions src/change_to_rule.rs
Expand Up @@ -316,12 +316,11 @@ fn after_analysis<'a, 'gcx>(
// which bit of the HIR tree has changed and select candidate placeholders.
find_rules_state.changed_span = new_changed_span;
find_rules_state.changed_side_state = Some(ChangedSideState {
candidate_placeholders:
PlaceholderCandidateFinder::find_placeholder_candidates(
tcx,
expr,
|child_expr| RelativeSpan::new(child_expr.span, &filemap),
),
candidate_placeholders: PlaceholderCandidateFinder::find_placeholder_candidates(
tcx,
expr,
|child_expr| RelativeSpan::new(child_expr.span, &filemap),
),
required_paths: ReferencedPathsFinder::paths_in_expr(tcx, expr),
})
}
Expand Down
9 changes: 7 additions & 2 deletions src/rule_matcher.rs
Expand Up @@ -132,7 +132,11 @@ impl<'r, 'a, 'gcx> RuleMatcher<'r, 'a, 'gcx> {

let maybe_match_placeholders = self.tcx.infer_ctxt().enter(|infcx| {
let tcx = infcx.tcx;
let substs = infcx.fresh_substs_for_item(tcx.def_span(rule_fn_id), rule_fn_id);
let substs = infcx.fresh_substs_for_item(
ty::UniverseIndex::ROOT,
tcx.def_span(rule_fn_id),
rule_fn_id,
);
let placeholder_types_by_id = rule_body
.arguments
.iter()
Expand Down Expand Up @@ -1484,7 +1488,8 @@ impl<'r, 'a, 'gcx, T: StartMatch> ReplacementVisitor<'r, 'a, 'gcx, T> {
}

impl<'r, 'a, 'gcx, T: StartMatch> intravisit::Visitor<'gcx>
for ReplacementVisitor<'r, 'a, 'gcx, T> {
for ReplacementVisitor<'r, 'a, 'gcx, T>
{
fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'this, 'gcx> {
intravisit::NestedVisitorMap::All(&self.tcx.hir)
}
Expand Down

0 comments on commit 1a31cb5

Please sign in to comment.