Commit Graph

491 Commits

Author SHA1 Message Date
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
David Tolnay
02e9a4795d
Release 1.0.74 2022-08-30 15:53:14 -07:00
David Tolnay
a6608495d1
Release 1.0.73 2022-08-01 17:10:57 -07:00
David Tolnay
5561bda12c
Sort package entries in Cargo.toml 2022-07-31 19:19:02 -07:00
David Tolnay
9e0d3680be
Release 1.0.72 2022-07-16 20:12:42 -07:00
David Tolnay
02d2600ebc
Resolve unused_must_use warning inside generated code
warning: unused return value of `Box::<T>::from_raw` that must be used
       --> tests/ffi/lib.rs:337:22
        |
    337 |     impl Box<Shared> {}
        |                      ^^
        |
        = note: `#[warn(unused_must_use)]` on by default
        = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`

    warning: unused return value of `Box::<T>::from_raw` that must be used
      --> tests/ffi/lib.rs:72:27
       |
    72 |         second: Box<Second>,
       |                           ^
       |
       = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`

    warning: unused return value of `Box::<T>::from_raw` that must be used
      --> tests/ffi/lib.rs:99:35
       |
    99 |         fn c_return_box() -> Box<R>;
       |                                   ^
       |
       = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
2022-07-16 20:03:45 -07:00
David Tolnay
2e1527c834
Release 1.0.71 2022-07-06 07:19:36 -07:00
abbform
0bbc34bc25 make #derive before #attr when derive 2022-07-06 21:58:48 +08:00
David Tolnay
ac89872316
Release 1.0.70 2022-07-04 09:56:31 -07:00
David Tolnay
66ba9a0a66
Preserve clippy attrs on extern "Rust" fn
#[cxx::bridge]
    mod ffi {
        extern "Rust" {
            #[allow(clippy::too_many_arguments)]
            fn repro(a: i32, b: i32, c: i32, d: i32, e: i32, f: i32, g: i32, h: i32) -> bool;
        }
    }

Before:

    warning: this function has too many arguments (8/7)
     --> src/main.rs:5:12
      |
    5 |         fn repro(a: i32, b: i32, c: i32, d: i32, e: i32, f: i32, g: i32, h: i32) -> bool;
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: `#[warn(clippy::too_many_arguments)]` on by default
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

After: no lint.
2022-07-04 09:33:40 -07:00
David Tolnay
5d50b94280
Release 1.0.69 2022-06-17 23:56:34 -07:00
David Tolnay
b305ae7741
Ignore derive_partial_eq_without_eq clippy lint
error: you are deriving `PartialEq` and can implement `Eq`
     --> gen/lib/src/gen/block.rs:3:23
      |
    3 | #[derive(Copy, Clone, PartialEq, Debug)]
      |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = note: `-D clippy::derive-partial-eq-without-eq` implied by `-D clippy::all`
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> gen/cmd/src/gen/block.rs:3:23
      |
    3 | #[derive(Copy, Clone, PartialEq, Debug)]
      |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> gen/build/src/gen/block.rs:3:23
      |
    3 | #[derive(Copy, Clone, PartialEq, Debug)]
      |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> gen/lib/src/syntax/atom.rs:5:23
      |
    5 | #[derive(Copy, Clone, PartialEq)]
      |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> gen/lib/src/syntax/derive.rs:10:23
       |
    10 | #[derive(Copy, Clone, PartialEq)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> gen/cmd/src/syntax/atom.rs:5:23
      |
    5 | #[derive(Copy, Clone, PartialEq)]
      |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> gen/build/src/syntax/atom.rs:5:23
      |
    5 | #[derive(Copy, Clone, PartialEq)]
      |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> gen/cmd/src/syntax/derive.rs:10:23
       |
    10 | #[derive(Copy, Clone, PartialEq)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> gen/build/src/syntax/derive.rs:10:23
       |
    10 | #[derive(Copy, Clone, PartialEq)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> gen/lib/src/syntax/mod.rs:72:23
       |
    72 | #[derive(Copy, Clone, PartialEq, Debug)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> gen/lib/src/syntax/mod.rs:285:23
        |
    285 | #[derive(Copy, Clone, PartialEq)]
        |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> gen/cmd/src/syntax/mod.rs:72:23
       |
    72 | #[derive(Copy, Clone, PartialEq, Debug)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> gen/cmd/src/syntax/mod.rs:285:23
        |
    285 | #[derive(Copy, Clone, PartialEq)]
        |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> gen/build/src/syntax/mod.rs:72:23
       |
    72 | #[derive(Copy, Clone, PartialEq, Debug)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> gen/build/src/syntax/mod.rs:285:23
        |
    285 | #[derive(Copy, Clone, PartialEq)]
        |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
     --> macro/src/syntax/atom.rs:5:23
      |
    5 | #[derive(Copy, Clone, PartialEq)]
      |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> macro/src/syntax/derive.rs:10:23
       |
    10 | #[derive(Copy, Clone, PartialEq)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
      --> macro/src/syntax/mod.rs:72:23
       |
    72 | #[derive(Copy, Clone, PartialEq, Debug)]
       |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

    error: you are deriving `PartialEq` and can implement `Eq`
       --> macro/src/syntax/mod.rs:285:23
        |
    285 | #[derive(Copy, Clone, PartialEq)]
        |                       ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
