Remove some unnecessary try-related type annotations

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.
This commit is contained in:
Scott McMurray 2026-01-30 18:21:19 -08:00
parent 36e2b8a3a7
commit f7931c8050
12 changed files with 45 additions and 47 deletions

View file

@ -1159,14 +1159,14 @@ impl<'tcx> TypePrivacyVisitor<'tcx> {
let typeck_results = self
.maybe_typeck_results
.unwrap_or_else(|| span_bug!(span, "`hir::Expr` or `hir::Pat` outside of a body"));
let result: ControlFlow<()> = try {
try {
self.visit(typeck_results.node_type(id))?;
self.visit(typeck_results.node_args(id))?;
if let Some(adjustments) = typeck_results.adjustments().get(id) {
adjustments.iter().try_for_each(|adjustment| self.visit(adjustment.target))?;
}
};
result.is_break()
}
.is_break()
}
fn check_def_id(&self, def_id: DefId, kind: &str, descr: &dyn fmt::Display) -> bool {