diff options
| author | Michael Goulet <michael@errs.io> | 2024-03-20 16:53:50 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-03-21 11:42:49 -0400 |
| commit | 2d633317f30dd02895f167b65dc1feeee0d08265 (patch) | |
| tree | 50b3622db66615853ae53baa9c54d968f01e413b /tests/ui/unboxed-closures | |
| parent | 2627e9f3012a97d3136b3e11bf6bd0853c38a534 (diff) | |
| download | rust-2d633317f30dd02895f167b65dc1feeee0d08265.tar.gz rust-2d633317f30dd02895f167b65dc1feeee0d08265.zip | |
Implement macro-based deref!() syntax for deref patterns
Stop using `box PAT` syntax for deref patterns, as it's misleading and also causes their semantics being tangled up.
Diffstat (limited to 'tests/ui/unboxed-closures')
| -rw-r--r-- | tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr index 1470c32d7de..394186fafe4 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr @@ -26,12 +26,16 @@ note: closure parameter defined here LL | let mut closure = expect_sig(|p, y| *p = y); | ^ -error[E0425]: cannot find function `deref` in this scope +error[E0423]: expected function, found macro `deref` --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:13:5 | LL | deref(p); - | ^^^^^ not found in this scope + | ^^^^^ not a function | +help: use `!` to invoke the macro + | +LL | deref!(p); + | + help: use the `.` operator to call the method `Deref::deref` on `&&()` | LL - deref(p); @@ -40,5 +44,5 @@ LL + p.deref(); error: aborting due to 4 previous errors -Some errors have detailed explanations: E0308, E0425. +Some errors have detailed explanations: E0308, E0423, E0425. For more information about an error, try `rustc --explain E0308`. |
