Commit Graph

537 Commits

Author SHA1 Message Date
David Tolnay
71225477bd
Release 1.0.103 2023-08-05 15:42:00 -07:00
David Tolnay
04622483f9
Release 1.0.102 2023-07-20 22:24:53 -07:00
David Tolnay
21e07fc0a6
Opt in to generate-link-to-definition when building on docs.rs 2023-07-20 22:24:14 -07:00
David Tolnay
3655e476ad
Release 1.0.101 2023-07-17 21:55:31 -07:00
David Tolnay
28954ac642
Suppress incorrect_partial_ord_impl_on_ord_type lint within generated code
warning: incorrect implementation of `partial_cmp` on an `Ord` type
      --> tests/ffi/lib.rs:27:43
       |
    27 |     #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
       |                                           ^^^^^^^^^^ help: change this to: `{ Some(self.cmp(other)) }`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type
       = note: `-W clippy::incorrect-partial-ord-impl-on-ord-type` implied by `-W clippy::all`

    warning: incorrect implementation of `partial_cmp` on an `Ord` type
      --> tests/ffi/lib.rs:37:27
       |
    37 |     #[derive(Debug, Hash, PartialOrd, Ord)]
       |                           ^^^^^^^^^^ help: change this to: `{ Some(self.cmp(other)) }`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type

    warning: incorrect implementation of `partial_cmp` on an `Ord` type
      --> tests/ffi/lib.rs:89:69
       |
    89 |     #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
       |                                                                     ^^^^^^^^^^ help: change this to: `{ Some(self.cmp(other)) }`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type
2023-07-17 21:37:35 -07:00
David Tolnay
155d6772bc
Release 1.0.100 2023-07-06 12:49:38 -07:00
David Tolnay
bcc8d8c990
Suppress items_after_statements pedantic clippy lint inside generated code
warning: adding items after statements is confusing, since items exist from the start of the scope
      --> demo/src/main.rs:15:12
       |
    15 |         fn next_chunk(buf: &mut MultiBuf) -> &[u8];
       |            ^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
       = note: `-W clippy::items-after-statements` implied by `-W clippy::pedantic`
