Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librustc: Remove cross-borrowing of Box<T> to &T from the language, #15515

Merged
merged 1 commit into from
Jul 17, 2014

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Jul 7, 2014

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

except where trait objects are involved.

Part of issue rust-lang#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]
bors added a commit that referenced this pull request Jul 17, 2014
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
@bors bors closed this Jul 17, 2014
@bors bors merged commit de70d76 into rust-lang:master Jul 17, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 11, 2023
…eykril

Check if lhs is also a binexpr and use its rhs in flip binexpr assist

Closes rust-lang#15508

From the original PR, flip binexpr assist is not meant to preserve equivalence, so I went with the simplest solution here.

I can add some extra checks to keep equivalence, but I think they should go in different specific assists (eg. flip arith op / flip logic op / etc), otherwise this one will get out of hand pretty quickly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants