Skip to content

Commit 4ec3ab6

Browse files
committed
diagnostics: Fix E0303 explanation.
1 parent edf29a7 commit 4ec3ab6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/diagnostics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -972,16 +972,16 @@ Updates to the borrow checker in a future version of Rust may remove this
972972
restriction, but for now patterns must be rewritten without sub-bindings.
973973
974974
```
975-
// Code like this...
976-
match Some(5) {
977-
ref op_num @ Some(num) => ...
975+
// Before.
976+
match Some("hi".to_string()) {
977+
ref op_string_ref @ Some(ref s) => ...
978978
None => ...
979979
}
980980
981981
// After.
982982
match Some("hi".to_string()) {
983983
Some(ref s) => {
984-
let op_string_ref = &Some(&s);
984+
let op_string_ref = &Some(s);
985985
...
986986
}
987987
None => ...

0 commit comments

Comments
 (0)