diff options
| author | Zachary S <zasample18+github@gmail.com> | 2024-05-15 12:45:52 -0500 |
|---|---|---|
| committer | Zachary S <zasample18+github@gmail.com> | 2024-05-15 12:47:20 -0500 |
| commit | 66573b70a9b1807337f1980538d524e1dfd2aba1 (patch) | |
| tree | 9835f3cee642e07e4c29cdd601b56fb24de57bea | |
| parent | 0e467596ffa85c68504b94b951a0c32fefb3c889 (diff) | |
| download | rust-66573b70a9b1807337f1980538d524e1dfd2aba1.tar.gz rust-66573b70a9b1807337f1980538d524e1dfd2aba1.zip | |
Use 'a' article for &Option.
| -rw-r--r-- | compiler/rustc_lint/src/for_loops_over_fallibles.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/for_loops_over_fallibles.rs b/compiler/rustc_lint/src/for_loops_over_fallibles.rs index 12a790bb0fa..b05f5e7638b 100644 --- a/compiler/rustc_lint/src/for_loops_over_fallibles.rs +++ b/compiler/rustc_lint/src/for_loops_over_fallibles.rs @@ -62,6 +62,7 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles { }; let (article, ty, var) = match adt.did() { + did if cx.tcx.is_diagnostic_item(sym::Option, did) && ref_mutability.is_some() => ("a", "Option", "Some"), did if cx.tcx.is_diagnostic_item(sym::Option, did) => ("an", "Option", "Some"), did if cx.tcx.is_diagnostic_item(sym::Result, did) => ("a", "Result", "Ok"), _ => return, |
