about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-04-11 11:31:54 -0700
committerEsteban Küber <esteban@kuber.com.ar>2020-04-20 11:17:03 -0700
commite53625706106e0227656ddd2fa4d7df54ae2b90e (patch)
treeca5862cc1e9602ebb3e5c20b671293de8732f9f1 /src/librustc_error_codes/error_codes
parentd3c96f03b5f6b4457cbabf4f3e1ec6c1aed23385 (diff)
downloadrust-e53625706106e0227656ddd2fa4d7df54ae2b90e.tar.gz
rust-e53625706106e0227656ddd2fa4d7df54ae2b90e.zip
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.
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0746.md3
1 files changed, 1 insertions, 2 deletions
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);
 }