about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/alloc_system.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-02 06:22:47 +0200
committerGitHub <noreply@github.com>2023-08-02 06:22:47 +0200
commit9cdca1884057b58962fd58880f01c824aca24536 (patch)
tree54b407caf7ddce93d9b2b75c7b4b6b37b7097180 /compiler/rustc_codegen_gcc/example/alloc_system.rs
parentaa8462b6df138d18a82e3a54d47f3b00bf01c7f4 (diff)
parent66d23793f08cef2360bde6afd23e6badaed5cc2f (diff)
downloadrust-9cdca1884057b58962fd58880f01c824aca24536.tar.gz
rust-9cdca1884057b58962fd58880f01c824aca24536.zip
Rollup merge of #114178 - estebank:let-binding-macro, r=petrochenkov
Account for macros when suggesting a new let binding

Provide a structured suggestion when the expression comes from a macro expansion:

```
error[E0716]: temporary value dropped while borrowed
  --> $DIR/borrowck-let-suggestion.rs:2:17
   |
LL |     let mut x = vec![1].iter();
   |                 ^^^^^^^       - temporary value is freed at the end of this statement
   |                 |
   |                 creates a temporary value which is freed while still in use
LL |
LL |     x.use_mut();
   |     - borrow later used here
   |
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider using a `let` binding to create a longer lived value
   |
LL ~     let binding = vec![1];
LL ~     let mut x = binding.iter();
   |
```
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/alloc_system.rs')
0 files changed, 0 insertions, 0 deletions