Skip to content

Generic vector reads read from the wrong place #301

Closed

Description

@pcwalton

Test case:

fn get[T](vec[T] v) -> T {
    ret v.(1);
}

fn main() {
    auto v = vec(1, 2, 3, 4, 5);
    log get(v);
}

Result:

[pwalton@fireferret ~/Source/rust/build] ./a.out
rt: ---
rt: 12ed:main:main:                       rust: 33554432 (0x2000000)

ret v.(0) works, so looks like we're miscalculating vec element size.

Activity

  1. pcwalton commented on Mar 31, 2011

    @pcwalton
    ContributorAuthor

    Fixed by 7f3f66d.

  2. added a commit that references this issue on Sep 19, 2017
  3. added a commit that references this issue on Dec 12, 2017
  4. added a commit that references this issue on Oct 9, 2023
  5. added a commit that references this issue on Jun 4, 2024
    e4a90e9
  6. added a commit that references this issue on Aug 21, 2026
  7. added a commit that references this issue on Nov 14, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions