Skip to content

Handle MIR FOR CTFE functions #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bbyalcinkaya opened this issue Feb 27, 2023 · 1 comment
Closed

Handle MIR FOR CTFE functions #62

bbyalcinkaya opened this issue Feb 27, 2023 · 1 comment

Comments

@bbyalcinkaya
Copy link
Member

rustc produces duplicate functions for compile-time function evaluation (CTFE).

Example: ui/attrs-resolution.mir

fn FooEnum::Bar(_1: i32) -> FooEnum {
    let mut _0: FooEnum;                 // return place in scope 0 at ui/attrs-resolution.rs:5:5: 5:8

    bb0: {
        _0 = FooEnum::Bar(move _1);      // scope 0 at ui/attrs-resolution.rs:5:5: 5:8
        return;                          // scope 0 at ui/attrs-resolution.rs:5:5: 5:8
    }
}

// MIR FOR CTFE
fn FooEnum::Bar(_1: i32) -> FooEnum {
    let mut _0: FooEnum;                 // return place in scope 0 at ui/attrs-resolution.rs:5:5: 5:8

    bb0: {
        _0 = FooEnum::Bar(move _1);      // scope 0 at ui/attrs-resolution.rs:5:5: 5:8
        return;                          // scope 0 at ui/attrs-resolution.rs:5:5: 5:8
    }
}
@yanliu18
Copy link
Contributor

Merge to issue #65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants