From 2ed758e77d4256799d84cf0caba8910c8a51100c Mon Sep 17 00:00:00 2001 From: Bruno Kirschner Date: Sat, 3 Oct 2020 15:45:50 +0200 Subject: [PATCH] Add missing main function in static life time example. --- src/scope/lifetime/static_lifetime.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/scope/lifetime/static_lifetime.md b/src/scope/lifetime/static_lifetime.md index 7a1bddfa0f..c9a9d095c8 100644 --- a/src/scope/lifetime/static_lifetime.md +++ b/src/scope/lifetime/static_lifetime.md @@ -75,13 +75,11 @@ does not: ```rust,editable,compile_fail use std::fmt::Debug; -fn print_it( input: impl Debug + 'static ) -{ +fn print_it( input: impl Debug + 'static ) { println!( "'static value passed in is: {:?}", input ); } -fn use_it() -{ +fn main() { // i is owned and contains no references, thus it's 'static: let i = 5; print_it(i);