Commit graph

99810 commits

Author SHA1 Message Date
Guillaume Gomez
1d49f9a10a update ui tests 2019-10-03 14:11:39 +02:00
Guillaume Gomez
e86af1bbeb Add long error explanation for E0556 2019-10-03 14:11:31 +02:00
bors
42ec6831b0 Auto merge of #64932 - tmandry:rollup-7t8x1nz, r=tmandry
Rollup of 9 pull requests

Successful merges:

 - #64377 (Add long error explanation for E0493)
 - #64786 (Use https for curl when building for linux)
 - #64828 (Graphviz debug output for generic dataflow analysis)
 - #64838 (Add long error explanation for E0550)
 - #64891 (Fix `vec![x; n]` with null raw fat pointer zeroing the pointer metadata)
 - #64893 (Zero-initialize `vec![None; n]` for `Option<&T>`, `Option<&mut T>` and `Option<Box<T>>`)
 - #64911 (Fixed a misleading documentation issue #64844)
 - #64921 (Add test for issue-64662)
 - #64923 (Add missing links for mem::needs_drop)

Failed merges:

 - #64918 (Add long error explanation for E0551)

r? @ghost
2019-10-01 02:31:48 +00:00
Tyler Mandry
913c095bcf
Rollup merge of #64923 - lzutao:improve-doc-needs_drop, r=jonas-schievink
Add missing links for mem::needs_drop

r? @jonas-schievink
2019-09-30 14:38:32 -07:00
Tyler Mandry
e9d28796ec
Rollup merge of #64921 - JohnTitor:add-test-enum, r=varkor
Add test for issue-64662

Closes #64662
r? @varkor
2019-09-30 14:38:31 -07:00
Tyler Mandry
5560f8c664
Rollup merge of #64911 - hman523:64844, r=Dylan-DPC
Fixed a misleading documentation issue #64844

Made the suggested change from @steveklabnik on issue #64844
2019-09-30 14:38:28 -07:00
Tyler Mandry
a8ed9bfe02
Rollup merge of #64893 - SimonSapin:vec-of-option-box, r=sfackler
Zero-initialize `vec![None; n]` for `Option<&T>`, `Option<&mut T>` and `Option<Box<T>>`
2019-09-30 14:38:27 -07:00
Tyler Mandry
1cd9b4bc85
Rollup merge of #64891 - SimonSapin:vec-of-fat-raw-ptr, r=sfackler
Fix `vec![x; n]` with null raw fat pointer zeroing the pointer metadata

https://github.com/rust-lang/rust/pull/49496 introduced specialization based on:

```rust
unsafe impl<T: ?Sized> IsZero for *mut T {
    fn is_zero(&self) -> bool {
        (*self).is_null()
    }
}
```

… to call `RawVec::with_capacity_zeroed` for creating `Vec<*mut T>`, which is incorrect for fat pointers since `<*mut T>::is_null` only looks at the data component. That is, a fat pointer can be “null” without being made entirely of zero bits.

This commit fixes it by removing the `?Sized` bound on this impl (and the corresponding `*const T` one). This regresses `vec![x; n]` with `x` a null raw slice of length zero, but that seems exceptionally uncommon. (Vtable pointers are never null, so raw trait objects would not take the fast path anyway.)

An alternative to keep the `?Sized` bound (or even generalize to `impl<U: Copy> IsZero for U`) would be to cast to `&[u8]` of length `size_of::<U>()`, but the optimizer seems not to be able to propagate alignment information and sticks with comparing one byte at a time:

https://rust.godbolt.org/z/xQFkwL

----

Without the library change, the new test fails as follows:

```rust
---- vec::vec_macro_repeating_null_raw_fat_pointer stdout ----
[src/liballoc/tests/vec.rs:1301] ptr_metadata(raw_dyn) = 0x00005596ef95f9a8
[src/liballoc/tests/vec.rs:1306] ptr_metadata(vec[0]) = 0x0000000000000000
thread 'vec::vec_macro_repeating_null_raw_fat_pointer' panicked at 'assertion failed: vec[0] == null_raw_dyn', src/liballoc/tests/vec.rs:1307:5
```
2019-09-30 14:38:25 -07:00
Tyler Mandry
3add9790ab
Rollup merge of #64838 - GuillaumeGomez:long-err-explanation-e0550, r=oli-obk
Add long error explanation for E0550

Part of #61137
2019-09-30 14:38:24 -07:00
Tyler Mandry
686ad4da9e
Rollup merge of #64828 - ecstatic-morse:generic-dataflow-graphviz, r=oli-obk
Graphviz debug output for generic dataflow analysis

A follow up to #64566.

