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

remove the TyDesc from TypedArena #12444

Merged
merged 1 commit into from
Feb 23, 2014
Merged

remove the TyDesc from TypedArena #12444

merged 1 commit into from
Feb 23, 2014

Conversation

thestinger
Copy link
Contributor

This prevents generating visit glue when using a TypedArena. The problem
still exists for the untyped Arena.

}
}
let mut start = self.start();
for _ in range(0, len) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these loops actually optimise out for non-dtor types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Vec<T> does the same thing. I do want to provide a better way of doing this than read_ptr to make the code clearer and reduce the pre-optimization bloat a bit though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if std::unstable::intrinsics::needs_drop::<T>() {
    for _ in range(0, len) { ... }
}

This prevents generating visit glue when using a TypedArena. The problem
still exists for the untyped Arena.
bors added a commit that referenced this pull request Feb 23, 2014
This prevents generating visit glue when using a TypedArena. The problem
still exists for the untyped Arena.
@bors bors closed this Feb 23, 2014
@bors bors merged commit 4687e1d into rust-lang:master Feb 23, 2014
@thestinger thestinger deleted the arena branch March 5, 2014 23:19
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
fix: parsing of `?` opt-out trait bounds

fixes rust-lang#12442
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 27, 2024
…xendoo

Avoid emitting `assigning_clones` when cloned data borrows from the place to clone into

Fixes rust-lang#12444
Fixes rust-lang#12460
Fixes rust-lang#12749
Fixes rust-lang#12757
Fixes rust-lang#12929

I think the documentation for the function should describe what- and how this is fixing the issues well.
It avoids emitting a warning when the data being cloned borrows from the place to clone into, which is information that we can get from `PossibleBorrowerMap`. Unfortunately, it is a tiny bit tedious to match on the MIR like that and I'm not sure if this is possibly relying a bit too much on the exact MIR lowering for assignments.

Things left to do:
- [x] Handle place projections (or verify that they work as expected)
- [x] Handle non-`Drop` types

changelog: [`assigning_clones`]: avoid warning when the suggestion would lead to a borrow-check error
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.

3 participants