-
Notifications
You must be signed in to change notification settings - Fork 14k
Implement DynSend and DynSync for std::panic::Location. #148779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zachs18
wants to merge
1
commit into
rust-lang:main
Choose a base branch
from
zachs18:panic-location-dynsendsync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4
−4
Conversation
This file contains hidden or 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
Required to allow the compiler to build with the debug_refcell stdlib cargo feature.
Collaborator
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
nnethercote
approved these changes
Nov 10, 2025
Contributor
|
@bors r+ rollup |
Collaborator
ChrisDenton
added a commit
to ChrisDenton/rust
that referenced
this pull request
Nov 10, 2025
…, r=nnethercote
Implement DynSend and DynSync for std::panic::Location.
Allows the compiler to build with the `debug_refcell` stdlib cargo feature.
With `rust.std-features = ["debug_refcell"]` in bootstrap.toml, `./x.py build --stage 2` fails before this patch, and succeeds afterwards.
<details> <summary>error for `./x.py build --stage 2` before this patch</summary>
```Rust
error[E0277]: `NonNull<str>` doesn't implement `DynSync`. Add it to `rustc_data_structures::marker` or use `IntoDynSyncSend` if it's already `Sync`
--> compiler/rustc_query_system/src/dep_graph/serialized.rs:719:33
|
719 | let results = broadcast(|_| {
| _______________________---------_^
| | |
| | required by a bound introduced by this call
720 | | let mut local = self.local.borrow_mut();
... |
734 | | });
| |_________^ within `Location<'static>`, the trait `DynSync` is not implemented for `NonNull<str>`
|
note: required because it appears within the type `Location<'static>`
--> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/panic/location.rs:39:12
|
39 | pub struct Location<'a> {
| ^^^^^^^^
= note: required for `&'static Location<'static>` to implement `DynSend`
note: required because it appears within the type `std::option::Option<&'static Location<'static>>`
--> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/option.rs:599:10
|
599 | pub enum Option<T> {
| ^^^^^^
note: required because it appears within the type `std::cell::UnsafeCell<std::option::Option<&'static Location<'static>>>`
--> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/cell.rs:2289:12
|
2289 | pub struct UnsafeCell<T: ?Sized> {
| ^^^^^^^^^^
note: required because it appears within the type `Cell<std::option::Option<&'static Location<'static>>>`
--> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/cell.rs:313:12
|
313 | pub struct Cell<T: ?Sized> {
| ^^^^
note: required because it appears within the type `RefCell<LocalEncoderState>`
--> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/library/core/src/cell.rs:822:12
|
822 | pub struct RefCell<T: ?Sized> {
| ^^^^^^^
= note: required for `rustc_data_structures::sync::WorkerLocal<RefCell<LocalEncoderState>>` to implement `DynSync`
note: required because it appears within the type `EncoderState<D>`
--> compiler/rustc_query_system/src/dep_graph/serialized.rs:546:8
|
546 | struct EncoderState<D: Deps> {
| ^^^^^^^^^^^^
= note: required because it appears within the type `&EncoderState<D>`
note: required because it's used within this closure
--> compiler/rustc_query_system/src/dep_graph/serialized.rs:719:33
|
719 | let results = broadcast(|_| {
| ^^^
note: required by a bound in `rustc_data_structures::sync::broadcast`
--> /home/zachary/opt_mount/zachary/Programming/rust-compiler-2/compiler/rustc_data_structures/src/sync/parallel.rs:239:56
|
239 | pub fn broadcast<R: DynSend>(op: impl Fn(usize) -> R + DynSync) -> Vec<R> {
| ^^^^^^^ required by this bound in `broadcast`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `rustc_query_system` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
Build completed unsuccessfully in 0:02:04
```
</details>
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows the compiler to build with the
debug_refcellstdlib cargo feature.With
rust.std-features = ["debug_refcell"]in bootstrap.toml,./x.py build --stage 2fails before this patch, and succeeds afterwards.error for `./x.py build --stage 2` before this patch