Open
Conversation
Includes the associated types for the first() and last() fns in addition to the contains() fn.
Collaborator
|
r? @marioidival rustbot has assigned @marioidival. Use |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Includes the associated types for the first() and last() fns in addition to the contains() fn.