Skip to content

Type mismatch on &dyn Send #12530

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

Closed
lnicola opened this issue Jun 14, 2022 · 1 comment
Closed

Type mismatch on &dyn Send #12530

lnicola opened this issue Jun 14, 2022 · 1 comment
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug S-actionable Someone could pick this issue up and work on it right now

Comments

@lnicola
Copy link
Member

lnicola commented Jun 14, 2022

use std::any::Any;

fn main() {
    let _: &(dyn Send + Sync) = &42; // Expected &(dyn Send + Sync), got &i32
    let _: &dyn Send = &42; // Expected &dyn Send, got &i32
    let _: &dyn Any = &42; // works
}
@lnicola lnicola added A-ty type system / type inference / traits / method resolution S-actionable Someone could pick this issue up and work on it right now C-bug Category: bug labels Jun 14, 2022
@lnicola lnicola changed the title Type mismatch on &(dyn T + U) Type mismatch on &dyn Send Jun 14, 2022
@lnicola
Copy link
Member Author

lnicola commented Jun 14, 2022

Dupe of #11847.

@lnicola lnicola closed this as completed Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

1 participant