-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 #134357 - Urgau:fn-ptr-134345, r=compiler-errors
Fix `trimmed_def_paths` ICE in the function ptr comparison lint This PR fixes an ICE with `trimmed_def_paths` ICE in the function ptr comparison lint, specifically when pretty-printing user types but then not using the resulting pretty-printing. Fixes #134345 r? `@saethlin`
- Loading branch information
Showing
3 changed files
with
75 additions
and
34 deletions.
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
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,16 @@ | ||
// This check veifies that we do not ICE when not showing a user type | ||
// in the suggestions/diagnostics. | ||
// | ||
// cf. https://github.com/rust-lang/rust/issues/134345 | ||
// | ||
//@ check-pass | ||
|
||
struct A; | ||
|
||
fn fna(_a: A) {} | ||
|
||
#[allow(unpredictable_function_pointer_comparisons)] | ||
fn main() { | ||
let fa: fn(A) = fna; | ||
let _ = fa == fna; | ||
} |