This outputs graphviz diagrams in the generic dataflow engine when `#[rustc_mir(borrowck_graphviz_postflow="suffix.dot")]` is set on an item. This code is based on [`dataflow/graphviz.rs`](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/dataflow/graphviz.rs), but displays different information since there are no "gen"/"kill" sets and transfer functions cannot be coalesced in the generic analysis. As a result, we show the dataflow state at the start and end of each block, as well as the changes resulting from each statement. I also render the state bitset in full  (`{_1,_2}`) instead of hex-encoded as the current renderer does (`06`).
2019-09-30 14:38:22 -07:00
Tyler Mandry
fb8f9b47eb
Rollup merge of #64786 - tmandry:patch-1, r=alexcrichton
Use https for curl when building for linux

I noticed that the dist-x86_64-linux builder uses http to fetch curl and doesn't do any signature verification. It should probably use https.

r? @alexcrichton @Mark-Simulacrum
2019-09-30 14:38:21 -07:00
Tyler Mandry
30ba6fd99c
Rollup merge of #64377 - GuillaumeGomez:E0493, r=estebank
Add long error explanation for E0493

Part of #61137.
2019-09-30 14:38:19 -07:00
Dylan MacKenzie
2b8e023b9d Stop printing Qualif results in debug logs
Now we can use the dataflow graphviz debugging.
2019-09-30 11:24:27 -07:00
Dylan MacKenzie
cf5f5c55be Use separate files for debugging Qualif dataflow results 2019-09-30 11:24:27 -07:00
Dylan MacKenzie
cd24cd4eec Update consumers of generic::Engine API 2019-09-30 11:24:27 -07:00
Dylan MacKenzie
d37c318677 Add graphviz debug output for generic dataflow 2019-09-30 11:24:27 -07:00
Dylan MacKenzie
3e88aa20b4 Allow ResultsCursor to borrow the underlying Results 2019-09-30 11:21:16 -07:00
Dylan MacKenzie
f33d94d88f Fix typo in docs 2019-09-30 11:21:16 -07:00
Lzu Tao
cdf1852a61 Add missing links for mem::needs_drop 2019-09-30 16:12:01 +00:00
Yuki Okushi
5bf4397abc Add test for issue-64662 2019-10-01 00:40:42 +09:00
Guillaume Gomez
e67ae0e023 update ui tests 2019-09-30 15:52:47 +02:00
Guillaume Gomez
67eabe110b Add long error explanation for E0550 2019-09-30 15:52:47 +02:00
bors
22bc9e1d9c Auto merge of #64778 - csmoe:index, r=eddyb
Introduce librustc_index crate

Closes #50592
2019-09-30 13:33:15 +00:00
Guillaume Gomez
9f978b7f17 update tests 2019-09-30 13:47:12 +02:00
Guillaume Gomez
cc9db523be Add long error explanation for E0493 2019-09-30 13:47:12 +02:00
bors
e0436d912d Auto merge of #64600 - scottmcm:no-slice-tryfold-unroll, r=bluss
Remove manual unrolling from slice::Iter(Mut)::try_fold

While this definitely helps sometimes (particularly for trivial closures), it's also a pessimization sometimes, so it's better to leave this to (hypothetical) future LLVM improvements instead of forcing this on everyone.

I think it's better for the advice to be that sometimes you need to unroll manually than you sometimes need to not-unroll manually (like #64545).

---

For context see https://github.com/rust-lang/rust/pull/64572#issuecomment-532961046
2019-09-30 09:52:29 +00:00
bors
bf8491e72e Auto merge of #64904 - ollie27:rustdoc_logo, r=Mark-Simulacrum
rustdoc: Fix default logo filename

This was a typo made in #64443. It's the reason the logo is missing on the [nightly docs](https://doc.rust-lang.org/nightly/std/).

r? @Mark-Simulacrum
2019-09-30 06:01:48 +00:00
hman523
6c6d27d685 Fixed a misleading documentation issue #64844 2019-09-30 00:26:42 -05:00
bors
bd9a0aa627 Auto merge of #64881 - RalfJung:miri, r=RalfJung
bump Miri

Fixes https://github.com/rust-lang/rust/issues/64798
2019-09-30 02:09:43 +00:00
bors
d16ee891c6 Auto merge of #64673 - Mark-Simulacrum:opt-match-ck, r=oli-obk
Optimize try_eval_bits to avoid layout queries

This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.

It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
2019-09-29 22:21:43 +00:00
Mark Rousskov
06c6e75aae Optimize try_eval_bits to avoid layout queries
This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.

