Skip to content

#inline(never) is not respected #73739

Closed as not planned
Closed as not planned
@jrmuizel

Description

@jrmuizel

I tried this code:

#[inline(never)]
fn demo(s: &str) -> &str {
    s
}

pub fn main() -> &'static str {
    demo("input string")
}

it compiles to:

example::main:
        lea     rax, [rip + .L__unnamed_1]
        mov     edx, 12
        ret

.L__unnamed_1:
        .ascii  "input string"

which has demo inlined into main

This worked properly in Rust 1.11 but broke in Rust 1.12 and remains broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationC-bugCategory: This is a bug.S-blockedStatus: Blocked on something else such as an RFC or other implementation work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions