rust/src/test
Yuki Okushi 89c98cd6b4
Rollup merge of #78063 - camelid:improve-cannot-multiply-error, r=estebank
Improve wording of "cannot multiply" type error

For example, if you had this code:

    fn foo(x: i32, y: f32) -> f32 {
        x * y
    }

You would get this error:

    error[E0277]: cannot multiply `f32` to `i32`
     --> src/lib.rs:2:7
      |
    2 |     x * y
      |       ^ no implementation for `i32 * f32`
      |
      = help: the trait `Mul<f32>` is not implemented for `i32`

However, that's not usually how people describe multiplication. People
usually describe multiplication like how the division error words it:

    error[E0277]: cannot divide `i32` by `f32`
     --> src/lib.rs:2:7
      |
    2 |     x / y
      |       ^ no implementation for `i32 / f32`
      |
      = help: the trait `Div<f32>` is not implemented for `i32`

So that's what this change does. It changes this:

    error[E0277]: cannot multiply `f32` to `i32`
     --> src/lib.rs:2:7
      |
    2 |     x * y
      |       ^ no implementation for `i32 * f32`
      |
      = help: the trait `Mul<f32>` is not implemented for `i32`

To this:

    error[E0277]: cannot multiply `i32` by `f32`
     --> src/lib.rs:2:7
      |
    2 |     x * y
      |       ^ no implementation for `i32 * f32`
      |
      = help: the trait `Mul<f32>` is not implemented for `i32`
2020-10-21 13:59:39 +09:00
..
assembly Add asm! support for mips64 2020-10-04 12:01:21 +00:00
auxiliary
codegen Rollup merge of #78046 - bugadani:issue-73827, r=nikic 2020-10-20 21:46:30 +02:00
codegen-units Move from {{closure}}#0 syntax to {closure#0} for (def) path components 2020-09-25 22:46:14 +01:00
compile-fail Add compile fail test for issue 27675 2020-10-08 08:18:59 +02:00
debuginfo BTreeMap: improve gdb introspection of BTreeMap with ZST keys or values 2020-10-14 13:03:23 +02:00
incremental Auto merge of #76859 - Aaron1011:fix/llvm-cgu-reuse, r=davidtwco,nikic 2020-10-11 20:50:02 +00:00
mir-opt Disable MatchBranchSimplification 2020-10-20 00:00:00 +00:00
pretty pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
run-make cleaning up code 2020-09-25 15:13:55 +02:00
run-make-fulldeps Fix hotplug_codegen_backend test 2020-10-10 19:00:51 +02:00
run-pass-valgrind
rustdoc Rollup merge of #77785 - GuillaumeGomez:remove-compiler-reexports, r=ollie27 2020-10-17 03:27:17 +02:00
rustdoc-js Add test for whitespace in doc alias 2020-10-05 16:37:13 +02:00
rustdoc-js-std
rustdoc-ui Rollup merge of #77753 - GuillaumeGomez:check-html-comments, r=jyn514 2020-10-15 07:32:31 +09:00
rustfix
ui Rollup merge of #78063 - camelid:improve-cannot-multiply-error, r=estebank 2020-10-21 13:59:39 +09:00
ui-fulldeps Replace run_compiler with RunCompiler builder pattern. 2020-10-08 16:11:45 -03:00
COMPILER_TESTS.md