rust/compiler/rustc_hir_analysis
bors 3200982b76 Auto merge of #108138 - compiler-errors:malformed-fn-trait, r=TaKO8Ki
Move `Fn*` traits malformedness protections to typeck

I found it strange that we were doing a custom well-formedness check just for the `Fn*` traits' `call_*` fn items. My understanding from the git history is that this is just to avoid ICEs later on in typeck.

Well, that well-formedness check isn't even implemented correctly for `FnOnce::call_once`, or `FnMut::call_mut` for that matter. Instead, this PR just makes the typeck checks more robust, and leaves it up to the call-site to report errors when lang items are implemented in funny ways.

This coincidentally fixes another ICE where a the `Add` lang item is implemented with a `add` item that's a const instead of a method.
2023-02-21 12:59:11 +00:00
..
src Auto merge of #108138 - compiler-errors:malformed-fn-trait, r=TaKO8Ki 2023-02-21 12:59:11 +00:00
Cargo.toml Use ThinVec in various AST types. 2023-02-21 11:51:56 +11:00
README.md

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.