rust/src/test
bors c70b35efd8 Auto merge of #84267 - dtolnay:ptrunit, r=nagisa
Make *const (), *mut () okay for FFI

Pointer-to-() is used occasionally in the standard library to mean "pointer to none-of-your-business". Examples:

- `RawWakerVTable::new` https://doc.rust-lang.org/1.51.0/std/task/struct.RawWakerVTable.html#method.new
- `<*const T>::to_raw_parts` https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.to_raw_parts

I believe it's useful for the same purpose in FFI signatures, even while `()` itself is not FFI safe. The following should be allowed:

```rust
extern "C" {
    fn demo(pc: *const (), pm: *mut ());
}
```

Prior to this PR, those pointers were not considered okay for an extern signature.

```console
warning: `extern` block uses type `()`, which is not FFI-safe
 --> src/main.rs:2:17
  |
2 |     fn demo(pc: *const (), pm: *mut ());
  |                 ^^^^^^^^^ not FFI-safe
  |
  = note: `#[warn(improper_ctypes)]` on by default
  = help: consider using a struct instead
  = note: tuples have unspecified layout

warning: `extern` block uses type `()`, which is not FFI-safe
 --> src/main.rs:2:32
  |
2 |     fn demo(pc: *const (), pm: *mut ());
  |                                ^^^^^^^ not FFI-safe
  |
  = help: consider using a struct instead
  = note: tuples have unspecified layout
```
2021-10-03 00:41:49 +00:00
..
assembly Rollup merge of #88820 - hlopko:add_pie_relocation_model, r=petrochenkov 2021-10-01 09:18:16 -07:00
auxiliary
codegen Rollup merge of #88820 - hlopko:add_pie_relocation_model, r=petrochenkov 2021-10-01 09:18:16 -07:00
codegen-units Support incremental in compiletest for non-incremental modes. 2021-09-23 12:16:51 -07:00
debuginfo Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
incremental Bless incremental tests. 2021-09-20 08:32:21 +02:00
mir-opt Auto merge of #89110 - Aaron1011:adjustment-span, r=estebank 2021-09-30 01:40:30 +00:00
pretty Use ZST for fmt unsafety 2021-09-21 10:04:44 -05:00
run-make Auto merge of #88161 - michaelwoerister:fix-whole-archive-no-bundle, r=petrochenkov 2021-09-07 12:31:11 +00:00
run-make-fulldeps Auto merge of #88880 - cjgillot:no-krate, r=oli-obk 2021-10-01 20:06:34 +00:00
run-pass-valgrind
rustdoc Rollup merge of #89198 - hkmatsumoto:hide-hidden-methods, r=jyn514 2021-09-25 18:22:19 -07:00
rustdoc-gui Rollup merge of #88896 - GuillaumeGomez:flakyness, r=camelid 2021-09-13 21:20:43 +02:00
rustdoc-js fix(rustdoc): generics search 2021-07-01 06:40:27 -07:00
rustdoc-js-std Fix linkcheck issues 2021-09-12 02:30:24 +00:00
rustdoc-json Fix populate of union.impls 2021-09-26 18:22:07 +02:00
rustdoc-ui Use the correct edition when syntax highlighting doctests 2021-09-26 16:36:33 +00:00
ui Auto merge of #84267 - dtolnay:ptrunit, r=nagisa 2021-10-03 00:41:49 +00:00
ui-fulldeps Bless tests. 2021-09-30 17:40:15 +02:00
COMPILER_TESTS.md