Skip to content

Appending to a mutable vector in a hashmap doesn't update the vector #2039

@jdm

Description

@jdm
import std::map;
import std::map::hashmap;
use std;

type mut_elts = {mutable elts: [int]};

fn main() {
    let elts_hash = map::str_hash::();
    elts_hash.insert("foo", {mutable elts: []});
    elts_hash.get("foo").elts += [1];
    #error("%u", vec::len(elts_hash.get("foo").elts));
}

I would expect to see 1 printed, but instead I see 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions