Skip to content

Add context span showing item that can't be annotated - #164880

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
estebank:bad-attr-context
Oct 25, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
estebank:bad-attr-context

Conversation

@estebank

@estebank estebank commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Add line pointing at Struct:

error: the `rustc_must_implement_one_of` attribute cannot be used on structs
  --> $DIR/rustc_must_implement_one_of_misuse.rs:72:3
   |
LL | #[rustc_must_implement_one_of(abc, xyz)]
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | struct Struct {}
   |
   = help: the `rustc_must_implement_one_of` attribute can only be applied to traits

@rustbot

rustbot commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred in tests/ui/sanitizer

cc @rcvalle

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 25, 2026
@rustbot

rustbot commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

rustbot has assigned @petrochenkov.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 17 candidates

@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer

Copy link
Copy Markdown
Member

r? me

@JonathanBrouwer JonathanBrouwer left a comment •

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.

@rust-bors

rust-bors Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 86fc633 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Oct 25, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 25, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd)
 - #161362 ( rustdoc: Correctly handle reexports when --document-private-items is used)
 - #163769 (reborrow: Fix various ICEs related to auto reborrowing of user-space types)
 - #164764 (Test(lib/sync): Fix `test_rwlock_max_readers` for 32bit architectures)
 - #164860 (std::fs: read interrupted by a signal, read_buf_exact_at reports EOF.)
 - #164869 (rustc_codegen_gcc subtree update)
 - #157123 (library: optimize truncate method)
 - #159916 (Optimize `str.escape_default().to_string()`)
 - #163510 (process: Improve the output of `Debug` for `ExitStatus` on Unix)
 - #164508 (ping me for layout invariant changes)
 - #164758 (Update dependency jinja2 to v3.1.6 [SECURITY])
 - #164816 (Take the colon span into account for struct field initializers)
 - #164836 (Add regression test for #162109)
 - #164846 (Remove contradictory inequalities from overflow safety docs)
 - #164857 (Do not checkout Cargo for bootstrap tests)
 - #164868 (Fix skipping library build with `--keep-stage[-std]`)
 - #164872 (cg_llvm: clarify Send / Sync story for modules)
 - #164880 (Add context span showing item that can't be annotated)
 - #164881 (Add FIXME comments to `from_ascii_bytes_radix_impl`)
 - #164884 (Windows: bounds-check the reparse point name in `read_link`)
rust-bors Bot pushed a commit that referenced this pull request Oct 25, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #160404 (fd-views: AsRef<File>&Co. for BorrowedFd)
 - #161362 ( rustdoc: Correctly handle reexports when --document-private-items is used)
 - #163769 (reborrow: Fix various ICEs related to auto reborrowing of user-space types)
 - #164764 (Test(lib/sync): Fix `test_rwlock_max_readers` for 32bit architectures)
 - #164860 (std::fs: read interrupted by a signal, read_buf_exact_at reports EOF.)
 - #164869 (rustc_codegen_gcc subtree update)
 - #157123 (library: optimize truncate method)
 - #159916 (Optimize `str.escape_default().to_string()`)
 - #163510 (process: Improve the output of `Debug` for `ExitStatus` on Unix)
 - #164508 (ping me for layout invariant changes)
 - #164758 (Update dependency jinja2 to v3.1.6 [SECURITY])
 - #164816 (Take the colon span into account for struct field initializers)
 - #164836 (Add regression test for #162109)
 - #164846 (Remove contradictory inequalities from overflow safety docs)
 - #164857 (Do not checkout Cargo for bootstrap tests)
 - #164868 (Fix skipping library build with `--keep-stage[-std]`)
 - #164872 (cg_llvm: clarify Send / Sync story for modules)
 - #164880 (Add context span showing item that can't be annotated)
 - #164881 (Add FIXME comments to `from_ascii_bytes_radix_impl`)
 - #164884 (Windows: bounds-check the reparse point name in `read_link`)
@rust-bors
rust-bors Bot merged commit 6179cc6 into rust-lang:main Oct 25, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 25, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 25, 2026
Rollup merge of #164880 - estebank:bad-attr-context, r=JonathanBrouwer

Add context span showing item that can't be annotated

Add line pointing at `Struct`:

```
error: the `rustc_must_implement_one_of` attribute cannot be used on structs
  --> $DIR/rustc_must_implement_one_of_misuse.rs:72:3
   |
LL | #[rustc_must_implement_one_of(abc, xyz)]
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | struct Struct {}
   |
   = help: the `rustc_must_implement_one_of` attribute can only be applied to traits
```
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (a0e03c6): comparison URL.

Overall result: ❌ regressions - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.3% [0.0%, 0.5%] 13
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.0%)

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

mean range count
Regressions ❌
(primary)
0.9% [0.5%, 1.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-0.6%, -0.5%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-0.6%, 1.3%] 8

Cycles

Results (primary -0.1%)

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

mean range count
Regressions ❌
(primary)
0.6% [0.4%, 0.9%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-1.3%, -0.4%] 7
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-1.3%, 0.9%] 13

Binary size

This perf run didn't have relevant results for this metric.

Artifact size: 405.87 MiB -> 405.91 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Oct 27, 2026
@panstromek

Copy link
Copy Markdown
Contributor

perf triage:

Noise

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. PG-exploit-mitigations Project group: Exploit mitigations 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.

7 participants