Commit Graph

2173 Commits

Author SHA1 Message Date
David Tolnay
395e20f64c
Suppress cppcoreguidelines-pro-type-varargs lint from clang-tidy
I don't understand why this specific lint is triggering in the two cases below
but the code seems fine.

    include/cxx.h:882:3: error: do not declare variables of type va_list; use variadic templates instead [cppcoreguidelines-pro-type-vararg,-warnings-as-errors]
      auto data = reinterpret_cast<char *>(this->data());
      ^
    src/cxx.cc:355:3: error: do not declare variables of type va_list; use variadic templates instead [cppcoreguidelines-pro-type-vararg,-warnings-as-errors]
      char *copy = new char[len];
      ^
2021-03-24 15:48:47 -04:00
David Tolnay
35c6c4b25c
Update to clang-tidy 11 2021-03-24 15:48:06 -04:00
David Tolnay
dda0c77b15
Update bazel build to rustc 1.50.0 2021-03-24 15:48:06 -04:00
David Tolnay
4be66f9ec8
Remove .clang-tidy link to issue #500
The issue has been closed and we are probably keeping the remaining set
of suppressions.
2021-03-24 15:47:29 -04:00
David Tolnay
c37a665e04
Release 1.0.34 2021-03-22 20:19:09 -07:00
David Tolnay
574206a9ef
Lockfile update 2021-03-22 20:18:41 -07:00
David Tolnay
c1b34d7b31
Merge pull request #753 from dtolnay/ptrcast
Handle pointer cast of non-ffi-safe pointer target types
2021-03-22 20:17:40 -07:00
David Tolnay
2982d73777
Handle pointer cast of non-ffi-safe pointer target types
Previously:

    error: `extern` block uses type `String`, which is not FFI-safe
      --> src/main.rs:13:27
       |
    13 |         unsafe fn test(x: *mut String);
       |                           ^^^^^^^^^^^ not FFI-safe
