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

TypeId is sometimes not consistent across crates #13507

Closed
Meyermagic opened this issue Apr 14, 2014 · 1 comment · Fixed by #13511
Closed

TypeId is sometimes not consistent across crates #13507

Meyermagic opened this issue Apr 14, 2014 · 1 comment · Fixed by #13511

Comments

@Meyermagic
Copy link
Contributor

See: https://gist.github.com/Meyermagic/10636908 (where the underscores in the filenames represent forward slashes / subdirectories)

With Foo as an enum, the TypeId differs in each crate. With a simple struct, the TypeIds match.

@Meyermagic
Copy link
Contributor Author

This causes AnyOwnExt's "move" and AnyRefExt's "is" to fail when used with some types from other crates / prevents the safe extraction of the underlying type of trait objects.

Meyermagic added a commit to Meyermagic/rust that referenced this issue Apr 15, 2014
Fixes hashing of DefId for ty_enum.

Adds tests for cross-crate TypeId equivalence for various types.
bors added a commit that referenced this issue Apr 16, 2014
Fixes #13507.

I haven't familiarized myself with this part of the rust compiler, so hopefully there are no mistakes (despite the simplicity of the commit). It is also 5am.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant