From 31eee595cf317d5a328356232016c8504dad9292 Mon Sep 17 00:00:00 2001 From: Fabian Wolff Date: Sun, 6 Jun 2021 22:54:00 +0200 Subject: [PATCH] Fix corrected example in E0759.md --- compiler/rustc_error_codes/src/error_codes/E0759.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0759.md b/compiler/rustc_error_codes/src/error_codes/E0759.md index 2fe5ada257fc2..6b16a7d415aa6 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0759.md +++ b/compiler/rustc_error_codes/src/error_codes/E0759.md @@ -16,13 +16,13 @@ fn bar(x: &i32) -> Box { // error! Add `'static` requirement to fix them: -```compile_fail,E0759 +``` # use std::fmt::Debug; -fn foo(x: &i32) -> impl Debug + 'static { // ok! +fn foo(x: &'static i32) -> impl Debug + 'static { // ok! x } -fn bar(x: &i32) -> Box { // ok! +fn bar(x: &'static i32) -> Box { // ok! Box::new(x) } ```