From e53625706106e0227656ddd2fa4d7df54ae2b90e Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sat, 11 Apr 2020 11:31:54 -0700 Subject: Ensure tail expression will have a `Ty` for E0746 When the return type is `!Sized` we look for all the returned expressions in the body to fetch their types and provide a reasonable suggestion. The tail expression of the body is normally evaluated after checking whether the return type is `Sized`. Changing the order of the evaluation produces undesirable knock down effects, so we detect the specific case that newcomers are likely to encounter ,returning a single bare trait object, and only in that case we evaluate the tail expression's type so that the suggestion will be accurate. --- src/librustc_error_codes/error_codes/E0746.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/librustc_error_codes/error_codes') diff --git a/src/librustc_error_codes/error_codes/E0746.md b/src/librustc_error_codes/error_codes/E0746.md index 16b2722f0ea..305667e58f8 100644 --- a/src/librustc_error_codes/error_codes/E0746.md +++ b/src/librustc_error_codes/error_codes/E0746.md @@ -2,8 +2,7 @@ Return types cannot be `dyn Trait`s as they must be `Sized`. Erroneous code example: -```compile_fail,E0277 -# // FIXME: after E0746 is in beta, change the above +```compile_fail,E0746 trait T { fn bar(&self); } -- cgit 1.4.1-3-g733a5 From e2901c48cf8fd828fb60015cd551a062c34c0ff8 Mon Sep 17 00:00:00 2001 From: aticu <15schnic@gmail.com> Date: Tue, 21 Apr 2020 18:13:58 +0200 Subject: Fix incorrect description of E0690 --- src/librustc_error_codes/error_codes/E0690.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/librustc_error_codes/error_codes') diff --git a/src/librustc_error_codes/error_codes/E0690.md b/src/librustc_error_codes/error_codes/E0690.md index 3a4d1c56fad..1673456580a 100644 --- a/src/librustc_error_codes/error_codes/E0690.md +++ b/src/librustc_error_codes/error_codes/E0690.md @@ -14,7 +14,7 @@ struct LengthWithUnit { // error: transparent struct needs exactly one Because transparent structs are represented exactly like one of their fields at run time, said field must be uniquely determined. If there is no field, or if there are multiple fields, it is not clear how the struct should be represented. -Note that fields of zero-typed types (e.g., `PhantomData`) can also exist +Note that fields of zero-sized types (e.g., `PhantomData`) can also exist alongside the field that contains the actual data, they do not count for this error. When generic types are involved (as in the above example), an error is reported because the type parameter could be non-zero-sized. -- cgit 1.4.1-3-g733a5 From 410fc9da3b8c31b87e749a538a96e76fa5e2aded Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 21 Apr 2020 21:40:29 +0200 Subject: Clean up E0554 explanation --- src/librustc_error_codes/error_codes/E0554.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/librustc_error_codes/error_codes') diff --git a/src/librustc_error_codes/error_codes/E0554.md b/src/librustc_error_codes/error_codes/E0554.md index e25212983eb..e55fa4c6ede 100644 --- a/src/librustc_error_codes/error_codes/E0554.md +++ b/src/librustc_error_codes/error_codes/E0554.md @@ -1,7 +1,7 @@ Feature attributes are only allowed on the nightly release channel. Stable or beta compilers will not comply. -Example of erroneous code (on a stable compiler): +Erroneous code example: ```ignore (depends on release channel) #![feature(non_ascii_idents)] // error: `#![feature]` may not be used on the -- cgit 1.4.1-3-g733a5