Check for region dependent goals on type_op itself as well#152816
Check for region dependent goals on type_op itself as well#152816rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
| infcx.tcx.check_potentially_region_dependent_goals(root_def_id).err().unwrap_or_else( | ||
| || { | ||
| infcx | ||
| .dcx() | ||
| .span_delayed_bug(span, format!("error performing operation: {name}")) | ||
| }, | ||
| ) |
There was a problem hiding this comment.
does just unwrapping here cause any ICE?
There was a problem hiding this comment.
Nothing so far
Edit) Oh we have one 😅 I've run only next-solver test suite locally
There was a problem hiding this comment.
can you look into why that obligation is failing even though HIR typeck is erroring, can't see the obligation which causes this ICE in CI
There was a problem hiding this comment.
Okay, I'll look into it
There was a problem hiding this comment.
So, the obligation fails here is &T: Iterator here(L15):
rust/tests/ui/wf/hir-wf-check-erase-regions.rs
Lines 11 to 19 in 8d50bcc
which is caused in here
rust/compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs
Lines 190 to 222 in 8d50bcc
while trying to normalize
<<Iter<'a, T> as Iterator>::Item as IntoIterator>::Iterator.
It's surprising that fn into_iter in L15 survives the typeck (or other earlier steps before MIR) without being tainted.
Maybe that's because of never type on unimplemented!() which bypasses actually touching the function's return type with NeverToAny coercion, otherwise the other concrete typed return would resulted in type mismatch error or fulfillment error while trying to normalize the function's return type?
I guess we ought to check the well-formedness of the type that never type is coerced into or the function's signature itself before MIR?
There was a problem hiding this comment.
I think the issue is that we check the return type is well-formed in wfcheck::check_well_formed and to avoid duplicate errors we don't check it in HIR typeck.
This means that non-wf return types go through HIR typeck without tainting it, only erroring in wfcheck.rs.
Hmm, I feel like ideally we do taint the MIR body here, but I think for now, just keep a span_delay_bug here and add a FIXME that we should try to make this an ICE (and why it doesn't work)
This comment has been minimized.
This comment has been minimized.
17c8020 to
5f3bdde
Compare
|
@bors r+ rollup thanks |
Rollup of 5 pull requests Successful merges: - #153341 (std: refactor Xous startup code) - #152816 (Check for region dependent goals on type_op itself as well) - #153224 (Fix LegacyKeyValueFormat report from docker build: disabled) - #153274 (Fix async drop multi crate crash) - #153324 (fix autodiff parsing for non-trait impl)
Fixes #151318
r? lcnr