]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/hygiene/hygienic-labels.rs
2 #![allow(unreachable_code)]
3 // Test that labels injected by macros do not break hygiene.
5 // Issue #24278: The label/lifetime shadowing checker from #24162
6 // conservatively ignores hygiene, and thus issues warnings that are
7 // both true- and false-positives for this test.
11 // $e shouldn't be able to interact with this 'x
16 macro_rules
! run_once
{
19 'x
: for _
in 0..1 { $e }
23 macro_rules
! while_x
{
26 'x
: while 1 + 1 == 2 { $e }
32 // this 'x should refer to the outer loop, lexically
34 panic
!("break doesn't act hygienically inside for loop");
40 panic
!("break doesn't act hygienically inside infinite loop");
43 'x
: while 1 + 1 == 2 {
45 panic
!("break doesn't act hygienically inside infinite while loop");
50 run_once
!(continue 'x
);
51 panic
!("continue doesn't act hygienically inside for loop");