Skip to content

Confusing error when forgetting #[fixed_stack_segment] #8825

Closed
@catamorphism

Description

I think this error message would be slightly confusing for a novice:

/Users/tjc/rust3/src/libstd/os.rs:2091:20: 2091:31 error: invoking non-Rust fn in fn without #[fixed_stack_segment] [-D cstack (default)]
/Users/tjc/rust3/src/libstd/os.rs:2091                     libc::fopen(fromp, modebuf)
                                                           ^~~~~~~~~~~

One way to read the error is that you should literally type #[fixed_stack_segment] [-D cstack (default)] in your code. Maybe there's a way to improve this error message to make it clearer that you have the choice of either using the fixed_stack_segment attribute, or the -D command-line flag. The error doesn't make it totally clear that the second thing-in-brackets is a command-line flag.

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions