From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../rustc_error_codes/src/error_codes/E0688.md | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 compiler/rustc_error_codes/src/error_codes/E0688.md (limited to 'compiler/rustc_error_codes/src/error_codes/E0688.md') diff --git a/compiler/rustc_error_codes/src/error_codes/E0688.md b/compiler/rustc_error_codes/src/error_codes/E0688.md new file mode 100644 index 000000000..44e641a2a --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0688.md @@ -0,0 +1,38 @@ +#### Note: this error code is no longer emitted by the compiler. + +In-band lifetimes were mixed with explicit lifetime binders. + +Erroneous code example: + +```ignore (feature got removed) +#![feature(in_band_lifetimes)] + +fn foo<'a>(x: &'a u32, y: &'b u32) {} // error! + +struct Foo<'a> { x: &'a u32 } + +impl Foo<'a> { + fn bar<'b>(x: &'a u32, y: &'b u32, z: &'c u32) {} // error! +} + +impl<'b> Foo<'a> { // error! + fn baz() {} +} +``` + +In-band lifetimes cannot be mixed with explicit lifetime binders. +For example: + +``` +fn foo<'a, 'b>(x: &'a u32, y: &'b u32) {} // ok! + +struct Foo<'a> { x: &'a u32 } + +impl<'a> Foo<'a> { + fn bar<'b,'c>(x: &'a u32, y: &'b u32, z: &'c u32) {} // ok! +} + +impl<'a> Foo<'a> { // ok! + fn baz() {} +} +``` -- cgit v1.2.3