Commit Graph

359 Commits

Author SHA1 Message Date
David Tolnay 1b0a84996b
Release 1.0.24 2021-02-18 20:25:18 -08:00
David Tolnay d81b7466bc
Merge pull request 121 from Aaron1011/fix/source-span 2021-02-18 20:15:06 -08: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 c09ddc2241
Fix catching clippy warnings as CI failures 2021-01-04 23:52:19 -08:00
David Tolnay dc3c5c6a87
Resolve clippy filter_map_next pedantic lint 2020-12-29 16:24:38 -08:00
David Tolnay 25f0be5e8f
Inform clippy of supported compiler version in clippy.toml 2020-12-29 16:23:19 -08:00
David Tolnay c0a56fefbe
Opt in to pedantic clippy lints 2020-12-29 16:22:54 -08:00
David Tolnay d263b4b7e4
Release 1.0.23 2020-12-26 17:37:45 -08:00
David Tolnay da6ee81909
Merge pull request #116 from dtolnay/lifetime
Detect non-static lifetime behind reference type parameter
2020-12-26 17:37:17 -08:00
David Tolnay d30890b4f7
Add ui test of Generic<&'a str> source 2020-12-26 17:33:51 -08:00
David Tolnay 0859205018
Detect non-static lifetime behind reference type parameter 2020-12-26 17:29:46 -08:00
David Tolnay cb3077c315
Merge pull request #115 from dtolnay/lifetime
Add justification to non-static lifetime diagnostic
2020-12-26 17:29:35 -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 a789be4219
Add import to make i32::MAX available on rustc <1.43
#110
2020-11-20 11:55:51 -08:00
David Tolnay 1969f03a6e
Merge pull request #110 from faern/use-newer-int-consts
Use i32::MAX instead of i32::max_value()
2020-11-20 11:54:45 -08:00
Linus Färnstrand a8c8594ae5 Use i32::MAX instead of i32::max_value() 2020-11-20 20:33:49 +01:00
David Tolnay 09f247adda
Release 1.0.22 2020-11-03 16:47:44 -08:00
David Tolnay 53bb2fbf98
Merge pull request #109 from dtolnay/keyword
Fix keyword as fmt argument
2020-11-03 16:47:17 -08:00
David Tolnay aafcf0a1b6
Fix second place that keyword fmt argument is failing 2020-11-03 16:41:37 -08:00
David Tolnay 2722f8e2c3
Fix first place that keyword fmt argument is failing 2020-11-03 16:38:35 -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
David Tolnay 334fed3a74
Briefer naming convention for raw identifier format vars 2020-11-03 16:27:28 -08:00
David Tolnay dbbd0f816c
Consolidate ident lex and conversion to Ident 2020-11-03 16:26:24 -08:00
David Tolnay 227ef7df76
Replace use of str::strip_prefix
Strip_prefix was introduced in Rust 1.45, whereas we support older compilers.
2020-11-03 16:23:05 -08:00
David Tolnay 7014b69e1a
Merge pull request #108 from ninevra/raw-idents
Support raw-identifier fields in format strings
2020-11-03 16:20:33 -08:00
ninevra 5fc018d195 Prefix raw field named params with "raw_field_"
Reduces likelihood of collision with user-defined named parameters.
2020-11-03 15:21:46 -08:00
ninevra 281ff9136e Test collision with user-defined named params 2020-11-03 15:10:09 -08:00
ninevra 9d274d433e Support raw idents in error() format strings 2020-11-03 14:42:35 -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 f757a0489b
Release 1.0.21 2020-10-06 16:55:43 -07:00
David Tolnay 56a4fa620b
Merge pull request #102 from dtolnay/arc-backtrace-from
Generalize backtrace capture to From<Backtrace> types, including Arc<Backtrace>
2020-10-06 16:55:27 -07:00
David Tolnay c6dcc694ba
Generalize backtrace capture to From<Backtrace> 2020-10-06 16:49:02 -07:00
David Tolnay 256576e718
Add test of capturing Arc<Backtrace> 2020-10-06 16:49:01 -07:00
David Tolnay 1baf746f7d
Merge pull request #101 from dtolnay/backtrace-from
Add test of capturing Backtrace/Option<Backtrace> in a From impl
2020-10-06 16:48:54 -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 bf947a2945
Merge pull request #100 from dtolnay/arc-backtrace
Add test involving Arc<Backtrace>
2020-10-06 16:39:27 -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
David Tolnay 2a7b7abbb7
Suppress option_if_let_else clippy pedantic lint in test 2020-07-15 18:47:18 -07:00
David Tolnay de996c863d
Update ui tests to nightly-2020-07-06 2020-07-06 19:18:54 -07:00
David Tolnay 42b537acf0
Release 1.0.20 2020-06-15 16:22:15 -07:00
David Tolnay f42549e0ef
Work around test suite warning in rustc older than 1.39
Apparently this is fine in 1.39 and up, but older compilers warn.

    warning: enum is never used: `Error`
       --> tests/test_display.rs:151:5
        |
    151 |     pub enum Error {}
        |     ^^^^^^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default

    warning: struct is never constructed: `MyError`
      --> tests/test_lints.rs:15:5
       |
    15 |     pub struct MyError;
       |     ^^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(dead_code)]` on by default
2020-06-15 16:21:48 -07:00
David Tolnay bcb60bd1b5
Merge pull request #92 from dtolnay/qual
Suppress unused_qualifications lint
2020-06-15 16:21:40 -07:00