From 9be635306cdf06dde62e2c1ebaadcdc33f44f45c Mon Sep 17 00:00:00 2001 From: csmoe Date: Fri, 22 May 2020 12:14:53 +0800 Subject: resolve error code e0760 --- src/librustc_error_codes/error_codes/E0755.md | 32 --------------------------- src/librustc_error_codes/error_codes/E0760.md | 32 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 src/librustc_error_codes/error_codes/E0755.md create mode 100644 src/librustc_error_codes/error_codes/E0760.md (limited to 'src/librustc_error_codes/error_codes') diff --git a/src/librustc_error_codes/error_codes/E0755.md b/src/librustc_error_codes/error_codes/E0755.md deleted file mode 100644 index 0c289146176..00000000000 --- a/src/librustc_error_codes/error_codes/E0755.md +++ /dev/null @@ -1,32 +0,0 @@ -`async fn`/`impl trait` return type cannot contain a projection -or `Self` that references lifetimes from a parent scope. - -Erroneous code example: - -```compile_fail,E0755,edition2018 -struct S<'a>(&'a i32); - -impl<'a> S<'a> { - async fn new(i: &'a i32) -> Self { - S(&22) - } -} -``` - -To fix this error we need to spell out `Self` to `S<'a>`: - -```edition2018 -struct S<'a>(&'a i32); - -impl<'a> S<'a> { - async fn new(i: &'a i32) -> S<'a> { - S(&22) - } -} -``` - -This will be allowed at some point in the future, -but the implementation is not yet complete. -See the [issue-61949] for this limitation. - -[issue-61949]: https://github.com/rust-lang/rust/issues/61949 diff --git a/src/librustc_error_codes/error_codes/E0760.md b/src/librustc_error_codes/error_codes/E0760.md new file mode 100644 index 00000000000..e1dcfefebcd --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0760.md @@ -0,0 +1,32 @@ +`async fn`/`impl trait` return type cannot contain a projection +or `Self` that references lifetimes from a parent scope. + +Erroneous code example: + +```compile_fail,E0760,edition2018 +struct S<'a>(&'a i32); + +impl<'a> S<'a> { + async fn new(i: &'a i32) -> Self { + S(&22) + } +} +``` + +To fix this error we need to spell out `Self` to `S<'a>`: + +```edition2018 +struct S<'a>(&'a i32); + +impl<'a> S<'a> { + async fn new(i: &'a i32) -> S<'a> { + S(&22) + } +} +``` + +This will be allowed at some point in the future, +but the implementation is not yet complete. +See the [issue-61949] for this limitation. + +[issue-61949]: https://github.com/rust-lang/rust/issues/61949 -- cgit 1.4.1-3-g733a5