2021-03-22 20:10:18 -07:00
David Tolnay
dec9392b65
Merge pull request #752 from dtolnay/noprlint
Disable lint jobs on pull requests
2021-03-22 19:54:36 -07:00
David Tolnay
6aeaca628d
Disable lint jobs on pull requests 2021-03-22 19:43:08 -07:00
David Tolnay
f3e52f29f0
Merge pull request #751 from dtolnay/argv
Rewrite raw ptr book page with example involving argc/argv
2021-03-22 19:43:00 -07:00
David Tolnay
5f04fda69d
Merge pull request #750 from dtolnay/pointers
Pointer to pointer, pointer to reference, reference to pointer
2021-03-22 19:41:13 -07:00
David Tolnay
1082db6669
Merge pull request #748 from dtolnay/fnptr-ptr
Detect raw pointer argument inside of function pointer
2021-03-22 19:41:05 -07:00
David Tolnay
cfdcede8f0
Rewrite raw ptr book page with example involving argc/argv 2021-03-22 19:29:12 -07:00
David Tolnay
d2d225c10c
East const to make nested pointer types work 2021-03-22 19:23:51 -07:00
David Tolnay
bd313d5e92
Add dedicated error message for ptr to ptr and ref to ptr 2021-03-22 19:23:51 -07:00
David Tolnay
2a2264c483
Add dedicated error message for pointer to reference 2021-03-22 19:23:50 -07:00
David Tolnay
d91d2a8d4a
Relax restriction on target types of pointer 2021-03-22 19:23:49 -07:00
David Tolnay
ff0ecfb4e1
Merge pull request #747 from dtolnay/rawptr-doc
Raw pointer doc tweaks
2021-03-22 19:22:50 -07:00
David Tolnay
aba7ab1bb0
Detect pointer argument inside of function pointer 2021-03-22 19:18:18 -07:00
David Tolnay
b8682334c8
Add failing ui test showing unsafety of fn ptr not enforced 2021-03-22 19:18:18 -07:00
David Tolnay
d6c1cb21f4
Merge pull request #746 from dtolnay/pointers
Defer unsafety check for fn with ptr argument
2021-03-22 19:18:08 -07:00
David Tolnay
75b487285f
Add raw pointer to builtin types list in crate-level rustdoc 2021-03-22 19:13:53 -07:00
David Tolnay
bbb22b2b4e
Fix order of Rust version of T* vs const T* 2021-03-22 19:13:52 -07:00
David Tolnay
abe4ca47e3
Document restriction on passing raw ptr as argument 2021-03-22 19:13:52 -07:00
David Tolnay
420de87130
Register raw ptrs page in book table of contents
Otherwise the page does not even get rendered by mdbook.
2021-03-22 19:13:52 -07:00
David Tolnay
b47185f7e3
Order raw ptrs just above function ptrs in bindings list 2021-03-22 19:13:52 -07:00
David Tolnay
285779635a
Defer unsafety check for fn with ptr argument
That error does not need to be fatal at parse time, because the parser
still understands exactly what was written. We accumulate and emit it
alongside other type errors that might be present in the same function
signature.
2021-03-22 19:12:06 -07:00
David Tolnay
a3ef34f95b
Merge pull request #745 from dtolnay/pointers
Touch up PR 689
2021-03-22 19:11:58 -07:00
David Tolnay
b70310b760
Remove unneeded pointer parse check
A pointer with neither `const` nor `mut` would not have parsed as a
syn::Type::Ptr.
2021-03-22 19:06:08 -07:00
David Tolnay
beba43d024
Touch up PR 689 imports 2021-03-22 19:06:07 -07:00
David Tolnay
94909e0a6e
Remove duplicate unsafety parse from PR 689 2021-03-22 19:06:07 -07:00
David Tolnay
824d691923
Format PR 689 with clang-format 2021-03-22 19:06:06 -07:00
David Tolnay
7bb11c30ce
Sort pointer ffi test functions consistently 2021-03-22 19:06:05 -07:00
David Tolnay
d0af9d320e
Disable missing Unsafety doc comment clippy lint for test suite 2021-03-22 19:06:05 -07:00
David Tolnay
274c06f495
Divide up pointer UI tests 2021-03-22 19:06:04 -07:00
David Tolnay
7c3197eba8
Format PR 689 with rustfmt 2021-03-22 19:06:02 -07:00
David Tolnay
9fc8138823
Merge pull request #689 from adetaylor/pointers
Support raw pointers in cxx::bridge.
2021-03-22 19:04:37 -07:00
David Tolnay
de01edf706
Update C++ formatting to clang-format 11 2021-03-22 15:00:59 -07:00
David Tolnay
5d12f1d4c5
Format PR 714 with clang-format 10
This change in formatting seems to be due to https://reviews.llvm.org/D68695.
2021-03-22 14:59:33 -07:00
David Tolnay
516bb068e4
Release 1.0.33 2021-03-18 14:11:25 -07:00
David Tolnay
b11e8dd6d5
Lockfile update 2021-03-18 14:09:44 -07:00
David Tolnay
2e43b51227
Consistently use 'other: &Self' in homogeneous comparison impls 2021-03-18 13:35:38 -07:00
David Tolnay
94e205403d
Delete CxxString heterogeneous PartialOrd impls 2021-03-18 13:33:57 -07:00
David Tolnay
05db2fbc9f
Touch up PR 743 2021-03-18 13:33:27 -07:00
David Tolnay
389887843c
Merge pull request 743 from b05902132/cxx_string_traits 2021-03-18 13:27:59 -07:00
b05902132
7b783f92de implment Ord, PartialOrd and Hash for CxxString. 2021-03-19 02:27:45 +08:00
David Tolnay
3dafaede93
Resolve inconsistent_struct_constructor style lint
error: inconsistent struct constructor
       --> gen/cmd/src/app.rs:95:5
        |
    95  | /     Opt {
    96  | |         input,
    97  | |         cxx_impl_annotations,
    98  | |         header,
    99  | |         include,
    100 | |         outputs,
    101 | |     }
        | |_____^ help: try: `Opt { input, header, cxx_impl_annotations, include, outputs }`
        |
        = note: `-D clippy::inconsistent-struct-constructor` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_struct_constructor
2021-02-25 20:42:30 -08:00
David Tolnay
e5bb345e8c
Merge pull request #723 from dtolnay/mangle
Document the possible arrangements of mangled symbols
2021-02-17 16:20:08 -08:00
Adrian Taylor
57832124b4 Merge fix. 2021-02-17 16:11:08 -08:00