Skip to content

ARC needs to enforce that its parameter is in the const kind #2458

Closed
@erickt

Description

@erickt
use std;
import std::arc;

fn main() {
    let i = @5;
    let arc_i = arc::arc(i);

    task::spawn { ||
        let i = *arc::get(&arc_i);
        #error("%?", i);
    }
}

Errors with:

Unreclaimed object found at 0x100600040: 5
rust: "@5"
Assertion failed: (false && "live_allocs < 1"), function free, file /Users/etryzelaar/Projects/rust/rust/src/rt/memory_region.cpp, line 60.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions