Skip to content

ICE "not a type parameter" on nightly (regression) #62263

Closed
@LegNeato

Description

@LegNeato

Repro:

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=c4a8f90dada13368b5749e84b7b01108

pub type PrivacyPolicy<E> =
    Vec<Box<dyn PrivacyRule<ViewerContext = Self::ViewerContext, Id = Self::Id, Err = E>>>;

pub trait PrivacyRule {
    type ViewerContext;
    type Id;
    fn can_see(&self, viewer: &Self::ViewerContext, id: &Self::Id) -> ();
}

This doesn't ICE on beta or stable but gives the following ICE on nightly:

error: internal compiler error: src/librustc/hir/map/mod.rs:517: ty_param_owner: ty PrivacyPolicy (hir_id=HirId { owner: DefIndex(12), local_id: 0 }) not a type parameter

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:643:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error


note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.37.0-nightly (b25ee6449 2019-06-17) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions