Skip to content

include!'d source, when encountering a parse error, does not report-and-abort. #21146

Closed
@emberian

Description

@emberian

Testcase:

inc.rs:

afddafadsfasdfdasfaf
fn never_parsed() -> i32 { 42 }

main.rs:

include!("inc.rs");
fn main() { never_parsed(); }

Output:

csguest@itl:~/Downloads$ rustc main.rs
main.rs:4:2: 4:14 error: unresolved name `never_parsed`
main.rs:4   never_parsed();
            ^~~~~~~~~~~~
error: aborting due to previous error

Should output, instead, the parse errors from include!. Probably misplacing the diagnostic emitter somehow, when creating the nested parser for the included source, and doesn't have an abort_if_errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: The lexing & parsing of Rust source code to an ASTE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions