Commit Graph

3517 Commits

Author SHA1 Message Date
David Tolnay
f8acab5518
Release 1.0.95 2022-05-16 15:38:18 -07:00
David Tolnay
be107389d4
Replace unicode-xid with unicode-ident crate 2022-05-16 15:30:15 -07:00
David Tolnay
fd1a51c69f
Release 1.0.94 2022-05-12 22:26:58 -07:00
David Tolnay
f1396f5480
Yet another unused macro rules lint
warning: 1st rule of macro `generate_to_tokens` is never used
       --> src/macros.rs:120:5
        |
    120 |     (do_not_generate_to_tokens $($foo:tt)*) => ();
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `#[warn(unused_macro_rules)]` on by default

    warning: 2nd rule of macro `generate_to_tokens` is never used
       --> src/macros.rs:122:5
        |
    122 | /     (
    123 | |         ($($arms:tt)*) $tokens:ident $name:ident {
    124 | |             $(#[cfg $cfg_attr:tt])*
    125 | |             $(#[doc $($doc_attr:tt)*])*
    ...   |
    128 | |         }
    129 | |     ) => {
        | |_____^
2022-05-12 22:17:49 -07:00
David Tolnay
209165eac4
Merge unknown_lints + unused_macro_rules attribute 2022-05-12 22:04:35 -07:00
David Tolnay
2fc9b71c38
Format with rustfmt 1.4.38 2022-05-12 22:03:49 -07:00
David Tolnay
accffbff8b
Fix unused macro rule in no-default-features mode
warning: 1st rule of macro `ast_struct` is never used
     --> src/macros.rs:2:5
      |
    2 | /     (
    3 | |         [$($attrs_pub:tt)*]
    4 | |         struct $name:ident #full $($rest:tt)*
    5 | |     ) => {
      | |_____^
      |
      = note: `#[warn(unused_macro_rules)]` on by default
2022-05-12 22:03:19 -07:00
David Tolnay
e3798ce02c
Fix obsolete rule in ast_enum_of_structs
warning: 1st rule of macro `ast_enum_of_structs` is never used
      --> src/macros.rs:56:5
       |
    56 | /     (
    57 | |         $(#[$enum_attr:meta])*
    58 | |         $pub:ident $enum:ident $name:ident #$tag:ident $body:tt
    59 | |         $($remaining:tt)*
    60 | |     ) => {
       | |_____^
       |
       = note: `#[warn(unused_macro_rules)]` on by default
2022-05-12 21:48:52 -07:00
David Tolnay
16315f531f
Fix obsolete rule in check_keyword_matches
warning: 1st rule of macro `check_keyword_matches` is never used
       --> src/macros.rs:176:5
        |
    176 |     (struct struct) => {};
        |     ^^^^^^^^^^^^^^^
2022-05-12 21:46:24 -07:00
David Tolnay
189c60c649
Ignore unused_macro_rules warning in test macros
warning: 2nd rule of macro `snapshot_impl` is never used
      --> tests/macros/mod.rs:44:5
       |
    44 |     (($($expr:tt)*) as $t:ty, @$snapshot:literal) => {{
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(unused_macro_rules)]` on by default

    warning: 1st rule of macro `snapshot_impl` is never used
      --> tests/macros/mod.rs:37:5
       |
    37 |     (($expr:ident) as $t:ty, @$snapshot:literal) => {
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: 3rd rule of macro `snapshot_impl` is never used
      --> tests/macros/mod.rs:52:5
       |
    52 |     (($($expr:tt)*) , @$snapshot:literal) => {{
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: 2nd rule of macro `spanless_eq_enum` is never used
       --> tests/common/eq.rs:225:5
        |
    225 | /     {
    226 | |         $($name:ident)::+;
    227 | |         $([$($variant:ident)::+; $($fields:tt)*])*
    228 | |         $next:ident [$([$($named:tt)*])* $(![$ignore:tt])*] (!$i:tt $($field:tt)*)
    229 | |         $($rest:tt)*
    230 | |     } => {
        | |_____^
        |
        = note: `#[warn(unused_macro_rules)]` on by default
2022-05-12 21:45:06 -07:00
David Tolnay
11b4a93da6
Remove doc(hidden) attribute that is being phased out
warning: `#[doc(hidden)]` is ignored on trait impl items
        --> src/parse.rs:1220:5
         |
    1220 |     #[doc(hidden)]
         |     ^^^^^^^^^^^^^^ help: remove this attribute
         |
         = note: `#[warn(unused_attributes)]` on by default
         = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
         = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item

    warning: `#[doc(hidden)]` is ignored on trait impl items
        --> src/parse.rs:1236:5
         |
    1236 |     #[doc(hidden)]
         |     ^^^^^^^^^^^^^^ help: remove this attribute
         |
         = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
         = note: whether the impl item is `doc(hidden)` or not entirely depends on the corresponding trait item
2022-05-09 19:06:46 -07:00
David Tolnay
2e505a8471
Release 1.0.93 2022-05-09 18:45:02 -07:00
David Tolnay
16ef95e38a
Merge pull request #1171 from zakarumych/fix-some
Use Some from $crate
2022-05-09 18:44:23 -07:00
Zakarum
2775d48f41 Use Some from $crate 2022-05-09 19:16:48 +04:00
David Tolnay
63f6c9f768
Run miri in stricter miri-strict-provenance mode 2022-05-06 04:01:35 -07:00
David Tolnay
ca511d1ec8
Update test suite to nightly-2022-05-05 2022-05-04 20:10:41 -07:00
David Tolnay
fc09072fa9
Update test suite to nightly-2022-05-02 2022-05-01 20:40:14 -07:00
David Tolnay
995144555b
Resolve type_repetition_in_bounds clippy lint
error: this type has already been used as a bound predicate
       --> src/punctuated.rs:815:5
        |
    815 |     I: DoubleEndedIterator<Item = &'a T> + ExactSizeIterator<Item = &'a T> + Clone,
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `-D clippy::type-repetition-in-bounds` implied by `-D clippy::pedantic`
        = help: consider combining the bounds: `I: DoubleEndedIterator<Item = &'a T> + ExactSizeIterator<Item = &'a T> + Clone`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    error: this type has already been used as a bound predicate
       --> src/punctuated.rs:898:5
        |
    898 |     I: DoubleEndedIterator<Item = &'a mut T> + ExactSizeIterator<Item = &'a mut T>
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider combining the bounds: `I: DoubleEndedIterator<Item = &'a mut T> + ExactSizeIterator<Item = &'a mut T>`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
2022-04-30 20:42:39 -07:00
David Tolnay
3c07913978
Update test suite to nightly-2022-05-01 2022-04-30 20:31:38 -07:00
David Tolnay
a0cd03c41b
Drop unneeded quoting from env variable in workflows yaml 2022-04-28 19:29:12 -07:00
David Tolnay
069bdf5757
Release 1.0.92 2022-04-28 18:43:34 -07:00
David Tolnay
000c0a63bb
Punctuate Box->ptr comment in TokenBuffer constructor 2022-04-28 18:37:13 -07:00
David Tolnay
5d7d112123
Merge pull request #1166 from saethlin/raw-pointer-tagging
Avoid Box invalidation to be compatible with tag-raw-pointers
2022-04-28 18:36:59 -07:00
David Tolnay
b9b0685375
Update test suite to nightly-2022-04-29 2022-04-28 18:34:35 -07:00
Ben Kimock
95f242c525 Avoid Box invalidation, for tag-raw-pointers
It looks like the only outstanding issue aliasing issue in this repo
(with raw pointer tagging) was this one move of a Box after saving a
pointer to the allocation that the Box guards. This is UB according to
the Stacked Borrows with raw pointer tagging in combination with the way
rustc applies noalias to Box. As is often the case, the resolution here
is to convert the Box down to a raw pointer before a pointer into the
allocation is created.
2022-04-28 20:32:01 -04:00
David Tolnay
ff84ce09ac
Update workflows to actions/checkout@v3 2022-04-24 19:04:49 -07:00
David Tolnay
ce0335b5fb
Pull miri from miri branch of dtolnay/rust-toolchain 2022-04-24 15:45:43 -07:00
David Tolnay
15c9e9463c
Merge pull request #1162 from SOF3/patch-1
Added `dyn` to Type::TraitObject docs
2022-04-23 10:25:15 -07:00
Jonathan Chan Kwan Yin
8c3684e0b5
Added dyn to Type::TraitObject docs
The old syntax is now a compile error, and it makes it difficult for users to search when they are looking for the keyword "dyn" on the documentation.
2022-04-24 00:51:28 +08:00
David Tolnay
a94fde515f
Update test suite to nightly-2022-04-17 2022-04-16 23:50:57 -07:00
David Tolnay
fd145a99a7
Update test suite to nightly-2022-04-14 2022-04-13 20:12:29 -07:00
David Tolnay
9fd668c666
Un-export test suite macros
Eliminates a clippy lint:

    error: `crate` references the macro call's crate
      --> tests/macros/mod.rs:40:21
       |
    40 |         let $expr = crate::macros::Tokens::parse::<$t>($expr).unwrap();
       |                     ^^^^^ help: to reference the macro definition's crate, use: `$crate`
       |
       = note: `-D clippy::crate-in-macro-def` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
2022-04-09 00:41:31 -07:00
David Tolnay
13bf252482
Make benchmark work with nightly-2022-04-06 2022-04-05 21:13:37 -07:00
David Tolnay
d4536630a8
Avoid loading XID_Start table on ASCII-only input
#![feature(test)]

    extern crate test;

    use unicode_xid::UnicodeXID;

    #[bench]
    fn bench(b: &mut test::Bencher) {
        b.iter(|| {
            for _ in 0..1000 {
                let ident = test::black_box("is_xid_start");
                test::black_box(xid_ok(ident));
            }
        });
    }

    fn xid_ok(symbol: &str) -> bool {
        let mut chars = symbol.chars();
        let first = chars.next().unwrap();
        if !(first == '_' || UnicodeXID::is_xid_start(first)) {
            return false;
        }
        for ch in chars {
            if !UnicodeXID::is_xid_continue(ch) {
                return false;
            }
        }
        true
    }
2022-04-05 21:07:51 -07:00
David Tolnay
4ba41ef16a
Update test suite to nightly-2022-04-06 2022-04-05 20:53:51 -07:00
David Tolnay
31e969c911
Remove codepath in test_round_trip that is no longer reached
I haven't been able to get the most recent rustc to produce that
message anymore.
2022-04-05 20:21:58 -07:00
David Tolnay
183e344d8d
Release 1.0.91 2022-04-05 16:25:42 -07:00
David Tolnay
6ae1c80118
impl Parse for MethodTurbofish 2022-04-05 16:23:10 -07:00
David Tolnay
e1ffb0756a
impl Parse for GenericMethodArgument 2022-04-05 16:23:10 -07:00
David Tolnay
cef0d69b93
impl Parse for ExprAwait 2022-04-05 16:13:04 -07:00
David Tolnay
714f868821
Sort the Expr variants in impl_by_parsing_expr call 2022-04-05 16:12:48 -07:00
David Tolnay
d94e7f191b
Merge pull request #1158 from frank2/rangelimits-to-tokens
#1157 implement ToTokens for RangeLimits enum
2022-04-05 15:45:11 -07:00
frank2
72e6ffc681 #1157 implement ToTokens for RangeLimits enum 2022-04-05 15:27:40 -07:00
David Tolnay
86c9fa49f5
Merge pull request 1156 from ZuseZ4/patch-1 2022-04-05 13:18:57 -07:00
Manuel Drehwald
7e58d0240c
Improve lookahead documentation
Given that a colleague also was not able to spot my mistake on its own I know three people which missed the this issue.
It might be obvious for those with a better understanding so please feel free to reject (or reword) this proposal :)

https://discord.com/channels/273534239310479360/512792629516173323/960864849305432095
2022-04-05 21:43:49 +02:00
David Tolnay
a0f0bb3d62
Release 1.0.90 2022-03-28 09:36:06 -07:00
David Tolnay
be520c1dbe
Merge pull request #1067 from dtolnay/nonexhaustive
Switch non exhaustive syntax tree enums to use #[non_exhaustive]
2022-03-27 14:33:00 -07:00
David Tolnay
c6ce512015
Switch non exhaustive syntax tree enums to use #[non_exhaustive]
This follows through on the comments on the __TestExhaustive variants
promising that their purpose will be substituted with a deny(reachable)
rustc lint once one is available.

That lint is now landing as non_exhaustive_omitted_patterns in Rust 1.57.
The correct way to use it for checking exhaustivity of a match is:

    match expr {
        Expr::Array(e) => {...}
        Expr::Assign(e) => {...}
        ...
        Expr::Yield(e) => {...}

        #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
        _ => { /* some sane fallback */ }
    }
2022-03-27 14:19:01 -07:00
David Tolnay
390e0c12f4
Move path printing to a pub(crate) function 2022-03-27 14:18:26 -07:00
David Tolnay
d5450934f8
Fix up variable names in exhaustive matching idiom comments 2022-03-27 13:53:23 -07:00