Skip to content

Commit

Permalink
resolve error code e0760
Browse files Browse the repository at this point in the history
  • Loading branch information
csmoe committed Jun 4, 2020
1 parent 2f311b0 commit 9be6353
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/librustc_error_codes/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ E0751: include_str!("./error_codes/E0751.md"),
E0752: include_str!("./error_codes/E0752.md"),
E0753: include_str!("./error_codes/E0753.md"),
E0754: include_str!("./error_codes/E0754.md"),
E0755: include_str!("./error_codes/E0755.md"),
E0760: include_str!("./error_codes/E0760.md"),
;
// E0006, // merged with E0005
// E0008, // cannot bind by-move into a pattern guard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ or `Self` that references lifetimes from a parent scope.

Erroneous code example:

```compile_fail,E0755,edition2018
```compile_fail,E0760,edition2018
struct S<'a>(&'a i32);
impl<'a> S<'a> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ fn check_opaque_for_inheriting_lifetimes(tcx: TyCtxt<'tcx>, def_id: LocalDefId,
let mut err = struct_span_err!(
tcx.sess,
span,
E0755,
E0760,
"`{}` return type cannot contain a projection or `Self` that references lifetimes from \
a parent scope",
if is_async { "async fn" } else { "impl Trait" },
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/async-await/issue-61949-self-return-type.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[E0755]: `async fn` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
error[E0760]: `async fn` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
--> $DIR/issue-61949-self-return-type.rs:11:40
|
LL | pub async fn new(_bar: &'a i32) -> Self {
| ^^^^ help: consider spelling out the type instead: `Foo<'a>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0755`.
For more information about this error, try `rustc --explain E0760`.
4 changes: 2 additions & 2 deletions src/test/ui/impl-trait/bound-normalization-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc
LL | fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output=T::Assoc> {
| ^^^^^^^^^^^^

error[E0755]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
error[E0760]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
--> $DIR/bound-normalization-fail.rs:43:41
|
LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
Expand All @@ -43,5 +43,5 @@ LL | fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output=T::

error: aborting due to 3 previous errors; 1 warning emitted

Some errors have detailed explanations: E0271, E0755.
Some errors have detailed explanations: E0271, E0760.
For more information about an error, try `rustc --explain E0271`.

0 comments on commit 9be6353

Please sign in to comment.