You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a type doesn't conform to Sync because it contains a field that doesn't conform, the error message yielded when trying to use that type where Sync is required is confusing. It talks about the type of the field itself, without actually mentioning that this is a field of the type in question, but it flags the point where the type is used rather than the field definition.
unnamed.rs:12:5: 12:26 error: the trait `core::marker::Sync` is not implemented for the type `Trait + Send` [E0277]
unnamed.rs:12 assert_is_sync::<Foo>();
^~~~~~~~~~~~~~~~~~~~~
unnamed.rs:12:5: 12:26 note: `Trait + Send` cannot be shared between threads safely
unnamed.rs:12 assert_is_sync::<Foo>();
^~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
The only way to understand this error is to know that Foo contains a field whose type includes Trait + Send and correctly guess this means that Foo does not conform to Send.
The text was updated successfully, but these errors were encountered:
When a type doesn't conform to
Sync
because it contains a field that doesn't conform, the error message yielded when trying to use that type whereSync
is required is confusing. It talks about the type of the field itself, without actually mentioning that this is a field of the type in question, but it flags the point where the type is used rather than the field definition.Example:
prints
The only way to understand this error is to know that
Foo
contains a field whose type includesTrait + Send
and correctly guess this means thatFoo
does not conform toSend
.The text was updated successfully, but these errors were encountered: