8

Do `fix_*_builtin_expr` hacks on the writeback results by compiler-errors · Pull...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/112410
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

During writeback, we do fix_{scalar,index}_builtin_expr so that during MIR build we generate built-in MIR instructions instead of method calls for certain built-in arithmetic operations. We do this by checking the types of these built-in operations are scalar types, and remove the method def-id to essentially mark the operation as built-in and not "overloaded".

For lazy norm and the new trait solver, this is a problem, because we don't actually normalize all the types we end up seeing in the typeck results until they're copied over writeback's copy of the typeck results. To fix this, delay these fixup calls until after this normalization has been done.

This doesn't affect the old trait solver, but does simplify the code a bit IMO, since we can remove a few sets of calls to resolve_vars_if_possible and some borrow_muts.

r? @lcnr


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK