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

Write guards on auto-sliced index expressions probably do not work #6272

Closed
nikomatsakis opened this issue May 6, 2013 · 1 comment
Closed
Labels
A-codegen Area: Code generation A-lifetimes Area: lifetime related

Comments

@nikomatsakis
Copy link
Contributor

I am pretty sure that the logic is slightly wrong if you have a program like this:

let y = @mut [3];
let x: ~[@mut [int]] = ~[y];
take_imm_slice(x[0]);

fn take_imm_slice<'a>(v: &[int]) { ... }

note here that the result of x[0] is being auto-sliced. The fix is to use an "derefs" count of 1 for auto-slicing, I think, but I did not want to disturb the currently working code with this change until I can land the current version.

cc #5074

nikomatsakis added a commit to nikomatsakis/rust that referenced this issue May 9, 2013
bors added a commit that referenced this issue May 9, 2013
…=graydon

Fix #6355 and #6272---we were not giving the correct index to the derefs that occur as part of the rooting process, resulting in extra copies and generally bogus behavior. Haven't quite produced the right test for this, but I thought I'd push the fix in the meantime. Test will follow shortly.

r? @graydon
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue May 9, 2013
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue May 9, 2013
@nikomatsakis
Copy link
Contributor Author

fixed in PR #6373

Aatch pushed a commit to Aatch/rust that referenced this issue May 12, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 20, 2020
…r=llogiq

Fix unnecessary_lazy_eval suggestion applicability

changelog: Fix unnecessary_lazy_eval suggestion applicability when breaking type inference

Fixes rust-lang#6240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-lifetimes Area: lifetime related
Projects
None yet
Development

No branches or pull requests

1 participant