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
The compiler panics when using generics in trait aliases. I tried to reduce the code as much as I could while preserving the error so I apologize if it does not make any sense. Basically I had created a couple of different libraries that depended on each other.
The first library created a multi parameter generic type alias
The second library used that alias to define a slightly less generic trait alias
The third used the second to create a trait with all concrete types
I attempted to collapse some of the code to use less generics and crates, so it probably won't make sense why you'd write code like this, but it should show the error regardless.
Thanks for the report. I can confirm this has already been fixed in my PR #55994, which I'm hoping will merge very soon. :-)
error[E0432]: unresolved import `crate::NON_EXISTENT`
--> src/lib.rs:7:12
|
7 | use crate::NON_EXISTENT::ANY_GIBERISH_HERE_CAUSES_PANIC;
| ^^^^^^^^^^^^ maybe a missing `extern crate NON_EXISTENT;`?
warning: unused import: `crate::NON_EXISTENT::ANY_GIBERISH_HERE_CAUSES_PANIC`
--> src/lib.rs:7:5
|
7 | use crate::NON_EXISTENT::ANY_GIBERISH_HERE_CAUSES_PANIC;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
error: aborting due to previous error
The above is what I got when I tried to build your crate locally, using my PR build of rustc. I presume you expected something like this? If so, please feel free to close.
@alexreg Great, that is what I would expect! Glad to see you're already ahead of me. I look forward to you landing your change so I can test the original project I was working on. I'll go ahead and close this issue. Thanks again!
…nikomatsakis
make trait-aliases work across crates
This is rebase of a small part of @alexreg's PR rust-lang#55994. It focuses just on the changes that integrate trait aliases properly into crate metadata, excluding the stylistic edits and the trait objects.
The stylistic edits I also rebased and can open a separate PR.
The trait object stuff I found challenging and decided it basically needed to be reimplemented. For now I've excluded it.
Since this is really @alexreg's work (I really just rebased) I am going to make it r=me once it is working.
Fixesrust-lang#56488.
Fixesrust-lang#57023.
The compiler panics when using generics in trait aliases. I tried to reduce the code as much as I could while preserving the error so I apologize if it does not make any sense. Basically I had created a couple of different libraries that depended on each other.
The first library created a multi parameter generic type alias
The second library used that alias to define a slightly less generic trait alias
The third used the second to create a trait with all concrete types
I attempted to collapse some of the code to use less generics and crates, so it probably won't make sense why you'd write code like this, but it should show the error regardless.
I tried this code:
https://github.com/jgrowl/rust_nightly_790f4c566_2018-12-19_trait_alias_bug
I expected to not get a compiler panic
Meta
Backtrace:
The text was updated successfully, but these errors were encountered: