Skip to content

Set up compiletest to test the compiler diagnostics in error cases #2

@dtolnay

Description

@dtolnay

https://github.com/dtolnay/tt-call/tree/4e6d2504cfef3a78b4ab22b8df76a0f519b8f1cb/ui has a setup I like that should be easy to follow. I have some short source files:

#[macro_use]
extern crate tt_call;

tt_call! {
    macro = [{ parse_type }]
    input = [{ [T; ] }]
}

fn main() {}

and the expected compiler stderr for each one:

error: no rules expected the token `]`
 --> $DIR/type-array-no-len.rs:6:20
  |
6 |     input = [{ [T; ] }]
  |                    ^ no rules expected the token `]`

error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions