diff options
Diffstat (limited to 'tests/ui/try-trait/try-operator-expansion-hygiene.rs')
| -rw-r--r-- | tests/ui/try-trait/try-operator-expansion-hygiene.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/ui/try-trait/try-operator-expansion-hygiene.rs b/tests/ui/try-trait/try-operator-expansion-hygiene.rs index 20538e094c6..b6f4e533d8d 100644 --- a/tests/ui/try-trait/try-operator-expansion-hygiene.rs +++ b/tests/ui/try-trait/try-operator-expansion-hygiene.rs @@ -1,16 +1,14 @@ +//! This test verifies that the `?` operator expansion is hygienic, +//! i.e., it's not affected by other `val` and `err` bindings that may be in scope. +//! +//! Note: Prior to the Try trait stabilization, `expr?` expanded to a match +//! with `val` and `err` bindings. The current implementation uses Try::branch() +//! but this test remains relevant for hygiene verification. + //@ run-pass #![allow(non_upper_case_globals)] #![allow(dead_code)] -// `expr?` expands to: -// -// match expr { -// Ok(val) => val, -// Err(err) => return Err(From::from(err)), -// } -// -// This test verifies that the expansion is hygienic, i.e., it's not affected by other `val` and -// `err` bindings that may be in scope. use std::num::ParseIntError; |
