Commit Graph

92075 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
cf370b40dc
Rollup merge of #59930 - kornelski:first-robots, r=GuillaumeGomez
Exclude some copies of old book editions from search engines

These are only stubs that confuse search engine users. There's no useful content in these locations.
2019-04-14 00:23:50 +02:00
Mazdak Farrokhzad
2413ac7956
Rollup merge of #59925 - solson:split_ascii_whitespace-docfix, r=Centril
Fix paste error in split_ascii_whitespace docs.

It was accidentally still testing the unicode version, `split_whitespace`.
2019-04-14 00:23:49 +02:00
Mazdak Farrokhzad
8769297e97
Rollup merge of #59912 - RalfJung:maybe-uninit, r=Centril
MaybeUninit: remove deprecated functions
2019-04-14 00:23:47 +02:00
Mazdak Farrokhzad
857416b590
Rollup merge of #59899 - nnethercote:sort-enum-variants-by-size, r=pnkfelix
In `-Zprint-type-size` output, sort enum variants by size.

It's useful to see the biggest variants first.

r? @pnkfelix
2019-04-14 00:23:46 +02:00
Mazdak Farrokhzad
abfca1e155
Rollup merge of #59858 - mark-i-m:dup-matcher-bindings-3, r=Centril
Make duplicate matcher bindings a hard error

r? @Centril

Closes #57742
2019-04-14 00:23:44 +02:00
Mazdak Farrokhzad
8af5c8f4cb
Rollup merge of #59855 - GuillaumeGomez:fix-attr-position-in-type-decl, r=QuietMisdreavus
Fix attributes position in type declaration

Fixes #59797.

r? @rust-lang/rustdoc
2019-04-14 00:23:42 +02:00
Mazdak Farrokhzad
a52fce7ec8
Rollup merge of #59852 - alexcrichton:more-vectored, r=sfackler
std: Add `{read,write}_vectored` for more types

This commit implements the `{read,write}_vectored` methods on more types
in the standard library, namely:

* `std::fs::File`
* `std::process::ChildStd{in,out,err}`
* `std::io::Std{in,out,err}`
* `std::io::Std{in,out,err}Lock`
* `std::io::Std{in,out,err}Raw`

Where supported the OS implementations hook up to native support,
otherwise it falls back to the already-defaulted implementation.
2019-04-14 00:23:40 +02:00
Mazdak Farrokhzad
449697b7ff
Rollup merge of #59835 - lzutao:nonzero-signed, r=Mark-Simulacrum
Re-export NonZero signed variant in std

Closes  #59834 .
2019-04-14 00:23:39 +02:00
Mazdak Farrokhzad
715875268a
Rollup merge of #59830 - ehuss:keyword-links, r=Mark-Simulacrum
Fix links on keyword docs.

- Make links relative.
- Adjust links from old 2018-edition book.
- Fix broken link in `let` docs.
2019-04-14 00:23:37 +02:00
Mazdak Farrokhzad
8ad17ec6e4
Rollup merge of #59818 - crlf0710:eliminate_libstd_fnbox, r=cramertj
Eliminate `FnBox` usages from libstd.
2019-04-14 00:23:35 +02:00
Mazdak Farrokhzad
1888b55d7b
Rollup merge of #59804 - Zoxc:cleaner-jobserver, r=alexcrichton
Clean up jobserver integration

cc @alexcrichton
2019-04-14 00:23:34 +02:00
Mazdak Farrokhzad
37b76f29e7
Rollup merge of #59796 - oli-obk:const_arg_ice, r=eddyb
Retire `IsNotConst` naming

This naming scheme caused a lot of confusion lately (including ICEs) due to misrefactored code. Also clean up the initialization code for said flag.

r? @eddyb

previous discussions: https://github.com/rust-lang/rust/pull/58784#issuecomment-468717439 https://github.com/rust-lang/rust/pull/58403#discussion_r265936336
2019-04-14 00:23:32 +02:00
Mazdak Farrokhzad
d34ebb4660
Rollup merge of #59747 - gruberb:copy-book-toml-unstable-book, r=ehuss
Copy book.toml unstable book generator

Solves https://github.com/rust-lang/rust/issues/59554 and adds a book title to the unstable book.

I assume that [copy_recursive](acd8dd6a50/src/tools/unstable-book-gen/src/main.rs (L105)) will take files regardless of their type (`.md` or `.toml`).

Although I had a hard time time testing it. A second pair of eyes is definitely needed.
2019-04-14 00:23:30 +02:00
Mazdak Farrokhzad
056c02ec2f
Rollup merge of #59735 - matklad:deadcode, r=sanxiyn
remove lookup_char_pos_adj

It is now exactly equivalent to lookup_char_pos.
2019-04-14 00:23:29 +02:00
Mazdak Farrokhzad
d5030e2489
Rollup merge of #59708 - matthewjasper:double-closure-unused-mut, r=pnkfelix
Mark variables captured by reference as mutable correctly

Closes #59620

r? @pnkfelix
2019-04-14 00:23:27 +02:00
Mazdak Farrokhzad
bdb264ff5f
Rollup merge of #59675 - SimonSapin:stable-alloc, r=alexcrichton
Stabilize the `alloc` crate.

This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

Closes https://github.com/rust-lang/rust/issues/27783
2019-04-14 00:23:25 +02:00
bors
e4c66afba5 Auto merge of #59612 - matthewjasper:dataflow-usual-newtype-index, r=estebank
Use normal newtype_index macro for MIR dataflows

* Makes the definition of these structs contain `struct IndexName`
* Avoids having an offset by removing high values, rather than 0
* Implements some traits for us.
2019-04-13 16:42:51 +00:00
bors
896c3a570f Auto merge of #59515 - wesleywiser:measureme, r=michaelwoerister
Use measureme in self profiler

r? @michaelwoerister

~Changes are still very rough.~

~I'm not sure what the right way to add the `measureme` dependency is. Currently it's just added with a relative path which Works On My Machine ™️.~

I'm also not sure what to do with the category data.
2019-04-13 11:54:26 +00:00
bors
aa35e73b25 Auto merge of #59922 - Centril:rollup-0qmx4jg, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #59781 (Remove check_match from const_eval)
 - #59820 (proc_macro: stop using LEB128 for RPC.)
 - #59846 (clarify what the item is in "not a module" error)
 - #59847 (Error when using `catch` after `try`)
 - #59859 (Suggest removing `?` to resolve type errors.)
 - #59862 (Tweak unstable diagnostic output)
 - #59866 (Recover from missing semicolon based on the found token)
 - #59892 (Impl RawFd conversion traits for WASI TcpListener, TcpStream and UdpSocket)

Failed merges:

r? @ghost
2019-04-13 07:48:01 +00:00
Wesley Wiser
56e434d84d Use measureme in self-profiler
Related to #58372
Related to #58967
2019-04-12 20:27:29 -04:00
Kornel
0a9b214b50 Exclude some copies of old book editions from search engines 2019-04-13 00:38:46 +01:00
bors
99da733f7f Auto merge of #59924 - Xanewok:subup, r=Xanewok
Update submodules (Clippy, RLS)

Basically https://github.com/rust-lang/rust/pull/59916 with one fix applied to make it build
2019-04-12 21:08:14 +00:00
Scott Olson
b27bcc0a17 Fix paste error in split_ascii_whitespace docs. 2019-04-12 13:57:45 -06:00
flip1995
0a5bc93f72 Update rls 2019-04-12 21:47:46 +02:00
flip1995
4a0aef4d1a Update Clippy 2019-04-12 21:27:15 +02:00
Mazdak Farrokhzad
ba173135be
Rollup merge of #59892 - rylev:as-raw-fd, r=alexcrichton
Impl RawFd conversion traits for WASI TcpListener, TcpStream and UdpSocket

r? @alexcrichton
2019-04-12 20:36:18 +02:00
Mazdak Farrokhzad
af4acd0533
Rollup merge of #59866 - estebank:recover-missing-semi, r=petrochenkov
Recover from missing semicolon based on the found token

When encountering one of a few keywords when a semicolon was
expected, suggest the semicolon and recover:

```
error: expected one of `.`, `;`, `?`, or an operator, found `let`
  --> $DIR/recover-missing-semi.rs:4:5
   |
LL |     let _: usize = ()
   |                      - help: missing semicolon here
LL |
LL |     let _ = 3;
   |     ^^^

error[E0308]: mismatched types
  --> $DIR/recover-missing-semi.rs:2:20
   |
LL |     let _: usize = ()
   |                    ^^ expected usize, found ()
   |
   = note: expected type `usize`
              found type `()`
```
2019-04-12 20:36:16 +02:00
Mazdak Farrokhzad
ca9f04e41e
Rollup merge of #59862 - estebank:tweak-unstable-diag, r=petrochenkov
Tweak unstable diagnostic output
2019-04-12 20:36:15 +02:00
Mazdak Farrokhzad
2bc127dcc7
Rollup merge of #59859 - davidtwco:issue-59756, r=cramertj
Suggest removing `?` to resolve type errors.

Fixes #59756.
2019-04-12 20:36:13 +02:00
Mazdak Farrokhzad
8f111951a1
Rollup merge of #59847 - Kampfkarren:try-block-catch, r=estebank
Error when using `catch` after `try`

Part of https://github.com/rust-lang/rust/issues/31436
2019-04-12 20:36:11 +02:00
Mazdak Farrokhzad
29f9dd2364
Rollup merge of #59846 - euclio:not-a-module, r=davidtwco
clarify what the item is in "not a module" error

The motivation here was that I was trying to import an associated constant when I thought it was an enum variant, and got confused by this error.

Ideally I would like to add a note saying that associated constants, types, and methods cannot be imported, but I'm not sure that the associated items for a `Def` can be checked at resolve time.
2019-04-12 20:36:09 +02:00
Mazdak Farrokhzad
ed1dd1eb74
Rollup merge of #59820 - eddyb:proc-macro-rpc-opt, r=nnethercote
proc_macro: stop using LEB128 for RPC.

