Commit Graph

3387 Commits

Author SHA1 Message Date
David Tolnay
2cb380eae6
Distinguish examples that have a conflicting package name
error: two packages named `example` in this workspace:
    - /git/syn/examples/lazy-static/example/Cargo.toml
    - /git/syn/examples/trace-var/example/Cargo.toml
2022-06-06 13:21:58 -07:00
David Tolnay
5ea8931523
Add all examples into top-level workspace 2022-06-06 13:21:50 -07:00
David Tolnay
cb8760bcdc
Release 1.0.96 2022-06-02 13:23:41 -07:00
David Tolnay
0f08f63cad
Merge pull request #1183 from dtolnay/punctmut
Add syn::punctuated::Pair::punct_mut
2022-06-02 13:22:52 -07:00
David Tolnay
45b10cbb6a
Add example of using pair.punct_mut() 2022-06-02 13:05:20 -07:00
David Tolnay
f6ab69cc48
Add syn::punctuated::Pair::punct_mut 2022-06-02 13:02:29 -07:00
David Tolnay
ded67c8920
Merge pull request #1181 from kianmeng/fix-typo
Fix typo
2022-05-30 08:20:53 -07:00
Kian-Meng Ang
e39a2045bf Fix typo 2022-05-30 18:58:59 +08:00
David Tolnay
f14a5721eb
Fix stmt_expr_attributes test 2022-05-25 08:31:45 -07:00
David Tolnay
952b1679a9
Categorize test exclusions from nightly-2022-05-24 2022-05-23 22:19:33 -07:00
David Tolnay
f4e9c62c55
Update the rust-lang/rust commit used for parser tests 2022-05-23 22:13:09 -07:00
David Tolnay
396aa225e8
Switch to imports_granularity=Item style for test rustc_ast imports
This avoids this large block of imports getting rewrapped every time
imports change, which made it hard to see what was being added/removed.
2022-05-23 22:08:09 -07:00
David Tolnay
9ccdbf1e7d
Update test suite to nightly-2022-05-24 2022-05-23 22:04:38 -07:00
David Tolnay
5b0adb164f
Merge lint lists
Lints move back and forth from pedantic to non-pedantic all the time, so
whatever is here is definitely out of date and not particularly
meaningful.
2022-05-21 19:55:20 -07:00
David Tolnay
6234202d22
Remove clippy lint allows that no longer trigger 2022-05-21 19:54:42 -07:00
David Tolnay
4951e8e87c
Use new name of eval order dependence lint
warning: lint `clippy::eval_order_dependence` has been renamed to `clippy::mixed_read_write_in_expression`
       --> src/lib.rs:261:5
        |
    261 |     clippy::eval_order_dependence,
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::mixed_read_write_in_expression`
        |
        = note: `#[warn(renamed_and_removed_lints)]` on by default
2022-05-21 19:46:11 -07:00
David Tolnay
0910d57f5a
Update test suite to nightly-2022-05-21 2022-05-20 21:57:02 -07:00
David Tolnay
7c9f307a71
Fix needless_borrow lint in test
error: this expression creates a reference which is immediately dereferenced by the compiler
       --> tests/common/eq.rs:572:38
        |
    572 |             is_escaped_literal_token(&token, unescaped) && trees.next().is_none()
        |                                      ^^^^^^ help: change this to: `token`
        |
        = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
2022-05-19 21:16:47 -07:00
David Tolnay
e077055f48
Update test suite to nightly-2022-05-20
error[E0277]: the trait bound `&rustc_ast::tokenstream::TokenTree: SpanlessEq` is not satisfied
       --> tests/common/eq.rs:510:16
        |
    510 |             if SpanlessEq::eq(&this, &other) {
        |                ^^^^^^^^^^^^^^ the trait `SpanlessEq` is not implemented for `&rustc_ast::tokenstream::TokenTree`
        |
        = help: the trait `SpanlessEq` is implemented for `rustc_ast::tokenstream::TokenTree`

    error[E0271]: type mismatch resolving `<CursorRef<'_> as Iterator>::Item == rustc_ast::tokenstream::TokenTree`
       --> tests/common/eq.rs:519:25
        |
    519 |                         doc_comment(*style, *symbol, &mut other_trees)
        |                         ^^^^^^^^^^^ expected enum `rustc_ast::tokenstream::TokenTree`, found `&rustc_ast::tokenstream::TokenTree`
        |
    note: required by a bound in `doc_comment`
       --> tests/common/eq.rs:537:31
        |
    534 | fn doc_comment(
        |    ----------- required by a bound in this
    ...
    537 |     trees: &mut impl Iterator<Item = TokenTree>,
        |                               ^^^^^^^^^^^^^^^^ required by this bound in `doc_comment`

    error[E0271]: type mismatch resolving `<CursorRef<'_> as Iterator>::Item == rustc_ast::tokenstream::TokenTree`
       --> tests/common/eq.rs:522:25
        |
    522 |                         doc_comment(*style, *symbol, &mut this_trees)
        |                         ^^^^^^^^^^^ expected enum `rustc_ast::tokenstream::TokenTree`, found `&rustc_ast::tokenstream::TokenTree`
        |
    note: required by a bound in `doc_comment`
       --> tests/common/eq.rs:537:31
        |
    534 | fn doc_comment(
        |    ----------- required by a bound in this
    ...
    537 |     trees: &mut impl Iterator<Item = TokenTree>,
        |                               ^^^^^^^^^^^^^^^^ required by this bound in `doc_comment`

    error[E0277]: can't compare `&Symbol` with `Symbol`
       --> tests/common/eq.rs:560:23
        |
    560 |         })) if symbol == sym::doc => {}
        |                       ^^ no implementation for `&Symbol == Symbol`
        |
        = help: the trait `PartialEq<Symbol>` is not implemented for `&Symbol`
        = help: the trait `PartialEq` is implemented for `Symbol`
2022-05-19 20:59:53 -07:00
David Tolnay
50805a96c5
Fix new broken_intra_doc_links warnings
warning: unresolved link to `parse_macro_input`
      --> src/error.rs:28:37
       |
    28 | /// When parsing macro input, the [`parse_macro_input!`] macro handles the
       |                                     ^^^^^^^^^^^^^^^^^^ no item named `parse_macro_input` in scope
       |
       = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
       = note: `macro_rules` named `parse_macro_input` exists in this crate, but it is not in scope at this link's location

    warning: unresolved link to `parse_macro_input`
       --> src/parse.rs:246:13
        |
    246 | /// - The [`parse_macro_input!`] macro if parsing input of a procedural macro;
        |             ^^^^^^^^^^^^^^^^^^ no item named `parse_macro_input` in scope
        |
        = note: `macro_rules` named `parse_macro_input` exists in this crate, but it is not in scope at this link's location

    warning: unresolved link to `parse_macro_input`
       --> src/error.rs:190:15
        |
    190 |     /// The [`parse_macro_input!`] macro provides a convenient way to invoke
        |               ^^^^^^^^^^^^^^^^^^ no item named `parse_macro_input` in scope
        |
        = note: `macro_rules` named `parse_macro_input` exists in this crate, but it is not in scope at this link's location
2022-05-16 22:01:12 -07:00
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