From 5a2bb177a3a8046603ce26c90afaf080aeef53b1 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Sun, 25 Aug 2024 04:00:03 +0000 Subject: [PATCH] Update Examples --- Examples.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Examples.md b/Examples.md index 2c674c1..aee6656 100644 --- a/Examples.md +++ b/Examples.md @@ -784,11 +784,41 @@ fn main ``` +#![allow(unreachable_code, unused_labels)] +fn main() { + 'outer: loop { + println!("Entered the outer loop"); + + 'inner: loop { + println!("Entered the inner loop"); + break 'outer; + } + + println!("This point will never be reached"); + } + + println!("Exited the outer loop"); +} ``` ``` +#![allow(unreachable_code, unused_labels)] + +fn main + 'outer loop { + println! "Entered the outer loop" + + 'inner loop + println! "Entered the inner loop" + break 'outer + + println! "This point will never be reached" + + println! "Exited the outer loop" + + ```