Remove doc comments for generate_trait_from_impl#20407
Merged
A4-Tacks merged 1 commit intorust-lang:masterfrom Mar 20, 2026
Merged
Remove doc comments for generate_trait_from_impl#20407A4-Tacks merged 1 commit intorust-lang:masterfrom
A4-Tacks merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
I'm not sure this is preferred. r-a does show the doc comment from the trait if there is none on the impl, but sometimes it's nicer to have it on the impl as well. Although they could go out of sync... |
Member
Author
|
Add another assistant to add documents from the trait? |
Member
Author
Ok |
This comment has been minimized.
This comment has been minimized.
ChayimFriedman2
approved these changes
Mar 20, 2026
be6dafc to
5caf836
Compare
Collaborator
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
5caf836 to
1eeb948
Compare
**Input**:
```rust
struct Foo(f64);
impl F$0oo {
/// Add `x`
///
/// # Examples
fn add(&mut self, x: f64) {
self.0 += x;
}
}
```
**This PR**:
```rust
struct Foo(f64);
trait NewTrait {
/// Add `x`
///
/// # Examples
fn add(&mut self, x: f64);
}
impl NewTrait for Foo {
fn add(&mut self, x: f64) {
self.0 += x;
}
}
```
**Old**:
```rust
struct Foo(f64);
trait NewTrait {
/// Add `x`
///
/// # Examples
fn add(&mut self, x: f64);
}
impl NewTrait for Foo {
/// Add `x`
///
/// # Examples
fn add(&mut self, x: f64) {
self.0 += x;
}
}
```
1eeb948 to
dbe9af6
Compare
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.
Input:
This PR:
Old: