diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 4df2b6ab3cff..9f478f7969f2 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1739,7 +1739,11 @@ fn parse_ty_param(p: parser) -> ast::ty_param { alt p.peek() { token::TILDE. { p.bump(); ast::kind_unique } token::AT. { p.bump(); ast::kind_shared } - _ { ast::kind_pinned } + _ { + if eat_word(p, "pinned") { ast::kind_pinned } + else if eat_word(p, "unique") { ast::kind_unique } + else { ast::kind_shared } + } }; ret {ident: parse_ident(p), kind: k}; } diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 91e3f2ffb599..e95ce36252f8 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -1193,8 +1193,8 @@ fn print_arg_mode(s: ps, m: ast::mode) { fn print_kind(s: ps, kind: ast::kind) { alt kind { - ast::kind_unique. { word(s.s, "~"); } - ast::kind_shared. { word(s.s, "@"); } + ast::kind_unique. { word_nbsp(s, "unique"); } + ast::kind_pinned. { word_nbsp(s, "pinned"); } _ {/* fallthrough */ } } } diff --git a/src/test/compile-fail/implicit-copy-2.rs b/src/test/compile-fail/implicit-copy-2.rs index fbdfa45ec8e1..4ff190ee405d 100644 --- a/src/test/compile-fail/implicit-copy-2.rs +++ b/src/test/compile-fail/implicit-copy-2.rs @@ -4,7 +4,7 @@ resource r(i: @mutable int) { *i = *i + 1; } -fn movearg(i: T) { +fn movearg(i: T) { // Implicit copy to mutate reference i let j <- i; } diff --git a/src/test/run-pass/resource-in-struct.rs b/src/test/run-pass/resource-in-struct.rs index 758beb3d9e12..f815fcfd534b 100644 --- a/src/test/run-pass/resource-in-struct.rs +++ b/src/test/run-pass/resource-in-struct.rs @@ -5,7 +5,7 @@ type closable = @mutable bool; resource close_res(i: closable) { *i = false; } -tag option { none; some(T); } +tag option { none; some(T); } fn sink(res: option) { }