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

Task startup makes cross-language/module fastcalls #495

Closed
eholk opened this issue Jun 15, 2011 · 1 comment
Closed

Task startup makes cross-language/module fastcalls #495

eholk opened this issue Jun 15, 2011 · 1 comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@eholk
Copy link
Contributor

eholk commented Jun 15, 2011

This isn't safe, in general.

@ghost ghost assigned eholk Jun 15, 2011
@eholk
Copy link
Contributor Author

eholk commented Jun 16, 2011

This took a sequence of three snapshots to finish. The relevant code portions are in the following three commits:

@eholk eholk closed this as completed in 405c164 Jun 16, 2011
@eholk eholk removed their assignment Jun 16, 2014
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 10, 2015
arielb1 added a commit to arielb1/rust that referenced this issue Sep 16, 2016
The wording of RFC rust-lang#495 enables moves out of slices. Unfortuantely, non-zeroing
moves out of slices introduce a very annoying complication: as slices can
vary in their length, indexes from the start and end may or may not overlap
depending on the slice's exact length, which prevents assigning a particular
drop flag for each individual element.

For example, in the code

```Rust
fn foo<T>(a: Box<[Box<[T]>]>, c: bool) -> T {
    match (a, c) {
        (box [box [t, ..], ..], true) => t,
        (box [.., box [.., t]], false) => t,
        _ => panic!()
    }
}
```

If the condition is false, we have to drop the first element
of `a`, unless `a` has size 1 in which case we drop all the elements
of it but the last.

If someone comes with a nice way of handling it, we can always re-allow
moves out of slices.

This is a [breaking-change], but it is behind the `slice_patterns` feature
gate and was not allowed until recently.
pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Instead of keeping our own copy of the monomorphizer, we would like to
start using rustc monomorphizer as is. This is the first step towards
that goal.

For now, we will use the upstream version of the monomorphizer with a
few small changes. Use a query to skip monomorphization for rmc instead
of hooks.

This change, adds a query to allow RMC to skip monomorphizing functions. It also does the following:
- Adds a default query to codegen base that don't skip anything.
- Adds a query implementation to RMC that checks our hooks.
- Skips monomorphizing the start function if --cfg=rmc

Issue rust-lang#485 tracks the rest of the changes needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Projects
None yet
Development

No branches or pull requests

1 participant