Commit graph

149876 commits

Author SHA1 Message Date
bjorn3
86b3ebe2da Inline box_region macro calls 2021-06-08 19:24:15 +02:00
bjorn3
8f397bc8a0 Simplify box_region macros 2021-06-08 19:24:15 +02:00
Mara Bos
58e0889bf5 Simplify proc_macro code using Bound::cloned(). 2021-06-08 16:31:50 +00:00
hyd-dev
18049647e1
Update Miri 2021-06-08 23:33:39 +08:00
Santiago Pastorino
f07412db41
Destructure OpaqueTypeKey in certain cases to simplify code 2021-06-08 10:13:54 -03:00
Santiago Pastorino
1278f3f295
Simplify code by using VecMap::get_by 2021-06-08 09:41:26 -03:00
Santiago Pastorino
dd56ec653c
Add VecMap::get_by(FnMut -> bool) 2021-06-08 09:40:58 -03:00
Ellen
47fe696d8f use non_erasable_generics 2021-06-08 09:07:52 +01:00
bors
a50d72158e Auto merge of #86127 - JohnTitor:rollup-0c6mp3j, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #85906 (Use `Iterator::find` instead of open-coding it)
 - #85951 (Update the documentation of `-C force-unwind-tables` for #83482)
 - #85985 (Clarify documentation of slice sorting methods)
 - #85989 (Remove rustfmt tests from top-level .gitattributes)
 - #86074 (Default panic message should print Box<dyn Any>)
 - #86078 (Type page font weight)
 - #86090 (⬆️ rust-analyzer)
 - #86095 (Search description codeblock)
 - #86096 (Comment out unused error codes and add description for E0316)
 - #86101 (Correct type signature in doc for Bound::as_mut)
 - #86103 (Remove lifetime hack)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-08 07:04:31 +00:00
Ellen
8e7299dfcd Support as casts in abstract consts 2021-06-08 08:02:16 +01:00
Jacob Hoffman-Andrews
1c0ecd41ad Refactor: Extract render_summary from render_impl.
This allows for a more readable straight-through logic in render_impl
without need for a closure.
2021-06-07 21:40:56 -07:00
Yuki Okushi
b7fadfddcb
Rollup merge of #86103 - camsteffen:lifetime-hack, r=jackh726
Remove lifetime hack

It compiles without the hack. But I don't know why. I can't get the example in the referenced issue to compile...
2021-06-08 13:26:38 +09:00
Yuki Okushi
a416e05d27
Rollup merge of #86101 - glittershark:bound-as-mut-doc-fix, r=m-ou-se
Correct type signature in doc for Bound::as_mut

Thanks to ``@drmason13`` for pointing this out!
2021-06-08 13:26:37 +09:00
Yuki Okushi
2e8ffed861
Rollup merge of #86096 - FabianWolff:ec-E0316, r=GuillaumeGomez
Comment out unused error codes and add description for E0316

