Repository navigation
ICE: Use a type that has already been pub used. #45876
Copy link
Copy link
Closed
Labels
A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Activity
I was unable to reproduce the ICE from any of the 10 most recent commits of that repository (starting at 41e849b3fea70753e12a2e04444c80593fb49837). I attempted on macOS with Rust 1.21.0.
for r in $(git rev-list origin/master~10..origin/master); do git checkout $r; echo $r; cargo build; done- changed the title
[-]The compiler unexpectedly panicked. This is a bug.[/-][+]ICE: Use a type that has already been pub used.[/+]on Nov 8, 2017 @shepmaster None of the 10 commits you used can be used to reproduce the issue. I can use this commit to reproduce the issue on 2 of my machines.
Yep, I can confirm I see the ICE now.
Here is a reduced testcase:
mod item { mod visibility { pub struct Visibility; } pub use self::visibility::*; use Visibility; struct Item(Visibility); impl Item { fn get_nodes(&self) { self.0; } } } pub use self::item::*; fn main() {}
error: internal compiler error: cat_expr Errd --> src/main.rs:13:13 | 13 | self.0; | ^^^^^^I see this fail on:
- macOS 1.21.0 &
1.23.0-nightly (d9f124965 2017-10-27) - Linux 1.21.0 &
1.23.0-nightly (2017-11-07 ee2286149a5f0b148334841d4f067dc819dcca3b)
Reacted by Noël Widmer and kennytm- macOS 1.21.0 &
It appears to me that
item::visibility::Visibilityis reachable through multiple paths:pub use self::visibility::*;->item::visibility::Visibilityuse Visibility;->pub use self::item::*;->item::visibility::Visibility
I'd guess the problem lies therein
- addedI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Nov 8, 2017
Metadata
Metadata
Assignees
Labels
A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Summary:
The compilation of my source panics. I believe this happens because I
useastructthat has already beenpub used. You may be able to reproduce the issue using this github commit from my repository.I tried this code:
The following source is inside the file:
src\syntactic_analysis\nodes\item\mod.rsThese are the complete file contents.
Modifying the file to the following snippet resolves the issue:
(Only one line has been modified)
I expected to see this happen:
A compilation result.
Instead, this happened:
Meta
rustc --version --verbose:Backtrace: