-
Notifications
You must be signed in to change notification settings - Fork 5k
Enable -Zpolonius=next and remove NLL borrow-checker workarounds #36951
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
base: main
Are you sure you want to change the base?
Changes from 11 commits
6b086aa
95b7d27
ad80a05
9e5b3c9
a5dcc4d
2851dd2
9b05b6b
850981a
9254173
cf16871
f4bf3ec
feaabc6
750fa2d
24ac600
e43da76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,27 +308,20 @@ impl Chunk { | |
| // Look up the CSS chunk via the JS chunk's css_chunks indices. | ||
| // This correctly handles deduplicated CSS chunks that are shared | ||
| // across multiple HTML entry points (see issue #23668). | ||
| // Note: reshaped for borrowck — we scan immutably for the JS chunk, copy the | ||
| // css-chunk index into a local, drop the borrow, then re-borrow mutably. | ||
| let entry_point_id = self.entry_point.entry_point_id(); | ||
| let css_idx: Option<usize> = 'find: { | ||
| for other in chunks.iter() { | ||
| if let Content::Javascript(js) = &other.content { | ||
| if other.entry_point.is_entry_point() | ||
| && other.entry_point.entry_point_id() == entry_point_id | ||
| { | ||
| let css_chunk_indices = &js.css_chunks[..]; | ||
| if !css_chunk_indices.is_empty() { | ||
| break 'find Some(css_chunk_indices[0] as usize); | ||
| } | ||
| break 'find None; | ||
| for other in chunks.iter() { | ||
| if let Content::Javascript(js) = &other.content { | ||
| if other.entry_point.is_entry_point() | ||
| && other.entry_point.entry_point_id() == entry_point_id | ||
| { | ||
| let css_chunk_indices = &js.css_chunks[..]; | ||
| if !css_chunk_indices.is_empty() { | ||
| let idx = css_chunk_indices[0] as usize; | ||
| return Some(&mut chunks[idx]); | ||
| } | ||
| break; | ||
| } | ||
| } | ||
|
Comment on lines
+312
to
324
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code compiles on stable without Polonius. I also tried to test the refactor on the first version of this code in the repo and it also compiles on stable. Do you know what was the original motivation for this workaround? Did the code look differently when it was introduced (maybe that point is not in git history anymore)? |
||
| None | ||
| }; | ||
| if let Some(idx) = css_idx { | ||
| return Some(&mut chunks[idx]); | ||
| } | ||
| // Fallback: match by entry_point_id for cases without a JS chunk. | ||
| for other in chunks.iter_mut() { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.