Skip to content

Commit 923f3e3

Browse files
committed
---
yaml --- r: 93165 b: refs/heads/try c: af16357 h: refs/heads/master i: 93163: e4daa03 v: v3
1 parent d80de7e commit 923f3e3

File tree

12 files changed

+24
-12
lines changed

12 files changed

+24
-12
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: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 5754848f8cd06bd3fc2bb084b5ca7bd41974e1b5
5+
refs/heads/try: af163579ed674c4b1a37f5c8d50bf348722db439
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ fn get_explicit_self(item: ebml::Doc) -> ast::explicit_self_ {
977977
's' => { return ast::sty_static; }
978978
'v' => { return ast::sty_value(get_mutability(string[1])); }
979979
'@' => { return ast::sty_box(get_mutability(string[1])); }
980-
'~' => { return ast::sty_uniq; }
980+
'~' => { return ast::sty_uniq(get_mutability(string[1])); }
981981
'&' => {
982982
// FIXME(#4846) expl. region
983983
return ast::sty_region(None, get_mutability(string[1]));

branches/try/src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,9 @@ fn encode_explicit_self(ebml_w: &mut writer::Encoder, explicit_self: ast::explic
675675
ebml_w.writer.write(&[ '@' as u8 ]);
676676
encode_mutability(ebml_w, m);
677677
}
678-
sty_uniq => {
678+
sty_uniq(m) => {
679679
ebml_w.writer.write(&[ '~' as u8 ]);
680+
encode_mutability(ebml_w, m);
680681
}
681682
}
682683

branches/try/src/librustc/middle/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ fn visit_fn(v: &mut LivenessVisitor,
392392
match *fk {
393393
visit::fk_method(_, _, method) => {
394394
match method.explicit_self.node {
395-
sty_value(_) | sty_region(*) | sty_box(_) | sty_uniq => {
395+
sty_value(_) | sty_region(*) | sty_box(_) | sty_uniq(_) => {
396396
fn_maps.add_variable(Arg(method.self_id,
397397
special_idents::self_));
398398
}

branches/try/src/librustc/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3801,7 +3801,7 @@ impl Resolver {
38013801
}
38023802
HasSelfBinding(self_node_id, explicit_self) => {
38033803
let mutable = match explicit_self.node {
3804-
sty_value(m) if m == MutMutable => true,
3804+
sty_uniq(m) | sty_value(m) if m == MutMutable => true,
38053805
_ => false
38063806
};
38073807
let def_like = DlDef(DefSelf(self_node_id, mutable));

branches/try/src/librustc/middle/typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ fn ty_of_method_or_bare_fn<AC:AstConv,RS:RegionScope + Clone + 'static>(
689689
ty::mt {ty: self_info.untransformed_self_ty,
690690
mutbl: mutability}))
691691
}
692-
ast::sty_uniq => {
692+
ast::sty_uniq(_) => {
693693
Some(ty::mk_uniq(this.tcx(),
694694
ty::mt {ty: self_info.untransformed_self_ty,
695695
mutbl: ast::MutImmutable}))

branches/try/src/librustc/middle/typeck/check/method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ impl<'self> LookupContext<'self> {
12361236
}
12371237
}
12381238

1239-
sty_uniq => {
1239+
sty_uniq(_) => {
12401240
debug!("(is relevant?) explicit self is a unique pointer");
12411241
match ty::get(rcvr_ty).sty {
12421242
ty::ty_uniq(mt) => {

branches/try/src/librustdoc/clean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl Clean<SelfTy> for ast::explicit_self {
389389
match self.node {
390390
ast::sty_static => SelfStatic,
391391
ast::sty_value(_) => SelfValue,
392-
ast::sty_uniq => SelfOwned,
392+
ast::sty_uniq(_) => SelfOwned,
393393
ast::sty_region(lt, mt) => SelfBorrowed(lt.clean(), mt.clean()),
394394
ast::sty_box(mt) => SelfManaged(mt.clean()),
395395
}

branches/try/src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ pub enum explicit_self_ {
924924
sty_value(Mutability), // `self`
925925
sty_region(Option<Lifetime>, Mutability), // `&'lt self`
926926
sty_box(Mutability), // `@self`
927-
sty_uniq // `~self`
927+
sty_uniq(Mutability) // `~self`
928928
}
929929
930930
pub type explicit_self = Spanned<explicit_self_>;

branches/try/src/libsyntax/ext/deriving/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub fn get_explicit_self(cx: @ExtCtxt, span: Span, self_ptr: &Option<PtrTy>)
246246
let self_ty = respan(
247247
span,
248248
match *ptr {
249-
Send => ast::sty_uniq,
249+
Send => ast::sty_uniq(ast::MutImmutable),
250250
Managed(mutbl) => ast::sty_box(mutbl),
251251
Borrowed(ref lt, mutbl) => {
252252
let lt = lt.map(|s| cx.lifetime(span, cx.ident_of(s)));

branches/try/src/libsyntax/parse/parser.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3520,7 +3520,7 @@ impl Parser {
35203520
self.span_err(*self.last_span,
35213521
"mutability declaration not allowed here");
35223522
}
3523-
sty_uniq
3523+
sty_uniq(MutImmutable)
35243524
}, self)
35253525
}
35263526
token::IDENT(*) if self.is_self_ident() => {
@@ -3546,6 +3546,14 @@ impl Parser {
35463546
self.expect_self_ident();
35473547
sty_value(mutability)
35483548
}
3549+
_ if self.token_is_mutability(self.token) &&
3550+
self.look_ahead(1, |t| *t == token::TILDE) &&
3551+
self.look_ahead(2, |t| token::is_keyword(keywords::Self, t)) => {
3552+
let mutability = self.parse_mutability();
3553+
self.bump();
3554+
self.expect_self_ident();
3555+
sty_uniq(mutability)
3556+
}
35493557
_ => {
35503558
sty_static
35513559
}

branches/try/src/libsyntax/print/pprust.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,10 @@ pub fn print_explicit_self(s: @ps, explicit_self: ast::explicit_self_) -> bool {
16901690
print_mutability(s, m);
16911691
word(s.s, "self");
16921692
}
1693-
ast::sty_uniq => { word(s.s, "~self"); }
1693+
ast::sty_uniq(m) => {
1694+
print_mutability(s, m);
1695+
word(s.s, "~self");
1696+
}
16941697
ast::sty_region(ref lt, m) => {
16951698
word(s.s, "&");
16961699
print_opt_lifetime(s, lt);

0 commit comments

Comments
 (0)