Skip to content

Rollup of 15 pull requests #59910

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 33 commits into from
Apr 12, 2019
Merged

Rollup of 15 pull requests #59910

merged 33 commits into from
Apr 12, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Apr 12, 2019

Successful merges:

Failed merges:

r? @ghost

Christian and others added 30 commits April 3, 2019 22:20
This adds some extra docs for the `no-prefer-dynamic` header.

And also a `s/must_compile_successfully/compile_pass`.

`must_compile_successfully` has been renamed to `compile_pass` at some
point in the past and this comment was still referring to the old name.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
…ble compiler flags, instead of flags for debugging.
Add `a` and other minor text improvements
It's a primitive slice method, not a standalone function.
…mertj

Document the -Z flag to the rustc book

# Description

Changes:
- Added new documentation on the `-Z` flag of rustc in the command-line arguments section of the rustc book.

If I need to rephrase anything or if you have any improvements, please let me know! I deliberately did not create an exhaustive list of all options since they are likely to change over time and per toolchain version.

closes rust-lang#41142
compiletest: Improve no_prefer_dynamic docs

This adds some extra docs for the `no-prefer-dynamic` header.

And also a `s/must_compile_successfully/compile_pass`.

`must_compile_successfully` has been renamed to `compile_pass` at some
point in the past and this comment was still referring to the old name.
…ebank

Make trait_methods_not_found use a lock

r? @estebank
Kill dead code dominator code.

Hi,

Whilst fiddling around in the dominator code, I found some (I think) unused code. This code *was* used at the time it was imported, but over time it seems to have become redundant.

I've tested a build up to stage 1 with no problems. Maybe the tests will turn up something though.

P.S.

There is a FIXME comment in `dominators/mod.rs`:
```
    pub fn is_dominated_by(&self, node: Node, dom: Node) -> bool {
        // FIXME -- could be optimized by using post-order-rank
        self.dominators(node).any(|n| n == dom)
    }
```

I'm not sure of the intention of this comment. The `Dominators` struct already operates over post-order rank nodes. Any ideas?
…sdreavus

Fix broken links on std::boxed doc page

r? @QuietMisdreavus
…idtwco

improve unknown enum variant errors

Fixes rust-lang#56517.
Remove strange formatting in `Ordering` docs.

I can't really fathom what the intent of the brackets is. The [original PR](rust-lang#12956) doesn't give any hints. I think it seems fine without them.
std::ops::Div examples: correct nominator to numerator
…0.2, r=steveklabnik

Update TRPL to use mdbook 0.2

I ran linkchecker locally and it passed. Let's see if I did it correctly...
Remove note about transmute for float bitpatterns.

This particular usecase has been safely abstracted in these `std` functions: [f32::to_bits](https://doc.rust-lang.org/std/primitive.f32.html#method.to_bits), [f32::from_bits](https://doc.rust-lang.org/std/primitive.f32.html#method.from_bits), [f64::to_bits](https://doc.rust-lang.org/std/primitive.f64.html#method.to_bits), [f64::from_bits](https://doc.rust-lang.org/std/primitive.f64.html#method.from_bits). So, I think we shouldn't recommend an unnecessary use of `unsafe` here anymore.
Centril added 3 commits April 12, 2019 12:18
…estebank

Update diagnostics.rs

Add `a` and other minor text improvements
…as-schievink

Fix the link to sort_by_cached_key

It's a primitive slice method, not a standalone function.
save-analysis: Pull associated type definition using `qpath_def`

Closes rust-lang/rls#1390

This (probably?) fixes the case where we run the save-analysis code on the following snippet:
```rust
trait Test<'a> {
    type Thing: Test2;
}

trait Test2 {
    fn print();
}

#[allow(unused)]
fn example<T>(t: T)
    where T: for<'a> Test<'a>
{
    T::Thing::print(); //~ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
    // ^ only errors in save-analysis mode
}
```

The chain is as follows:
- culprit is `hir_ty_to_ty`
- which calls `ast_ty_to_ty` in the `ItemCtxt`
- which calls `associated_path_to_ty`
- which finally fails on `projected_ty_from_poly_trait_ref`
https://github.com/rust-lang/rust/blob/3de0106789468b211bcc3a25c09c0cf07119186d/src/librustc_typeck/collect.rs#L212-L224

I'm not exactly sure why `hir_ty_to_ty` fails - is it because it needs more setup from typeck to work correctly? I'm guessing the fix is okay since we just pull the already typeck'd data (we run save-analysis after all the analysis passes are complete) from the tables.

With this change we can 'go to def' on all segments in the `T::Thing::print()` path.
@Centril
Copy link
Contributor Author

Centril commented Apr 12, 2019

@bors r+ p=15

@bors
Copy link
Collaborator

bors commented Apr 12, 2019

📌 Commit 7a8329f has been approved by Centril

@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 12, 2019
@bors
Copy link
Collaborator

bors commented Apr 12, 2019

⌛ Testing commit 7a8329f with merge 5b96425...

bors added a commit that referenced this pull request Apr 12, 2019
Rollup of 15 pull requests

Successful merges:

 - #59680 (Document the -Z flag to the rustc book)
 - #59711 (Add back the substring test)
 - #59806 (compiletest: Improve no_prefer_dynamic docs)
 - #59809 (Make trait_methods_not_found use a lock)
 - #59811 (Kill dead code dominator code.)
 - #59814 (Fix broken links on std::boxed doc page)
 - #59821 (improve unknown enum variant errors)
 - #59831 (Remove strange formatting in `Ordering` docs.)
 - #59836 (std::ops::Div examples: correct nominator to numerator)
 - #59857 (SGX target: fix cfg(test) build)
 - #59876 (Update TRPL to use mdbook 0.2)
 - #59880 (Remove note about transmute for float bitpatterns.)
 - #59889 (Update diagnostics.rs)
 - #59891 (Fix the link to sort_by_cached_key)
 - #59894 (save-analysis: Pull associated type definition using `qpath_def`)

Failed merges:

r? @ghost
@bors
Copy link
Collaborator

bors commented Apr 12, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing 5b96425 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 12, 2019
@bors bors merged commit 7a8329f into rust-lang:master Apr 12, 2019
@Centril Centril deleted the rollup-yjv7b06 branch April 12, 2019 18:37
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup 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.