Skip to content

Commit c3a1c47

Browse files
committed
---
yaml --- r: 210830 b: refs/heads/try c: 7ca560d h: refs/heads/master v: v3
1 parent 3f1dd6f commit c3a1c47

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 952614bc8b5e198ffa82dd0ecffc96b141a3cc91
5+
refs/heads/try: 7ca560d6abc0217943db436bb4b738bf6977cf93
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc_trans/save/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
111111
let qualname = format!("::{}", self.analysis.ty_cx.map.path_to_string(item.id));
112112

113113
// If the variable is immutable, save the initialising expression.
114-
let value = match mt {
115-
ast::MutMutable => String::from_str("<mutable>"),
116-
ast::MutImmutable => self.span_utils.snippet(expr.span),
114+
let (value, keyword) = match mt {
115+
ast::MutMutable => (String::from_str("<mutable>"), keywords::Mut),
116+
ast::MutImmutable => (self.span_utils.snippet(expr.span), keywords::Static),
117117
};
118118

119-
let sub_span = self.span_utils.sub_span_after_keyword(item.span, keywords::Static);
119+
let sub_span = self.span_utils.sub_span_after_keyword(item.span, keyword);
120120

121121
Data::VariableData(VariableData {
122122
id: item.id,

branches/try/src/librustc_trans/save/span_utils.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl<'a> SpanUtils<'a> {
237237

238238
let mut toks = self.retokenise_span(span);
239239
// We keep track of how many brackets we're nested in
240-
let mut bracket_count = 0;
240+
let mut bracket_count: isize = 0;
241241
let mut found_ufcs_sep = false;
242242
loop {
243243
let ts = toks.real_token();
@@ -255,19 +255,16 @@ impl<'a> SpanUtils<'a> {
255255
}
256256
bracket_count += match ts.tok {
257257
token::Lt => 1,
258-
token::Gt => {
259-
// Ignore the `>::` in `<Type as Trait>::AssocTy`.
260-
if !found_ufcs_sep && bracket_count == 0 {
261-
found_ufcs_sep = true;
262-
0
263-
} else {
264-
-1
265-
}
266-
}
258+
token::Gt => -1,
267259
token::BinOp(token::Shl) => 2,
268260
token::BinOp(token::Shr) => -2,
269261
_ => 0
270262
};
263+
// Ignore the `>::` in `<Type as Trait>::AssocTy`.
264+
if !found_ufcs_sep && bracket_count == -1 {
265+
found_ufcs_sep = true;
266+
bracket_count += 1
267+
}
271268
if ts.tok.is_ident() && bracket_count == nesting {
272269
result.push(self.make_sub_span(span, Some(ts.sp)).unwrap());
273270
}

branches/try/src/test/run-make/save-analysis/foo.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,15 @@ impl Iterator for nofields {
352352
panic!()
353353
}
354354
}
355+
356+
trait Pattern<'a> {
357+
type Searcher;
358+
}
359+
360+
struct CharEqPattern;
361+
362+
impl<'a> Pattern<'a> for CharEqPattern {
363+
type Searcher = CharEqPattern;
364+
}
365+
366+
struct CharSearcher<'a>(<CharEqPattern as Pattern<'a>>::Searcher);

0 commit comments

Comments
 (0)