correctly deal with user type ascriptions in pat#96515
correctly deal with user type ascriptions in pat#96515bors merged 4 commits intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
I don't really understand the PR description, @lcnr :( maybe we can find some time to sync up on this. I'd like to understand better what is going on! |
|
@bors r+ |
|
📌 Commit 9b5a0f55a7d08ec900a7ca3e08de1e9ef4b634fa has been approved by |
|
⌛ Testing commit 9b5a0f55a7d08ec900a7ca3e08de1e9ef4b634fa with merge 35e0e69c59029e2659cc6b35c3d1006856e44995... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
@bors r=nikomatsakis |
|
📌 Commit 7637008 has been approved by |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (e52e711): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
supersedes #93856
thir::PatKind::AscribeUserTypepreviously resulted inCanonicalUserTypeAnnotationswhere the inferred type already had a subtyping relation according tovarianceto theuser_ty.The bug can pretty much be summarized as follows:
user_ty -> inferred_ty: considers varianceStatementKind::AscribeUserType:inferred_tyis the type of the place, so no variance neededuser_ty -> inferred_ty: does not consider varianceStatementKind::AscribeUserType: applies varianceThis mostly worked fine. The lifetimes in
inferred_tywere only bound by its relation touser_tyand to theplaceofStatementKind::AscribeUserType, so it doesn't matter where exactly the subtyping happens.It does however matter when having higher ranked subtying. At this point the place where the subtyping happens is forced, causing this mismatch between building and borrowck to result in unintended errors.
cc #96514 which is pretty much the same issue
r? @nikomatsakis