Fix handling of const params defaults that ref Self & generalize diag
We used to lower such bad defaulted const args in trait object types to
`{type error}`; now correctly lower them to `{const error}`.
The added tests used to ICE prior to this change.
This commit is contained in:
parent
baba337869
commit
233a45c41a
14 changed files with 139 additions and 108 deletions
|
|
@ -1,6 +0,0 @@
|
|||
//@ known-bug: #136063
|
||||
#![feature(generic_const_exprs)]
|
||||
trait A<const B: u8 = X> {}
|
||||
impl A<1> for bool {}
|
||||
fn bar(arg : &dyn A<x>) { bar(true) }
|
||||
pub fn main() {}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
//@ known-bug: #137260
|
||||
#![feature(generic_const_exprs)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait Iter<const N: usize = { 1 + true }> {}
|
||||
|
||||
fn needs_iter<const N: usize, T: Iter<N>>() {}
|
||||
|
||||
fn test() {
|
||||
needs_iter::<1, dyn Iter<()>>();
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
//@ known-bug: #137514
|
||||
//@ needs-rustc-debug-assertions
|
||||
#![feature(generic_const_exprs)]
|
||||
|
||||
trait Bar<const N: usize> {}
|
||||
|
||||
trait BB = Bar<{ 1i32 + 1 }>;
|
||||
|
||||
fn foo(x: &dyn BB) {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue