Skip to content

Regression: methods that take self by value no longer assert against use-after-move with --debug #1669

@fitzgen

Description

@fitzgen

This used to generate "attempt to use moved value" checks in the glue for MyThing::take, but no longer does:

use wasm_bindgen::prelude::*;

#[wasm_bindgen]
pub struct MyThing {}

#[wasm_bindgen]
impl MyThing {
    pub fn new() -> MyThing {
        MyThing {}
    }

    pub fn take(self) {}
}

Free functions do still generate the check. Will dig in a little bit.

See also: rustwasm/wasm-pack#677

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcodegenIssues related to emitting code at the end of the wasm-bindgen pipelinejavascript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions