public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Merge #1278
@ 2022-06-08 12:50 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:50 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:d5c1531cc41ea7fab4d522dafe3ff725a766fb49
commit d5c1531cc41ea7fab4d522dafe3ff725a766fb49
Merge: 36c91efc86d 7f7efa4463d
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date: Wed May 25 12:49:07 2022 +0000
Merge #1278
1278: Remove inside_loop parameter r=philberty a=philberty
The parameter was a hack used to support error handling cases
in Break and Continue expression's but this is no longer required.
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diff:
gcc/rust/typecheck/rust-hir-trait-resolve.cc | 3 +-
gcc/rust/typecheck/rust-hir-type-check-enumitem.h | 2 +-
gcc/rust/typecheck/rust-hir-type-check-expr.cc | 20 ++--
gcc/rust/typecheck/rust-hir-type-check-expr.h | 112 ++++++++++------------
gcc/rust/typecheck/rust-hir-type-check-implitem.h | 5 +-
gcc/rust/typecheck/rust-hir-type-check-item.h | 2 +-
gcc/rust/typecheck/rust-hir-type-check-pattern.cc | 14 +--
gcc/rust/typecheck/rust-hir-type-check-stmt.h | 21 ++--
gcc/rust/typecheck/rust-hir-type-check-struct.cc | 11 +--
gcc/rust/typecheck/rust-hir-type-check-toplevel.h | 5 +-
gcc/rust/typecheck/rust-hir-type-check-type.cc | 2 +-
gcc/rust/typecheck/rust-hir-type-check.cc | 10 +-
gcc/rust/typecheck/rust-hir-type-check.h | 2 +
gcc/rust/typecheck/rust-tyty.cc | 8 +-
14 files changed, 95 insertions(+), 122 deletions(-)
diff --cc gcc/rust/typecheck/rust-hir-type-check-expr.h
index 4eae0571595,d7c3da928c1..9dcae0871ca
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.h
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.h
@@@ -381,10 -377,49 +377,10 @@@ public
infered
= TyTy::TupleType::get_unit_type (expr.get_mappings ().get_hirid ());
- auto lhs = TypeCheckExpr::Resolve (expr.get_lhs (), false);
- auto rhs = TypeCheckExpr::Resolve (expr.get_rhs (), false);
+ auto lhs = TypeCheckExpr::Resolve (expr.get_lhs ());
+ auto rhs = TypeCheckExpr::Resolve (expr.get_rhs ());
- auto result = lhs->coerce (rhs);
- if (result->get_kind () == TyTy::TypeKind::ERROR)
- return;
-
- // in the case of declare first for an ADT Type:
- //
- // let a;
- // a = Foo{..}
- // let b = a.field;
- //
- // The lhs will have a TyTy of INFER and so when the declaration is
- // referenced it will still have an unknown type so we will fail to resolve
- // FieldAccessExpr
-
- NodeId ast_node_id = expr.get_lhs ()->get_mappings ().get_nodeid ();
- NodeId ref_node_id;
- if (!resolver->lookup_resolved_name (ast_node_id, &ref_node_id))
- return;
-
- Definition def;
- if (!resolver->lookup_definition (ref_node_id, &def))
- {
- rust_error_at (expr.get_locus (),
- "assignment infer - unknown reference");
- return;
- }
-
- HirId ref;
- if (!mappings->lookup_node_to_hir (expr.get_mappings ().get_crate_num (),
- def.parent, &ref))
- {
- rust_error_at (expr.get_locus (),
- "assignment infer - reverse lookup failure");
- return;
- }
-
- context->insert_type (
- Analysis::NodeMapping (expr.get_lhs ()->get_mappings ().get_crate_num (),
- ref_node_id, ref, UNKNOWN_LOCAL_DEFID),
- result->clone ());
+ lhs->coerce (rhs);
}
void visit (HIR::CompoundAssignmentExpr &expr) override
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 12:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:50 [gcc/devel/rust/master] Merge #1278 Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).