about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-02 10:09:35 +0100
committerGitHub <noreply@github.com>2024-03-02 10:09:35 +0100
commit1c724ee110832957cfc0242d8b64fae00ceacbb7 (patch)
tree8d1b68ba5ff917bb912ad73c13f42cdb4fc25fe1
parentd0e5431eb04e7019857f7a07c217489aa58fe2c2 (diff)
parent50ff36239a424c855a5faeac45ac269e1c3f54d8 (diff)
downloadrust-1c724ee110832957cfc0242d8b64fae00ceacbb7.tar.gz
rust-1c724ee110832957cfc0242d8b64fae00ceacbb7.zip
Rollup merge of #120684 - carschandler:patch-1, r=nnethercote
Update E0716.md for clarity

When reading through this, I got slightly hung up thinking the `let` it was referring to was the `let tmp` on line 25, which was confusing considering the comment states that the temporary is freed at the end of the block. I think adding this clarification could potentially help some beginners like myself without being overly verbose.
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0716.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0716.md b/compiler/rustc_error_codes/src/error_codes/E0716.md
index c3546cd744f..be60716a264 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0716.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0716.md
@@ -30,7 +30,7 @@ let q = p;
 
 Whenever a temporary is created, it is automatically dropped (freed) according
 to fixed rules. Ordinarily, the temporary is dropped at the end of the enclosing
-statement -- in this case, after the `let`. This is illustrated in the example
+statement -- in this case, after the `let p`. This is illustrated in the example
 above by showing that `tmp` would be freed as we exit the block.
 
 To fix this problem, you need to create a local variable to store the value in