Skip to content

Conversation

@roesnera
Copy link

Includes the associated types for the first() and last() fns in addition to the contains() fn.

Includes the associated types for the first() and last() fns in addition to the contains() fn.
@rustbot
Copy link
Collaborator

rustbot commented Dec 18, 2025

r? @marioidival

rustbot has assigned @marioidival.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@marioidival
Copy link
Member

The job failed in generics/assoc_items/types.md because the trait Contains is missing the correct references to associated types in the method signatures. Specifically, it should use Self::A and Self::B, not just A and B. Here’s how to fix it:

Change the trait definition from:

trait Contains {
    // Define generic types here which methods will be able to utilize.
    type A;
    type B;

    fn contains(&self, _: &Self::A, _: &Self::B) -> bool;
    fn first(&self) -> A;
    fn last(&self) -> B;
}

to:

trait Contains {
    type A;
    type B;

    fn contains(&self, _: &Self::A, _: &Self::B) -> bool;
    fn first(&self) -> Self::A;
    fn last(&self) -> Self::B;
}

Update the method return types to Self::A and Self::B. This will resolve the usage errors for A and B in this scope. For reference, see the current code on branch ref f460725.

Apply this change in src/generics/assoc_items/types.md to fix the failing job.

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.

3 participants