Commit graph

125381 commits

Author SHA1 Message Date
Rich Kadel
d4593af78f Change registered "program name" for -Cllvm-args usage messages
While debugging a codegen issue, I tried adding LLVM options with
the rustc -Cllvm-args option, and was confused by the error and usage
messaging.

The LLVM "program name" argument is set to "rustc", and command line
error messages make it look like invalid arguments are "rustc"
arguments, not LLVM.

I changed this argument so error messages and the "-help" usage feedback
is easier to understand and react to. (Clang does something similar.)
2020-08-12 16:11:17 -07: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
Ruben Gonzalez
b38e571e9c
Fix E0741 error code explanation
Use OK ! like other explanations
2020-08-12 23:42:10 +02: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
kadmin
5c0b416dde Update stderr files
And also fix some comments as suggested by lcnr
2020-08-12 20:04:36 +00:00
Mark Rousskov
bff104d4db Remove unused tcx parameter 2020-08-12 16:00:44 -04: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
Ralf Jung
0e26f9b994 fix LocalInfo doc comment 2020-08-12 19:40:29 +02: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
Eric Huss
ce717476ff Add a script to verify the Platform Support page is up-to-date. 2020-08-12 08:40:22 -07: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
kadmin
9bf40f10bc Add missing tests in root const-gen dir 2020-08-12 08:30:17 +00:00
kadmin
be650a7ecd Add a bunch of revisions
This adds a bunch of revisions to const-generic tests
2020-08-12 08:30:17 +00:00
Ralf Jung
5154b66586 only set frame location during push after preamble is done 2020-08-12 09:59:03 +02:00
Bastian Kauschke
d2398eee0f allow escaping bound vars when normalizing ty::Opaque 2020-08-12 09:08:34 +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
Camelid
d8f96146e8 Use Child::std{in,out,err} instead of Child.
These links were broken before.
2020-08-11 20:10:41 -07: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
Yuki Okushi
7a900835c1
Rollup merge of #75395 - nixphix:docs/os-fs, r=jyn514
Switch to intra-doc links in library/std/src/os/*/fs.rs

Partial fix for #75080

@rustbot modify labels: T-doc, T-rustdoc, A-intra-doc-links
2020-08-12 12:07:17 +09:00
Yuki Okushi
5ef0a0a7f8
Rollup merge of #75394 - oli-obk:get_static, r=RalfJung
Add a function to `TyCtxt` for computing an `Allocation` for a `static` item's initializer

r? @RalfJung

miri-side: https://github.com/rust-lang/miri/issues/1507

split out of https://github.com/rust-lang/rust/pull/74949#discussion_r468100991 to make that PR leaner
2020-08-12 12:07:15 +09:00
Yuki Okushi
261773e185
Rollup merge of #75371 - poliorcetics:intra-doc-links-std-time, r=jyn514
Move to doc links inside std/time.rs

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
2020-08-12 12:07:14 +09:00
Yuki Okushi
c423fdeb74
Rollup merge of #75368 - poliorcetics:intra-doc-links-std-prelude, r=jyn514
Move to doc links inside the prelude

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
2020-08-12 12:07:12 +09:00
Yuki Okushi
0bdb83942d
Rollup merge of #75234 - Amanieu:asm_unstable_book, r=nikomatsakis
Update asm! documentation in unstable book

- Update the list of supported architectures.
- Clarify issues with LLVM's use of reserved registers.
2020-08-12 12:07:10 +09:00
Yuki Okushi
43babed7e2
Rollup merge of #74960 - nbdd0121:typeck, r=nikomatsakis
Fix regionck failure when converting Index to IndexMut

Fixes #74933

Consider an overloaded index expression `base[index]`. Without knowing whether it will be mutated, this will initially be desugared into `<U as Index<T>>::index(&base, index)` for some `U` and `T`. Let `V` be the `expr_ty_adjusted` of `index`.

If this expression ends up being used in any mutable context (or used in a function call with `&mut self` receiver before #72280), we will need to fix it up. The current code will rewrite it to `<U as IndexMut<V>>::index_mut(&mut base, index)`. In most cases this is fine as `V` will be equal to `T`, however this is not always true when `V/T` are references, as they may have different region.

This issue is quite subtle before #72280 as this code path is only used to fixup function receivers, but after #72280 we've made this a common path.

The solution is basically just rewrite it to `<U as IndexMut<T>>::index_mut(&mut base, index)`. `T` can retrieved in the fixup path using `node_substs`.
2020-08-12 12:07:08 +09:00
Yuki Okushi
7e503a09b5
Rollup merge of #74521 - andjo403:readme, r=nikic
older toolchains not valid anymore

with the change to llvm 10 the parameter
LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN do not do anything as min and soft error is the same.
see 86b120e6f3/llvm/cmake/modules/CheckCompilerVersion.cmake
2020-08-12 12:07:06 +09:00
bors
840dbe7654 Auto merge of #75427 - Xanewok:update-rls, r=Dylan-DPC
Update RLS and Rustfmt

Closes #74811
Closes #74812

r? @calebcartwright
2020-08-12 02:49:01 +00:00
Camelid
e005b71125 Switch to intra-doc links in std::process 2020-08-11 18:02:24 -07:00
bors
8da42ddbf6 Auto merge of #75405 - flip1995:clippyup, r=Manishearth
Update Clippy

Biweekly Clippy update (2 days late, since I wanted to wait for https://github.com/rust-lang/rust/pull/75098)

r? @Manishearth
2020-08-12 00:34:19 +00:00