about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/optimize/code_layout.rs
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2020-12-08 21:56:22 -0800
committerCamelid <camelidcamel@gmail.com>2020-12-08 21:56:22 -0800
commit4e21942ba4d435c3211677ad42ddc528fff97857 (patch)
tree94b46162f7df7f440b33818c785c65e41f824a54 /compiler/rustc_codegen_cranelift/src/optimize/code_layout.rs
parent5bb68c31f8cef24174a7d3499de6b4ebea069900 (diff)
downloadrust-4e21942ba4d435c3211677ad42ddc528fff97857.tar.gz
rust-4e21942ba4d435c3211677ad42ddc528fff97857.zip
Clarify the 'default is only allowed on...' error
Code like

    impl Foo {
        default fn foo() {}
    }

will trigger the error

    error: `default` is only allowed on items in `impl` definitions
     --> src/lib.rs:5:5
      |
    5 |     default fn foo() {}
      |     -------^^^^^^^^^
      |     |
      |     `default` because of this

but that's very confusing! I *did* put it on an item in an impl!

So this commit changes the message to

    error: `default` is only allowed on items in trait impls
     --> src/lib.rs:5:5
      |
    5 |     default fn foo() {}
      |     -------^^^^^^^^^
      |     |
      |     `default` because of this
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/optimize/code_layout.rs')
0 files changed, 0 insertions, 0 deletions