-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Int and float inference variables are trivially copy #102695
Int and float inference variables are trivially copy #102695
Conversation
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
r? @lcnr Though I don't like that this change fixes an ICE. This code shouldn't ICE without that change as well, as it feels like there's probably a bigger underlying issue here. |
@lcnr, yeah, sorry, I forgot to comment on this. There is a bigger underlying issue here, specifically using a raw type query on a type that hasn't been fully resolved. Ideally we'd be canonicalizing the types that we pass into this query and dealing with them more responsibly within a new infer ctxt, like we do when we check if a type is copy or sized. Luckily, the only type of inference variables that can leak into the queries at that point are region variables, which are erased, and int/float inference variables, which are fixed by this ICE. Unresolved type variables don't make it this far into generators I think. I'll leave a note near the |
I wonder if we should just plainly disallow stable-hashing of inference variables. This would get rid of this hazard by a preemptive panic. |
surprising that int/float infer still exists here then, I feel like these also shouldn't appear during borrowck. Will look at this once I am back home next week. Leaving a note there seems good enough for me 👍 |
this isn't during borrowck, this is in generator interior analysis during typeck, so I don't think we've done fallback on the integer variables at this point. |
9d7dfa5
to
42321b0
Compare
@bors r=lcnr |
…ial-copy, r=lcnr Int and float inference variables are trivially copy Fixes rust-lang#102645
☀️ Test successful - checks-actions |
Finished benchmarking commit (3271760): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
Deny hashing ty/re/ct inference variables cc `@cjgillot` and rust-lang#102695 (comment) r? `@lcnr` best reviewed one commit at a time, mostly because the second commit that fixes `ClosureOutlivesRequirement` is mostly noise because of losing its `<'tcx>` lifetime parameter.
Deny hashing ty/re/ct inference variables cc `@cjgillot` and rust-lang/rust#102695 (comment) r? `@lcnr` best reviewed one commit at a time, mostly because the second commit that fixes `ClosureOutlivesRequirement` is mostly noise because of losing its `<'tcx>` lifetime parameter.
Fixes #102645