Commit graph

125223 commits

Author SHA1 Message Date
kadmin
46e5699af9 Add 64bit / 32bit files 2020-08-13 08:20:26 +00:00
kadmin
9ef5b884b2 bless diff
Just output the current bless'd MIR diff
The tests are still fairly broken rn
2020-08-13 06:59:57 +00:00
kadmin
f51422b474 Update to pick Eq or Ne 2020-08-13 06:59:57 +00:00
kadmin
bce5eb0c08 Update w/ comments from oli
This also updates a check to ensure that this is only applied to bools
2020-08-13 06:59:57 +00:00
kadmin
6c0f2a9446 Update to actually use transform 2020-08-13 06:59:57 +00:00
kadmin
a6c2cb42d0 First iteration of simplify match branches 2020-08-13 06:59:57 +00:00
bors
814bc4fe93 Auto merge of #75426 - ehuss:update-cargo, r=ehuss
Update cargo

7 commits in 1653f354644834073d6d2541e27fae94588e685e..ab32ee88dade1b50c77347599e82ca2de3fb8a51
2020-08-04 23:14:37 +0000 to 2020-08-10 17:44:43 +0000
- Build manpage archive deterministically (rust-lang/cargo#8600)
- doc: Qualify GNU licenses in example license field (rust-lang/cargo#8604)
- Fix jobserver_exists test on single-cpu systems (rust-lang/cargo#8598)
- Fix small typo in reference/profiles.md (rust-lang/cargo#8605)
- Default cargo publish to the alt registry if it's the only allowed one (rust-lang/cargo#8571)
- cargo install with specific yanked version gives confusing "not found" error (rust-lang/cargo#8565)
- Fix typo (rust-lang/cargo#8589)
2020-08-13 04:20:51 +00:00
bors
9aa6cc025d Auto merge of #75476 - JohnTitor:rollup-ap1rqf1, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #75189 (Fix wasi::fs::OpenOptions to imply write when append is on)
 - #75201 (Fix some Clippy warnings in librustc_serialize)
 - #75372 (Fix suggestion to use lifetime in type and in assoc const)
 - #75400 (Fix minor things in the `f32` primitive docs)
 - #75449 (add regression test for #74739 (mir const-prop bug))
 - #75451 (Clean up E0751 explanation)
 - #75455 (Use explicit path link in place for doc in time)
 - #75457 (Remove some dead variants in LLVM FFI)
 - #75466 (Move to intra doc links whenever possible within std/src/lib.rs)
 - #75469 (Switch to intra-doc links in `std/io/mod.rs`)
 - #75473 (Flip order of const & type)

Failed merges:

r? @ghost
2020-08-13 02:26:20 +00:00
Yuki Okushi
76ac5d61e4
Rollup merge of #75473 - JulianKnodt:swap_order_oops, r=varkor
Flip order of const & type

Fix swapped order of consts & types in error message introduced in #74953

r? @varkor cc @lcnr
2020-08-13 11:05:48 +09:00
Yuki Okushi
5526c1a8cd
Rollup merge of #75469 - camelid:intra-doc-links-std-io-mod, r=KodrAus
Switch to intra-doc links in `std/io/mod.rs`

Part of #75080.
2020-08-13 11:05:47 +09:00
Yuki Okushi
e94f7437bd
Rollup merge of #75466 - poliorcetics:intra-links-std-lib, r=KodrAus
Move to intra doc links whenever possible within std/src/lib.rs

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

There are some things like

```rust
`//! [`Option<T>`]: option::Option`
```

that will either be fixed in the future or have open issues about them.
2020-08-13 11:05:45 +09:00
Yuki Okushi
4cf55a67dd
Rollup merge of #75457 - Mark-Simulacrum:llvm-clean, r=cuviper
Remove some dead variants in LLVM FFI

r? @nikic or @cuviper
2020-08-13 11:05:44 +09:00
Yuki Okushi
9ea03ddd0b
Rollup merge of #75455 - pickfire:patch-3, r=jyn514
Use explicit path link in place for doc in time

r? @jyn514

More worth for your time. :P
2020-08-13 11:05:42 +09:00
Yuki Okushi
a62dd23c5c
Rollup merge of #75451 - GuillaumeGomez:cleanup-e0751, r=pickfire
Clean up E0751 explanation

r? @Dylan-DPC

cc @pickfire
2020-08-13 11:05:40 +09:00
Yuki Okushi
845fb94da4
Rollup merge of #75449 - RalfJung:const-prop-test, r=wesleywiser
add regression test for #74739 (mir const-prop bug)

Fixes https://github.com/rust-lang/rust/issues/74739
2020-08-13 11:05:38 +09:00
Yuki Okushi
66157e27e2
Rollup merge of #75400 - LukasKalbertodt:fix-f32-docs, r=KodrAus
Fix minor things in the `f32` primitive docs

All of these were review comments in #74621 that I first fixed in that PR, but later accidentally overwrote by a force push.

Thanks @the8472 for noticing.

r? @KodrAus
2020-08-13 11:05:37 +09:00
Yuki Okushi
d90a4b8ae9
Rollup merge of #75372 - estebank:lt-sugg-in-type, r=lcnr
Fix suggestion to use lifetime in type and in assoc const

_Do not merge until #75363 has landed, as it has the test case for this._

* Account for associated types
* Associated `const`s can't have generics (fix #74264)
* Do not suggest duplicate lifetimes and suggest `for<'a>` more (fix #72404)
2020-08-13 11:05:35 +09:00
Yuki Okushi
d0414b57b4
Rollup merge of #75201 - Hirrolot:hirrolot/fix-clippy-warnings, r=varkor
Fix some Clippy warnings in librustc_serialize
2020-08-13 11:05:33 +09:00
Yuki Okushi
ed543ae2f6
Rollup merge of #75189 - kawamuray:bugfix-wasi-append, r=KodrAus
Fix wasi::fs::OpenOptions to imply write when append is on

This PR fixes a bug in `OpenOptions` of `wasi` platform that it currently doesn't imply write mode when only `append` is enabled.
As explained in the [doc of OpenOptions#append](https://doc.rust-lang.org/std/fs/struct.OpenOptions.html#method.append), calling `.append(true)` should imply `.write(true)` as well.

## Reproduce

Given below simple Rust program:

```rust
use std::fs::OpenOptions;
use std::io::Write;

fn main() {
    let mut file = OpenOptions::new()
        .write(true)
        .create(true)
        .open("foo.txt")
        .unwrap();
    writeln!(file, "abc").unwrap();
}
```

it can successfully compiled into wasm and execute by `wasmtime` runtime:

```sh
$ rustc --target wasm32-wasi write.rs
$ ~/wasmtime/target/debug/wasmtime run --dir=. write.wasm
$ cat foo.txt
abc
```

However when I change `.write(true)` to `.append(true)`, it fails to execute by the error "Capabilities insufficient":

```sh
$ ~/wasmtime/target/debug/wasmtime run --dir=. append.wasm
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 76, kind: Other, message: "Capabilities insufficient" }', append.rs:10:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: failed to run main module `append.wasm`
...
```

This is because of lacking "rights" on the opened file:

```sh
$ RUST_LOG=trace ~/wasmtime/target/debug/wasmtime run --dir=. append.wasm 2>&1 | grep validate_rights
 TRACE wasi_common::entry                                  >      | validate_rights failed: required rights = HandleRights { base: fd_write (0x40), inheriting: empty (0x0) }; actual rights = HandleRights { base: fd_seek|fd_fdstat_set_flags|fd_sync|fd_tell|fd_advise|fd_filestat_set_times|poll_fd_readwrite (0x88000bc), inheriting: empty (0x0) }
```
2020-08-13 11:05:31 +09:00
kadmin
c48d45bf6b Flip order of const & type 2020-08-12 23:19:07 +00:00
bors
847ba835ce Auto merge of #74512 - LukasKalbertodt:debloat-copy-from-slice, r=KodrAus
Put panic code path from `copy_from_slice` into cold function

The previous `assert_eq` generated quite some code, which is especially problematic when this call is inlined. This commit also slightly improves the panic message from:

    assertion failed: `(left == right)`
      left: `3`,
     right: `2`: destination and source slices have different lengths

...to:

    source slice length (2) does not match destination slice length (3)

You can see the code bloat in assembly [here](https://rust.godbolt.org/z/74a3qo).
2020-08-12 23:03:28 +00:00
Camelid
a7749fe451 Fix intra-doc link 2020-08-12 15:30:15 -07:00
Camelid
bc8367617e Switch to intra-doc links in std/io/mod.rs 2020-08-12 15:11:17 -07:00
Alexis Bourget
3f16597a6a Move to intra doc links whenever possible within std/src/lib.rs 2020-08-12 23:23:07 +02:00
bors
576d27c5a6 Auto merge of #75396 - RalfJung:miri-spans, r=oli-obk
Miri: improve spans of required_const failures

In https://github.com/rust-lang/rust/pull/75339 I added a loop evaluating all consts required by a function body. Unfortunately, if one of their evaluations fails, then the span used for that was that of the first statement in the function body, which happened to work form some existing test but is not sensible in general.

This PR changes it to point to the whole function instead, which is at least not wrong.

r? @oli-obk
2020-08-12 20:44:19 +00:00
Lukas Kalbertodt
db99f98c3e
Put panic code path from copy_from_slice into cold function
The previous `assert_eq` generated quite some code, which is especially
problematic when this call is inlined. This commit also slightly
improves the panic message from:

  assertion failed: `(left == right)`
    left: `3`,
   right: `2`: destination and source slices have different lengths

...to:

  source slice length (2) does not match destination slice length (3)
2020-08-12 21:12:21 +02:00
bors
ef1d58e7c9 Auto merge of #75354 - estebank:tuple-struct-as-struct-pat, r=petrochenkov
Detect tuple variants used as struct pattern and suggest correct pattern

Fix #61326

r? @petrochenkov
2020-08-12 18:50:20 +00:00
bors
3df25ae186 Auto merge of #75019 - nanpuyue:to_ipv4_mapped, r=LukasKalbertodt
Add Ipv6Addr::to_ipv4_mapped

* add Ipv6Addr::to_ipv4_mapped
* ~~deprecate Ipv4Addr::to_ipv6_compatible & Ipv6Addr::to_ipv4~~ reference: #75150

According to [IETF RFC 4291](https://tools.ietf.org/html/rfc4291#page-10), the "IPv4-Compatible IPv6 address" is deprecated.

> 2.5.5.1.  IPv4-Compatible IPv6 Address
>
>    The "IPv4-Compatible IPv6 address" was defined to assist in the IPv6
>    transition.  The format of the "IPv4-Compatible IPv6 address" is as
>    follows:
>
>    |                80 bits               | 16 |      32 bits        |
>    +--------------------------------------+--------------------------+
>    |0000..............................0000|0000|    IPv4 address     |
>    +--------------------------------------+----+---------------------+
>
>    Note: The IPv4 address used in the "IPv4-Compatible IPv6 address"
>    must be a globally-unique IPv4 unicast address.
>
>    The "IPv4-Compatible IPv6 address" is now deprecated because the
>    current IPv6 transition mechanisms no longer use these addresses.
>    New or updated implementations are not required to support this
>    address type.

And the current implementation of `Ipv4Addr::to_ipv6_compatible`is incorrect: it does not check whether the IPv4 address is a globally-unique IPv4 unicast address.

Please let me know if there are any issues with this pull request.
2020-08-12 16:30:46 +00:00
Mark Rousskov
486c48b570 Remove ArchiveKind::Other
Also unused since introduction in #35174
2020-08-12 12:03:44 -04:00
Mark Rousskov
7a0b195188 Remove CodeGenOptLevel::Other
Also introduced in #35174, and immediately unused.
2020-08-12 12:01:31 -04:00
Mark Rousskov
fc163ed4ee Remove AsmDialect::Other
Added in #35174, this was already unused (and new uses have not been introduced
since then).
2020-08-12 11:59:17 -04:00
Mark Rousskov
f043c8fa48 Remove FileType::Other
Added in #35174, this was already unused (and new uses have not been introduced
since then).
2020-08-12 11:55:45 -04:00
Guillaume Gomez
f11b2e521e Improve wording 2020-08-12 16:51:29 +02:00
bors
ded20c98be Auto merge of #75066 - poliorcetics:document-unsafety-in-core-slice, r=LukasKalbertodt
Document unsafety in library/core/src/slice/mod.rs

Restart where #73555 left off, helping with #66219.
2020-08-12 14:18:15 +00:00
Ivan Tham
cda660b5fc
Use explicit path link in place for doc in time 2020-08-12 22:17:12 +08:00
bors
cee14d8c30 Auto merge of #75450 - pietroalbini:fix-toolstate, r=pietroalbini
Remove embedded-resources alumni from toolstate

Some people left the embedded-resources working group (https://github.com/rust-lang/team/pull/401), making them unassignable in toolstate issues. This PR removes them from the toolstate assignees list, fixing CI.
2020-08-12 12:21:09 +00:00
Guillaume Gomez
d0704d5d36 Clean up E0751 explanation 2020-08-12 14:15:44 +02:00
Pietro Albini
8345f323b3
toolstate: remove embedded-resources alumni from toolstate 2020-08-12 13:53:50 +02:00
Ralf Jung
0d6ff997a5 add regression test for #74739 (mir const-prop bug) 2020-08-12 12:50:24 +02:00
Ralf Jung
fd32fe9bb9 fix span of stack size error 2020-08-12 11:14:49 +02:00
Ralf Jung
a505e773a5 fix typos
Co-authored-by: Oliver Scherer <github35764891676564198441@oli-obk.de>
2020-08-12 10:48:08 +02:00
Ralf Jung
d21e0118d0 more precise span for erroneous consts during CTFE/Miri 2020-08-12 10:48:08 +02:00
Ralf Jung
4b4d43fe6a bless tests 2020-08-12 10:48:08 +02:00
Ralf Jung
d6c988b3a7 miri: fall back to whole-function span when loc==None 2020-08-12 10:48:08 +02:00
bors
5989bf4872 Auto merge of #75321 - estebank:js-goes-gaga, r=davidtwco
Detect JS-style `===` and `!==` and recover

Fix #75312.
2020-08-12 08:40:36 +00:00
Ralf Jung
5154b66586 only set frame location during push after preamble is done 2020-08-12 09:59:03 +02:00
bors
4745cbe83e Auto merge of #75205 - Aaron1011:fix/auto-trait-proj-ice, r=nikomatsakis
Handle projection predicates in the param env for auto-trait docs

Fixes #72213

Any predicates in the param env are guaranteed to hold, so we don't need
to do any additional processing of them if we come across them as
sub-obligations of a different predicate. This allows us to avoid adding
the same predicate to the computed ParamEnv multiple times (but with
different regions each time), which causes an ambiguity error during
fulfillment.
2020-08-12 06:42:49 +00:00
bors
c94ed5ca91 Auto merge of #75436 - JohnTitor:rollup-ss0lxds, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #74521 (older toolchains not valid anymore)
 - #74960 (Fix regionck failure when converting Index to IndexMut)
 - #75234 (Update asm! documentation in unstable book)
 - #75368 (Move to doc links inside the prelude)
 - #75371 (Move to doc links inside std/time.rs)
 - #75394 (Add a function to `TyCtxt` for computing an `Allocation` for a `static` item's initializer)
 - #75395 (Switch to intra-doc links in library/std/src/os/*/fs.rs)
 - #75422 (Accept more safety comments)
 - #75424 (fix wrong word in documentation)

Failed merges:

r? @ghost
2020-08-12 04:43:38 +00:00
Yuki Okushi
2cc7da6f95
Rollup merge of #75424 - joseluis:patch-1, r=joshtriplett
fix wrong word in documentation

Change "two" to "three", since there are three significantly different things printed below that sentence:

---

While these:
```rust
println!("{}, `{name:.*}` has 3 fractional digits", "Hello", 3, name=1234.56);
println!("{}, `{name:.*}` has 3 characters", "Hello", 3, name="1234.56");
println!("{}, `{name:>8.*}` has 3 right-aligned characters", "Hello", 3, name="1234.56");
```

print two significantly different things:

``` rust
Hello, `1234.560` has 3 fractional digits
Hello, `123` has 3 characters
Hello, `     123` has 3 right-aligned characters
```
---
[`https://doc.rust-lang.org/std/fmt/#precision`](https://doc.rust-lang.org/std/fmt/#precision)
2020-08-12 12:07:21 +09:00
Yuki Okushi
a8b0a3ca8e
Rollup merge of #75422 - poliorcetics:tidy-accept-more-safety-comments, r=Mark-Simulacrum
Accept more safety comments

This accepts more `// SAFETY:` comments from `tidy`.

This is done after the current behaviour of requiring text one the same line (because spaces are stripped so the last space never pass if there is no text on the same line) bit me once more in #75066

This could potentially accept empty `// SAFETY:` comments but `tidy` is an internal tool used only here so my reasoning is reviews will catch those.
2020-08-12 12:07:19 +09:00