|
| 1 | +//@ revisions: expanded hir |
| 2 | +//@[expanded]compile-flags: -Zunpretty=expanded |
| 3 | +//@[expanded]check-pass |
| 4 | +//@[hir]compile-flags: -Zunpretty=hir |
| 5 | +//@[hir]check-fail |
| 6 | +//@ edition:2024 |
| 7 | + |
| 8 | +// Note: the HIR revision includes a `.stderr` file because there are some |
| 9 | +// errors that only occur once we get past the AST. |
| 10 | + |
| 11 | +#![feature(auto_traits)]#![feature(box_patterns)]#![feature(builtin_syntax)]#![feature(concat_idents)]#![feature(const_trait_impl)]#![feature(decl_macro)]#![feature(deref_patterns)]#![feature(dyn_star)]#![feature(explicit_tail_calls)]#![feature(gen_blocks)]#![feature(more_qualified_paths)]#![feature(never_patterns)]#![feature(never_type)]#![feature(pattern_types)]#![feature(pattern_type_macro)]#![feature(prelude_import)]#![feature(specialization)]#![feature(trace_macros)]#![feature(trait_alias)]#![feature(try_blocks)]#![feature(yeet_expr)]#![allow(incomplete_features)] |
| 12 | +#[prelude_import] |
| 13 | +use std::prelude::rust_2024::*; |
| 14 | +#[macro_use] |
| 15 | +extern crate std; |
| 16 | + |
| 17 | +#[prelude_import] |
| 18 | +use self::prelude::*; |
| 19 | + |
| 20 | +mod prelude { |
| 21 | + use std::prelude::rust_2024::*; |
| 22 | + |
| 23 | + type T = _; |
| 24 | + |
| 25 | + trait Trait { |
| 26 | + const |
| 27 | + CONST: |
| 28 | + (); |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +//! inner single-line doc comment |
| 33 | +/*! |
| 34 | + * inner multi-line doc comment |
| 35 | + */ |
| 36 | +#[doc = "inner doc attribute"]#[allow(dead_code, unused_variables)]#[no_std] |
| 37 | +mod attributes {//! inner single-line doc comment |
| 38 | + /*! |
| 39 | + * inner multi-line doc comment |
| 40 | + */ |
| 41 | + #![doc = |
| 42 | + "inner doc attribute"]#![allow(dead_code, unused_variables)]#![no_std] |
| 43 | + |
| 44 | + /// outer single-line doc comment |
| 45 | + /** |
| 46 | + * outer multi-line doc comment |
| 47 | + */ |
| 48 | + #[doc = |
| 49 | + "outer doc attribute"]#[doc = "macro"]#[allow()]#[attr = Repr([ReprC])] |
| 50 | + struct Struct; |
| 51 | +} |
| 52 | + |
| 53 | +mod expressions { |
| 54 | + /// ExprKind::Array |
| 55 | + fn expr_array() { |
| 56 | + []; |
| 57 | + [true]; |
| 58 | + [true]; |
| 59 | + [true, true]; |
| 60 | + ["long........................................................................"]; |
| 61 | + ["long............................................................", |
| 62 | + true]; |
| 63 | + } |
| 64 | + |
| 65 | + /// ExprKind::ConstBlock |
| 66 | + fn expr_const_block() { |
| 67 | + const { }; |
| 68 | + const { 1 }; |
| 69 | + const |
| 70 | + { |
| 71 | + struct S; |
| 72 | + }; |
| 73 | + } |
| 74 | + |
| 75 | + /// ExprKind::Call |
| 76 | + fn expr_call() { |
| 77 | + let f; |
| 78 | + f(); |
| 79 | + f::<u8>(); |
| 80 | + f::<1>(); |
| 81 | + f::<'static, u8, 1>(); |
| 82 | + f(true); |
| 83 | + f(true); |
| 84 | + ()(); |
| 85 | + } |
| 86 | + |
| 87 | + /// ExprKind::MethodCall |
| 88 | + fn expr_method_call() { |
| 89 | + let x; |
| 90 | + x.f(); |
| 91 | + x.f::<u8>(); |
| 92 | + x.collect::<Vec<_>>(); |
| 93 | + } |
| 94 | + |
| 95 | + /// ExprKind::Tup |
| 96 | + fn expr_tup() { (); (true,); (true, false); (true, false); } |
| 97 | + |
| 98 | + /// ExprKind::Binary |
| 99 | + fn expr_binary() { |
| 100 | + let (a, b, c, d, x, y); |
| 101 | + true || false; |
| 102 | + true || false && false; |
| 103 | + a < 1 && 2 < b && c > 3 && 4 > d; |
| 104 | + a & b & !c; |
| 105 | + a + b * c - d + -1 * -2 - -3; |
| 106 | + x = !y; |
| 107 | + } |
| 108 | + |
| 109 | + /// ExprKind::Unary |
| 110 | + fn expr_unary() { let expr; *expr; !expr; -expr; } |
| 111 | + |
| 112 | + /// ExprKind::Lit |
| 113 | + fn expr_lit() { 'x'; 1000i8; 1.00000000000000000000001; } |
| 114 | + |
| 115 | + /// ExprKind::Cast |
| 116 | + fn expr_cast() { let expr; expr as T; expr as T<u8>; } |
| 117 | + |
| 118 | + /// ExprKind::Type |
| 119 | + fn expr_type() { let expr; type_ascribe!(expr, T); } |
| 120 | + |
| 121 | + /// ExprKind::Let |
| 122 | + fn expr_let() { |
| 123 | + let b; |
| 124 | + if let Some(a) = b { } |
| 125 | + if let _ = true && false { } |
| 126 | + if let _ = (true && false) { } |
| 127 | + } |
| 128 | + |
| 129 | + /// ExprKind::If |
| 130 | + fn expr_if() { |
| 131 | + if true { } |
| 132 | + if !true { } |
| 133 | + if let true = true { } else { } |
| 134 | + if true { } else if false { } |
| 135 | + if true { } else if false { } else { } |
| 136 | + if true { return; } else if false { 0 } else { 0 } |
| 137 | + } |
| 138 | + |
| 139 | + /// ExprKind::While |
| 140 | + fn expr_while() { |
| 141 | + loop { if false { } else { break; } } |
| 142 | + 'a: loop { if false { } else { break; } } |
| 143 | + loop { if let true = true { } else { break; } } |
| 144 | + } |
| 145 | + |
| 146 | + /// ExprKind::ForLoop |
| 147 | + fn expr_for_loop() { |
| 148 | + let x; |
| 149 | + { |
| 150 | + let _t = |
| 151 | + match #[lang = "into_iter"](x) { |
| 152 | + mut iter => |
| 153 | + loop { |
| 154 | + match #[lang = "next"](&mut iter) { |
| 155 | + #[lang = "None"] {} => break, |
| 156 | + #[lang = "Some"] { 0: _ } => { } |
| 157 | + } |
| 158 | + }, |
| 159 | + }; |
| 160 | + _t |
| 161 | + }; |
| 162 | + { |
| 163 | + let _t = |
| 164 | + match #[lang = "into_iter"](x) { |
| 165 | + mut iter => |
| 166 | + 'a: |
| 167 | + loop { |
| 168 | + match #[lang = "next"](&mut iter) { |
| 169 | + #[lang = "None"] {} => break, |
| 170 | + #[lang = "Some"] { 0: _ } => { } |
| 171 | + } |
| 172 | + }, |
| 173 | + }; |
| 174 | + _t |
| 175 | + } |
| 176 | + } |
| 177 | + |
| 178 | + /// ExprKind::Loop |
| 179 | + fn expr_loop() { loop { } 'a: loop { } } |
| 180 | + |
| 181 | + /// ExprKind::Match |
| 182 | + fn expr_match() { |
| 183 | + let value; |
| 184 | + match value { } |
| 185 | + match value { ok => 1, } |
| 186 | + match value { ok => 1, err => 0, } |
| 187 | + } |
| 188 | + |
| 189 | + /// ExprKind::Closure |
| 190 | + fn expr_closure() { |
| 191 | + let value; |
| 192 | + || { }; |
| 193 | + |x| { }; |
| 194 | + |x: u8| { }; |
| 195 | + || (); |
| 196 | + move || value; |
| 197 | + || |mut _task_context: ResumeTy| { { let _t = value; _t } }; |
| 198 | + move || |mut _task_context: ResumeTy| { { let _t = value; _t } }; |
| 199 | + || value; |
| 200 | + move || value; |
| 201 | + || |mut _task_context: ResumeTy| { { let _t = value; _t } }; |
| 202 | + move || |mut _task_context: ResumeTy| { { let _t = value; _t } }; |
| 203 | + || -> u8 { value }; |
| 204 | + 1 + (|| { }); |
| 205 | + } |
| 206 | + |
| 207 | + /// ExprKind::Block |
| 208 | + fn expr_block() { |
| 209 | + { } |
| 210 | + unsafe { } |
| 211 | + 'a: { } |
| 212 | + #[allow()] |
| 213 | + { } |
| 214 | + #[allow()] |
| 215 | + { } |
| 216 | + } |
| 217 | + |
| 218 | + /// ExprKind::Gen |
| 219 | + fn expr_gen() { |
| 220 | + |mut _task_context: ResumeTy| { }; |
| 221 | + move |mut _task_context: ResumeTy| { }; |
| 222 | + || { }; |
| 223 | + move || { }; |
| 224 | + |mut _task_context: ResumeTy| { }; |
| 225 | + move |mut _task_context: ResumeTy| { }; |
| 226 | + } |
| 227 | + |
| 228 | + /// ExprKind::Await |
| 229 | + fn expr_await() { |
| 230 | + let fut; |
| 231 | + { |
| 232 | + fut; |
| 233 | + (/*ERROR*/) |
| 234 | + }; |
| 235 | + } |
| 236 | + |
| 237 | + /// ExprKind::TryBlock |
| 238 | + fn expr_try_block() { |
| 239 | + { #[lang = "from_output"](()) } |
| 240 | + { return; #[lang = "from_output"](()) } |
| 241 | + } |
| 242 | + |
| 243 | + /// ExprKind::Assign |
| 244 | + fn expr_assign() { let expr; expr = true; } |
| 245 | + |
| 246 | + /// ExprKind::AssignOp |
| 247 | + fn expr_assign_op() { let expr; expr += true; } |
| 248 | + |
| 249 | + /// ExprKind::Field |
| 250 | + fn expr_field() { let expr; expr.field; expr.0; } |
| 251 | + |
| 252 | + /// ExprKind::Index |
| 253 | + fn expr_index() { let expr; expr[true]; } |
| 254 | + |
| 255 | + /// ExprKind::Range |
| 256 | + fn expr_range() { |
| 257 | + let (lo, hi); |
| 258 | + #[lang = "RangeFull"] { }; |
| 259 | + #[lang = "RangeTo"] { end: hi }; |
| 260 | + #[lang = "RangeFrom"] { start: lo }; |
| 261 | + #[lang = "Range"] { start: lo, end: hi }; |
| 262 | + #[lang = "Range"] { start: lo, end: hi }; |
| 263 | + #[lang = "RangeToInclusive"] { end: hi }; |
| 264 | + #[lang = "range_inclusive_new"](lo, hi); |
| 265 | + #[lang = "range_inclusive_new"](-2, -1); |
| 266 | + } |
| 267 | + |
| 268 | + /// ExprKind::Underscore |
| 269 | + fn expr_underscore() { |
| 270 | + (/*ERROR*/); |
| 271 | + } |
| 272 | + |
| 273 | + /// ExprKind::Path |
| 274 | + fn expr_path() { |
| 275 | + let x; |
| 276 | + crate::expressions::expr_path; |
| 277 | + crate::expressions::expr_path::<'static>; |
| 278 | + <T as Default>::default; |
| 279 | + <T as ::core::default::Default>::default; |
| 280 | + x; |
| 281 | + x::<T, T>; |
| 282 | + crate::expressions::expr_path; |
| 283 | + core::marker::PhantomData; |
| 284 | + } |
| 285 | + |
| 286 | + /// ExprKind::AddrOf |
| 287 | + fn expr_addr_of() { |
| 288 | + let expr; |
| 289 | + &expr; |
| 290 | + &mut expr; |
| 291 | + &raw const expr; |
| 292 | + &raw mut expr; |
| 293 | + } |
| 294 | + |
| 295 | + /// ExprKind::Break |
| 296 | + fn expr_break() { 'a: { break; break 'a; break true; break 'a true; } } |
| 297 | + |
| 298 | + /// ExprKind::Continue |
| 299 | + fn expr_continue() { 'a: { continue; continue 'a; } } |
| 300 | + |
| 301 | + /// ExprKind::Ret |
| 302 | + fn expr_ret() { return; return true; } |
| 303 | + |
| 304 | + /// ExprKind::InlineAsm |
| 305 | + fn expr_inline_asm() { |
| 306 | + let x; |
| 307 | + asm!("mov {1}, {0}\nshl {1}, 1\nshl {0}, 2\nadd {0}, {1}", |
| 308 | + inout(reg) |
| 309 | + x, |
| 310 | + out(reg) |
| 311 | + _); |
| 312 | + } |
| 313 | + |
| 314 | + /// ExprKind::OffsetOf |
| 315 | + fn expr_offset_of() { |
| 316 | + |
| 317 | + |
| 318 | + |
| 319 | + |
| 320 | + |
| 321 | + |
| 322 | + |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | + |
| 328 | + |
| 329 | + // ... |
| 330 | + |
| 331 | + |
| 332 | + |
| 333 | + |
| 334 | + |
| 335 | + // concat_idents is deprecated |
| 336 | + |
| 337 | + |
| 338 | + |
| 339 | + |
| 340 | + { offset_of!(T, field) }; |
| 341 | + } |
| 342 | + /// ExprKind::MacCall |
| 343 | + fn expr_mac_call() { "..."; "..."; "..."; } |
| 344 | + /// ExprKind::Struct |
| 345 | + fn expr_struct() { |
| 346 | + struct Struct { |
| 347 | + } |
| 348 | + let (x, base); |
| 349 | + Struct { }; |
| 350 | + <Struct as ToOwned>::Owned { }; |
| 351 | + Struct { .. }; |
| 352 | + Struct { ..base }; |
| 353 | + Struct { x }; |
| 354 | + Struct { x, ..base }; |
| 355 | + Struct { x: true }; |
| 356 | + Struct { x: true, .. }; |
| 357 | + Struct { x: true, ..base }; |
| 358 | + Struct { 0: true, ..base }; |
| 359 | + } |
| 360 | + /// ExprKind::Repeat |
| 361 | + fn expr_repeat() { [(); 0]; } |
| 362 | + /// ExprKind::Paren |
| 363 | + fn expr_paren() { let expr; expr; } |
| 364 | + /// ExprKind::Try |
| 365 | + fn expr_try() { |
| 366 | + let expr; |
| 367 | + match #[lang = "branch"](expr) { |
| 368 | + #[lang = "Break"] { 0: residual } => |
| 369 | + #[allow(unreachable_code)] |
| 370 | + return #[lang = "from_residual"](residual), |
| 371 | + #[lang = "Continue"] { 0: val } => #[allow(unreachable_code)] |
| 372 | + val, |
| 373 | + }; |
| 374 | + } |
| 375 | + /// ExprKind::Yield |
| 376 | + fn expr_yield() { yield (); yield true; } |
| 377 | + /// ExprKind::Yeet |
| 378 | + fn expr_yeet() { |
| 379 | + return #[lang = "from_yeet"](()); |
| 380 | + return #[lang = "from_yeet"](0); |
| 381 | + } |
| 382 | + /// ExprKind::Become |
| 383 | + fn expr_become() { become true; } |
| 384 | + /// ExprKind::IncludedBytes |
| 385 | + fn expr_include_bytes() { |
| 386 | + b"data for include_bytes in ../expanded-exhaustive.rs\n"; |
| 387 | + } |
| 388 | + /// ExprKind::FormatArgs |
| 389 | + fn expr_format_args() { |
| 390 | + let expr; |
| 391 | + format_arguments::new_const(&[]); |
| 392 | + format_arguments::new_v1(&[""], |
| 393 | + &[format_argument::new_display(&expr)]); |
| 394 | + } |
| 395 | +} |
| 396 | +mod items { |
| 397 | + /// ItemKind::ExternCrate |
| 398 | + mod item_extern_crate {/// ItemKind::ExternCrate |
| 399 | + extern crate core; |
| 400 | + extern crate self as unpretty; |
| 401 | + extern crate core as _; |
| 402 | + } |
| 403 | + /// ItemKind::Use |
| 404 | + mod item_use {/// ItemKind::Use |
| 405 | + use ::{}; |
| 406 | + use crate::expressions; |
| 407 | + use crate::items::item_use; |
| 408 | + use core::*; |
| 409 | + } |
| 410 | + /// ItemKind::Static |
| 411 | + mod item_static {/// ItemKind::Static |
| 412 | + static A: () = { }; |
| 413 | + static mut B: () = { }; |
| 414 | + } |
| 415 | + /// ItemKind::Const |
| 416 | + mod item_const {/// ItemKind::Const |
| 417 | + const A: () = { }; |
| 418 | + trait TraitItems { |
| 419 | + const |
| 420 | + B: |
| 421 | + (); |
| 422 | + const |
| 423 | + C: |
| 424 | + () |
| 425 | + = |
| 426 | + { }; |
| 427 | + } |
| 428 | + } |
| 429 | + /// ItemKind::Fn |
| 430 | + mod item_fn {/// ItemKind::Fn |
| 431 | + const unsafe extern "C" fn f() { } |
| 432 | + async unsafe extern "C" fn g() |
| 433 | + -> |
| 434 | + /*impl Trait*/ |mut _task_context: ResumeTy| |
| 435 | + { { let _t = { }; _t } } |
| 436 | + fn h<'a, T>() where T: 'a { } |
| 437 | + trait TraitItems { |
| 438 | + unsafe extern "C" fn f(); |
| 439 | + } |
| 440 | + impl TraitItems for _ { |
| 441 | + unsafe extern "C" fn f() { } |
| 442 | + } |
| 443 | + } |
| 444 | + /// ItemKind::Mod |
| 445 | + mod item_mod {/// ItemKind::Mod |
| 446 | + } |
| 447 | + /// ItemKind::ForeignMod |
| 448 | + mod item_foreign_mod {/// ItemKind::ForeignMod |
| 449 | + extern "Rust" { } |
| 450 | + extern "C" { } |
| 451 | + } |
| 452 | + /// ItemKind::GlobalAsm |
| 453 | + mod item_global_asm {/// ItemKind::GlobalAsm |
| 454 | + global_asm! (".globl my_asm_func") } |
| 455 | + /// ItemKind::TyAlias |
| 456 | + mod item_ty_alias {/// ItemKind::TyAlias |
| 457 | + type Type<'a> where T: 'a = T; |
| 458 | + } |
| 459 | + /// ItemKind::Enum |
| 460 | + mod item_enum {/// ItemKind::Enum |
| 461 | + enum Void { } |
| 462 | + enum Empty { |
| 463 | + Unit, |
| 464 | + Tuple(), |
| 465 | + Struct { |
| 466 | + }, |
| 467 | + } |
| 468 | + enum Generic<'a, T> where T: 'a { |
| 469 | + Tuple(T), |
| 470 | + Struct { |
| 471 | + t: T, |
| 472 | + }, |
| 473 | + } |
| 474 | + } |
| 475 | + /// ItemKind::Struct |
| 476 | + mod item_struct {/// ItemKind::Struct |
| 477 | + struct Unit; |
| 478 | + struct Tuple(); |
| 479 | + struct Newtype(Unit); |
| 480 | + struct Struct { |
| 481 | + } |
| 482 | + struct Generic<'a, T> where T: 'a { |
| 483 | + t: T, |
| 484 | + } |
| 485 | + } |
| 486 | + /// ItemKind::Union |
| 487 | + mod item_union {/// ItemKind::Union |
| 488 | + union Generic<'a, T> where T: 'a { |
| 489 | + t: T, |
| 490 | + } |
| 491 | + } |
| 492 | + /// ItemKind::Trait |
| 493 | + mod item_trait {/// ItemKind::Trait |
| 494 | + auto unsafe trait Send { } |
| 495 | + trait Trait<'a>: Sized where Self: 'a { } |
| 496 | + } |
| 497 | + /// ItemKind::TraitAlias |
| 498 | + mod item_trait_alias {/// ItemKind::TraitAlias |
| 499 | + trait Trait<T> = Sized where for<'a> T: 'a; |
| 500 | + } |
| 501 | + /// ItemKind::Impl |
| 502 | + mod item_impl {/// ItemKind::Impl |
| 503 | + impl () { } |
| 504 | + impl <T> () { } |
| 505 | + impl Default for () { } |
| 506 | + impl const <T> Default for () { } |
| 507 | + } |
| 508 | + /// ItemKind::MacCall |
| 509 | + mod item_mac_call {/// ItemKind::MacCall |
| 510 | + } |
| 511 | + /// ItemKind::MacroDef |
| 512 | + mod item_macro_def {/// ItemKind::MacroDef |
| 513 | + macro_rules! mac { () => { ... }; } |
| 514 | + macro stringify { () => {} } |
| 515 | + } |
| 516 | + /// ItemKind::Delegation |
| 517 | + /*! FIXME: todo */ |
| 518 | + mod item_delegation {/// ItemKind::Delegation |
| 519 | + /*! FIXME: todo */ |
| 520 | + } |
| 521 | + /// ItemKind::DelegationMac |
| 522 | + /*! FIXME: todo */ |
| 523 | + mod item_delegation_mac {/// ItemKind::DelegationMac |
| 524 | + /*! FIXME: todo */ |
| 525 | + } |
| 526 | + } |
| 527 | + mod patterns { |
| 528 | + /// PatKind::Missing |
| 529 | + fn pat_missing() { let _: for fn(u32, T, &'_ str); } |
| 530 | + /// PatKind::Wild |
| 531 | + fn pat_wild() { let _; } |
| 532 | + /// PatKind::Ident |
| 533 | + fn pat_ident() { |
| 534 | + let x; |
| 535 | + let ref x; |
| 536 | + let mut x; |
| 537 | + let ref mut x; |
| 538 | + let ref mut x@_; |
| 539 | + } |
| 540 | + /// PatKind::Struct |
| 541 | + fn pat_struct() { |
| 542 | + let T {}; |
| 543 | + let T::<T> {}; |
| 544 | + let T::<'static> {}; |
| 545 | + let T { x }; |
| 546 | + let T { x: _x }; |
| 547 | + let T { .. }; |
| 548 | + let T { x, .. }; |
| 549 | + let T { x: _x, .. }; |
| 550 | + let T { 0: _x, .. }; |
| 551 | + let <T as ToOwned>::Owned {}; |
| 552 | + } |
| 553 | + /// PatKind::TupleStruct |
| 554 | + fn pat_tuple_struct() { |
| 555 | + struct Tuple(); |
| 556 | + let Tuple(); |
| 557 | + let Tuple::<T>(); |
| 558 | + let Tuple::<'static>(); |
| 559 | + let Tuple(x); |
| 560 | + let Tuple(..); |
| 561 | + let Tuple(x, ..); |
| 562 | + } |
| 563 | + /// PatKind::Or |
| 564 | + fn pat_or() { let true | false; let true; let true | false; } |
| 565 | + /// PatKind::Path |
| 566 | + fn pat_path() { |
| 567 | + let core::marker::PhantomData; |
| 568 | + let core::marker::PhantomData::<T>; |
| 569 | + let core::marker::PhantomData::<'static>; |
| 570 | + let <T as Trait>::CONST; |
| 571 | + } |
| 572 | + /// PatKind::Tuple |
| 573 | + fn pat_tuple() { let (); let (true,); let (true, false); } |
| 574 | + /// PatKind::Box |
| 575 | + fn pat_box() { let box pat; } |
| 576 | + /// PatKind::Deref |
| 577 | + fn pat_deref() { let deref!(pat); } |
| 578 | + /// PatKind::Ref |
| 579 | + fn pat_ref() { let &pat; let &mut pat; } |
| 580 | + /// PatKind::Expr |
| 581 | + fn pat_expr() { let 1000i8; let -""; } |
| 582 | + /// PatKind::Range |
| 583 | + fn pat_range() { |
| 584 | + let ..1; |
| 585 | + let 0...; |
| 586 | + let 0..1; |
| 587 | + let 0...1; |
| 588 | + let -2...-1; |
| 589 | + } |
| 590 | + /// PatKind::Slice |
| 591 | + fn pat_slice() { let []; let [true]; let [true]; let [true, false]; } |
| 592 | + /// PatKind::Rest |
| 593 | + fn pat_rest() { let _; } |
| 594 | + /// PatKind::Never |
| 595 | + fn pat_never() { let !; let Some(!); } |
| 596 | + /// PatKind::Paren |
| 597 | + fn pat_paren() { let pat; } |
| 598 | + /// PatKind::MacCall |
| 599 | + fn pat_mac_call() { let ""; let ""; let ""; } |
| 600 | + } |
| 601 | + mod statements { |
| 602 | + /// StmtKind::Let |
| 603 | + fn stmt_let() { |
| 604 | + let _; |
| 605 | + let _ = true; |
| 606 | + let _: T = true; |
| 607 | + let _ = true else { return; }; |
| 608 | + } |
| 609 | + /// StmtKind::Item |
| 610 | + fn stmt_item() { |
| 611 | + struct Struct { |
| 612 | + } |
| 613 | + struct Unit; |
| 614 | + } |
| 615 | + /// StmtKind::Expr |
| 616 | + fn stmt_expr() { () } |
| 617 | + /// StmtKind::Semi |
| 618 | + fn stmt_semi() { 1 + 1; } |
| 619 | + /// StmtKind::Empty |
| 620 | + fn stmt_empty() { } |
| 621 | + /// StmtKind::MacCall |
| 622 | + fn stmt_mac_call() { "..."; "..."; "..."; } |
| 623 | + } |
| 624 | + mod types { |
| 625 | + /// TyKind::Slice |
| 626 | + fn ty_slice() { let _: [T]; } |
| 627 | + /// TyKind::Array |
| 628 | + fn ty_array() { let _: [T; 0]; } |
| 629 | + /// TyKind::Ptr |
| 630 | + fn ty_ptr() { let _: *const T; let _: *mut T; } |
| 631 | + /// TyKind::Ref |
| 632 | + fn ty_ref() { |
| 633 | + let _: &T; |
| 634 | + let _: &mut T; |
| 635 | + let _: &'static T; |
| 636 | + let _: &'static mut [T]; |
| 637 | + let _: &T<T<T<T<T>>>>; |
| 638 | + let _: &T<T<T<T<T>>>>; |
| 639 | + } |
| 640 | + /// TyKind::BareFn |
| 641 | + fn ty_bare_fn() { |
| 642 | + let _: fn(); |
| 643 | + let _: fn() -> (); |
| 644 | + let _: fn(T); |
| 645 | + let _: fn(t: T); |
| 646 | + let _: fn(); |
| 647 | + let _: for<'a> fn(); |
| 648 | + } |
| 649 | + /// TyKind::Never |
| 650 | + fn ty_never() { let _: !; } |
| 651 | + /// TyKind::Tup |
| 652 | + fn ty_tup() { let _: (); let _: (T,); let _: (T, T); } |
| 653 | + /// TyKind::Path |
| 654 | + fn ty_path() { |
| 655 | + let _: T; |
| 656 | + let _: T<'static>; |
| 657 | + let _: T<T>; |
| 658 | + let _: T<T>; |
| 659 | + let _: T; |
| 660 | + let _: <T as ToOwned>::Owned; |
| 661 | + } |
| 662 | + /// TyKind::TraitObject |
| 663 | + fn ty_trait_object() { |
| 664 | + let _: dyn Send; |
| 665 | + let _: dyn Send + 'static; |
| 666 | + let _: dyn Send + 'static; |
| 667 | + let _: dyn for<'a> Send; |
| 668 | + let _: dyn* Send; |
| 669 | + } |
| 670 | + /// TyKind::ImplTrait |
| 671 | + const fn ty_impl_trait() { |
| 672 | + let _: (/*ERROR*/); |
| 673 | + let _: (/*ERROR*/); |
| 674 | + let _: (/*ERROR*/); |
| 675 | + let _: (/*ERROR*/); |
| 676 | + let _: (/*ERROR*/); |
| 677 | + let _: (/*ERROR*/); |
| 678 | + } |
| 679 | + /// TyKind::Paren |
| 680 | + fn ty_paren() { let _: T; } |
| 681 | + /// TyKind::Typeof |
| 682 | + /*! unused for now */ |
| 683 | + fn ty_typeof() { } |
| 684 | + /// TyKind::Infer |
| 685 | + fn ty_infer() { let _: _; } |
| 686 | + /// TyKind::ImplicitSelf |
| 687 | + /*! there is no syntax for this */ |
| 688 | + fn ty_implicit_self() { } |
| 689 | + /// TyKind::MacCall |
| 690 | + #[expect(deprecated)] |
| 691 | + fn ty_mac_call() { let _: T; let _: T; let _: T; } |
| 692 | + /// TyKind::CVarArgs |
| 693 | + /*! FIXME: todo */ |
| 694 | + fn ty_c_var_args() { } |
| 695 | + /// TyKind::Pat |
| 696 | + fn ty_pat() { let _: u32 is 1..=RangeMax; } |
| 697 | + } |
| 698 | + mod visibilities { |
| 699 | + /// VisibilityKind::Public |
| 700 | + mod visibility_public {/// VisibilityKind::Public |
| 701 | + struct Pub; |
| 702 | + } |
| 703 | + /// VisibilityKind::Restricted |
| 704 | + mod visibility_restricted {/// VisibilityKind::Restricted |
| 705 | + struct PubCrate; |
| 706 | + struct PubSelf; |
| 707 | + struct PubSuper; |
| 708 | + struct PubInCrate; |
| 709 | + struct PubInSelf; |
| 710 | + struct PubInSuper; |
| 711 | + struct PubInCrateVisibilities; |
| 712 | + struct PubInSelfSuper; |
| 713 | + struct PubInSuperMod; |
| 714 | + } |
| 715 | + } |
0 commit comments