From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7905) id BA731385B509; Tue, 31 Jan 2023 13:16:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA731385B509 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675171009; bh=qO3waqaDpTlI0EoNWQcWCMRSjnxCBipmZ4LSZTyIbzU=; h=From:To:Subject:Date:From; b=GifQ177jW1h8r/Soshd6wKQ3uBO2YjYdKN8erhWYHrv+kRtaae67PSPzkyhhDEz4d q5ptMsMFnrspVNerbfI5RzJew8nNx4COtlDgaN4FgBmvJ7owygUAkzooj8c5GS2IyF gOCOlbWh7v1U1nQtXRljeXgzd5wfWwTtCyWx/Xds= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Arthur Cohen To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5564] gccrs: Statics are a coercion site X-Act-Checkin: gcc X-Git-Author: Philip Herron X-Git-Refname: refs/heads/master X-Git-Oldrev: 70fc174b78a2df9cd31fb1ec054d9d8c641b78af X-Git-Newrev: 408ab8a6e412270996ec10369b778cfcb3946ae5 Message-Id: <20230131131649.BA731385B509@sourceware.org> Date: Tue, 31 Jan 2023 13:16:49 +0000 (GMT) List-Id: https://gcc.gnu.org/g:408ab8a6e412270996ec10369b778cfcb3946ae5 commit r13-5564-g408ab8a6e412270996ec10369b778cfcb3946ae5 Author: Philip Herron Date: Sat Sep 17 10:05:59 2022 +0100 gccrs: Statics are a coercion site Statics can be assigned to a block expression meaning they need to behave similarly to constant items. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-toplevel.cc (TypeCheckTopLevel::visit): Make static items behave more similarly to const items. Diff: --- gcc/rust/typecheck/rust-hir-type-check-toplevel.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/rust/typecheck/rust-hir-type-check-toplevel.cc b/gcc/rust/typecheck/rust-hir-type-check-toplevel.cc index b0ee292df10..594e527fdcf 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-toplevel.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-toplevel.cc @@ -261,11 +261,11 @@ TypeCheckTopLevel::visit (HIR::StaticItem &var) TyTy::BaseType *expr_type = TypeCheckExpr::Resolve (var.get_expr ()); TyTy::BaseType *unified - = unify_site (var.get_mappings ().get_hirid (), - TyTy::TyWithLocation (type, var.get_type ()->get_locus ()), - TyTy::TyWithLocation (expr_type, - var.get_expr ()->get_locus ()), - var.get_locus ()); + = coercion_site (var.get_mappings ().get_hirid (), + TyTy::TyWithLocation (type, var.get_type ()->get_locus ()), + TyTy::TyWithLocation (expr_type, + var.get_expr ()->get_locus ()), + var.get_locus ()); context->insert_type (var.get_mappings (), unified); }