Skip to content

Error reported over different Send and Sync ordering #12739

@coreyja

Description

@coreyja

Hey, first issue over here! Thanks everyone for the hard work put into this tool!

I ran into a small issue where I get an error that the order of Send + Sync is 'wrong'. Here is an example error message:

expected &(dyn Fn(&GameType) -> ScoreType + Send + Sync), found &(dyn Fn(&GameType) -> ScoreType + Sync + Send)

image

Notice the only difference being the order of Send and Sync at the end of each type. This code compiles fine with rustc but rust-analyzer (via nvim for me) is showing this error. Changing the order of Send and Sync in my code, so each site matches, resolves the error.

Is this intended behavior or a bug?
I fixed my usage, as it makes sense for both sites to have the same ordering! But was midly surprised me that it showed an error, especially when rustc did not.

Minimal Example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ac7efd618222cb33058c459d2d9b98de

rust-analyzer version: rust-analyzer 0.0.0 (5342f47 2022-07-09)
Also present on the latest (https://github.com/rust-lang/rust-analyzer/tree/2022-07-04) release, both downloaded from Github Releases for arm64 apple

rustc version: rustc 1.62.0 (a8314ef7d 2022-06-27)

relevant settings: None that I know of

Metadata

Metadata

Assignees

Labels

A-tytype system / type inference / traits / method resolutionC-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions