gccrs: Fix bug when compiling const position intrinsic calls

Since the changes to improve query_type to resolve function signitures
seperate to the bodies we can end up with the case where we resolve just
to a signiture which needs to call another function which is not yet type
checked so when we do const-eval during typechecking it fails because its
not ready.

This patch adds a new const context stack so we can override that behaviour
for const eval to make sure we dont have unresolved chunks for this case.

Fixes Rust-GCC/gccrs#4855

gcc/rust/ChangeLog:

	* checks/errors/privacy/rust-reachability.cc: dont need to assert
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): push const ctx
	* typecheck/rust-hir-type-check-implitem.cc (TypeCheckImplItem::visit): likewise
	* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): likewise
	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewse
	* typecheck/rust-hir-type-check.h: likewise
	* typecheck/rust-type-util.cc (query_type): check const_context_p

gcc/testsuite/ChangeLog:

	* rust/compile/issue-4855.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
8 files changed