I'm not sure how much of an improvement this creates, it's pretty tricky to measure.
2019-04-12 20:36:07 +02:00
Mazdak Farrokhzad
1fb4837bb6
Rollup merge of #59781 - whitfin:issue-59378, r=oli-obk
Remove check_match from const_eval

This fixes #59378.

It seems that the `check_match` may be unnecessary, so this removes it per instructions provided in the issue. I re-ran the tests for `librustc_mir` and everything seemed fine!
2019-04-12 20:36:05 +02:00
Simon Sapin
fc928a18ba Stabilize the alloc crate.
This implements RFC 2480:

* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md

Closes https://github.com/rust-lang/rust/issues/27783
2019-04-12 20:07:30 +02:00
bors
df25d79a33 Auto merge of #59733 - cramertj:wake-by-ref, r=withoutboats
Final (one can only hope) futures_api adjustments

Based on https://github.com/rust-lang/rust/pull/59119 -- this change is only the latter two commits.
cc https://github.com/rust-lang/rust/issues/59725

r? @withoutboats
2019-04-12 17:24:01 +00:00
bors
9a612b2348 Auto merge of #59651 - tmandry:discr-index, r=eddyb
Add discr_index to multi-variant layouts

We remove the assumption that the discriminant is always field 0, in
preparations for layouts like generators where this is not (always) going to be
the case.

Specifically, upvars are going to go before the discriminant. In theory, it's possible to remove _that_ assumption instead and keep the discriminant at field index 0, but one assumption or the other had to go :)

There is one place I know of in the debuginfo code where we'll still need to remove assumptions that the discriminant is the _only_ field. I was planning on doing this along with the upcoming generator change, which will also include tests that exercise the code changing in this PR.

r? @eddyb
cc @oli-obk
cc @cramertj
2019-04-12 14:38:15 +00:00
bors
5b96425699 Auto merge of #59910 - Centril:rollup-yjv7b06, r=Centril
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
2019-04-12 11:46:01 +00:00
Ralf Jung
1ce6645d1f MaybeUninit: remove deprecated functions 2019-04-12 12:41:17 +02:00
Mazdak Farrokhzad
7a8329f5da
Rollup merge of #59894 - Xanewok:save-assoc-ty-qpath, r=eddyb
save-analysis: Pull associated type definition using `qpath_def`

Closes https://github.com/rust-lang/rls/issues/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`
3de0106789/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.
2019-04-12 12:18:11 +02:00
Mazdak Farrokhzad
dddcd928dd
Rollup merge of #59891 - rust-lang:sort_by_cached_key, r=jonas-schievink
Fix the link to sort_by_cached_key

It's a primitive slice method, not a standalone function.
2019-04-12 12:18:09 +02:00
Mazdak Farrokhzad
cb7079fe72
Rollup merge of #59889 - andrewbanchich:minor-text-fixes, r=estebank
Update diagnostics.rs

Add `a` and other minor text improvements
2019-04-12 12:18:07 +02:00
Mazdak Farrokhzad
257dbb826d
Rollup merge of #59880 - solson:transmute-float, r=alexcrichton
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.
2019-04-12 12:18:05 +02:00
Mazdak Farrokhzad
ef90d940dc
Rollup merge of #59876 - integer32llc:update-trpl-to-mdbook-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...
2019-04-12 12:18:02 +02:00
Mazdak Farrokhzad
c852cc5443
Rollup merge of #59857 - jethrogb:jb/sgx-test, r=Centril
SGX target: fix cfg(test) build
2019-04-12 12:18:01 +02:00
Mazdak Farrokhzad
740c9ea703
Rollup merge of #59836 - andersk:nominator, r=Centril
std::ops::Div examples: correct nominator to numerator
2019-04-12 12:17:59 +02:00
Mazdak Farrokhzad
94b7b6a604
Rollup merge of #59831 - ehuss:ordering-docs, r=kennytm
Remove strange formatting in `Ordering` docs.

I can't really fathom what the intent of the brackets is. The [original PR](#12956) doesn't give any hints. I think it seems fine without them.
2019-04-12 12:17:58 +02:00
Mazdak Farrokhzad
24ee611eac
Rollup merge of #59821 - euclio:unknown-enum-variants, r=davidtwco
improve unknown enum variant errors

Fixes #56517.
2019-04-12 12:17:56 +02:00
Mazdak Farrokhzad
484e703a0b
Rollup merge of #59814 - ollie27:dead_boxed_links, r=QuietMisdreavus
Fix broken links on std::boxed doc page

r? @QuietMisdreavus
2019-04-12 12:17:55 +02:00
Mazdak Farrokhzad
ba10b13e80
Rollup merge of #59811 - vext01:dead-dominator-code, r=oli-obk
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?
2019-04-12 12:17:54 +02:00
Mazdak Farrokhzad
f4c8cc9538
Rollup merge of #59809 - Zoxc:trait_methods_not_found, r=estebank
Make trait_methods_not_found use a lock

r? @estebank
2019-04-12 12:17:52 +02:00