Skip to content

Conversation

@scottmcm
Copy link
Member

I left a few, like

let result: Result<_, ModError<'_>> = try {

where it felt like seeing it might still be useful for the reader.

Feel free to push back on any of these changes if you think they should be left alone.

I left a few, like
```rust
let result: Result<_, ModError<'_>> = try {
```
where it felt like seeing it might still be useful for the reader.

Feel free to push back on any of these changes if you think seeing the type would be better.
@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2026

Some changes occurred in need_type_info.rs

cc @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 31, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2026

r? @jackh726

rustbot has assigned @jackh726.
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

}
}
}
.unwrap_or_default()
Copy link
Member Author

Choose a reason for hiding this comment

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

annot: the whitespace changed here, so you might want the ignore whitespace diff for this function.


let generics = tcx.generics_of(def_id);
let segment: Option<_> = try {
if !segment.infer_args || generics.has_impl_trait() {
Copy link
Member

Choose a reason for hiding this comment

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

old code seems simpler.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since this one didn't have any ? inside the try, my instinct was that just using None instead of do yeet; was more direct.

@Zalathar
Copy link
Member

I think that in a lot of the io::Result<()> cases, having the explicit type is clearer than not having it, and removing the type doesn't really gain any simplicity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants