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

Implement return-by-reference #918

Closed
marijnh opened this issue Sep 14, 2011 · 0 comments
Closed

Implement return-by-reference #918

marijnh opened this issue Sep 14, 2011 · 0 comments

Comments

@marijnh
Copy link
Contributor

marijnh commented Sep 14, 2011

See https://mail.mozilla.org/pipermail/rust-dev/2011-July/000634.html for context. Opening this to track progress on the feature.

@ghost ghost assigned marijnh Sep 14, 2011
marijnh added a commit that referenced this issue Sep 14, 2011
marijnh added a commit that referenced this issue Sep 14, 2011
This will be used in the near future to decide what can safely
be done with the returned reference.

Issue #918
marijnh added a commit that referenced this issue Sep 15, 2011
marijnh added a commit that referenced this issue Sep 15, 2011
marijnh added a commit that referenced this issue Sep 15, 2011
marijnh added a commit that referenced this issue Sep 15, 2011
marijnh added a commit that referenced this issue Sep 15, 2011
    fn f(a: {x: str}) -> &str {
        ret a.x;
    }

    fn main() {
        let x = {x: "hi"};
        let &y = f(x); // Look ma, no copy!
        log_err y;
    }

Issue #918.
marijnh added a commit that referenced this issue Sep 15, 2011
The set of active bindings has to be updated as by-reference locals are
encountered.

Issue #918
marijnh added a commit that referenced this issue Sep 15, 2011
marijnh added a commit that referenced this issue Sep 15, 2011
This allows calls-returning-a-reference to count as expression roots,
making it possible to return the result of such a call by reference.

Issue #918
marijnh added a commit that referenced this issue Sep 16, 2011
It is now 1-based, rather than 0 based. (Seems more natural, and allows 0 to
be used to refer to self and maybe to closure.)

Also allows non-referenced args to be implicitly copied again.

Issue #918
@marijnh marijnh removed their assignment Jun 16, 2014
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
Implement incremental caching of object files
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
coastalwhite pushed a commit to coastalwhite/rust that referenced this issue Aug 5, 2023
Co-authored-by: Wang Maozhang <wangmaozhang@huawei.com>
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

No branches or pull requests

1 participant