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 5 pull requests #71707

Merged
merged 19 commits into from
Apr 30, 2020
Merged

Rollup of 5 pull requests #71707

merged 19 commits into from
Apr 30, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

neocturne and others added 19 commits April 16, 2020 17:23
UI tests are updated with additional error messages that were missing
before.
Add testcases for the `#[track_caller]` and `#[target_feature(..)]`
function attributes for errors that were not not caught before.
The wording was discussed, to a limited degree in rust-lang#71679.  This tries to
address some confusion I as well as someone else had independently when
looking at this macro.

Fixes rust-lang#71679
Co-Authored-By: kennytm <kennytm@gmail.com>
…vink

rustc: fix check_attr() for methods, closures and foreign functions

This fixes an issue that previously turned up for methods in rust-lang#69274, but also exists for closures and foreign function: `check_attr` does not call `codegen_fn_attrs()` for these types when it should, meaning that incorrectly used function attributes are not diagnosed without codegen.

The issue affects our UI tests, as they run with `--emit=metadata` by default, but as it turns out, this is not the only case: Function attributes are not checked on any dead code without this fix!

This makes the fix a **breaking change**. The following very silly Rust programs compiles fine on stable Rust when it should not, which is fixed by this PR.
```rust
fn main() {
    #[target_feature(enable = "sse2")]
    || {};
}
```

I assume any real-world program which may trigger this issue would at least emit a dead code warning, but of course that is no guarantee that such code does not exist...

Fixes rust-lang#70307
Suggest deref when coercing `ty::Ref` to `ty::RawPtr`

Fixes rust-lang#32122

Currently we do autoderef when casting `ty::Ref` ->`ty::Ref`, but we don't autoderef when casting `ty::Ref` -> `ty::RawPtr`. This PR make the compiler suggests deref when coercing `ty::Ref` to `ty::RawPtr`
…=oli-obk

Miri: better document and fix dynamic const pattern soundness checks

rust-lang/const-eval#42 got me thinking about soundness for consts being used in patterns, and I found a hole in our existing dynamic checks: a const referring to a mutable static *in a different crate* was not caught. This PR fixes that. It also adds some comments that explain which invariants are crucial for soundness of const-patterns.

Curiously, trying to weaponize this soundness hole failed: pattern matching compilation ICEd when encountering the cross-crate static, saying "expected allocation ID alloc0 to point to memory". I don't know why that would happen, statics *should* be entirely normal memory for pattern matching to access.

r? @oli-obk
Cc @rust-lang/wg-const-eval
document missing stable counterparts of intrinsics

Notes the stable counterpart of each intrinsic in case one exists.

Implements rust-lang#34338

r? @Dylan-DPC
Add clarification on std::cfg macro docs v. #[cfg] attribute

The wording was discussed, to a limited degree in rust-lang#71679.  This tries to
address some confusion I as well as someone else had independently when
looking at this macro.

Fixes rust-lang#71679
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Apr 30, 2020

📌 Commit 8f6eabf 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 Apr 30, 2020
@Dylan-DPC-zz
Copy link
Author

@bors p=5

@bors
Copy link
Contributor

bors commented Apr 30, 2020

⌛ Testing commit 8f6eabf with merge eece58a...

@bors
Copy link
Contributor

bors commented Apr 30, 2020

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 30, 2020
@bors bors merged commit eece58a into rust-lang:master Apr 30, 2020
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #71707!

Tested on commit eece58a.
Direct link to PR: #71707

💔 rustc-dev-guide on linux: test-pass → test-fail (cc @JohnTitor @amanjeev @spastorino @mark-i-m).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Apr 30, 2020
Tested on commit rust-lang/rust@eece58a.
Direct link to PR: <rust-lang/rust#71707>

💔 rustc-dev-guide on linux: test-pass → test-fail (cc @JohnTitor @amanjeev @spastorino @mark-i-m).
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.

9 participants