forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#63867 - petrochenkov:dhelpers, r=matthewjasper
resolve: Block expansion of a derive container until all its derives are resolved So, it turns out there's one more reason to block expansion of a `#[derive]` container until all the derives inside it are resolved, beside `Copy` (rust-lang#63248). The set of derive helper attributes registered by derives in the container also has to be known before the derives themselves are expanded, otherwise it may be too late (see rust-lang#63468 (comment) and the `#[stable_hasher]`-related test failures in rust-lang#63468). So, we stop our attempts to unblock the container earlier, as soon as the `Copy` status is known, and just block until all its derives are resolved. After all the derives are resolved we immediately go and process their helper attributes in the item, without delaying it until expansion of the individual derives. Unblocks rust-lang#63468 r? @matthewjasper (as a reviewer of rust-lang#63248) cc @c410-f3r
- Loading branch information
Showing
15 changed files
with
195 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 5 additions & 11 deletions
16
src/test/ui/feature-gate/issue-43106-gating-of-derive.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,32 @@ | ||
error: `derive` may only be applied to structs, enums and unions | ||
--> $DIR/issue-43106-gating-of-derive.rs:4:1 | ||
| | ||
LL | #![derive(Debug)] | ||
| ^^^^^^^^^^^^^^^^^ help: try an outer attribute: `#[derive(Debug)]` | ||
|
||
error: `derive` may only be applied to structs, enums and unions | ||
--> $DIR/issue-43106-gating-of-derive.rs:7:1 | ||
| | ||
LL | #[derive(Debug)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: `derive` may only be applied to structs, enums and unions | ||
--> $DIR/issue-43106-gating-of-derive.rs:10:17 | ||
--> $DIR/issue-43106-gating-of-derive.rs:7:17 | ||
| | ||
LL | mod inner { #![derive(Debug)] } | ||
| ^^^^^^^^^^^^^^^^^ help: try an outer attribute: `#[derive(Debug)]` | ||
|
||
error: `derive` may only be applied to structs, enums and unions | ||
--> $DIR/issue-43106-gating-of-derive.rs:13:5 | ||
--> $DIR/issue-43106-gating-of-derive.rs:10:5 | ||
| | ||
LL | #[derive(Debug)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: `derive` may only be applied to structs, enums and unions | ||
--> $DIR/issue-43106-gating-of-derive.rs:26:5 | ||
--> $DIR/issue-43106-gating-of-derive.rs:23:5 | ||
| | ||
LL | #[derive(Debug)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: `derive` may only be applied to structs, enums and unions | ||
--> $DIR/issue-43106-gating-of-derive.rs:30:5 | ||
--> $DIR/issue-43106-gating-of-derive.rs:27:5 | ||
| | ||
LL | #[derive(Debug)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 6 previous errors | ||
error: aborting due to 5 previous errors | ||
|
Oops, something went wrong.