rust/tests
bors 7b97a5ca84 Auto merge of #117511 - gurry:117406-err-packed-structs, r=compiler-errors
Emit explanatory note for move errors in packed struct derives

Derive expansions for packed structs with non-`Copy` fields cause move errors because they prefer copying over borrowing since borrowing the fields of a packed struct can result in unaligned access.

This underlying cause of the errors, however, is not apparent to the user. This PR adds a diagnostic note to make it clear to the user (the new note is on the second last line):

```
tests/ui/derives/deriving-with-repr-packed-move-errors.rs:13:16
   |
12 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
   |          ----- in this derive macro expansion
13 | struct StructA(String);
   |                ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
   |
   = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
```

Fixes #117406

Partially addresses #110777
2023-11-07 00:03:53 +00:00
..
assembly Fix closure-inherit-target-feature test for SGX platform 2023-10-23 14:39:01 +02:00
auxiliary
codegen Auto merge of #117503 - kornelski:hint-try-reserved, r=workingjubilee 2023-11-05 00:03:41 +00:00
codegen-units Automatically enable cross-crate inlining for small functions 2023-10-17 19:53:51 -04:00
coverage-map coverage: Consistently remove unused counter IDs from expressions/mappings 2023-10-28 09:33:48 +11:00
debuginfo Check alignment of pointers only when read/written through 2023-11-04 13:01:32 -04:00
incremental Bless incremental tests. 2023-10-06 15:46:11 +00:00
mir-opt Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillot 2023-11-05 13:44:59 +00:00
pretty Remove unnecessary CVarArgs name skipping logic 2023-10-25 17:44:17 +02:00
run-coverage coverage: Consistently remove unused counter IDs from expressions/mappings 2023-10-28 09:33:48 +11:00
run-coverage-rustdoc
run-make Remove support for compiler plugins. 2023-11-04 08:50:46 +11:00
run-make-fulldeps Minimize pub usage in source_map.rs. 2023-11-02 19:35:00 +11:00
run-pass-valgrind
rustdoc Auto merge of #117459 - matthiaskrgr:rollup-t3osb3c, r=matthiaskrgr 2023-10-31 23:08:56 +00:00
rustdoc-gui Add GUI test to ensure that implementations on foreign types are in the expected order 2023-11-02 18:02:14 +01:00
rustdoc-js Add regression test for #115480 2023-10-11 11:41:39 +02:00
rustdoc-js-std
rustdoc-json Accept less invalid Rust in rustdoc 2023-10-31 13:58:03 +00:00
rustdoc-ui Remove support for compiler plugins. 2023-11-04 08:50:46 +11:00
ui Auto merge of #117511 - gurry:117406-err-packed-structs, r=compiler-errors 2023-11-07 00:03:53 +00:00
ui-fulldeps add fn visit_capture_by to MutVisitor and fix pprust-expr-roundtrip.rs 2023-11-04 21:04:54 +01:00
COMPILER_TESTS.md