2023-07-06 12:41:08 -07:00
David Tolnay
718eacac67
Resolve unnested_or_patterns pedantic clippy lint
warning: unnested or-patterns
      --> gen/src/check.rs:19:20
       |
    19 |             if let Some(Component::CurDir) | Some(Component::ParentDir) = first_component {
       |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
       = note: `-W clippy::unnested-or-patterns` implied by `-W clippy::pedantic`
    help: nest the patterns
       |
    19 |             if let Some(Component::CurDir | Component::ParentDir) = first_component {
       |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> gen/src/write.rs:208:17
        |
    208 | /                 Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(I8) | Some(I16) | Some(I32)
    209 | |                 | Some(I64) => out.include.cstdint = true,
        | |___________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    208 |                 Some(U8 | U16 | U32 | U64 | I8 | I16 | I32 | I64) => out.include.cstdint = true,
        |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> gen/src/write.rs:214:17
        |
    214 |                 Some(Bool) | Some(Char) | Some(F32) | Some(F64) | None => {}
        |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    214 |                 Some(Bool | Char | F32 | F64) | None => {}
        |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> gen/src/write.rs:851:9
        |
    851 |         Some(Type::Str(_)) | Some(Type::SliceRef(_)) if !indirect_return => write!(out, ")"),
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    851 |         Some(Type::Str(_) | Type::SliceRef(_)) if !indirect_return => write!(out, ")"),
        |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
        --> gen/src/write.rs:1185:9
         |
    1185 |         Some(Type::RustBox(ty)) | Some(Type::UniquePtr(ty)) => {
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
         |
    1185 |         Some(Type::RustBox(ty) | Type::UniquePtr(ty)) => {
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
        --> gen/src/write.rs:1196:9
         |
    1196 |         Some(Type::Str(_)) | Some(Type::SliceRef(_)) => {
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
         |
    1196 |         Some(Type::Str(_) | Type::SliceRef(_)) => {
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> syntax/check.rs:126:17
        |
    126 | /                 None | Some(Bool) | Some(Char) | Some(U8) | Some(U16) | Some(U32) | Some(U64)
    127 | |                 | Some(Usize) | Some(I8) | Some(I16) | Some(I32) | Some(I64) | Some(Isize)
    128 | |                 | Some(F32) | Some(F64) | Some(RustString) => return,
        | |__________________________________________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    126 ~                 None |
    127 + Some(Bool | Char | U8 | U16 | U32 | U64 | Usize | I8 | I16 | I32 | I64 | Isize
    128 ~ | F32 | F64 | RustString) => return,
        |

    warning: unnested or-patterns
       --> syntax/check.rs:165:13
        |
    165 | /             None | Some(Bool) | Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(Usize)
    166 | |             | Some(I8) | Some(I16) | Some(I32) | Some(I64) | Some(Isize) | Some(F32)
    167 | |             | Some(F64) | Some(CxxString) => return,
        | |_________________________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    165 ~             None |
    166 + Some(Bool | U8 | U16 | U32 | U64 | Usize | I8 | I16 | I32 | I64 | Isize | F32
    167 ~ | F64 | CxxString) => return,
        |

    warning: unnested or-patterns
       --> syntax/check.rs:168:13
        |
    168 |             Some(Char) | Some(RustString) => {}
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    168 |             Some(Char | RustString) => {}
        |             ~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> syntax/check.rs:186:13
        |
    186 | /             None | Some(Bool) | Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(Usize)
    187 | |             | Some(I8) | Some(I16) | Some(I32) | Some(I64) | Some(Isize) | Some(F32)
    188 | |             | Some(F64) | Some(CxxString) => return,
        | |_________________________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    186 ~             None |
    187 + Some(Bool | U8 | U16 | U32 | U64 | Usize | I8 | I16 | I32 | I64 | Isize | F32
    188 ~ | F64 | CxxString) => return,
        |

    warning: unnested or-patterns
       --> syntax/check.rs:189:13
        |
    189 |             Some(Char) | Some(RustString) => {}
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    189 |             Some(Char | RustString) => {}
        |             ~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> syntax/check.rs:210:13
        |
    210 | /             None | Some(U8) | Some(U16) | Some(U32) | Some(U64) | Some(Usize) | Some(I8)
    211 | |             | Some(I16) | Some(I32) | Some(I64) | Some(Isize) | Some(F32) | Some(F64)
    212 | |             | Some(CxxString) => return,
        | |_____________________________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    210 ~             None |
    211 + Some(U8 | U16 | U32 | U64 | Usize | I8 | I16 | I32 | I64 | Isize | F32 | F64 |
    212 ~ CxxString) => return,
        |

    warning: unnested or-patterns
       --> syntax/check.rs:214:13
        |
    214 |             Some(Bool) | Some(RustString) => {}
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    214 |             Some(Bool | RustString) => {}
        |             ~~~~~~~~~~~~~~~~~~~~~~~

    warning: unnested or-patterns
       --> gen/build/src/lib.rs:458:21
        |
    458 |                     Some("h") | Some("hh") | Some("hpp") => {}
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
    help: nest the patterns
        |
    458 |                     Some("h" | "hh" | "hpp") => {}
        |                     ~~~~~~~~~~~~~~~~~~~~~~~~
2023-07-06 12:29:28 -07:00
David Tolnay
7a5c69f405
Resolve semicolon_if_nothing_returned pedantic clippy lint
warning: consider adding a `;` to the last statement for consistent formatting
       --> gen/src/write.rs:132:17
        |
    132 |                 check_trivial_extern_type(out, ety, reasons)
        |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `check_trivial_extern_type(out, ety, reasons);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
        = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`

    warning: consider adding a `;` to the last statement for consistent formatting
      --> syntax/parse.rs:45:17
       |
    45 |                 parse_foreign_mod(cx, foreign_mod, &mut apis, trusted, namespace)
       |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `parse_foreign_mod(cx, foreign_mod, &mut apis, trusted, namespace);`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    warning: consider adding a `;` to the last statement for consistent formatting
      --> gen/lib/tests/test.rs:27:5
       |
    27 |     assert!(cxx_gen::generate_header_and_cc(rs, &opt).is_err())
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `assert!(cxx_gen::generate_header_and_cc(rs, &opt).is_err());`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
       = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`
2023-07-06 12:21:41 -07:00
David Tolnay
669a72080a
Ignore all currently triggered clippy pedantic lints 2023-07-06 12:15:11 -07:00
David Tolnay
6ccae07bb7
Update to 2021 edition 2023-07-06 11:50:43 -07:00
David Tolnay
22d0e8c4b8
Release 1.0.99 2023-07-06 11:41:18 -07:00
David Tolnay
8308e99118
Release 1.0.98 2023-07-05 09:05:18 -07:00
David Tolnay
1ae80edc8e
Eliminate syn 1 from minimal-versions 2023-07-05 09:03:13 -07:00
David Tolnay
c5265738a0
Allow serde and serde_derive to compile in parallel 2023-06-14 23:49:21 -07:00
David Tolnay
cd391fe312
Update experimental enum-variants-from-header feature to syn 2 2023-06-14 23:48:21 -07:00
David Tolnay
de800b8700
Release 1.0.97 2023-06-14 23:29:33 -07:00
David Tolnay
76e8a2f55f
Release 1.0.96 2023-06-14 17:09:04 -07:00
David Tolnay
f5bcbece4a
Fix typo in ParsedDiscriminant comment 2023-05-27 14:43:49 -07:00
David Tolnay
f4abebe5b4
Release 1.0.95 2023-05-25 20:03:42 -07:00
David Tolnay
7b0895b718
Pull in proc-macro2 build script rust-toolchain fixes 2023-05-17 04:57:52 -07:00
David Tolnay
8d44aebd03
Release 1.0.94 2023-03-25 13:28:33 -07:00
David Tolnay
e33fac67d2
Use error reporting provided by Meta 2023-03-18 14:25:20 -07:00
David Tolnay
cea0cef207
Release 1.0.93 2023-03-17 18:48:01 -07:00
David Tolnay
1259995732
Update to syn 2 2023-03-17 18:41:45 -07:00
David Tolnay
459ac616ab
Remove extern crate proc_macro unneeded since Rust 1.42 2023-03-06 11:53:58 -08:00
David Tolnay
fd3b3d595a
Release 1.0.92 2023-03-05 16:11:59 -08:00
David Tolnay
473f24ab1a
Release 1.0.91 2023-02-15 09:29:18 -08:00
David Tolnay
33b5c9eec5
Release 1.0.90 2023-02-10 19:36:09 -08:00
David Tolnay
b3bdffce04
Ignore extra_unused_type_parameters clippy lint in generated code
error: type parameter goes unused in function definition
      --> demo/src/main.rs:11:14
       |
    11 |         type MultiBuf;
       |              ^^^^^^^^
       |
       = help: consider removing the parameter
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
       = note: `-D clippy::extra-unused-type-parameters` implied by `-D clippy::all`

    error: type parameter goes unused in function definition
      --> src/cxx_string.rs:94:15
       |
    94 |     pub fn new<T: Private>() -> Self {
       |               ^^^^^^^^^^^^
       |
       = help: consider removing the parameter
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters

    error: type parameter goes unused in function definition
       --> src/extern_type.rs:184:27
        |
    184 | pub fn verify_extern_type<T: ExternType<Id = Id>, Id>() {}
        |                           ^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider removing the parameter
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
        = note: `-D clippy::extra-unused-type-parameters` implied by `-D clippy::all`

    error: type parameter goes unused in function definition
       --> src/extern_type.rs:187:27
        |
    187 | pub fn verify_extern_kind<T: ExternType<Kind = Kind>, Kind: self::Kind>() {}
        |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider removing the parameter
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters

    error: type parameter goes unused in function definition
       --> tests/ffi/lib.rs:230:14
        |
    230 |         type Reference<'a>;
        |              ^^^^^^^^^
        |
        = help: consider removing the parameter
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
        = note: `-D clippy::extra-unused-type-parameters` implied by `-D clippy::all`

    error: type parameter goes unused in function definition
       --> tests/ffi/lib.rs:259:14
        |
    259 |         type R;
        |              ^
        |
        = help: consider removing the parameter
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
2023-02-10 19:21:36 -08:00
David Tolnay
1fdbb96b62
Release 1.0.89 2023-02-01 12:52:54 -08:00
David Tolnay
69f0380c3d
Suppress various pedantic clippy lints 2023-02-01 12:44:48 -08:00
David Tolnay
721bfc4eb3
Suppress dead_code on generated enum variants 2023-02-01 12:38:18 -08:00
David Tolnay
f33abb9ca8
Release 1.0.88 2023-01-26 20:48:38 -08:00
David Tolnay
3aa71ecdd4
Release 1.0.87 2023-01-19 19:01:49 -08:00
David Tolnay
fe16a5dea3
Raise minimum rustc to 1.60 2023-01-07 12:37:18 -08:00
David Tolnay
1f3627267a
Release 1.0.86 2023-01-07 12:18:32 -08:00
David Tolnay
09ae2ee7b5
Release 1.0.85 2022-12-18 09:42:05 -08:00
David Tolnay
1ac3311fa9
Release 1.0.84 2022-12-17 10:52:16 -08:00
David Tolnay
340f0ba52a
Release 1.0.83 2022-12-02 17:13:59 -08:00
David Tolnay
513371edca
Release 1.0.82 2022-11-18 01:23:30 -08:00
David Tolnay
544b350af6
Release 1.0.81 2022-11-08 01:00:47 -08:00
David Tolnay
8a029059c1
Support raw identifiers in namespace attribute
As in: #[namespace = ::my::company::r#box::implementation]
2022-11-08 00:35:10 -08:00
David Tolnay
c7060d4036
Release 1.0.80 2022-10-21 09:33:41 -07:00
David Tolnay
152b89b08b
No-std fixes for Box, String, Pin, c_char 2022-10-21 09:18:48 -07:00
David Tolnay
97a46f93b6
Release 1.0.79 2022-10-15 15:15:47 -07:00
David Tolnay
d2a7e0b244
Release 1.0.78 2022-09-28 16:45:12 -07:00
David Tolnay
be7090ab22
Release 1.0.77 2022-09-27 17:53:26 -07:00
David Tolnay
4e96c36aac
Release 1.0.76 2022-09-19 10:36:53 -07:00
David Tolnay
0293ff50cf
Release 1.0.75 2022-09-02 14:33:59 -07:00