Skip to content

Segfault from incorrect capture #4679

@brson

Description

@brson

I've hit this several times recently.

use core::pipes::*;

fn main() {
    let (po, ch) = stream();
    let ch = SharedChan(ch);

    for 100.times {
        do task::spawn {
            // ch should not be copyable
            ch.send(());
        }
    }
}

Metadata

Metadata

Assignees

Labels

A-lifetimesArea: Lifetimes / regionsA-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

Relationships

None yet

Development

No branches or pull requests

Issue actions