Skip to content

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Oct 29, 2025

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Oct 29, 2025
@hvitved hvitved force-pushed the rust/type-inference-overlap-test branch from 9dcfe73 to 92cf5b3 Compare October 29, 2025 12:26
@hvitved hvitved marked this pull request as ready for review October 29, 2025 13:47
@hvitved hvitved requested a review from a team as a code owner October 29, 2025 13:47
Copilot AI review requested due to automatic review settings October 29, 2025 13:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds test cases for trait inheritance method resolution in Rust's type inference system. The changes test how method calls are resolved when a type implements both a base trait and a derived trait that inherits from it.

  • Added test structures and traits to cover trait inheritance scenarios
  • Added test calls to verify method resolution behavior with trait inheritance
  • Updated consistency expectations to reflect the new test cases with multiple call targets

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
main.rs Added MyTrait1/MyTrait2 trait definitions, S4 and S5 struct implementations, and test method calls to verify trait inheritance resolution behavior
PathResolutionConsistency.expected Updated expected output to include new method calls that resolve to multiple targets due to trait inheritance

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

struct S4;

impl MyTrait1 for S4 {
// <S4_as_MyTrait2>::m
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment incorrectly references <S4_as_MyTrait2>::m, but this is an implementation of MyTrait1 for S4. The comment should be <S4_as_MyTrait1>::m to accurately reflect the trait being implemented.

Suggested change
// <S4_as_MyTrait2>::m
// <S4_as_MyTrait1>::m

Copilot uses AI. Check for mistakes.
struct S5<T5>(T5);

impl MyTrait1 for S5<i32> {
// <S5<i32>_as_MyTrait2>::m
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment incorrectly references <S5<i32>_as_MyTrait2>::m, but this is an implementation of MyTrait1 for S5<i32>. The comment should be <S5<i32>_as_MyTrait1>::m to accurately reflect the trait being implemented.

Suggested change
// <S5<i32>_as_MyTrait2>::m
// <S5<i32>_as_MyTrait1>::m

Copilot uses AI. Check for mistakes.
@hvitved hvitved force-pushed the rust/type-inference-overlap-test branch from 92cf5b3 to 6ed8bcb Compare October 29, 2025 13:53
@hvitved hvitved requested a review from paldepind October 29, 2025 14:01
@hvitved hvitved merged commit 3c663d8 into github:main Oct 29, 2025
15 checks passed
@hvitved hvitved deleted the rust/type-inference-overlap-test branch October 29, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants