about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/optimize/code_layout.rs
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2020-12-10 21:33:10 -0800
committerGitHub <noreply@github.com>2020-12-10 21:33:10 -0800
commitdc90573454775538702f27dedd458f7c7eb31124 (patch)
tree381b4a228867b29f76db1f76aa23b34d1cc23d97 /compiler/rustc_codegen_cranelift/src/optimize/code_layout.rs
parent17ec4b8258b3f59ded7b2cfae8484be976c658af (diff)
parent4e21942ba4d435c3211677ad42ddc528fff97857 (diff)
downloadrust-dc90573454775538702f27dedd458f7c7eb31124.tar.gz
rust-dc90573454775538702f27dedd458f7c7eb31124.zip
Rollup merge of #79851 - camelid:better-error-for-default-fn, r=davidtwco
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