Hello everyone! I have a question about lowering. In order to fix https://github.com/rust-lang/rust/issues/71104 i would like to generate a fatal error for async generator here https://github.com/rust-lang/rust/blob/master/src/librustc_ast_lowering/expr.rs#L1021 instead of letting the compilation continue because the produced hir is invalid
Is that a sensible idea?
If so, how would I do that?
We're trying to remove fatal errors from the compiler. Maybe we can instead create typecktables for these
HirNode::Err that have their
tainted_by_errors field set: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TypeckTables.html#structfield.tainted_by_errors
I think we should explore some other avenues before introducing a new fatal error
Ok duly noted. That was just an idea I had. It was to clean up this FIXME i added: https://github.com/rust-lang/rust/blob/master/src/librustc_middle/ty/context.rs#L1117
Maybe one improvements could be to not store
resolutions.trait_map? Instead storing
sorry, this is severely out of my mental cache, I need to read up and I don't have that time at the moment. Feel free to ping me on monday if you still don't have an answer
Sure! I'll investigate a bit.
So instead of generating a fatal error, we can just avoid returning a
hir::ExprKind::Err and keep going with the lowering: https://github.com/rust-lang/rust/pull/72275