Skip to content
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

Refactor Vec::map_in_place to move code out of PartialVec #17381

Merged
merged 1 commit into from
Oct 2, 2014

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Sep 18, 2014

Additionally, support zero-sized types.

Now there isn't a safe interface of PartialVec anymore, it's just a bare data structure with destructor that assumes you handled everything correctly before.

Additionally, support zero-sized types.
@rust-highfive
Copy link
Collaborator

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@aturon
Copy link
Member

aturon commented Oct 1, 2014

@tbu-

First off, this is awesome! I definitely think the code is cleaner this way, and I love the work you put into the comments making the algorithm clear.

Second, I'm sorry for the delay in having this reviewed -- it seems to've fallen through the cracks. In the future, feel free to ping me or any other member of the team by leaving an "r? @aturon" comment or messaging on IRC if your PR goes unreviewed for more than a day or two.

Meantime, I'm handing this off to bors. Nice work!

bors added a commit that referenced this pull request Oct 2, 2014
Additionally, support zero-sized types.

Now there isn't a safe interface of `PartialVec` anymore, it's just a bare data structure with destructor that assumes you handled everything correctly before.
@bors bors closed this Oct 2, 2014
@bors bors merged commit 454d91d into rust-lang:master Oct 2, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Jun 23, 2024
fix: ensure that the parent of a SourceRoot cannot be itself

fix rust-lang#17378.

In `FileSetConfig.map`, different roots might be mapped to the same `root_id` due to deduplication in `ProjectFolders::new`:

```rust
// Example from rustup
/Users/roife/code/rustup/target/debug/build/rustup-863a063426b56c51/out
/Users/roife/code/rustup
```

In `source_root_parent_map`, r-a might encounter paths where their SourceRootId (i.e. `root_id`) is identical, yet one the them is the parent of the another. This situation can cause the `root_id` to be its own parent, potentially leading to an infinite loop.

This PR resolves such cases by adding a check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants