Skip to content

Conversation

@pcwalton
Copy link
Contributor

This can break code like:

fn call_rec(f: |uint| -> uint) -> uint {
    (|x| f(x))(call_rec(f))
}

Change this code to use a temporary instead of violating the borrow
rules:

fn call_rec(f: |uint| -> uint) -> uint {
    let tmp = call_rec(|x| f(x)); f(tmp)
}

Closes #17144.

[breaking-change]

r? @huonw

This can break code like:

    fn call_rec(f: |uint| -> uint) -> uint {
        (|x| f(x))(call_rec(f))
    }

Change this code to use a temporary instead of violating the borrow
rules:

    fn call_rec(f: |uint| -> uint) -> uint {
        let tmp = call_rec(|x| f(x)); f(tmp)
    }

Closes rust-lang#17144.

[breaking-change]
bors added a commit that referenced this pull request Sep 13, 2014
This can break code like:

    fn call_rec(f: |uint| -> uint) -> uint {
        (|x| f(x))(call_rec(f))
    }

Change this code to use a temporary instead of violating the borrow
rules:

    fn call_rec(f: |uint| -> uint) -> uint {
        let tmp = call_rec(|x| f(x)); f(tmp)
    }

Closes #17144.

[breaking-change]

r? @huonw
@bors bors closed this Sep 13, 2014
@bors bors merged commit a9b929d into rust-lang:master Sep 13, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request May 19, 2024
fix: Fix implicit ty args being lowered where they shouldn't

Fixes rust-lang/rust-analyzer#17173
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.

Closure moved out inside own argument can be reborrowed after moving

3 participants