Skip to content

Use super_fold in RegionsToStatic visitor #124808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion compiler/rustc_next_trait_solver/src/canonicalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ compile-flags: -Znext-solver=coherence
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ICEs on -Znext-solver, could add a separate revision I guess.


#[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() {}
Original file line number Diff line number Diff line change
@@ -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