blob: 0c46a38d73f352b34bd2bb3f381005f70e604f53 [file] [log] [blame]
许杰友 Jieyou Xu (Joe)ec2cc762024-02-16 20:02:501//@ run-pass
Vadim Petrochenkovca9faa52019-07-26 21:54:252
Felix S. Klock IIc9f2c2d2018-09-14 10:20:283#![allow(unused_must_use)]
4#![allow(dead_code)]
Ahmed Charles6fbff4f2016-08-13 09:41:435#![allow(path_statements)]
Manish Goregaokar713e8752014-04-14 15:30:316#![allow(unreachable_code)]
Ahmed Charles6fbff4f2016-08-13 09:41:437#![allow(unused_variables)]
Matthew Jasperb4914022023-09-18 15:18:518#![feature(if_let_guard)]
Tim Chevalierc8ea9fc2012-07-26 21:47:059
Matthew Jasperb4914022023-09-18 15:18:5110fn id(x: bool) -> bool {
11 x
12}
Tim Chevalierc8ea9fc2012-07-26 21:47:0513
14fn call_id() {
Steve Klabnik7828c3d2014-10-09 19:17:2215 let c = panic!();
Tim Chevalierc8ea9fc2012-07-26 21:47:0516 id(c);
17}
18
Matthew Jasperb4914022023-09-18 15:18:5119fn call_id_2() {
20 id(true) && id(return);
21}
Tim Chevalierc8ea9fc2012-07-26 21:47:0522
Matthew Jasperb4914022023-09-18 15:18:5123fn call_id_3() {
24 id(return) && id(return);
25}
Tim Chevalierc8ea9fc2012-07-26 21:47:0526
Tim Chevalierc8ea9fc2012-07-26 21:47:0527fn ret_guard() {
Tobias Bucher7f64fe42015-01-25 21:05:0328 match 2 {
Brian Anderson025d8662012-08-04 02:59:0429 x if (return) => { x; }
Matthew Jasperb4914022023-09-18 15:18:5130 x if let true = return => { x; }
Brian Anderson025d8662012-08-04 02:59:0431 _ => {}
Tim Chevalierc8ea9fc2012-07-26 21:47:0532 }
33}
34
Graydon Hoare89c8ef72013-02-02 03:43:1735pub fn main() {}