Skip to content

Fix decoding attributes of SyntheticCoroutineBody - #159085

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
JonathanBrouwer:fix-def-path-attrs
Jul 27, 2026
Merged

Fix decoding attributes of SyntheticCoroutineBody#159085
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
JonathanBrouwer:fix-def-path-attrs

Conversation

@JonathanBrouwer

@JonathanBrouwer JonathanBrouwer commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

View all comments

Fixes #156905 by returning an empty list of attributes for SyntheticCoroutineBody when its attributes are decoded

@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 Jul 10, 2026
@rustbot

rustbot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

r? @folkertdev

rustbot has assigned @folkertdev.
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 75 candidates
  • Random selection from 20 candidates

.get(self, parent_id)
.expect("no encoded attributes for a structure or variant")
}
DefPathData::SyntheticCoroutineBody => {

@kn1g78 kn1g78 Jul 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we add a regression test for this?

This fixes an ICE while decoding attributes of an external SyntheticCoroutineBody, but the PR currently has no test
covering that cross-crate path. A Miri regression test would likely be the closest match for #156905, since it
exercises find_attr! / attrs_for_def.

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.

A regression test would be great yeah, I think taking the test from quiode@dd72b0b makes sense, I'll do that

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.

Done

@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 10, 2026
@rustbot

rustbot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot

rustbot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@rustbot

rustbot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Comment thread src/tools/miri/tests/deps/Cargo.toml Outdated
//@normalize-stderr-test: "/rustc-dev/[^/]*/" -> "/rustc-dev/$HASH/"

// Miri ICE when encountering a `SyntheticCoroutineBody` from an external crate (see
// `closure_ice_lib` for details). Calling the async closure triggers the ICE.

@RalfJung RalfJung Jul 26, 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.

I hope we don't ICE any more? Why all this error normalization in a "pass" test?

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.

Fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The description still says "triggers", that should be "triggered" maybe? Also maybe link the issue.

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.

Sounds reasonable, fixed

@JonathanBrouwer
JonathanBrouwer force-pushed the fix-def-path-attrs branch 2 times, most recently from bd9cacd to 768a041 Compare July 26, 2026 11:14
Comment thread src/tools/miri/tests/pass-dep/cross_crate_async_closure_ice.rs
Comment thread src/tools/miri/tests/deps/cross-crate-items/src/lib.rs Outdated
@JonathanBrouwer
JonathanBrouwer force-pushed the fix-def-path-attrs branch 2 times, most recently from a29dcd5 to 9f85877 Compare July 26, 2026 11:45
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@RalfJung how about this?
@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 26, 2026
@RalfJung

Copy link
Copy Markdown
Member

That's great, thanks :)

Co-authored-by: Dominik Schwaiger <mail@dominik-schwaiger.ch>
@folkertdev

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e12d28f has been approved by folkertdev

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 26, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 27, 2026
…, r=folkertdev

Fix decoding attributes of `SyntheticCoroutineBody`

Fixes rust-lang#156905 by returning an empty list of attributes for `SyntheticCoroutineBody` when its attributes are decoded
rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - #159554 (feat: Update method signature of int_from_ascii)
 - #159637 (Some place analysis tweaks)
 - #159961 (sanitize_standard_fds: Miri supports poll now)
 - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
Fix decoding attributes of `SyntheticCoroutineBody`



Fixes #156905 by returning an empty list of attributes for `SyntheticCoroutineBody` when its attributes are decoded
@jhpratt

jhpratt commented Jul 27, 2026

Copy link
Copy Markdown
Member

@bors yield

@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #159085.

rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - #159554 (feat: Update method signature of int_from_ascii)
 - #159637 (Some place analysis tweaks)
 - #159961 (sanitize_standard_fds: Miri supports poll now)
 - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 27, 2026
…, r=folkertdev

Fix decoding attributes of `SyntheticCoroutineBody`

Fixes rust-lang#156905 by returning an empty list of attributes for `SyntheticCoroutineBody` when its attributes are decoded
rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #158417 (Avoid ICE when cfg_eval recovers no item from derive input)
 - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - #159554 (feat: Update method signature of int_from_ascii)
 - #159637 (Some place analysis tweaks)
 - #159649 (Normalize region obligations before regionck)
 - #159961 (sanitize_standard_fds: Miri supports poll now)
 - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - #159804 (Expand docs for fs::metadata and fs::symlink_metadata)
 - #159821 (Update expect message using the recommended style in binary_heap module)
 - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
 - #159991 (std: make send_process_group_signal unsupported on VxWorks)
 - #159996 (Detect when a macro without exclamation mark uses square brackets)
@rust-bors
rust-bors Bot merged commit e3a5100 into rust-lang:main Jul 27, 2026
13 of 14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 27, 2026
rust-timer added a commit that referenced this pull request Jul 27, 2026
Rollup merge of #159085 - JonathanBrouwer:fix-def-path-attrs, r=folkertdev

Fix decoding attributes of `SyntheticCoroutineBody`

Fixes #156905 by returning an empty list of attributes for `SyntheticCoroutineBody` when its attributes are decoded
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Jul 28, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#158417 (Avoid ICE when cfg_eval recovers no item from derive input)
 - rust-lang/rust#159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - rust-lang/rust#159554 (feat: Update method signature of int_from_ascii)
 - rust-lang/rust#159637 (Some place analysis tweaks)
 - rust-lang/rust#159649 (Normalize region obligations before regionck)
 - rust-lang/rust#159961 (sanitize_standard_fds: Miri supports poll now)
 - rust-lang/rust#159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - rust-lang/rust#159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - rust-lang/rust#159804 (Expand docs for fs::metadata and fs::symlink_metadata)
 - rust-lang/rust#159821 (Update expect message using the recommended style in binary_heap module)
 - rust-lang/rust#159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - rust-lang/rust#159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
 - rust-lang/rust#159991 (std: make send_process_group_signal unsupported on VxWorks)
 - rust-lang/rust#159996 (Detect when a macro without exclamation mark uses square brackets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[ICE]: find_attr! panics for SyntheticCoroutineBody (in Miri, related to rustc_no_writable)

6 participants