forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#122173 - compiler-errors:ptr-equality-in-ctfe, r=lcnr Don't ICE in CTFE if raw/fn-ptr types differ Fixes rust-lang#121688 r? lcnr
- Loading branch information
Showing
3 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const fn cmp(x: fn(&'static ()), y: for<'a> fn(&'a ())) -> bool { | ||
x == y | ||
//~^ ERROR pointers cannot be reliably compared during const eval | ||
} | ||
|
||
fn main() {} |
10 changes: 10 additions & 0 deletions
10
tests/ui/consts/different-fn-ptr-binders-during-ctfe.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: pointers cannot be reliably compared during const eval | ||
--> $DIR/different-fn-ptr-binders-during-ctfe.rs:2:5 | ||
| | ||
LL | x == y | ||
| ^^^^^^ | ||
| | ||
= note: see issue #53020 <https://github.com/rust-lang/rust/issues/53020> for more information | ||
|
||
error: aborting due to 1 previous error | ||
|