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 #39694

Merged
merged 13 commits into from
Feb 10, 2017
Merged

Rollup of 6 pull requests #39694

merged 13 commits into from
Feb 10, 2017

Conversation

est31 and others added 13 commits February 7, 2017 01:55
Even more SNAP cleanup.
Unignore u128 test for stage 0,1

Even more SNAP cleanup.

Follow-up of rust-lang#39519.

Sorry, I didn't check twice.
…ata, r=alexcrichton

Choose different name for metadata obj-file to avoid clashes with user-chosen names.

Fixes rust-lang#39585 and probably rust-lang#39508.
Incremental compilation assigns different names to obj-files than regular compilation. If a crate is called "metadata" this can lead to a clash between the root module's obj-file and the obj-file containing crate-metadata. This PR assigns a name to the metadata obj-file that cannot clash with other obj-file because it contains a `.` which is not allowed in a Rust module identifier.

r? @alexcrichton

cc @nikomatsakis
…erister

Exclude top-level macro expansions from source location override.

It occurred to me that a simple heuristic can address the issue rust-lang#36382: any macros that expand into items (including `include!()`) don't need to be stepped over because there's not code to step through above a function scope level.

r? @michaelwoerister
Fix unsafe unaligned loads in test.

r? @eddyb
cc @Aatch @nikomatsakis

The `#[derive(PartialEq, Debug)]` impls on a packed struct contain undefined behaviour. Both generated impls take references to unaligned fields, which will fail to compile once we correctly treat that as unsafe (see rust-lang#27060).

This UB was found by running the test under [Miri](https://github.com/solson/miri/) which rejects these unsafe unaligned loads. 😄

Here's a simpler example:

```rust
struct Packed {
    a: u8,
    b: u64,
}
```

It expands to:

```rust
    fn fmt(&self, __arg_0: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        match *self {
            Packed { a: ref __self_0_0, b: ref __self_0_1 } => { // BAD: these patterns are unsafe
                let mut builder = __arg_0.debug_struct("Packed");
                let _ = builder.field("a", &&(*__self_0_0));
                let _ = builder.field("b", &&(*__self_0_1));
                builder.finish()
            }
        }
    }
```

and

```rust
    fn eq(&self, __arg_0: &Packed) -> bool {
        match *__arg_0 {
            Packed { a: ref __self_1_0, b: ref __self_1_1 } => // BAD: these patterns are unsafe
            match *self {
                Packed { a: ref __self_0_0, b: ref __self_0_1 } => // BAD: these patterns are unsafe
                true && (*__self_0_0) == (*__self_1_0) &&
                    (*__self_0_1) == (*__self_1_1),
            },
        }
    }
```
…metadata, r=bluss

Fix unaligned load in librustc_metadata::index.

The derived `Clone` impl contains UB and will be unsafe when we fix rust-lang#27060. See [this comment](rust-lang#27060 (comment)) for more context.

r? @bluss
@frewsxcv
Copy link
Member Author

frewsxcv commented Feb 9, 2017

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Feb 9, 2017

📌 Commit 55c17a5 has been approved by frewsxcv

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@bors
Copy link
Contributor

bors commented Feb 9, 2017

⌛ Testing commit 55c17a5 with merge 24a70eb...

bors added a commit that referenced this pull request Feb 9, 2017
Rollup of 6 pull requests

- Successful merges: #39604, #39619, #39670, #39678, #39682, #39683
- Failed merges:
@bors
Copy link
Contributor

bors commented Feb 10, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: frewsxcv
Pushing 24a70eb to master...

@bors bors merged commit 55c17a5 into rust-lang:master Feb 10, 2017
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants