]> git.lizzy.rs Git - rust.git/commitdiff
Change wording for function without return value
authorEsteban Küber <esteban@kuber.com.ar>
Wed, 7 Aug 2019 05:22:04 +0000 (22:22 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Fri, 9 Aug 2019 14:18:05 +0000 (07:18 -0700)
Fix #62677

15 files changed:
src/librustc_typeck/check/mod.rs
src/test/ui/block-result/consider-removing-last-semi.stderr
src/test/ui/block-result/issue-11714.stderr
src/test/ui/block-result/issue-13428.stderr
src/test/ui/coercion/coercion-missing-tail-expected-type.stderr
src/test/ui/issues/issue-32323.stderr
src/test/ui/issues/issue-43162.stderr
src/test/ui/issues/issue-44023.stderr
src/test/ui/issues/issue-6458-4.stderr
src/test/ui/liveness/liveness-forgot-ret.stderr
src/test/ui/liveness/liveness-missing-ret2.stderr
src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
src/test/ui/missing/missing-return.stderr
src/test/ui/parser/issue-62881.stderr
src/test/ui/parser/issue-62895.stderr

index 08033b46b800420f9b9fb35d46296207353f1261..da9b02fcf513a1c91f90cd63081f45a5fdfc016a 100644 (file)
@@ -3709,7 +3709,7 @@ fn check_block_with_expected(
                             self.consider_hint_about_removing_semicolon(blk, expected_ty, err);
                         }
                         if let Some(fn_span) = fn_span {
-                            err.span_label(fn_span, "this function's body doesn't return");
+                            err.span_label(fn_span, "this function's body doesn't return a value");
                         }
                     }, false);
                 }
index 618d020ce08b54c443add265e724fc8d744c337d..7f8bb67c946e6e22c7ce5f84f2bfcee8ca785c34 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn f() -> String {
    |    -      ^^^^^^ expected struct `std::string::String`, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 LL |     0u8;
 LL |     "bla".to_string();
    |                      - help: consider removing this semicolon
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
 LL | fn g() -> String {
    |    -      ^^^^^^ expected struct `std::string::String`, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 LL |     "this won't work".to_string();
 LL |     "removeme".to_string();
    |                           - help: consider removing this semicolon
index d73489a602df4dc31d6de97dad3c40f2a90d4403..569e012540c4f938a4c1cd4e30cf5a5e1c10a47b 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn blah() -> i32 {
    |    ----      ^^^ expected i32, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 ...
 LL |     ;
    |     - help: consider removing this semicolon
index 18adb15c9615d7c2f7e79fa27650a8e3949b1642..ca48910026d9a45888bd490703cfd963cd34e1a0 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn foo() -> String {
    |    ---      ^^^^^^ expected struct `std::string::String`, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 ...
 LL |     ;
    |     - help: consider removing this semicolon
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
 LL | fn bar() -> String {
    |    ---      ^^^^^^ expected struct `std::string::String`, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 LL |     "foobar".to_string()
 LL |     ;
    |     - help: consider removing this semicolon
index 057de5b625e874bcc9f8f2d3a7998c94a541272c..a7ac930ba670e40ef5c5ae24dfbf2ff7617fd5b6 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn plus_one(x: i32) -> i32 {
    |    --------            ^^^ expected i32, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 LL |     x + 1;
    |          - help: consider removing this semicolon
    |
@@ -17,7 +17,7 @@ error[E0308]: mismatched types
 LL | fn foo() -> Result<u8, u64> {
    |    ---      ^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 LL |     Ok(1);
    |          - help: consider removing this semicolon
    |
index 0339fdc55b9c83157860ce5422091cf8510348f0..6b8bca078b5e6fb761d690fa431c1415e567b6c9 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {}
    |        -                     ^^^^^^^^^^^^^^^^^^ expected associated type, found ()
    |        |
-   |        this function's body doesn't return
+   |        this function's body doesn't return a value
    |
    = note: expected type `<T as Tr<'a>>::Out`
               found type `()`
index cd11959ede6cbea2a6514e983f9a68bafbae0af4..fd62ac30ab1954f5e7437f19a539ddeedf47fd09 100644 (file)
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
 LL | fn foo() -> bool {
    |    ---      ^^^^ expected bool, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 LL |
 LL |     break true;
    |               - help: consider removing this semicolon
index 153be363c1deab85d4a88e76b66f3503baa8fccd..cad202129a719aa2439eb2000ffda73790e6796a 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn საჭმელად_გემრიელი_სადილი ( ) -> isize {
    |    ------------------------        ^^^^^ expected isize, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
    |
    = note: expected type `isize`
               found type `()`
index 90b493e1634c4c0d5c059ab36bdf8be1693ed9d5..d4f5b2ba41f69f6e21e081e6cc37e9c38013911a 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn foo(b: bool) -> Result<bool,String> {
    |    ---             ^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 LL |     Err("bar".to_string());
    |                           - help: consider removing this semicolon
    |
index a970b80fdbbd93e9da12b018c0207f75487675a5..6d917393663b04d498e0b180cf03cb26ad4e547d 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; }
    |    -              ^^^^^ expected isize, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
    |
    = note: expected type `isize`
               found type `()`
index ab7d411880bbafaf16034d2563a456d2d8c1db06..a71b9296702b75c440d4be2733a5df80748bdecf 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn f() -> isize {
    |    -      ^^^^^ expected isize, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
    |
    = note: expected type `isize`
               found type `()`
index a5d9734c069ec06f737828eb54dbffe1866b8fd9..3a0869917064354cc7d427092fc8b3e3f25a6b8b 100644 (file)
@@ -5,7 +5,7 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
    |                                ---      ^^^    - help: consider removing this semicolon
    |                                |        |
    |                                |        expected i32, found ()
-   |                                this function's body doesn't return
+   |                                this function's body doesn't return a value
 ...
 LL |     test!();
    |     -------- in this macro invocation
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
 LL | fn no_return() -> i32 {}
    |    ---------      ^^^ expected i32, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
    |
    = note: expected type `i32`
               found type `()`
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
 LL | fn bar(x: u32) -> u32 {
    |    ---            ^^^ expected u32, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
 LL |     x * 2;
    |          - help: consider removing this semicolon
    |
@@ -43,7 +43,7 @@ error[E0308]: mismatched types
 LL | fn baz(x: u64) -> u32 {
    |    ---            ^^^ expected u32, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
    |
    = note: expected type `u32`
               found type `()`
index 42466e2fc6574f8fba377aed422388bc9e55df00..c7d7116a9cd7cdc2197cbdd29b53c1d19aab1eea 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn f() -> isize { }
    |    -      ^^^^^ expected isize, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
    |
    = note: expected type `isize`
               found type `()`
index 85c3575fd92885dfae2255072ccbc19b81de9c92..b2e2da35a2700599ba96812f68a8d03aa4108db1 100644 (file)
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
 LL | fn f() -> isize { fn f() -> isize {} pub f<
    |                      -      ^^^^^ expected isize, found ()
    |                      |
-   |                      this function's body doesn't return
+   |                      this function's body doesn't return a value
    |
    = note: expected type `isize`
               found type `()`
index 7def7b562ca593b3dd99a95a159884204c8a69a3..6c3a8fb766c0a708c02d7868ec1125361c6b9608 100644 (file)
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
 LL | fn v() -> isize {
    |    -      ^^^^^ expected isize, found ()
    |    |
-   |    this function's body doesn't return
+   |    this function's body doesn't return a value
    |
    = note: expected type `isize`
               found type `()`