Use super_fold in RegionsToStatic visitor
This commit is contained in:
parent
25e3949aa1
commit
116f95bb46
6 changed files with 28 additions and 1 deletions
|
@ -455,7 +455,7 @@ impl<I: Interner> TypeFolder<I> for RegionsToStatic<I> {
|
|||
I::Binder<T>: TypeSuperFoldable<I>,
|
||||
{
|
||||
self.binder.shift_in(1);
|
||||
let t = t.fold_with(self);
|
||||
let t = t.super_fold_with(self);
|
||||
self.binder.shift_out(1);
|
||||
t
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
//@ compile-flags: -Znext-solver=coherence
|
||||
|
||||
#[derive(Debug)]
|
||||
struct X<const FN: fn() = { || {} }>;
|
||||
//~^ ERROR using function pointers as const generic parameters is forbidden
|
||||
//~| ERROR using function pointers as const generic parameters is forbidden
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,19 @@
|
|||
error: using function pointers as const generic parameters is forbidden
|
||||
--> $DIR/const-region-infer-to-static-in-binder.rs:4:20
|
||||
|
|
||||
LL | struct X<const FN: fn() = { || {} }>;
|
||||
| ^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool` and `char`
|
||||
|
||||
error: using function pointers as const generic parameters is forbidden
|
||||
--> $DIR/const-region-infer-to-static-in-binder.rs:4:20
|
||||
|
|
||||
LL | struct X<const FN: fn() = { || {} }>;
|
||||
| ^^^^
|
||||
|
|
||||
= note: the only supported types are integers, `bool` and `char`
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue