Skip to content

Typestate apparently doesn't handle loops... #819

Closed
@eholk

Description

@eholk
Contributor
fn test00_start(ch: _chan[int], message: int, count: int) {
    log "Starting test00_start";
    let i: int = 0;
    while i < count {
        log "Sending Message";
        send(ch, message);
        i = i + 1;
    }
    log "Ending test00_start";
}

send uses move-mode for the second argument, which means that message is deinitialized the second time through the loop. Typestate should catch this.

Activity

added a commit that references this issue on Aug 18, 2011
catamorphism

catamorphism commented on Aug 18, 2011

@catamorphism
Contributor

Actually, loops don't have anything to do with it. Typestate didn't handle move-mode arguments correctly at all. Just pushed a commit that fixes it.

added a commit that references this issue on Dec 12, 2017

Auto merge of rust-lang#819 - andrewtj:atj-rel, r=alexcrichton

added a commit that references this issue on Mar 7, 2023
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

        Participants

        @eholk@catamorphism

        Issue actions

          Typestate apparently doesn't handle loops... · Issue #819 · rust-lang/rust