diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-05-20 18:44:57 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-05-27 09:27:15 +0000 |
commit | c77c3494f82da01c85a294a5f9c3a0c5496f8572 (patch) | |
tree | cf9dcd5e07173b53eef5bd937350c9b9e49efe2b /libjava/java/security/KeyException.java | |
parent | ba32a6e460813a94e5f129dbc0e259c300690385 (diff) | |
download | gcc-c77c3494f82da01c85a294a5f9c3a0c5496f8572.zip gcc-c77c3494f82da01c85a294a5f9c3a0c5496f8572.tar.gz gcc-c77c3494f82da01c85a294a5f9c3a0c5496f8572.tar.bz2 |
gccrs: Always emit the error highest in the type hierarchy
The unify code was a bit dumb here where we always set emit_error to false for any
subtypes for example in comparing tuples we always emitted the whole tuple didnt
match the other tuple but really its much better to say expected bool got i32 because
the element types didn't match.
gcc/rust/ChangeLog:
* typecheck/rust-coercion.cc (TypeCoercionRules::coerce_unsized): dont emit error here
* typecheck/rust-unify.cc (UnifyRules::resolve_subtype): new helper to handle emit error
(UnifyRules::expect_adt): call resolve_subtype
(UnifyRules::expect_reference): likewise
(UnifyRules::expect_pointer): likewise
(UnifyRules::expect_array): likewise
(UnifyRules::expect_slice): likewise
(UnifyRules::expect_fndef): likewise
(UnifyRules::expect_fnptr): likewise
(UnifyRules::expect_tuple): likewise
(UnifyRules::expect_closure): likewise
(UnifyRules::expect_opaque): likeiwse
* typecheck/rust-unify.h: add new helper to header
gcc/testsuite/ChangeLog:
* rust/compile/traits9.rs: update errors
* rust/compile/unify-errors1.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'libjava/java/security/KeyException.java')
0 files changed, 0 insertions, 0 deletions