2023-04-29 06:01:08 -05:00
|
|
|
// Verify that we do not ICE when we try to overwrite an anon-const's type because of a trait
|
|
|
|
// cycle.
|
|
|
|
//
|
|
|
|
//@ compile-flags: -Zincremental-ignore-spans
|
|
|
|
//@ revisions: cpass cfail
|
2023-04-29 06:01:51 -05:00
|
|
|
//@ error-pattern: cycle detected when computing type of `Bar::N`
|
2023-04-29 06:01:08 -05:00
|
|
|
|
|
|
|
#![feature(trait_alias)]
|
|
|
|
#![crate_type="lib"]
|
|
|
|
|
|
|
|
#[cfg(cpass)]
|
|
|
|
trait Bar<const N: usize> {}
|
|
|
|
|
|
|
|
#[cfg(cfail)]
|
|
|
|
trait Bar<const N: dyn BB> {}
|
|
|
|
|
|
|
|
trait BB = Bar<{ 2 + 1 }>;
|