Lines Matching refs:Pat

10 use syn::{parse_quote, token, Item, Pat, PatTuple, Stmt, Token};
14 match Pat::parse_single.parse2(quote!(self)).unwrap() {
15 Pat::Ident(_) => (),
22 match Pat::parse_single.parse2(quote!(self::CONST)).unwrap() {
23 Pat::Path(_) => (),
52 let pat = Pat::parse_single.parse2(tokens).unwrap();
55 Pat::TupleStruct {
64 Pat::Wild,
72 Pat::parse_single.parse_str("..").unwrap();
73 Pat::parse_single.parse_str("..hi").unwrap();
74 Pat::parse_single.parse_str("lo..").unwrap();
75 Pat::parse_single.parse_str("lo..hi").unwrap();
77 Pat::parse_single.parse_str("..=").unwrap_err();
78 Pat::parse_single.parse_str("..=hi").unwrap();
79 Pat::parse_single.parse_str("lo..=").unwrap_err();
80 Pat::parse_single.parse_str("lo..=hi").unwrap();
82 Pat::parse_single.parse_str("...").unwrap_err();
83 Pat::parse_single.parse_str("...hi").unwrap_err();
84 Pat::parse_single.parse_str("lo...").unwrap_err();
85 Pat::parse_single.parse_str("lo...hi").unwrap();
87 Pat::parse_single.parse_str("[lo..]").unwrap_err();
88 Pat::parse_single.parse_str("[..=hi]").unwrap_err();
89 Pat::parse_single.parse_str("[(lo..)]").unwrap();
90 Pat::parse_single.parse_str("[(..=hi)]").unwrap();
91 Pat::parse_single.parse_str("[lo..=hi]").unwrap();
93 Pat::parse_single.parse_str("[_, lo.., _]").unwrap_err();
94 Pat::parse_single.parse_str("[_, ..=hi, _]").unwrap_err();
95 Pat::parse_single.parse_str("[_, (lo..), _]").unwrap();
96 Pat::parse_single.parse_str("[_, (..=hi), _]").unwrap();
97 Pat::parse_single.parse_str("[_, lo..=hi, _]").unwrap();
107 snapshot!(expr.to_token_stream() as Pat, @"Pat::Tuple");
110 // Must not parse to Pat::Paren
111 snapshot!(expr.to_token_stream() as Pat, @r###"
112 Pat::Tuple {
114 Pat::Wild,
121 snapshot!(expr.to_token_stream() as Pat, @r###"
122 Pat::Tuple {
124 Pat::Wild,
131 snapshot!(expr.to_token_stream() as Pat, @r###"
132 Pat::Tuple {
134 Pat::Wild,
136 Pat::Wild,
142 snapshot!(expr.to_token_stream() as Pat, @r###"
143 Pat::Tuple {
145 Pat::Wild,
147 Pat::Wild,