about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZachary S <zasample18+github@gmail.com>2024-05-15 12:45:52 -0500
committerZachary S <zasample18+github@gmail.com>2024-05-15 12:47:20 -0500
commit66573b70a9b1807337f1980538d524e1dfd2aba1 (patch)
tree9835f3cee642e07e4c29cdd601b56fb24de57bea
parent0e467596ffa85c68504b94b951a0c32fefb3c889 (diff)
downloadrust-66573b70a9b1807337f1980538d524e1dfd2aba1.tar.gz
rust-66573b70a9b1807337f1980538d524e1dfd2aba1.zip
Use 'a' article for &Option.
-rw-r--r--compiler/rustc_lint/src/for_loops_over_fallibles.rs1
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,