]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/pattern-bound-var-in-for-each.rs
Rollup merge of #104822 - spastorino:selctx-new-instead-of-with_query_mode, r=lcnr
[rust.git] / src / test / ui / binding / pattern-bound-var-in-for-each.rs
1 // run-pass
2 // Tests that codegen_path checks whether a
3 // pattern-bound var is an upvar (when codegenning
4 // the for-each body)
5
6
7 fn foo(src: usize) {
8
9     match Some(src) {
10       Some(src_id) => {
11         for _i in 0_usize..10_usize {
12             let yyy = src_id;
13             assert_eq!(yyy, 0_usize);
14         }
15       }
16       _ => { }
17     }
18 }
19
20 pub fn main() { foo(0_usize); }