I have added an extended description of `E0316` and commented out a bunch of unused error codes to make clear the fact that they are no longer in use. You can check for yourself with
```shell
for ec in                                                \
    E0314 E0315   E0473 E0474 E0475   E0479 E0480 E0481  \
    E0483 E0484 E0485 E0486 E0487 E0488 E0489
do
    if [ ! -z "`grep -r $ec compiler/* --exclude-dir=rustc_error_codes`" ]
    then
        echo $ec
        false
    fi
done
```
i.e. these error codes appear nowhere in the compiler code and thus cannot be emitted.

r? ```@GuillaumeGomez```
2021-06-08 13:26:36 +09:00
Yuki Okushi
f99a892e6d
Rollup merge of #86095 - GuillaumeGomez:search-description-codeblock, r=jsha
Search description codeblock

The codeblocks are not displayed correctly:

![Screenshot from 2021-06-07 11-11-53](https://user-images.githubusercontent.com/3050060/120991915-5fb05680-c782-11eb-9b32-973a64b1f631.png)

This PR interprets the HTML correctly (and still prevent invalid HTML because of how it inserts it):

![Screenshot from 2021-06-07 11-12-00](https://user-images.githubusercontent.com/3050060/120991919-6048ed00-c782-11eb-8ac5-c3aa6508bc8b.png)

r? ```@jsha```
2021-06-08 13:26:35 +09:00
Yuki Okushi
e062121f03
Rollup merge of #86090 - lnicola:rust-analyzer-2021-06-07, r=jonas-schievink
⬆️ rust-analyzer
2021-06-08 13:26:33 +09:00
Yuki Okushi
c783e28905
Rollup merge of #86078 - GuillaumeGomez:type-page-font-weight, r=jsha
Type page font weight

Fixes https://github.com/rust-lang/rust/issues/86069.

r? ```@jsha```
2021-06-08 13:26:32 +09:00
Yuki Okushi
b7d05f8165
Rollup merge of #86074 - reaganmcf:iss-86039, r=jyn514
Default panic message should print Box<dyn Any>

Closes #86039

Prior to this patch, the panic message from running the following code would be `thread 'main' panicked at 'Box<Any>'...`
```rust
use std::panic::panic_any;
fn main() {
    panic_any(42);
}
```

This patch updates the phrasing to be more consistent. It now instead shows the following panic message:

```
thread 'main' panicked at 'Box<dyn Any>', ...
```

It's a very small fix 😄
2021-06-08 13:26:31 +09:00
Yuki Okushi
c3028101a2
Rollup merge of #85989 - jyn514:gitignore-cleanup, r=ehuss
Remove rustfmt tests from top-level .gitattributes

These are tracked in src/tools/rustfmt/.gitattributes already, they
don't need to be listed twice.

r? `@ehuss` since you suggested adding them in https://github.com/rust-lang/rust/pull/82208/#issuecomment-841440199; I think it should be ok now that bors isn't trying to merge the `subtree add` changes.

cc `@calebcartwright`
2021-06-08 13:26:30 +09:00
Yuki Okushi
2a23af6341
Rollup merge of #85985 - Lionelf329:master, r=joshtriplett
Clarify documentation of slice sorting methods

After reading about [this](https://polkadot.network/a-polkadot-postmortem-24-05-2021/), I realized that although the documentation of these methods is not ambiguous in its current state, it is very easy to read it and erroneously assume that their exact behaviour can be relied upon to be deterministic. Although the docs make no guarantees about which index is returned when there are multiple matches, being more explicit about when and how their determinism can be relied upon should help prevent people from making this mistake in the future.

r? ``@steveklabnik``
2021-06-08 13:26:29 +09:00
Yuki Okushi
3502bff900
Rollup merge of #85951 - hyd-dev:force-unwind-tables, r=steveklabnik
Update the documentation of `-C force-unwind-tables` for #83482

`panic=unwind` does not require `force-unwind-tables` to be "yes" anymore.
I forgot to update this in #83482.
2021-06-08 13:26:28 +09:00
Yuki Okushi
472dbec026
Rollup merge of #85906 - LingMan:iter_find, r=matthewjasper
Use `Iterator::find` instead of open-coding it

```@rustbot``` modify labels +C-cleanup +T-compiler
2021-06-08 13:26:28 +09:00
bors
376ec9487e Auto merge of #86115 - Xanewok:update-rls, r=Xanewok
Update RLS

This bumps racer to 2.1.48, which bumps rustc-ap-* crates to v722 in
order to unbreak the toolstate.

r? `@ghost`
2021-06-08 04:23:27 +00:00
Aaron Hill
822f800ad7
Include macro name in 'local ambiguity' error
Currently, we only point at the span of the macro argument. When the
macro call is itself generated by another macro, this can make it
difficult or impossible to determine which macro is responsible for
producing the error.
2021-06-07 20:17:48 -05:00
bors
dda4a881e0 Auto merge of #83515 - tamird:string-remove-matches-rev, r=m-ou-se
String::remove_matches O(n^2) -> O(n)

Copy only non-matching bytes. Replace collection of matches into a
vector with iteration over rejections, exploiting the guarantee that we
mutate parts of the haystack that have already been searched over.

r? `@joshtriplett`
2021-06-08 01:05:48 +00:00
Alex Crichton
aba85ff820 Enable rustdoc to document safe wasm intrinsics
This commit fixes an issue not found during #84988 where rustdoc is used
to document cross-platform intrinsics but it was requiring that
functions which use `#[target_feature]` are `unsafe` erroneously, even
if they're WebAssembly specific. Rustdoc today, for example, already has
a special case where it enables annotations like
`#[target_feature(enable = "simd128")]` on platforms other than
WebAssembly. The purpose of this commit is to relax the "require all
`#[target_feature]` functions are `unsafe`" requirement for all targets
whenever rustdoc is running, enabling all targets to fully document
other targets, such as WebAssembly, where intrinsics functions aren't
always `unsafe`.
2021-06-07 17:14:35 -07:00
myshylin
ed8a775b71 Forwarding implementation for Seek trait's stream_position method 2021-06-07 19:21:22 -04:00
Santiago Pastorino
c80d062084
Add more TAIT multiple defining uses test cases 2021-06-07 19:10:14 -03:00
Santiago Pastorino
9e547b4464
Differentiate different defining uses of taits when they reference distinct generic parameters 2021-06-07 19:10:12 -03:00
Santiago Pastorino
e386373514
Remove substs from OpaqueTypeDecl, use the one in OpaqueTypeKey 2021-06-07 19:09:32 -03:00
Santiago Pastorino
5dabd55d7d
Use substs from opaque type key instead of using it from opaque_decl 2021-06-07 19:08:43 -03:00
Santiago Pastorino
37ab718350
Make opaque type map key be of type OpaqueTypeKey 2021-06-07 19:07:24 -03:00
Santiago Pastorino
7294f49d52
Remove ResolvedOpaqueTy and just use Ty, SubstsRef is already there 2021-06-07 19:07:07 -03:00
Santiago Pastorino
7f8cad2019
Make OpaqueTypeKey the key of opaque types map 2021-06-07 19:04:52 -03:00
Santiago Pastorino
3405725e00
Change concrete opaque type to be a VecMap 2021-06-07 19:04:19 -03:00
Santiago Pastorino
2bc723fbca
Change opaque type map to be a VecMap 2021-06-07 19:03:57 -03:00
Santiago Pastorino
aa7024b0c7
Add VecMap to rustc_data_structures 2021-06-07 19:03:51 -03:00
Fabian Wolff
6206247335 Suggest a trailing comma if a 1-tuple is expected 2021-06-07 23:16:03 +02:00
Lionel Foxcroft
fddf012177 Clarify documentation of slice sorting methods 2021-06-07 16:50:08 -04:00
Igor Matuszewski
5d7a990d36 Update RLS
This bumps racer to 2.1.48, which bumps rustc-ap-* crates to v722 in
order to unbreak the toolstate.
2021-06-07 22:19:58 +02:00
The8472
0ddc3afbb5 build doctests with lld if use-lld = true 2021-06-07 21:17:11 +02:00
Anatol Ulrich
39ba856151 fix off by one 2021-06-07 19:55:33 +02:00
Pietro Albini
12d37e615f
add the x86_64-gnu-stable job to test with stable channel
During the 1.52 release process we had to deal with some commits that
passed the test suite on the nightly branch but failed on the beta or
stable branch. In that case it was due to some UI tests including the
channel name in the output, but other changes might also be dependent on
the channel.

This commit adds a new CI job that runs the Linux x86_64 test suite with
the stable branch, ensuring nightly changes also work as stable.
2021-06-07 18:55:43 +02:00
Pietro Albini
b52bf1b41c
use channel-relative urls in rustdoc/intra-doc/field.rs 2021-06-07 18:55:43 +02:00
Smitty
2f1c2193d1 Peephole optimize x == false and x != true 2021-06-07 12:33:00 -04:00
Pietro Albini
a1c884682c
ignore ui-fulldeps/session-derive-errors.rs on beta and stable
The session-derive-errors test ensures the internal SessionDiagnostic
derive macro outputs the right error messages when misused.

The macro relies on the proc_macro2 crate though, which changes its span
behavior depending on whether the channel is nightly or not. This caused
test failures when bumping the channel from nightly to beta/stable.

Since SessionDiagnostic is internal-only we don't care about its
diagnostics quality outside of nightly, as the compiler itself is
developed on nightly. Thus the easiest solution is to ignore that test
on the beta and stable channels.

This also implements `// only-{channel}` and `// ignore-{channel}` in
compiletest to properly support the change.
2021-06-07 18:09:12 +02:00
Griffin Smith
5aa188ac5d Correct type signature in doc for Bound::as_mut 2021-06-07 11:00:59 -04:00
Cameron Steffen
fb92c92a72 Remove lifetime hack 2021-06-07 10:00:58 -05:00
bors
e4a6032706 Auto merge of #85903 - bjorn3:rustc_serialize_cleanup, r=varkor
Remove unused functions and arguments from rustc_serialize
2021-06-07 14:40:26 +00:00
Fabian Wolff
09307a3e0d Bless ui/where-clauses/where-for-self.rs test 2021-06-07 15:00:47 +02:00