Commit Graph

116 Commits

Author SHA1 Message Date
David Tolnay 8adf113f0a
Revert "Delete broken #[deprecated] test"
This reverts commit 8862629bcc.
2022-08-30 19:14:00 -07:00
David Tolnay e11c97babf
Update backtrace test to provider API 2022-08-30 19:08:59 -07:00
David Tolnay 986e106172
Revert "Disable nightly backtrace testing until converted to provider API"
This reverts commit c1fb583043.
2022-08-30 19:04:12 -07:00
David Tolnay 034c6ecf10
Update ui test suite to nightly-2022-08-24 2022-08-24 02:15:12 -07:00
David Tolnay 1442e27eaf
Remove stabilized feature(backtrace) from ui test 2022-08-10 21:18:11 -07:00
David Tolnay 0ac645e896
Update ui test suite to nightly-2022-08-11 2022-08-10 21:17:07 -07:00
David Tolnay c1fb583043
Disable nightly backtrace testing until converted to provider API 2022-08-02 20:46:44 -07:00
David Tolnay 24db929a56
Update ui test suite to nightly-2022-07-10 2022-07-09 19:50:13 -07:00
David Tolnay b338fe6ac1
Update ui test suite to nightly-2022-07-02 2022-07-01 19:30:59 -07:00
David Tolnay e82ff362db
Update ui test suite to nightly-2022-06-26 2022-06-25 22:55:12 -07:00
David Tolnay dd9206cfd0
Remove clippy deny attributes from test suite
These were superseded by the clippy invocation made in our CI workflow:

    run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
2022-04-24 15:22:58 -07:00
David Tolnay 625d349ffb
Disable ui test on miri 2022-04-24 15:20:06 -07:00
David Tolnay c4d7c2b135
Fix miscounting fields when from and backtrace are same field 2021-12-18 11:41:17 -08:00
David Tolnay 8602ca3dd2
Add ui test reproducing issue 163 2021-12-18 11:36:51 -08:00
David Tolnay 604e47ccbd
Ignore needless_late_init Clippy lint in test
error: unneeded late initalization
      --> tests/test_generics.rs:90:5
       |
    90 |     let mut instance: EnumCompound<DisplayOnly, DebugOnly, NoFormat>;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
    help: declare `instance` here
       |
    92 |     let mut instance: EnumCompound<DisplayOnly, DebugOnly, NoFormat> = EnumCompound::DisplayDebug(DisplayOnly, DebugOnly);
       |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-12-07 18:36:06 -08:00