It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
2019-09-29 17:52:20 -04:00
Oliver Middleton
dc295318fc rustdoc: Fix default logo filename 2019-09-29 22:17:03 +01:00
Tyler Mandry
2185710748 Use https for curl when building for linux 2019-09-29 13:33:12 -07:00
bors
8431f261dd Auto merge of #64902 - Centril:rollup-1i431vs, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #64691 (Point at definition when misusing ADT)
 - #64735 (Add long error explanation for E0533)
 - #64825 (Point at enclosing match when expecting `()` in arm)
 - #64858 (Add support for relating slices in `super_relate_consts`)
 - #64894 (syntax: fix dropping of attribute on first param of non-method assocated fn)
 - #64898 (fixed typo)

Failed merges:

r? @ghost
2019-09-29 18:35:04 +00:00
Mazdak Farrokhzad
50940ae952
Rollup merge of #64898 - jakevossen5:master, r=jonas-schievink
fixed typo

Accidentally had a typo in https://github.com/rust-lang/rust/pull/64884, sorry!
2019-09-29 20:34:19 +02:00
Mazdak Farrokhzad
64afa26253
Rollup merge of #64894 - Centril:fix-64682, r=petrochenkov
syntax: fix dropping of attribute on first param of non-method assocated fn

Fixes #64682.

The general idea is that we bake parsing of `self` into `parse_param_general` and then we just use standard list parsing. Overall, this simplifies the parsing and makes it more consistent.

r? @petrochenkov cc @c410-f3r
2019-09-29 20:34:18 +02:00
Mazdak Farrokhzad
4ada68e325
Rollup merge of #64858 - skinny121:str-const-generics, r=varkor
Add support for relating slices in `super_relate_consts`

This allows passing strings as generic arguments.

Fixes #63773
Fixes #60813

r? @varkor
2019-09-29 20:34:16 +02:00
Mazdak Farrokhzad
8109332a4c
Rollup merge of #64825 - estebank:match-unit, r=Centril
Point at enclosing match when expecting `()` in arm

When encountering code like the following:

```rust
fn main() {
    match 3 {
        4 => 1,
        3 => {
            println!("Yep it maches.");
            2
        }
        _ => 2
    }
    println!("Bye!")
}
```

point at the enclosing `match` expression and suggest ignoring the
returned value:

```
error[E0308]: mismatched types
  --> $DIR/match-needing-semi.rs:8:13
   |
LL | /     match 3 {
LL | |         4 => 1,
LL | |         3 => {
LL | |             2
   | |             ^ expected (), found integer
LL | |         }
LL | |         _ => 2
LL | |     }
   | |     -- help: consider using a semicolon here
   | |_____|
   |       expected this to be `()`
   |
   = note: expected type `()`
              found type `{integer}
```

Fix #40799.
2019-09-29 20:34:15 +02:00
Mazdak Farrokhzad
f34e2b1e7c
Rollup merge of #64735 - GuillaumeGomez:long-err-explanation-E0533, r=Centril
Add long error explanation for E0533

Part of https://github.com/rust-lang/rust/issues/61137
2019-09-29 20:34:14 +02:00
Mazdak Farrokhzad
0a2ddcc346
Rollup merge of #64691 - estebank:unexpected-variant, r=Centril
Point at definition when misusing ADT

When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
2019-09-29 20:34:12 +02:00
Ralf Jung
17fa7fe77e bump Miri 2019-09-29 13:57:26 -04:00
csmoe
64f61c7888 remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
csmoe
d20183dbbf remove bit_set re-export from rustc_data_structures 2019-09-29 16:11:30 +00:00
csmoe
17990637b3 move bit_set into rustc_index 2019-09-29 16:11:30 +00:00
csmoe
1cff2e6557 move index_vec into rustc_index 2019-09-29 16:11:30 +00:00
csmoe
be32185810 init librustc_index crate 2019-09-29 16:11:29 +00:00
=
d695e2417a
fixed typo 2019-09-29 09:58:29 -06:00
bors
06c68947ad Auto merge of #64158 - tmandry:libtest-panic-abort, r=alexcrichton
panic=abort support in libtest

Add experimental support for tests compiled with panic=abort. Enabled with `-Z panic_abort_tests`.

r? @alexcrichton
cc @cramertj
2019-09-29 13:53:08 +00:00
Mazdak Farrokhzad
8fd03b1e47 syntax: fix #64682.
Fuse parsing of `self` into `parse_param_general`.
2019-09-29 12:55:45 +02:00
bors
d046ffddc4 Auto merge of #64546 - weiznich:bugfix/rfc-2451-rerebalance-tests, r=nikomatsakis
Bugfix/rfc 2451 rerebalance tests

r? @nikomatsakis

Fixes #64412
Depends/Contains on #64414

cc #55437 and #63599
2019-09-29 09:52:58 +00:00