Skip to content

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

Description

@nikomatsakis

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-lifetimesArea: Lifetimes / regions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions