Skip to content

Commit

Permalink
Make some editorial tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
traviscross committed Oct 22, 2024
1 parent 686b13f commit 7546115
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/trait-bounds.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fn f<'a, 'b>(x: &'a i32, mut y: &'b i32) {
}
```

For the purpose of determining implied bounds on trait implementations, the implementing type (the `T` in `impl Trait for T`) is considered to be an input, as are generic parameters on the trait definition.
For the purpose of determining implied bounds on trait implementations, the type being implemented is considered to be an input, as are generic parameters on the trait definition.
Parameters of the trait implementation, which come directly after the `impl` keyword, are not otherwise considered to be inputs.
For example, for the `Vec<T>` implementation below, `'a` and `Vec<T>` are inputs to the trait, but `T` and `&'a T` are not:

Expand All @@ -177,7 +177,7 @@ impl<'a, T> MakeRef<'a> for Vec<T>
type Type = &'a T;
}

// `T: 'a` is implied: `&'a T` (implementing type) is an input to the trait
// `T: 'a` is implied: `&'a T` is an input to the trait
impl<'a, T> MakeRef<'a> for &'a T {
type Type = &'a T;
}
Expand Down

0 comments on commit 7546115

Please sign in to comment.