Skip to content

Phil/libcore dev WIP - #4816

Open
philberty wants to merge 8 commits into
masterfrom
phil/libcore-dev
Open

Phil/libcore dev WIP#4816
philberty wants to merge 8 commits into
masterfrom
phil/libcore-dev

Conversation

@philberty

Copy link
Copy Markdown
Member

WIP

Fixes #4814

gcc/rust/ChangeLog:

	* hir/rust-hir-dump.cc (Dump::do_typepathfunction): add guard

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
This is just a general improvement so we can filter trait probing to not
look at the whole crate.

gcc/rust/ChangeLog:

	* hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): add mapping
	* rust-session-manager.cc (Session::compile_crate): make sure nr context is ready
	* typecheck/rust-hir-path-probe.cc (PathProbeImplTrait::process_trait_impl_items_for_candidates):
	use the new filter
	* util/rust-hir-map.cc (Mappings::insert_trait_impl_mapping): new helper
	* util/rust-hir-map.h: likewise

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
This means we can do some pre filtering instead of scanning the crate.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-dot-operator.cc (MethodResolver::MethodResolver): new optional filter
	(MethodResolver::Probe): likewise
	(MethodResolver::try_select_predicate_candidates): likewise
	(MethodResolver::select): likewise
	* typecheck/rust-hir-dot-operator.h: likewise
	* typecheck/rust-hir-type-check-expr.cc: pass lang item trait
	* util/rust-hir-map.cc: new helper to scan implblocks
	* util/rust-hir-map.h: likewise

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-bounds.h: optional trait arg
	* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::TypeBoundsProbe): likewise
	(TypeBoundsProbe::Probe): likewise
	(TypeBoundsProbe::is_bound_satisfied_for_type): use specified trait
	(TypeBoundsProbe::scan): try to scan for indexed traits

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

	* typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::validate_type_implements_this):
 	add filter

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
The code used to work by accident that the type bounds probe already setup
the type checked trait before hand so the lookup's just worked by accident.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): dp trait lookup
	* typecheck/rust-tyty.cc (BaseType::satisfies_bound): add filter

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

	* typecheck/rust-type-util.cc (lookup_associated_impl_block): add filter
	(normalize_projection): likewise

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
@philberty philberty changed the title Phil/libcore dev Phil/libcore dev WIP Aug 23, 2026
gcc/rust/ChangeLog:

	* typecheck/rust-hir-path-probe.cc (PathProbeType::Probe): filter

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant