rust/tests
许杰友 Jieyou Xu (Joe) 7b821d1752
Rollup merge of #151278 - estebank:issue-108894, r=davidtwco
Provide more context on trait bounds being unmet due to imperfect derive

When encountering a value that has a borrow checker error where the type was previously moved, when suggesting cloning verify that it is not already being derived. If it is, explain why the `derive(Clone)` doesn't apply:

```
note: if `TypedAddress<T>` implemented `Clone`, you could clone the value
  --> $DIR/derive-clone-implicit-bound.rs:6:1
   |
LL | #[derive(Clone, Copy)]
   |          ----- derived `Clone` adds implicit bounds on type parameters
LL | pub struct TypedAddress<T>{
   | ^^^^^^^^^^^^^^^^^^^^^^^^-^
   | |                       |
   | |                       introduces an implicit `T: Clone` bound
   | consider manually implementing `Clone` for this type
...
LL |         let old = self.return_value(offset);
   |                                     ------ you could clone this value
```

When encountering a bound coming from a derive macro, suggest manual impl of the trait.

Use the span for the specific param when adding bounds in builtin derive macros, so the diagnostic will point at them as well as the derive macro itself.

```
note: required for `Id<SomeNode>` to implement `PartialEq`
  --> $DIR/derive-implicit-bound.rs:5:10
   |
LL | #[derive(PartialEq, Eq)]
   |          ^^^^^^^^^
LL | pub struct Id<T>(PhantomData<T>);
   |               - unsatisfied trait bound introduced in this `derive` macro
   = help: consider manually implementing `PartialEq` to avoid undesired bounds
```

Mention that the trait could be manually implemented in E0599.

Fix rust-lang/rust#108894. Address rust-lang/rust#143714. Address #rust-lang/rust#146515 (but ideally would also suggest constraining the fn bound correctly as well).
2026-02-06 10:25:43 +08:00
..
assembly-llvm Move bigint helper tracking issues 2026-02-02 18:45:26 -05:00
auxiliary Rollup merge of #150368 - minicore-ordering, r=workingjubilee 2026-01-11 09:56:38 +01:00
build-std/configurations Test that -Zbuild-std=core works on a variety of profiles 2026-01-14 20:39:12 -05:00
codegen-llvm Rollup merge of #152128 - zmodem:matches-logical-or-141497, r=nikic 2026-02-05 08:32:57 +01:00
codegen-units address review comments; fix CI 2026-01-01 19:17:11 -05:00
coverage coverage: Add a test case for a previously-unknown span mismatch 2026-02-03 22:53:38 +11:00
coverage-run-rustdoc
crashes error on unsized AnonConsts 2026-02-02 20:48:14 +01:00
debuginfo Auto merge of #150843 - fmease:dyn-ace, r=BoxyUwU 2026-01-22 01:56:41 +00:00
incremental Port rustc_clean to attribute parser 2026-02-04 20:58:02 +00:00
mir-opt Auto merge of #151622 - scottmcm:elide-more-transmutes, r=cjgillot 2026-01-31 20:42:37 +00:00
pretty Update uitests 2026-01-19 21:50:29 +01:00
run-make Auto merge of #151739 - Zalathar:short-backtrace, r=fee1-dead 2026-02-05 01:56:57 +00:00
run-make-cargo Update cargo submodule 2026-01-30 19:15:24 -05:00
rustdoc-gui Remove rustdoc GUI flaky test 2026-02-04 17:09:57 +01:00
rustdoc-html resolve: Mark items under ambigous imports as exported 2026-01-27 16:24:53 +03:00
rustdoc-js Auto merge of #149370 - Zalathar:rollup-6fkk5x4, r=Zalathar 2025-11-27 07:30:25 +00:00
rustdoc-js-std Explicitly export core and std macros 2026-01-13 08:47:48 +01:00
rustdoc-json resolve: Mark items under ambigous imports as exported 2026-01-27 16:24:53 +03:00
rustdoc-ui Move remaining doc attribute parsing errors to warnings 2026-02-04 10:54:45 +01:00
ui Rollup merge of #151278 - estebank:issue-108894, r=davidtwco 2026-02-06 10:25:43 +08:00
ui-fulldeps Rollup merge of #150379 - ChrisDenton:exitcode, r=jieyouxu 2026-02-05 08:32:43 +01:00
COMPILER_TESTS.md