Skip to content

Look at proc-macro attributes when encountering unknown attribute #134841

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Dec 28, 2024

error: cannot find attribute `sede` in this scope
  --> $DIR/missing-derive-2.rs:22:7
   |
LL |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)]
   |         +

error: cannot find attribute `serde` in this scope
  --> $DIR/missing-derive-2.rs:16:7
   |
LL |     #[serde(untagged)]
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> $DIR/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B {
   |

Partially address #47608. This PR doesn't find macros that haven't yet been imported by name.

@rustbot
Copy link
Collaborator

rustbot commented Dec 28, 2024

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 28, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@bors

This comment was marked as resolved.

@wesleywiser
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 9, 2025

📌 Commit b2f9a3f has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 9, 2025
@estebank
Copy link
Contributor Author

estebank commented Jun 9, 2025

@bors r=wesleywiser

@bors
Copy link
Collaborator

bors commented Jun 9, 2025

📌 Commit 3ed1787 has been approved by wesleywiser

It is now in the queue for this repository.

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 10, 2025
Look at proc-macro attributes when encountering unknown attribute

```
error: cannot find attribute `sede` in this scope
  --> $DIR/missing-derive-2.rs:22:7
   |
LL |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)]
   |         +

error: cannot find attribute `serde` in this scope
  --> $DIR/missing-derive-2.rs:16:7
   |
LL |     #[serde(untagged)]
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> $DIR/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B {
   |
```

Partially address rust-lang#47608. This PR doesn't find [macros that haven't yet been imported by name](rust-lang@af945cb).
bors added a commit that referenced this pull request Jun 10, 2025
Rollup of 13 pull requests

Successful merges:

 - #134442 (Specify the behavior of `file!`)
 - #134841 (Look at proc-macro attributes when encountering unknown attribute)
 - #140372 (Exhaustively handle parsed attributes in CheckAttr)
 - #140766 (Stabilize keylocker)
 - #141061 (Change __rust_no_alloc_shim_is_unstable to be a function)
 - #142042 (Make E0621 missing lifetime suggestion verbose)
 - #142101 (core::ptr: deduplicate more method docs)
 - #142176 (tests: Split dont-shuffle-bswaps along opt-levels and arches)
 - #142258 (platform-support.md: Mention specific Linux kernel version or later)
 - #142260 (Miri subtree update)
 - #142262 (Mark `core::slice::memchr` as `#[doc(hidden)]`)
 - #142272 (tests: Change ABIs in tests to more future-resilient ones)
 - #142275 (rustdoc: Refractor `clean_ty_generics`)

r? `@ghost`
`@rustbot` modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 10, 2025
Look at proc-macro attributes when encountering unknown attribute

```
error: cannot find attribute `sede` in this scope
  --> $DIR/missing-derive-2.rs:22:7
   |
LL |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)]
   |         +

error: cannot find attribute `serde` in this scope
  --> $DIR/missing-derive-2.rs:16:7
   |
LL |     #[serde(untagged)]
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> $DIR/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B {
   |
```

Partially address rust-lang#47608. This PR doesn't find [macros that haven't yet been imported by name](rust-lang@af945cb).
bors added a commit that referenced this pull request Jun 10, 2025
Rollup of 12 pull requests

Successful merges:

 - #134442 (Specify the behavior of `file!`)
 - #134841 (Look at proc-macro attributes when encountering unknown attribute)
 - #140372 (Exhaustively handle parsed attributes in CheckAttr)
 - #140766 (Stabilize keylocker)
 - #141061 (Change __rust_no_alloc_shim_is_unstable to be a function)
 - #142042 (Make E0621 missing lifetime suggestion verbose)
 - #142101 (core::ptr: deduplicate more method docs)
 - #142258 (platform-support.md: Mention specific Linux kernel version or later)
 - #142260 (Miri subtree update)
 - #142262 (Mark `core::slice::memchr` as `#[doc(hidden)]`)
 - #142272 (tests: Change ABIs in tests to more future-resilient ones)
 - #142275 (rustdoc: Refractor `clean_ty_generics`)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request Jun 10, 2025
Look at proc-macro attributes when encountering unknown attribute

```
error: cannot find attribute `sede` in this scope
  --> $DIR/missing-derive-2.rs:22:7
   |
LL |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)]
   |         +

error: cannot find attribute `serde` in this scope
  --> $DIR/missing-derive-2.rs:16:7
   |
LL |     #[serde(untagged)]
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> $DIR/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B {
   |
```

Partially address rust-lang#47608. This PR doesn't find [macros that haven't yet been imported by name](rust-lang@af945cb).
@workingjubilee
Copy link
Member

@bors rollup=iffy

@estebank
Copy link
Contributor Author

seems it still has problems?

I think there's another Vec<Symbol>::sort() that needs to be Vec<Symbol>::sort_by_key(|s| s.as_str()) in a different message :(

@estebank
Copy link
Contributor Author

@bors r=wesleywiser

@bors
Copy link
Collaborator

bors commented Jun 11, 2025

📌 Commit 69a3122 has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 11, 2025
bors added a commit that referenced this pull request Jun 11, 2025
Look at proc-macro attributes when encountering unknown attribute

```
error: cannot find attribute `sede` in this scope
  --> $DIR/missing-derive-2.rs:22:7
   |
LL |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Deserialize` and `Serialize` accept the similarly named `serde` attribute
   |
LL |     #[serde(untagged)]
   |         +

error: cannot find attribute `serde` in this scope
  --> $DIR/missing-derive-2.rs:16:7
   |
LL |     #[serde(untagged)]
   |       ^^^^^
   |
note: `serde` is imported here, but it is a crate, not an attribute
  --> $DIR/missing-derive-2.rs:5:1
   |
LL | extern crate serde;
   | ^^^^^^^^^^^^^^^^^^^
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
LL + #[derive(Serialize, Deserialize)]
LL | enum B {
   |
```

Partially address #47608. This PR doesn't find [macros that haven't yet been imported by name](af945cb).
@bors
Copy link
Collaborator

bors commented Jun 11, 2025

⌛ Testing commit 69a3122 with merge b84566d...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 11, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 11, 2025
```
error: cannot find attribute `empty_helper` in this scope
  --> $DIR/derive-helper-legacy-limits.rs:17:3
   |
LL | #[empty_helper]
   |   ^^^^^^^^^^^^
   |
help: `empty_helper` is an attribute that can be used by the derive macro `Empty`, you might be missing a `derive` attribute
   |
LL + #[derive(Empty)]
LL | struct S2;
   |
```

Look at proc-macro attributes when encountering unknown attribute

```
error: cannot find attribute `sede` in this scope
  --> src/main.rs:18:7
   |
18 |     #[sede(untagged)]
   |       ^^^^
   |
help: the derive macros `Serialize` and `Deserialize` accept the similarly named `serde` attribute
   |
18 |     #[serde(untagged)]
   |       ~~~~~

error: cannot find attribute `serde` in this scope
  --> src/main.rs:12:7
   |
12 |     #[serde(untagged)]
   |       ^^^^^
   |
   = note: `serde` is in scope, but it is a crate, not an attribute
help: `serde` is an attribute that can be used by the derive macros `Serialize` and `Deserialize`, you might be missing a `derive` attribute
   |
10 | #[derive(Serialize, Deserialize)]
   |
```
@estebank
Copy link
Contributor Author

@bors r=wesleywiser

@bors
Copy link
Collaborator

bors commented Jun 12, 2025

📌 Commit 92a798d has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 12, 2025
@bors
Copy link
Collaborator

bors commented Jun 13, 2025

⌛ Testing commit 92a798d with merge d087f11...

@bors
Copy link
Collaborator

bors commented Jun 14, 2025

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing d087f11 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 14, 2025
@bors bors merged commit d087f11 into rust-lang:master Jun 14, 2025
11 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 14, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 8da6239 (parent) -> d087f11 (this PR)

Test differences

Show 14 test diffs

Stage 1

  • [ui] tests/ui/macros/missing-derive-1.rs: [missing] -> pass (J1)
  • [ui] tests/ui/macros/missing-derive-2.rs: [missing] -> pass (J1)
  • [ui] tests/ui/macros/missing-derive-3.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/macros/missing-derive-1.rs: [missing] -> pass (J0)
  • [ui] tests/ui/macros/missing-derive-2.rs: [missing] -> pass (J0)
  • [ui] tests/ui/macros/missing-derive-3.rs: [missing] -> pass (J0)

Additionally, 8 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard d087f112b7d1323446c7b39a8b616aee7fa56b3d --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-2: 5617.4s -> 3428.9s (-39.0%)
  2. x86_64-apple-1: 8936.4s -> 6185.4s (-30.8%)
  3. dist-aarch64-apple: 4604.1s -> 5629.0s (22.3%)
  4. dist-apple-various: 7919.5s -> 6243.7s (-21.2%)
  5. aarch64-apple: 5190.8s -> 4330.2s (-16.6%)
  6. dist-x86_64-apple: 9236.5s -> 7706.6s (-16.6%)
  7. mingw-check-2: 2231.2s -> 1885.4s (-15.5%)
  8. i686-gnu-1: 8471.4s -> 7221.1s (-14.8%)
  9. mingw-check-1: 1961.5s -> 1677.9s (-14.5%)
  10. i686-gnu-2: 6253.9s -> 5391.9s (-13.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d087f11): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.1%, secondary 0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
2.8% [2.4%, 3.3%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-3.2%, -2.1%] 3
All ❌✅ (primary) 2.1% [2.1%, 2.1%] 1

Cycles

Results (secondary -6.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.7% [-6.8%, -6.6%] 3
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 756.284s -> 757.156s (0.12%)
Artifact size: 372.34 MiB -> 372.29 MiB (-0.01%)

tgross35 added a commit to tgross35/rust that referenced this pull request Jun 14, 2025
To prepare for merging from rust-lang/rust, set the version file to:

    d087f11 Auto merge of rust-lang#134841 - estebank:serde-attr-4, r=wesleywiser
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Jun 18, 2025
To prepare for merging from rust-lang/rust, set the version file to:

    d087f11 Auto merge of rust-lang#134841 - estebank:serde-attr-4, r=wesleywiser
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants