Skip to content
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

type cannot be shared between threads safely message could be more informative #28378

Closed
vvuk opened this issue Sep 12, 2015 · 1 comment
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@vvuk
Copy link
Contributor

vvuk commented Sep 12, 2015

If you hit an issue such as

misc.rs:26:5: 26:17 error: the trait `core::marker::Sync` is not implemented for the type `*mut libc::types::common::c95::c_void` [E0277]
misc.rs:26     require_sync(&x);
               ^~~~~~~~~~~~
misc.rs:26:5: 26:17 help: run `rustc --explain E0277` to see a detailed explanation
misc.rs:26:5: 26:17 note: `*mut libc::types::common::c95::c_void` cannot be shared between threads safely
misc.rs:26     require_sync(&x);
               ^~~~~~~~~~~~
error: aborting due to previous error

It's very difficult to track down the actual type that has the c_void (or whatever). Sample gist with issue: https://gist.github.com/vvuk/333cef042169abbf9bfb

It would be very nice if rustc were to indicate that it's talking about the "p" field of OneStruct, which is the 'one' field of TwoStruct. Even just having the note/error refer to OneStruct would be helpful, because as it is it's very difficult to track down where the actual problem is.

@jdm jdm added I-papercut A-diagnostics Area: Messages for errors, warnings, and lints labels Sep 12, 2015
@huonw
Copy link
Member

huonw commented Sep 13, 2015

Dupe of #21793 , thanks for filing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

3 participants