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

Rollup of 6 pull requests #70441

Merged
merged 15 commits into from
Mar 27, 2020
Merged

Rollup of 6 pull requests #70441

merged 15 commits into from
Mar 27, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

nnethercote and others added 15 commits March 25, 2020 14:09
It's unused by any existing targets, and soon we'll be embedding full
bitcode by default anyway.
Currently, there are three fields in `ModuleConfig` that dictate
how object files are emitted: `emit_obj`, `obj_is_bitcode`, and
`embed_bitcode`.

Some of the combinations of these fields are nonsensical, in particular
having both `obj_is_bitcode` and `embed_bitcode` true at the same time.

Also, currently:
- we needlessly emit and then delete a bytecode file if `obj_is_bitcode`
  is true but `emit_obj` is false;
- we needlessly embed bitcode in the LLVM module if `embed_bitcode` is
  true and `emit_obj` is false.

This commit combines the three fields into one, with a new type
`EmitObj` (and the auxiliary `BitcodeSection`) which can encode five
different possibilities.

In the old code, `set_flags` would set `obj_is_bitcode` and
`embed_bitcode` on all three of the configs (`modules`, `allocator`,
`metadata`) if the relevant other conditions were met, even if no object
code needed to be emitted for one or more of them. Whereas
`start_async_codegen` would set `emit_obj`, but only for those configs
that need it.

In the new code, `start_async_codegen` does all the work of setting
`emit_obj`, and it only does that for the configs that need it.
`set_flags` no longer sets anything related to object file emission.
It makes things a little clearer.
- Added is_under_guard parameter to _match::is_useful and
  only add to the matrix if false
- Added comments explaining behavior
…ndling, r=alexcrichton

Refactor object file handling

Some preliminary clean-ups that grease the path to rust-lang#66961.

r? @alexcrichton
add 'fn write_u16s' to Memory

Added new function `Memory::write_u16s`. Needed in `MIRI` for implementing helper function to write wide_str to memory (for Windows).
…arning, r=Centril,Nadrieril,varkor

Fix incorrect pattern warning "unreachable pattern"

Fixes rust-lang#70372

Added `is_under_guard` parameter to `_match::is_useful` and only add it to the matrix if `false`

Tested with:
```rust
#![feature(or_patterns)]
fn main() {
    match (3,42) {
        (a,_) | (_,a) if a > 10 => {println!("{}", a)}
        _ => ()
    }

    match Some((3,42)) {
        Some((a, _)) | Some((_, a)) if a > 10 => {println!("{}", a)}
        _ => ()

    }

    match Some((3,42)) {
        Some((a, _) | (_, a)) if a > 10 => {println!("{}", a)}
        _ => ()
    }
}
```
`error_bad_item_kind`: add help text

For example, this adds:
```
    = help: consider moving the `use` import out to a nearby module scope
```
r? @petrochenkov @estebank

Fixes rust-lang#37205.
Miri float->int casts: be explicit that this is saturating

r? @hanna-kruppe
Cc rust-lang/miri#1264
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Mar 26, 2020

📌 Commit 195147c has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 26, 2020
@Dylan-DPC-zz Dylan-DPC-zz reopened this Mar 26, 2020
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Mar 26, 2020

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Mar 26, 2020

📌 Commit 195147c has been approved by Dylan-DPC

@bors
Copy link
Contributor

bors commented Mar 26, 2020

⌛ Testing commit 195147c with merge 62c6006...

@bors
Copy link
Contributor

bors commented Mar 27, 2020

☀️ Test successful - checks-azure
Approved by: Dylan-DPC
Pushing 62c6006 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 27, 2020
@bors bors merged commit 62c6006 into rust-lang:master Mar 27, 2020
@Dylan-DPC-zz Dylan-DPC-zz deleted the rollup-qv7h2ph branch March 27, 2020 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants