about summary refs log tree commit diff
path: root/src/librustc_error_codes
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-04-22 10:34:03 +0900
committerGitHub <noreply@github.com>2020-04-22 10:34:03 +0900
commit24fb393207967d3f3b2802a0dbdd3efafab4e595 (patch)
tree65a9e90822f9957eb7dce831121923d5be2c9dac /src/librustc_error_codes
parent45d050cde277b22a755847338f2acc2c7b834141 (diff)
parente53625706106e0227656ddd2fa4d7df54ae2b90e (diff)
downloadrust-24fb393207967d3f3b2802a0dbdd3efafab4e595.tar.gz
rust-24fb393207967d3f3b2802a0dbdd3efafab4e595.zip
Rollup merge of #70998 - estebank:suggest-impl-trait-empty-fn, r=varkor
Suggest `-> impl Trait` and `-> Box<dyn Trait>` on fn that doesn't return

During development, a function could have a return type set that is a
bare trait object by accident. We already suggest using either a boxed
trait object or `impl Trait` if the return paths will allow it. We now
do so too when there are *no* return paths or they all resolve to `!`.
We still don't handle cases where the trait object is *not* the entirety
of the return type gracefully.

Closes #38376.
Diffstat (limited to 'src/librustc_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);
 }