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

multiple applicable items in scope - type_id #58922

Closed
Dylan-DPC-zz opened this issue Mar 4, 2019 · 5 comments
Closed

multiple applicable items in scope - type_id #58922

Dylan-DPC-zz opened this issue Mar 4, 2019 · 5 comments
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@Dylan-DPC-zz
Copy link

Dylan-DPC-zz commented Mar 4, 2019

From a crater run:

[INFO] [stderr]    Compiling downcast v0.9.2 (/opt/crater/workdir)
[INFO] [stderr] error[E0034]: multiple applicable items in scope
[INFO] [stderr]    --> src/lib.rs:120:38
[INFO] [stderr]     |
[INFO] [stderr] 120 |     fn is_type(&self) -> bool { self.type_id() == TypeId::of::<T>() }
[INFO] [stderr]     |                                      ^^^^^^^ multiple `type_id` found
[INFO] [stderr]     |
[INFO] [stderr] note: candidate #1 is defined in the trait `Any`
[INFO] [stderr]    --> src/lib.rs:29:5
[INFO] [stderr]     |
[INFO] [stderr] 29  |     fn type_id(&self) -> TypeId { TypeId::of::<Self>() }
[INFO] [stderr]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stderr]     = help: to disambiguate the method call, write `Any::type_id(&self)` instead
[INFO] [stderr] note: candidate #2 is defined in the trait `std::any::Any`
[INFO] [stderr]     = help: to disambiguate the method call, write `std::any::Any::type_id(&self)` instead
[INFO] [stderr] 
[INFO] [stderr] error: aborting due to previous error
[INFO] [stderr] 
[INFO] [stderr] For more information about this error, try `rustc --explain E0034`.
[INFO] [stderr] error: Could not compile `downcast`.

Found this error in the following crates:
Downcast: crater log

Findr: crater log

ncollide - crater log

ncollide-geometry - crater log

cc crate authors: @stevedonovan @elrnv @sebcrozet

@estebank
Copy link
Contributor

estebank commented Mar 4, 2019

This is fallout from the recent change from get_type_id to type_id.

@sebcrozet
Copy link
Contributor

We already fixed this on ncollide. The fix required a breaking change so it was released as ncollide 0.18.
And the ncollide-geometry crate is no longer maintained.

@jonas-schievink jonas-schievink added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Mar 5, 2019
@pietroalbini
Copy link
Member

cc @rust-lang/libs

@SimonSapin
Copy link
Contributor

This sounds like business as usual when adding / stabilizing new methods on existing standard library types, and upstream already has a work-around. So I’m inclined to close this with no change.

@khimaros
Copy link

FYI, this appears to have transitively broken the sqlite crate. Is there a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants