rust/compiler/rustc_ast_passes/src
Tyler Mandry dc90573454
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
2020-12-10 21:33:10 -08:00
..
ast_validation.rs Clarify the 'default is only allowed on...' error 2020-12-08 21:56:22 -08:00
feature_gate.rs Accept arbitrary expressions in key-value attributes at parse time 2020-12-09 21:37:32 +03:00
lib.rs Bump recursion_limit in rustc_ast_passes 2020-11-27 15:47:58 -05:00
node_count.rs rustc_ast: visit_mac -> visit_mac_call 2020-11-03 23:39:51 +03:00
show_span.rs rustc_ast: Do not panic by default when visiting macro calls 2020-11-03 20:38:20 +03:00