From de70d76373e05fcf0f421cedb185b08de10a714c Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 7 Jul 2014 16:35:15 -0700 Subject: librustc: Remove cross-borrowing of `Box` to `&T` from the language, 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] --- src/libsyntax/parse/parser.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libsyntax/parse/parser.rs') 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::>() .append(inedible.as_slice()); self.check_for_erroneous_unit_struct_expecting( -- cgit 1.4.1-3-g733a5