diff options
| author | bors <bors@rust-lang.org> | 2014-07-17 22:16:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-17 22:16:23 +0000 |
| commit | e288fc6a996562c5e4aca46e22c1da46eb3d086b (patch) | |
| tree | 2f26793e5416aa2cef3b93760807543c0c6398d2 /src/libsyntax/parse/parser.rs | |
| parent | 36d6acc4eea7e305058511c3fda19d459095b7f8 (diff) | |
| parent | de70d76373e05fcf0f421cedb185b08de10a714c (diff) | |
| download | rust-e288fc6a996562c5e4aca46e22c1da46eb3d086b.tar.gz rust-e288fc6a996562c5e4aca46e22c1da46eb3d086b.zip | |
auto merge of #15515 : pcwalton/rust/cross-borrowing, r=alexcrichton
except where trait objects are involved.
Part of issue #15349, though I'm leaving it open for trait objects.
Cross borrowing for trait objects remains because it is needed until we
have DST.
This will break code like:
fn foo(x: &int) { ... }
let a = box 3i;
foo(a);
Change this code to:
fn foo(x: &int) { ... }
let a = box 3i;
foo(&*a);
[breaking-change]
r? @alexcrichton
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index bdfd928cfbc..a77f24f98f8 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -502,7 +502,9 @@ impl<'a> Parser<'a> { inedible: &[token::Token]) { debug!("commit_stmt {:?}", s); let _s = s; // unused, but future checks might want to inspect `s`. - if self.last_token.as_ref().map_or(false, |t| is_ident_or_path(*t)) { + if self.last_token + .as_ref() + .map_or(false, |t| is_ident_or_path(&**t)) { let expected = edible.iter().map(|x| (*x).clone()).collect::<Vec<_>>() .append(inedible.as_slice()); self.check_for_erroneous_unit_struct_expecting( |
