You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// See [Wrapping expr in curly braces changes the operator precedence
18
+
/// #28777](https://github.com/rust-lang/rust/issues/28777). This was fixed by
19
+
/// <https://github.com/rust-lang/rust/pull/30375>. #30375 added the `that_odd_parse` example above,
20
+
/// but that is not *quite* the same original example as reported in #28777, so we also include the
21
+
/// original example here.
22
+
fncheck_issue_28777(){
23
+
// Before #30375 fixed the precedence...
24
+
25
+
// ... `v1` evaluated to 9, indicating a parse of `(1 + 2) * 3`, while
26
+
let v1 = {1 + {2}*{3}};
27
+
28
+
// `v2` evaluated to 7, indicating a parse of `1 + (2 * 3)`.
29
+
let v2 = 1 + {2}*{3};
30
+
31
+
// Check that both now evaluate to 7, as was fixed by #30375.
0 commit comments