Skip to content

Commit

Permalink
Auto merge of #108138 - compiler-errors:malformed-fn-trait, r=TaKO8Ki
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Feb 21, 2023
2 parents c834084 + 57e7afc commit e6634d1
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit e6634d1

Please sign in to comment.