Commit Graph

3536 Commits

Author SHA1 Message Date
徐未来
f138b90acb syn 1.0.107升级至2.0.48
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
2024-03-08 17:26:00 +08:00
openharmony_ci
295076b475
!2 Add OAT.xml and README.OpenSource
Merge pull request !2 from fangting/master
2023-04-14 08:10:45 +00:00
fangting
50ca1e86cb Add OAT.xml and README.OpenSource
Signed-off-by: fangting <fangting12@huawei.com>
2023-04-14 14:15:27 +08:00
openharmony_ci
9abdaddb10
!1 [syn]Add GN Build Files and Custom Modifications to Rust Third-party Libraries
Merge pull request !1 from lubinglun/master
2023-04-13 11:34:21 +00:00
lubinglun
ae9e8d79a3 Add GN Build Files and Custom Modifications
Issue:https://gitee.com/openharmony/build/issues/I6UFTP
Signed-off-by: lubinglun <lubinglun@huawei.com>
2023-04-12 17:27:08 +08:00
David Tolnay
4168f6bbdf
Release 1.0.107 2022-12-18 08:56:42 -08:00
David Tolnay
d8690f212e
Opt out -Zrustdoc-scrape-examples on docs.rs
I'd like a chance to audit all the code that rustdoc is inserting into
the docs. Currently I am skeptical that showing syn's internal usages of
APIs is a net benefit to the public documentation. I am also skeptical
that quite so many examples are needed, and that they should be featured
so prominently in comparison to handwritten docs. Lastly I wish there
were a way to turn this behavior off on a more granular basis.
2022-12-18 08:49:21 -08:00
David Tolnay
5306cdeb5f
Release 1.0.106 2022-12-17 12:03:30 -08:00
David Tolnay
6db337ce63
Update build status badge 2022-12-17 12:02:54 -08:00
David Tolnay
876a605f75
Merge pull request #1251 from dtolnay/instaloop
Fix invalid use of insta snapshot inside a loop
2022-12-03 13:28:05 -08:00
David Tolnay
65e0e4248e
Fix invalid use of insta snapshot inside a loop 2022-12-03 13:16:17 -08:00
David Tolnay
1d0902414b
Update test suite to nightly-2022-12-03 2022-12-02 18:51:37 -08:00
David Tolnay
998e86375b
Release 1.0.105 2022-11-30 23:51:49 -08:00
David Tolnay
02e2a2190b
Merge pull request #1247 from dtolnay/punctdrop
Infer may_dangle on type parameters of Punctuated iterator Drop impls
2022-11-30 23:44:48 -08:00
David Tolnay
9113ad0887
Help infer may_dangle on type parameter of Punctuated iterator Drop impls 2022-11-30 23:30:51 -08:00
David Tolnay
3eaa443c3a
Add regression test for issue 1246
error[E0505]: cannot move out of `p` because it is borrowed
      --> tests/test_iterators.rs:56:18
       |
    54 |     for element in &p {
       |                    --
       |                    |
       |                    borrow of `p` occurs here
       |                    a temporary with access to the borrow is created here ...
    55 |         if *element == 2 {
    56 |             drop(p);
       |                  ^ move out of `p` occurs here
    ...
    59 |     }
       |     - ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `syn::punctuated::Iter<'_, i32>`

    error[E0505]: cannot move out of `p` because it is borrowed
      --> tests/test_iterators.rs:64:18
       |
    62 |     for element in &mut p {
       |                    ------
       |                    |
       |                    borrow of `p` occurs here
       |                    a temporary with access to the borrow is created here ...
    63 |         if *element == 2 {
    64 |             drop(p);
       |                  ^ move out of `p` occurs here
    ...
    67 |     }
       |     - ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `syn::punctuated::IterMut<'_, i32>`
2022-11-30 22:37:38 -08:00
David Tolnay
17f9a5c566
Merge pull request #1245 from dtolnay/bounds
Improve dyn/impl-related parse errors
2022-11-30 22:11:53 -08:00
David Tolnay
db874ddf9b
Improve dyn/impl-related parse errors 2022-11-30 22:01:54 -08:00
David Tolnay
b8b0761cb8
Move TypeParamBound parse loop to associated function 2022-11-30 21:50:15 -08:00
David Tolnay
3e915e5c98
Clean up naming in rustc syntax tree manipulation 2022-11-28 19:15:42 -08:00
David Tolnay
ecacc475dd
Import token::Lit now there's no conflict with MetaItemLit 2022-11-28 19:11:45 -08:00
David Tolnay
2647b2a189
Update test suite to nightly-2022-11-29 2022-11-28 19:10:13 -08:00
David Tolnay
78fa618e96
Release 1.0.104 2022-11-27 17:42:18 -08:00
David Tolnay
e054b03a3b
Merge pull request #1244 from dtolnay/isnone
Make PathArguments::is_none() public
2022-11-27 17:41:41 -08:00
David Tolnay
3a0406db04
Make PathArguments::is_none() public 2022-11-27 17:32:31 -08:00
David Tolnay
ac1dbf5d85
Time out workflows after 45 minutes
GitHub's default timeout is 6 hours. Recently some of my GitHub Actions
jobs have started randomly stalling for that long, which is inconvenient
because it ties up a chunk of my runner quota. It apepars to be very
rare for a job to recover after stalling. It's better to time out
quicker and retry on a different runner.
2022-11-25 18:56:19 -08:00
David Tolnay
f510eb0ba9
Update test suite to nightly-2022-11-25 2022-11-24 18:53:32 -08:00
David Tolnay
20087fc51c
Update test suite to nightly-2022-11-24 2022-11-23 19:49:39 -08:00
David Tolnay
dbc86fe1ed
Suppress "emit":"dep-info" json from syn-test-suite-feature-check
Previously:

    NOTE:  use --release
      Syn's test suite has some tests that run on every source file
      and test case in the rust-lang/rust repo, which can be pretty
      slow in debug mode. Consider running cargo test with `--release`
      to speed things up.
    {"artifact":"/git/syn/target/debug/deps/syn_test_suite-695bcafef2321389.d","emit":"dep-info"}
2022-11-22 22:47:28 -08:00
David Tolnay
1e8227295e
Fix renamed let_underscore_drop lint
warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
       --> src/lib.rs:270:5
        |
    270 |     clippy::let_underscore_drop,
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
        |
        = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
      --> tests/crates/main.rs:13:10
       |
    13 | #![allow(clippy::let_underscore_drop)]
       |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
       |
       = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
     --> tests/features/macro/lib.rs:1:10
      |
    1 | #![allow(clippy::let_underscore_drop, clippy::toplevel_ref_arg)]
      |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
     --> tests/regression.rs:1:10
      |
    1 | #![allow(clippy::let_underscore_drop)]
      |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default
2022-11-22 22:38:08 -08:00
David Tolnay
754236dbe6
Update test suite to nightly-2022-11-23 2022-11-22 22:36:23 -08:00
David Tolnay
4245c41f22
Update test suite to nightly-2022-11-19 2022-11-18 22:11:00 -08:00
David Tolnay
1043106dc8
Update test suite to nightly-2022-11-18 2022-11-17 23:10:59 -08:00
David Tolnay
df8b10aa64
Update test suite to nightly-2022-11-13 2022-11-12 21:32:46 -08:00
David Tolnay
4c0ddcc84c
Ignore items_after_statements pedantic clippy lint
error: adding items after statements is confusing, since items exist from the start of the scope
       --> src/error.rs:139:9
        |
    139 | /         fn new(span: Span, message: String) -> Error {
    140 | |             Error {
    141 | |                 messages: vec![ErrorMessage {
    142 | |                     start_span: ThreadBound::new(span),
    ...   |
    146 | |             }
    147 | |         }
        | |_________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
        = note: `-D clippy::items-after-statements` implied by `-D clippy::pedantic`

    error: adding items after statements is confusing, since items exist from the start of the scope
       --> src/error.rs:167:9
        |
    167 | /         fn new_spanned(tokens: TokenStream, message: String) -> Error {
    168 | |             let mut iter = tokens.into_iter();
    169 | |             let start = iter.next().map_or_else(Span::call_site, |t| t.span());
    170 | |             let end = iter.last().map_or(start, |t| t.span());
    ...   |
    177 | |             }
    178 | |         }
        | |_________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements

    error: adding items after statements is confusing, since items exist from the start of the scope
       --> src/error.rs:301:5
        |
    301 | /     fn new2(start: Span, end: Span, message: String) -> Error {
    302 | |         Error {
    303 | |             messages: vec![ErrorMessage {
    304 | |                 start_span: ThreadBound::new(start),
    ...   |
    308 | |         }
    309 | |     }
        | |_____^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
2022-10-24 21:54:47 -07:00
David Tolnay
f4c1822b93
Move code of Error functions to non-generic functions 2022-10-24 21:52:01 -07:00
David Tolnay
4510c1b1ef
Resolve needless_borrow pedantic clippy lint
error: the borrowed expression implements the required traits
       --> tests/repo/mod.rs:191:43
        |
    191 |     let response = reqwest::blocking::get(&url)?.error_for_status()?;
        |                                           ^^^^ help: change this to: `url`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
        = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
2022-10-24 21:25:53 -07:00
David Tolnay
c29c2abf1b
Release 1.0.103 2022-10-20 14:38:12 -07:00
David Tolnay
8e81cad736
Merge pull request #1237 from dtolnay/partialord
Restrict PartialOrd comparison to only tokens in the same buffer
2022-10-20 14:36:53 -07:00
David Tolnay
8db5adbb2b
Ignore cast_possible_wrap pedantic clippy lint
error: casting `usize` to `isize` may wrap around the value
      --> src/buffer.rs:56:46
       |
    56 |                     entries.push(Entry::End(-(group_end_index as isize)));
       |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
       = note: `-D clippy::cast-possible-wrap` implied by `-D clippy::pedantic`

    error: casting `usize` to `isize` may wrap around the value
      --> src/buffer.rs:82:34
       |
    82 |         entries.push(Entry::End(-(entries.len() as isize)));
       |                                  ^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
2022-10-20 14:17:08 -07:00
David Tolnay
f6f7d8a6b3
Restrict PartialOrd comparison to only tokens in the same buffer 2022-10-20 14:07:35 -07:00
David Tolnay
8dd9b01c58
Touch up PR 1236 2022-10-20 13:41:59 -07:00
David Tolnay
2b3f742696
Merge pull request #1236 from CAD97/cursor-cmp
Implement `PartialOrd` for `Cursor`
2022-10-20 13:34:34 -07:00
Christopher Durham
f6a43aa4d6 Handle the case where verbatim enters a None group
Fixes #1235. As seen in that issue, a syntax node can actually cross the
border of a None-delimited group, due to such groups being transparent
to the parser in most cases. In the cases that this can occur, the
presence of the group is known to be semantically irrelevant, so we just
explicitly ignore the presence of the group.

It's important that we only ignore None-delimited groups when the
verbatim end requires entering the group, as such groups can have semantic
impact (such as grouping binary operator chains) in other positions.
2022-10-20 15:14:33 -05:00
Christopher Durham
e9fb6a9ea5 Implement PartialOrd for Cursor 2022-10-20 15:14:33 -05:00
Christopher Durham
26a605e565 Add test for Item::Verbatim splitting a None group
(see issue #1235)
2022-10-20 15:13:52 -05:00
David Tolnay
a807b16011
Update test suite to nightly-2022-10-13 2022-10-13 09:13:00 -07:00
David Tolnay
711cd8c3d4
Update test suite to nightly-2022-10-11 2022-10-10 22:11:03 -07:00
David Tolnay
e4127c706c
Release 1.0.102 2022-10-06 17:43:35 -07:00
David Tolnay
691fc0676c
Merge pull request #1230 from dtolnay/groupgeneric
Fix left shift after macro metavariable in type position
2022-10-06 17:42:47 -07:00