2022-05-21 19:58:53 -07:00
David Tolnay
2a197e7688
Replace unicode-xid with unicode-ident crate 2022-05-16 15:43:42 -07:00
David Tolnay
d4920548a7
Release 1.0.68 2022-05-13 16:45:29 -07:00
David Tolnay
13cc5d9df9
Resolve unused_attributes lints in generated code
warning: `#[doc(hidden)]` is ignored on trait impl items
      --> tests/ffi/module.rs:74:23
       |
    74 |     impl UniquePtr<D> {}
       |                       ^^ 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
      --> tests/ffi/module.rs:75:23
       |
    75 |     impl UniquePtr<E> {}
       |                       ^^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
      --> tests/ffi/module.rs:76:23
       |
    76 |     impl UniquePtr<F> {}
       |                       ^^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
      --> tests/ffi/module.rs:77:23
       |
    77 |     impl UniquePtr<G> {}
       |                       ^^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
      --> tests/ffi/module.rs:57:51
       |
    57 |         fn c_return_ns_unique_ptr() -> UniquePtr<H>;
       |                                                   ^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
      --> tests/ffi/module.rs:71:54
       |
    71 |         fn ns_c_return_unique_ptr_ns() -> UniquePtr<I>;
       |                                                      ^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
       --> tests/ffi/lib.rs:227:18
        |
    227 |         #[derive(ExternType)]
        |                  ^^^^^^^^^^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
       --> tests/ffi/lib.rs:337:34
        |
    337 |     impl CxxVector<SharedString> {}
        |                                  ^^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
      --> tests/ffi/lib.rs:99:48
       |
    99 |         fn c_return_unique_ptr() -> UniquePtr<C>;
       |                                                ^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
       --> tests/ffi/lib.rs💯48
        |
    100 |         fn c_return_shared_ptr() -> SharedPtr<C>;
        |                                                ^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
       --> tests/ffi/lib.rs:112:77
        |
    112 |         fn c_return_unique_ptr_vector_shared() -> UniquePtr<CxxVector<Shared>>;
        |                                                                             ^^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
       --> tests/ffi/lib.rs:113:72
        |
    113 |         fn c_return_unique_ptr_vector_opaque() -> UniquePtr<CxxVector<C>>;
        |                                                                        ^^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
       --> tests/ffi/lib.rs:204:44
        |
    204 |         fn c_get_use_count(weak: &WeakPtr<C>) -> usize;
        |                                            ^ 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

    warning: `#[doc(hidden)]` is ignored on trait impl items
       --> tests/ffi/lib.rs:234:72
        |
    234 |         fn c_return_borrow<'a>(s: &'a CxxString) -> UniquePtr<Borrow<'a>>;
        |                                                                        ^^ 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 21:33:40 -07:00
David Tolnay
0006c00f45
Release 1.0.67 2022-04-25 18:50:09 -07:00
David Tolnay
f13e68f5c5
Release 1.0.66 2022-03-08 12:19:26 -08:00
David Tolnay
c53e4bc81b
Release 1.0.65 2022-02-16 19:46:45 -08:00
Philip Craig
a4c94445a9 clippy fixes 2022-02-13 15:00:29 +00:00
David Tolnay
26137f95a2
Release 1.0.64 2022-01-30 13:03:12 -08:00
David Tolnay
e41be2f96b
Begin development on async fn support 2022-01-18 17:58:16 -08:00
David Tolnay
d58307a1f0
Rename variants_from_header optin to "experimental-enum-variants-from-header"
In preparation for "experimental-async-fn" as a completely orthogonal
experimental feature.
2022-01-18 17:29:01 -08:00
David Tolnay
cf5bbe629e
Fix variants_from_header build 2022-01-18 17:21:16 -08:00
David Tolnay
34d4447d43
Release 1.0.63 2022-01-18 15:55:25 -08:00
David Tolnay
2476aff7b2
Store parsed cfg attributes into syntax tree 2022-01-17 18:47:30 -08:00
David Tolnay
7fae55596e
Resolve dead code warnings uncovered by rustc_privacy/rustc_resolve refactor
warning: associated function is never used: `checked_succ`
       --> gen/build/src/syntax/discriminant.rs:183:18
        |
    183 |     pub const fn checked_succ(self) -> Option<Self> {
        |                  ^^^^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default

    warning: associated function is never used: `ty`
       --> gen/build/src/syntax/tokens.rs:305:12
        |
    305 |     pub fn ty(&self) -> ReceiverType {
        |            ^^

    warning: associated function is never used: `ty_self`
       --> gen/build/src/syntax/tokens.rs:310:12
        |
    310 |     pub fn ty_self(&self) -> ReceiverTypeSelf {
        |            ^^^^^^^

    warning: variant is never constructed: `Foreign`
       --> gen/build/src/syntax/mod.rs:122:5
        |
    122 |     Foreign { rust_type: Path },
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: associated function is never used: `checked_succ`
       --> macro/src/syntax/discriminant.rs:183:18
        |
    183 |     pub const fn checked_succ(self) -> Option<Self> {
        |                  ^^^^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default

    warning: associated function is never used: `is_empty`
      --> macro/src/syntax/doc.rs:22:12
       |
    22 |     pub fn is_empty(&self) -> bool {
       |            ^^^^^^^^

    warning: associated function is never used: `to_string`
      --> macro/src/syntax/doc.rs:26:12
       |
    26 |     pub fn to_string(&self) -> String {
       |            ^^^^^^^^^

    warning: associated function is never used: `remove`
       --> macro/src/syntax/map.rs:127:16
        |
    127 |         pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
        |                ^^^^^^

    warning: associated function is never used: `to_fully_qualified`
      --> macro/src/syntax/names.rs:24:12
       |
    24 |     pub fn to_fully_qualified(&self) -> String {
       |            ^^^^^^^^^^^^^^^^^^

    warning: associated function is never used: `prefix_with`
      --> macro/src/syntax/symbol.rs:44:12
       |
    44 |     pub fn prefix_with(&self, prefix: &str) -> Symbol {
       |            ^^^^^^^^^^^

    warning: variant is never constructed: `Foreign`
       --> macro/src/syntax/mod.rs:122:5
        |
    122 |     Foreign { rust_type: Path },
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-01-10 18:50:49 -08:00
David Tolnay
6d7299e7b5
Release 1.0.62 2022-01-03 00:59:41 -08:00
David Tolnay
8aa54e6080
Release 1.0.61 2021-12-31 14:10:12 -08:00
David Tolnay
fa7380675e
Implement rust::Vec clear in terms of truncate(0) 2021-12-31 13:26:53 -08:00
Nikhil Benesch
e3918b5422
Add Vec<T>::truncate to C++ API
Based on the model of #951, which added `Vec<T>::clear`. The `truncate`
method is the more general form of clear.

(If we wanted to, we could delete the binding for `clear` and implement
`clear` as a call to `truncate(0)` on the C++ side, but seemed worth
leaving in in case the Rust `clear` implementation one day gets
smarter.)
2021-12-26 15:18:50 -05:00
David Tolnay
719fc253ef
Release 1.0.60 2021-12-10 13:36:54 -08:00
David Tolnay
753f42ab36
Fill in elided lifetimes on derived operators 2021-12-10 13:17:22 -08:00
David Tolnay
e0966f7396
Fill in elided lifetimes on AssertUnpin and AssertSized 2021-12-10 13:17:17 -08:00
David Tolnay
3d14230ecc
Fill in elided lifetime in macro-generated code 2021-12-10 12:56:12 -08:00
David Tolnay
ebf72757d2
Move unsized type comment to the right function 2021-12-10 12:55:52 -08:00
David Tolnay
dd78e66fb5
Wrap all derived trait impls exposed to C++ in prevent_unwind 2021-12-09 20:10:29 -08:00
David Tolnay
c9ee10189c
Add a comment linking to Box::new_uninit 2021-12-09 20:02:16 -08:00
David Tolnay
bf6ede6dc6
Refer to standard library macros by an absolute path 2021-12-09 19:43:04 -08:00
David Tolnay
314d9ab5c5
Release 1.0.59 2021-12-09 04:17:23 -08:00
David Tolnay
67b9143818
Rename catch_unwind -> prevent_unwind 2021-12-08 17:47:40 -08:00
David Tolnay
aa3e828402
Merge pull request #951 from rookboom/vector_clear
Add Vec clear
2021-12-08 17:11:50 -08:00
David Tolnay
6c0f458c52
Copy SipHasher13 from libstd to use in no-std mode
Closes #976.
2021-12-07 20:54:08 -08:00
David Tolnay
34d73d6741
Release 1.0.58 2021-12-07 16:47:33 -08:00
David Tolnay
bd124f4618
Eliminate references to ::std from generated code 2021-12-07 15:22:45 -08:00
David Tolnay
0854ef70c0
Release 1.0.57 2021-11-30 23:14:35 -08:00
Johan Verwey
8be52606f5
Expose Rust's Vec<T>::clear() method. 2021-10-29 07:36:57 -07:00
David Tolnay
9bbdfc25a4
Refer to serde derives through absolute path
Touch up PR 941.
2021-10-26 19:50:53 -07:00