David Tolnay 5a03b0a56b
Ignore iter_cloned_collect Clippy lint in test
error: called `iter().copied().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
      --> tests/test_expr.rs:18:30
       |
    18 |     #[error("#error {}", (.0).iter().copied().collect::<Vec<_>>().join(" "))]
       |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
2021-12-07 18:35:29 -08:00
David Tolnay b743d8f4ee
Update ui test suite to nightly-2021-10-17 2021-10-16 19:20:11 -07:00
David Tolnay 00956f1f8c
Ui test changes for trybuild 1.0.49 2021-10-08 03:02:01 -04:00
David Tolnay f072c626ef
Update ui test files 2021-10-07 00:32:11 -04:00
David Tolnay 791a98eb93
Update ui test suite to nightly-2021-10-07 2021-10-07 00:27:37 -04:00
David Tolnay 42d36e5806
Add test with generic transparent field 2021-09-04 19:38:00 -07:00
David Tolnay 1e6e267914
Implied bounds for Display and Error impl 2021-09-04 18:21:37 -07:00
David Tolnay 81b881063f
Add test of generic error types 2021-09-04 18:21:36 -07:00
David Tolnay e96e0d57d7
Revert "Ignore buggy nonstandard_macro_braces clippy lint"
This reverts commit 4bbe3ece51.
2021-09-04 12:41:36 -07:00
David Tolnay 6159aba3b7
Add test of #[from] on optional source 2021-08-28 15:43:30 -07:00
David Tolnay c45d7e4de8
Merge pull request 137 from astraw/combined-from-and-backtrace-field 2021-08-28 12:56:45 -07:00
David Tolnay 4bbe3ece51
Ignore buggy nonstandard_macro_braces clippy lint
Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422

    error: use of irregular braces for `write!` macro
     --> tests/test_backtrace.rs:5:10
      |
    5 | #[derive(Error, Debug)]
      |          ^^^^^
      |
      = note: `-D clippy::nonstandard-macro-braces` implied by `-D clippy::all`
    help: consider writing `Error`
     --> tests/test_backtrace.rs:5:10
      |
    5 | #[derive(Error, Debug)]
      |          ^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
      = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_lints.rs:13:21
       |
    13 |     #[derive(Debug, Error)]
       |                     ^^^^^
       |
       = note: `-D clippy::nonstandard-macro-braces` implied by `-D clippy::all`
    help: consider writing `Error`
      --> tests/test_lints.rs:13:21
       |
    13 |     #[derive(Debug, Error)]
       |                     ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
     --> tests/test_source.rs:7:10
      |
    7 | #[derive(Error, Debug)]
      |          ^^^^^
      |
    note: the lint level is defined here
     --> tests/test_source.rs:1:9
      |
    1 | #![deny(clippy::all, clippy::pedantic)]
      |         ^^^^^^^^^^^
      = note: `#[deny(clippy::nonstandard_macro_braces)]` implied by `#[deny(clippy::all)]`
    help: consider writing `Error`
     --> tests/test_source.rs:7:10
      |
    7 | #[derive(Error, Debug)]
      |          ^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
      = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_source.rs:13:10
       |
    13 | #[derive(Error, Debug)]
       |          ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_source.rs:13:10
       |
    13 | #[derive(Error, Debug)]
       |          ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_source.rs:21:10
       |
    21 | #[derive(Error, Debug)]
       |          ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_source.rs:21:10
       |
    21 | #[derive(Error, Debug)]
       |          ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_source.rs:54:18
       |
    54 |           #[derive(Error)]
       |                    ^^^^^
    ...
    64 | / error_from_macro! {
    65 | |     #[error("Something")]
    66 | |     Variant(#[from] io::Error)
    67 | | }
       | |_- in this macro invocation
       |
    help: consider writing `Error`
      --> tests/test_source.rs:54:18
       |
    54 |           #[derive(Error)]
       |                    ^^^^^
    ...
    64 | / error_from_macro! {
    65 | |     #[error("Something")]
    66 | |     Variant(#[from] io::Error)
    67 | | }
       | |_- in this macro invocation
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
     --> tests/test_expr.rs:9:10
      |
    9 | #[derive(Error, Debug)]
      |          ^^^^^
      |
    note: the lint level is defined here
     --> tests/test_expr.rs:1:9
      |
    1 | #![deny(clippy::all, clippy::pedantic)]
      |         ^^^^^^^^^^^
      = note: `#[deny(clippy::nonstandard_macro_braces)]` implied by `#[deny(clippy::all)]`
    help: consider writing `Error`
     --> tests/test_expr.rs:9:10
      |
    9 | #[derive(Error, Debug)]
      |          ^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
      = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_expr.rs:39:10
       |
    39 | #[derive(Error, Debug)]
       |          ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_expr.rs:39:10
       |
    39 | #[derive(Error, Debug)]
       |          ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
     --> tests/test_from.rs:6:10
      |
    6 | #[derive(Error, Debug)]
      |          ^^^^^
      |
    note: the lint level is defined here
     --> tests/test_from.rs:1:9
      |
    1 | #![deny(clippy::all, clippy::pedantic)]
      |         ^^^^^^^^^^^
      = note: `#[deny(clippy::nonstandard_macro_braces)]` implied by `#[deny(clippy::all)]`
    help: consider writing `Error`
     --> tests/test_from.rs:6:10
      |
    6 | #[derive(Error, Debug)]
      |          ^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
      = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_from.rs:13:10
       |
    13 | #[derive(Error, Debug)]
       |          ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_from.rs:13:10
       |
    13 | #[derive(Error, Debug)]
       |          ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
     --> tests/test_path.rs:8:10
      |
    8 | #[derive(Error, Debug)]
      |          ^^^^^
      |
    note: the lint level is defined here
     --> tests/test_path.rs:1:9
      |
    1 | #![deny(clippy::all, clippy::pedantic)]
      |         ^^^^^^^^^^^
      = note: `#[deny(clippy::nonstandard_macro_braces)]` implied by `#[deny(clippy::all)]`
    help: consider writing `Error`
     --> tests/test_path.rs:8:10
      |
    8 | #[derive(Error, Debug)]
      |          ^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
      = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_path.rs:14:10
       |
    14 | #[derive(Error, Debug, RefCast)]
       |          ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_path.rs:14:10
       |
    14 | #[derive(Error, Debug, RefCast)]
       |          ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_from.rs:17:10
       |
    17 | #[derive(Error, Debug)]
       |          ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_from.rs:17:10
       |
    17 | #[derive(Error, Debug)]
       |          ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_path.rs:21:10
       |
    21 | #[derive(Error, Debug)]
       |          ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_path.rs:21:10
       |
    21 | #[derive(Error, Debug)]
       |          ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_transparent.rs:14:14
       |
    14 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    note: the lint level is defined here
      --> tests/test_transparent.rs:1:9
       |
    1  | #![deny(clippy::all, clippy::pedantic)]
       |         ^^^^^^^^^^^
       = note: `#[deny(clippy::nonstandard_macro_braces)]` implied by `#[deny(clippy::all)]`
    help: consider writing `Error`
      --> tests/test_transparent.rs:14:14
       |
    14 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_from.rs:26:10
       |
    26 | #[derive(Error, Debug)]
       |          ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_from.rs:26:10
       |
    26 | #[derive(Error, Debug)]
       |          ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_transparent.rs:34:14
       |
    34 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_transparent.rs:34:14
       |
    34 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_transparent.rs:69:14
       |
    69 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_transparent.rs:69:14
       |
    69 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_display.rs:12:14
       |
    12 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    note: the lint level is defined here
      --> tests/test_display.rs:1:9
       |
    1  | #![deny(clippy::all, clippy::pedantic)]
       |         ^^^^^^^^^^^
       = note: `#[deny(clippy::nonstandard_macro_braces)]` implied by `#[deny(clippy::all)]`
    help: consider writing `Error`
      --> tests/test_display.rs:12:14
       |
    12 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_display.rs:24:14
       |
    24 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_display.rs:24:14
       |
    24 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_display.rs:35:14
       |
    35 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_display.rs:35:14
       |
    35 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_display.rs:44:14
       |
    44 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_display.rs:44:14
       |
    44 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_display.rs:53:14
       |
    53 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_display.rs:53:14
       |
    53 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_display.rs:70:14
       |
    70 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_display.rs:70:14
       |
    70 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_display.rs:84:14
       |
    84 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_display.rs:84:14
       |
    84 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
      --> tests/test_display.rs:98:14
       |
    98 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    help: consider writing `Error`
      --> tests/test_display.rs:98:14
       |
    98 |     #[derive(Error, Debug)]
       |              ^^^^^
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:107:14
        |
    107 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:107:14
        |
    107 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:115:14
        |
    115 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:115:14
        |
    115 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:129:14
        |
    129 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:129:14
        |
    129 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:158:14
        |
    158 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:158:14
        |
    158 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:170:14
        |
    170 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:170:14
        |
    170 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:184:14
        |
    184 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:184:14
        |
    184 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:201:14
        |
    201 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:201:14
        |
    201 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:214:29
        |
    214 |             #[derive(Debug, Error)]
        |                             ^^^^^
    ...
    228 |     decl_error!(Repro(u8));
        |     ----------------------- in this macro invocation
        |
    help: consider writing `Error`
       --> tests/test_display.rs:214:29
        |
    214 |             #[derive(Debug, Error)]
        |                             ^^^^^
    ...
    228 |     decl_error!(Repro(u8));
        |     ----------------------- in this macro invocation
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:220:29
        |
    220 |             #[derive(Debug, Error)]
        |                             ^^^^^
    ...
    228 |     decl_error!(Repro(u8));
        |     ----------------------- in this macro invocation
        |
    help: consider writing `Error`
       --> tests/test_display.rs:220:29
        |
    220 |             #[derive(Debug, Error)]
        |                             ^^^^^
    ...
    228 |     decl_error!(Repro(u8));
        |     ----------------------- in this macro invocation
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:236:14
        |
    236 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:236:14
        |
    236 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:247:14
        |
    247 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:247:14
        |
    247 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:258:14
        |
    258 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:258:14
        |
    258 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: use of irregular braces for `write!` macro
       --> tests/test_display.rs:269:14
        |
    269 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
    help: consider writing `Error`
       --> tests/test_display.rs:269:14
        |
    269 |     #[derive(Error, Debug)]
        |              ^^^^^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonstandard_macro_braces
        = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
2021-07-02 21:05:58 -07:00
Andrew Straw cd2b9db3aa fixup tests for combined from and backtrace 2021-06-13 09:44:18 +02:00
Andrew Straw 52dc286e79 test combined `#[from]` and `#[backtrace]` 2021-06-12 17:03:49 +02:00
David Tolnay 8862629bcc
Delete broken #[deprecated] test
Issue #136 tracks making this work again, or tracking down whatever
broke this in nightly.
2021-06-03 21:33:27 -07:00
David Tolnay 51a1ff6593
Add regression test for issue 113
This does not currently compile.

    error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
      --> tests/test_transparent.rs:63:14
       |
    63 |     #[derive(Error, Debug)]
       |              ^^^^^
       |
    note: first, the lifetime cannot outlive the lifetime `'a` as defined on the impl at 65:18...
      --> tests/test_transparent.rs:65:18
       |
    65 |     struct Error<'a> {
       |                  ^^
    note: ...so that the types are compatible
      --> tests/test_transparent.rs:63:14
       |
    63 |     #[derive(Error, Debug)]
       |              ^^^^^
       = note: expected `&test_non_static::ErrorKind<'_>`
                  found `&test_non_static::ErrorKind<'a>`
       = note: but, the lifetime must be valid for the static lifetime...
    note: ...so that the type `test_non_static::ErrorKind<'_>` will meet its required lifetime bounds
      --> tests/test_transparent.rs:63:14
       |
    63 |     #[derive(Error, Debug)]
       |              ^^^^^
       = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
2021-05-22 14:28:48 -07:00
David Tolnay ee2a47d3af
Adjust macro hygiene test formatting
Different versions of rustfmt mangle this all different ways.
2021-05-22 14:28:15 -07:00
David Tolnay c610d97267
Update ui test suite to nightly-2021-05-14 2021-05-13 19:15:14 -07:00
Aaron Hill 0fa679b1b8
Consistently use `quote!` when emitting 'source'
When a macro generates part of the derive input, the call-site hygiene
may be different than the hygiene of a field. Therefore, we need to
be sure to use the same hygiene information for any identifiers we
generate, instead of relying on the hygiene from a particular span
via `quote_spanned!`
2021-02-18 12:40:04 -05:00
David Tolnay d0f521c208
Update ui test suite to nightly-2021-01-29 2021-01-28 18:37:39 -08:00
David Tolnay d30890b4f7
Add ui test of Generic<&'a str> source 2020-12-26 17:33:51 -08:00
David Tolnay d31d96bba2
Add justification to non-static lifetime diagnostic 2020-12-26 17:27:02 -08:00
David Tolnay 464a409608
Tweak placement of diagnostic on non-static lifetimes in source 2020-12-26 17:25:34 -08:00
David Tolnay 25c73d7cdf
Add test of keyword fmt argument
Presently crashes with:

    error: proc-macro derive panicked
       --> tests/test_display.rs:269:14
        |
    269 |     #[derive(Error, Debug)]
        |              ^^^^^
        |
        = help: message: called `Result::unwrap()` on an `Err` value: Error("expected identifier")
2020-11-03 16:32:15 -08:00
David Tolnay 7a9066f000
Condense raw identifier unit tests 2020-11-03 16:31:08 -08:00
ninevra 281ff9136e Test collision with user-defined named params 2020-11-03 15:10:09 -08:00
ninevra 207b240f8f Add tests of raw idents in error() format strings 2020-11-03 14:41:23 -08:00
David Tolnay fbe9804476
Provide suggestion for anyone grepping for concat 2020-10-17 11:00:59 -07:00
David Tolnay 04d2e6c998
Pick up more specific string literal error message 2020-10-17 10:59:56 -07:00
David Tolnay 3ed6e38cc8
Add ui test of unexpected display expression 2020-10-17 10:37:43 -07:00
David Tolnay 256576e718
Add test of capturing Arc<Backtrace> 2020-10-06 16:49:01 -07:00
David Tolnay f83eb46586
Add test of capturing Backtrace/Option<Backtrace> in a From impl 2020-10-06 16:43:09 -07:00
David Tolnay bd459c8cf3
Add test involving Arc<Backtrace> 2020-10-06 16:15:37 -07:00
David Tolnay 04b91d7646
Change ui tests to work whether or not rust-src is installed 2020-09-04 23:39:02 -07:00
David Tolnay 663d835689
Update ui tests to nightly-2020-09-05 2020-09-04 23:31:10 -07:00