Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//! Reporting the unconstrained const param error used to hit
//! `assertion failed: !origin.span.is_dummy()` with the new solver.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/152415>.
//@ compile-flags: -Znext-solver

trait Super<T> {
type Assoc;
}

trait Mirror {
type Assoc;
}

impl<T, const N: usize> Mirror for T {
//~^ ERROR the const parameter `N` is not constrained by the impl trait, self type, or predicates
type Assoc = T;
}

trait Foo<A>: Super<<A as Mirror>::Assoc, Assoc = A> {}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/unconstrained-const-param-supertrait-projection-152415.rs:15:9
|
LL | impl<T, const N: usize> Mirror for T {
| ^^^^^^^^^^^^^^ unconstrained const parameter
|
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0207`.
Loading