Commit Graph

744 Commits

Author SHA1 Message Date
David Tolnay
26137f95a2
Release 1.0.64 2022-01-30 13:03:12 -08:00
David Tolnay
09e8df598f
Add workaround for evaluating cfg(debug_assertions) 2022-01-30 12:49:15 -08:00
David Tolnay
b03c912181
Reduce indentation in CargoEnvCfgEvaluator 2022-01-30 12:48:19 -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
34d4447d43
Release 1.0.63 2022-01-18 15:55:25 -08:00
David Tolnay
124e10ebcf
Support all/any cfg evaluation with not all clauses determinate 2022-01-18 15:39:34 -08:00
David Tolnay
8cade5c70d
Disallow cfg(test) inside Cargo builds 2022-01-18 15:13:06 -08:00
David Tolnay
6deee4c82e
Add --cfg to cli help test 2022-01-18 15:06:58 -08:00
David Tolnay
c40118fde4
Add a cfg evaluator for the non-Cargo builds 2022-01-18 14:58:17 -08:00
David Tolnay
c1f2176154
Handle module-level cfg attributes 2022-01-18 00:39:25 -08:00
David Tolnay
2c8674ff59
Add a cfg evaluator for the cxx-build crate 2022-01-18 00:18:59 -08:00
David Tolnay
70453b3b92
Simple way to create CfgResult from bool 2022-01-17 23:25:58 -08:00
David Tolnay
28b9214659
Enforce docs on anything that ends up in the cxx-gen API 2022-01-17 20:46:02 -08:00
David Tolnay
7bafde28f4
Run cfg evaluator to strip syntax tree 2022-01-17 19:54:54 -08:00
David Tolnay
700f87355d
Add a trait for evaluating cfg expressions 2022-01-17 19:45:10 -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
5126af7eb5
Replace lazy_static with once_cell 2022-01-03 12:29:28 -08:00
David Tolnay
6d7299e7b5
Release 1.0.62 2022-01-03 00:59:41 -08:00
David Tolnay
0b74c5ff5c
Update to clap 3 2022-01-02 13:15:22 -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
314d9ab5c5
Release 1.0.59 2021-12-09 04:17:23 -08:00
David Tolnay
8bb18c37ff
Touch up PR 951 2021-12-08 17:13:41 -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
34d73d6741
Release 1.0.58 2021-12-07 16:47:33 -08:00
David Tolnay
0854ef70c0
Release 1.0.57 2021-11-30 23:14:35 -08:00
adetaylor
0431bad0dd Export UniquePtr and similar functions.
Previously these did not respect
  cxxbridge --cxx-impl-annotations
and similar directives in other build pipelines. These may be linked against
from Rust code just as other generated functions are, so it's important that
they are exported from shared objects in a similar fashion.
2021-11-29 22:33:25 -08:00
Adrian Taylor
9d0cb7958a Remove unnecessary dependency. 2021-11-23 11:28:51 -08:00
Johan Verwey
9aeb5fa277
Missed template specifier for clear method 2021-10-29 08:26:34 -07:00
Johan Verwey
8be52606f5
Expose Rust's Vec<T>::clear() method. 2021-10-29 07:36:57 -07:00
David Tolnay
4c4987390a
Release 1.0.56 2021-10-05 16:48:49 -04:00
David Tolnay
e6cd18ee16
Declare minimum Rust version in Cargo metadata 2021-10-02 02:35:02 -04:00
David Tolnay
ac98b543b8
Release 1.0.55 2021-09-24 11:47:58 -07:00
David Tolnay
1dd71ca1db
Fix race condition between simultaneous build scripts creating symlinks 2021-09-24 11:39:15 -07:00
David Tolnay
84333be213
Ignore if_same_then_else clippy lint
error: this `if` has identical blocks
       --> gen/build/src/gen/write.rs:704:33
        |
    704 |           if arg.ty == RustString {
        |  _________________________________^
    705 | |             write!(out, "const ");
    706 | |         } else if let Type::RustVec(_) = arg.ty {
        | |_________^
        |
        = note: `-D clippy::if-same-then-else` implied by `-D clippy::all`
    note: same as this
       --> gen/build/src/gen/write.rs:706:49
        |
    706 |           } else if let Type::RustVec(_) = arg.ty {
        |  _________________________________________________^
    707 | |             write!(out, "const ");
    708 | |         }
        | |_________^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else

    error: this `if` has identical blocks
       --> macro/src/expand.rs:430:33
        |
    430 |           if arg.ty == RustString {
        |  _________________________________^
    431 | |             quote!(#var #colon *const #ty)
    432 | |         } else if let Type::RustVec(_) = arg.ty {
        | |_________^
        |
        = note: `-D clippy::if-same-then-else` implied by `-D clippy::all`
    note: same as this
       --> macro/src/expand.rs:432:49
        |
    432 |           } else if let Type::RustVec(_) = arg.ty {
        |  _________________________________________________^
    433 | |             quote!(#var #colon *const #ty)
    434 | |         } else if let Type::Fn(_) = arg.ty {
        | |_________^
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
2021-09-12 05:18:13 -07:00
David Tolnay
fccef86d19
Release 1.0.54 2021-08-27 13:39:49 -07:00
David Tolnay
a7bde2b7d2
Consistently use new_cap in signatures of reserve_total 2021-08-27 12:01:24 -07:00
David Tolnay
a23d0ec21b
Release 1.0.53 2021-08-26 14:35:10 -07:00
David Tolnay
8dfba30813
Release 1.0.52 2021-08-12 14:24:09 -07:00
David Tolnay
9230abf9f3
Release 1.0.51 2021-08-03 10:47:13 -07:00
David Tolnay
c59a4022cd
Avoid inheriting formatter flags in some Display impls
The previous implementation would produce wrong unintentional output
when formatting with alignment or padding, such as {:<15}.
2021-07-29 13:34:55 -07:00
David Tolnay
7b76ea0881
Release 1.0.50 2021-07-23 17:33:40 -07:00
David Tolnay
0d7d9e02c1
Release 1.0.49 2021-05-01 14:52:34 -07:00
David Tolnay
a134ecab9f
Release 1.0.48 2021-04-28 17:48:57 -07:00
David Tolnay
1d0556e068
Release 1.0.47 2021-04-26 14:23:07 -07:00
David Tolnay
4584958676
Support enum repr types from std::os::raw 2021-04-22 20:04:03 -07:00