Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

@Kivooeo Kivooeo Jun 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sugg: derive-compound-arities

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for https://github.com/rust-lang/rust/issues/28561
//@ check-pass
#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, Clone, Copy)]
struct Array<T> {
Expand Down
Comment thread
Kivooeo marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for https://github.com/rust-lang/rust/issues/33571
#[derive(Clone,
Sync, //~ ERROR cannot find derive macro `Sync` in this scope
//~| ERROR cannot find derive macro `Sync` in this scope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error: cannot find derive macro `Sync` in this scope
--> $DIR/issue-33571.rs:2:10
--> $DIR/derive-error-identifies-unsafe-trait-name.rs:3:10
|
LL | Sync,
| ^^^^
|
note: unsafe traits like `Sync` should be implemented explicitly
--> $DIR/issue-33571.rs:2:10
--> $DIR/derive-error-identifies-unsafe-trait-name.rs:3:10
|
LL | Sync,
| ^^^^

error: cannot find derive macro `Sync` in this scope
--> $DIR/issue-33571.rs:2:10
--> $DIR/derive-error-identifies-unsafe-trait-name.rs:3:10
|
LL | Sync,
| ^^^^
|
note: unsafe traits like `Sync` should be implemented explicitly
--> $DIR/issue-33571.rs:2:10
--> $DIR/derive-error-identifies-unsafe-trait-name.rs:3:10
|
LL | Sync,
| ^^^^
Expand Down

@Kivooeo Kivooeo Jun 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: this test checks that we can't use non-clone type inside struct that claims to be clone, which is not possible in rust because it requires to all fields to be clone

so i'm quite unsure about this name

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was fixated on tuples, I wrongly assumed it was tied to the cause of the error. The test has evolved past the original intention. How does derived-trait-requires-field-impl sound ?

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for https://github.com/rust-lang/rust/issues/27340
struct Foo;
#[derive(Copy, Clone)]
struct Bar(Foo);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0204]: the trait `Copy` cannot be implemented for this type
--> $DIR/issue-27340.rs:3:8
--> $DIR/derived-trait-requires-field-impl.rs:4:8
|
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Bar(Foo);
| ^^^ --- this field does not implement `Copy`

error[E0277]: the trait bound `Foo: Clone` is not satisfied
--> $DIR/issue-27340.rs:3:12
--> $DIR/derived-trait-requires-field-impl.rs:4:12
|
LL | #[derive(Copy, Clone)]
| ----- in this derive macro expansion
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/derives/hash-on-compound-types.rs

@Kivooeo Kivooeo Jun 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sugg: not array field but compound types

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, will make the change

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/21402>.

//! Regression test for https://github.com/rust-lang/rust/issues/21402
//@ check-pass
#![allow(dead_code)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for https://github.com/rust-lang/rust/issues/32324
//@ check-pass
#![allow(dead_code)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for https://github.com/rust-lang/rust/issues/46101
trait Foo {}
#[derive(Foo::Anything)] //~ ERROR cannot find
//~| ERROR cannot find
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0433]: cannot find derive macro `Anything` in trait `Foo`
--> $DIR/issue-46101.rs:2:10
--> $DIR/no-ice-on-path-style-derive-macro.rs:3:10
|
LL | #[derive(Foo::Anything)]
| ^^^^^^^^^^^^^ a derive macro can't exist within a trait

error[E0433]: cannot find derive macro `Anything` in trait `Foo`
--> $DIR/issue-46101.rs:2:10
--> $DIR/no-ice-on-path-style-derive-macro.rs:3:10
|
LL | #[derive(Foo::Anything)]
| ^^^^^^^^^^^^^ a derive macro can't exist within a trait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for https://github.com/rust-lang/rust/issues/32292
//@ run-pass
#![deny(warnings)]

Expand Down
Loading