Skip to content

Commit 7d73e4c

Browse files
committed
Remove ReScope
1 parent c102312 commit 7d73e4c

File tree

19 files changed

+27
-455
lines changed

19 files changed

+27
-455
lines changed

src/librustc_infer/infer/canonical/canonicalizer.rs

-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
332332
ty::ReStatic
333333
| ty::ReEarlyBound(..)
334334
| ty::ReFree(_)
335-
| ty::ReScope(_)
336335
| ty::ReEmpty(_)
337336
| ty::RePlaceholder(..)
338337
| ty::ReErased => self.canonicalize_region_mode.canonicalize_free_region(self, r),

src/librustc_infer/infer/combine.rs

-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,6 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
619619
| ty::ReVar(..)
620620
| ty::ReEmpty(_)
621621
| ty::ReStatic
622-
| ty::ReScope(..)
623622
| ty::ReEarlyBound(..)
624623
| ty::ReFree(..) => {
625624
// see common code below

src/librustc_infer/infer/error_reporting/mod.rs

-45
Original file line numberDiff line numberDiff line change
@@ -88,51 +88,6 @@ pub(super) fn note_and_explain_region(
8888
suffix: &str,
8989
) {
9090
let (description, span) = match *region {
91-
ty::ReScope(scope) => {
92-
let new_string;
93-
let unknown_scope =
94-
|| format!("{}unknown scope: {:?}{}. Please report a bug.", prefix, scope, suffix);
95-
let span = scope.span(tcx, region_scope_tree);
96-
let hir_id = scope.hir_id(region_scope_tree);
97-
let tag = match hir_id.and_then(|hir_id| tcx.hir().find(hir_id)) {
98-
Some(Node::Block(_)) => "block",
99-
Some(Node::Expr(expr)) => match expr.kind {
100-
hir::ExprKind::Call(..) => "call",
101-
hir::ExprKind::MethodCall(..) => "method call",
102-
hir::ExprKind::Match(.., hir::MatchSource::IfLetDesugar { .. }) => "if let",
103-
hir::ExprKind::Match(.., hir::MatchSource::WhileLetDesugar) => "while let",
104-
hir::ExprKind::Match(.., hir::MatchSource::ForLoopDesugar) => "for",
105-
hir::ExprKind::Match(..) => "match",
106-
_ => "expression",
107-
},
108-
Some(Node::Stmt(_)) => "statement",
109-
Some(Node::Item(it)) => item_scope_tag(&it),
110-
Some(Node::TraitItem(it)) => trait_item_scope_tag(&it),
111-
Some(Node::ImplItem(it)) => impl_item_scope_tag(&it),
112-
Some(_) | None => {
113-
err.span_note(span, &unknown_scope());
114-
return;
115-
}
116-
};
117-
let scope_decorated_tag = match scope.data {
118-
region::ScopeData::Node => tag,
119-
region::ScopeData::CallSite => "scope of call-site for function",
120-
region::ScopeData::Arguments => "scope of function body",
121-
region::ScopeData::Destruction => {
122-
new_string = format!("destruction scope surrounding {}", tag);
123-
&new_string[..]
124-
}
125-
region::ScopeData::Remainder(first_statement_index) => {
126-
new_string = format!(
127-
"block suffix following statement {}",
128-
first_statement_index.index()
129-
);
130-
&new_string[..]
131-
}
132-
};
133-
explain_span(tcx, scope_decorated_tag, span)
134-
}
135-
13691
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReStatic => {
13792
msg_span_from_free_region(tcx, region)
13893
}

src/librustc_infer/infer/freshen.rs

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
127127
ty::ReStatic
128128
| ty::ReEarlyBound(..)
129129
| ty::ReFree(_)
130-
| ty::ReScope(_)
131130
| ty::ReVar(_)
132131
| ty::RePlaceholder(..)
133132
| ty::ReEmpty(_)

src/librustc_infer/infer/lexical_region_resolve/graphviz.rs

-253
This file was deleted.

0 commit comments

Comments
 (0)