-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
analyze: fix deconstruct_hir_ty adt/path case (#1023)
Previously, type aliases for `Option<*const T>` caused a panic, as `deconstruct_hir_ty` would match the HIR alias with the MIR type `Option<T>` and then get confused due to the mismatched number of type arguments. With this fix, `deconstruct_hir_ty` will no longer match the HIR alias with the MIR type as the two have different `DefId`s.
- 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
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,11 @@ | ||
// Regression test: previously, type aliases for `Option<*const T>` caused a panic, as | ||
// `deconstruct_hir_ty` would match the HIR alias with the MIR type `Option<T>` and then get | ||
// confused due to the mismatched number of type arguments. | ||
type AliasOption = Option<*const u8>; | ||
|
||
// CHECK: struct UseAliasOption<'h0> | ||
struct UseAliasOption { | ||
// FIXME: should be `Option<&'h0 u8>` | ||
// CHECK: x: std::option::Option<&u8> | ||
x: AliasOption, | ||
} |