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

Const adjustments #5304

Closed
wants to merge 8 commits into from
Closed

Const adjustments #5304

wants to merge 8 commits into from

Conversation

jld
Copy link
Contributor

@jld jld commented Mar 10, 2013

These changes make const translation use adjustments (autodereference, autoreference, bare-fn-to-closure), like normal code does, replacing some ad-hoc logic that wasn't always right.

As a convenient side-effect, explicit dereference (both of pointers and of newtypes) is also supported in const expressions.

There is also a “bonus fix” for a bug in the pretty-printer exposed by one of the added tests.

jld added 8 commits March 9, 2013 17:40
Changes the ad-hoc closure adjustment into using adjustment info instead
of being separately driven from types, and likewise for autoderef.

Also takes care of autoref (the cases we should be seeing in consts,
at least, since we can't be doing method calls which would need the
ref-to-vec mode), which didn't quite work right previously.

However, "dereference" of a newtype isn't handled yet....
const-autoderef.rs is based on an example from jdm in IRC (but the
quadruple-pointer part is entirely my fault).
bors added a commit that referenced this pull request Mar 12, 2013
These changes make const translation use adjustments (autodereference, autoreference, bare-fn-to-closure), like normal code does, replacing some ad-hoc logic that wasn't always right.

As a convenient side-effect, explicit dereference (both of pointers and of newtypes) is also supported in const expressions.

There is also a “bonus fix” for a bug in the pretty-printer exposed by one of the added tests.
@bors bors closed this Mar 12, 2013
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
…=flip1995

Extend `redundant_clone` to the case that cloned value is not consumed

Fixes rust-lang#5303.

---

changelog: Extend `redundant_clone` to the case that cloned value is not consumed
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.

3 participants