Commit graph

142912 commits

Author SHA1 Message Date
Ralf Jung b1e152c7e5
Rollup merge of #84803 - jyn514:duplicate-macros, r=petrochenkov
Reduce duplication in `impl_dep_tracking_hash` macros

Cherry-picked from https://github.com/rust-lang/rust/pull/84234 since it will be a while until it lands.
2021-05-05 17:52:22 +02:00
Ralf Jung 4c4b3e81df
Rollup merge of #84709 - joshtriplett:doc-alias-chdir, r=dtolnay
Add doc alias for `chdir` to `std::env::set_current_dir`

Searching for `chdir` in the Rust documentation produces no useful
results.

I wrote some code recently that called `libc::chdir` and manually
handled errors, because I didn't realize that the safe
`std::env::set_current_dir` existed. I searched for `chdir` and
`change_dir` and `change_directory` (the latter two based on the
precedent of unabbreviating set by `create_dir`), and I also read
through `std::fs` expecting to potentially find it there. Given that
none of those led to `std::env::set_current_dir`, I think that provides
sufficient justification to add this specific alias.
2021-05-05 17:52:20 +02:00
Ralf Jung d84fcc8b29
Rollup merge of #84183 - rust-lang:relnotes-1.52.0, r=pietroalbini
Update RELEASES.md for 1.52.0

### [Rendered](https://github.com/rust-lang/rust/blob/relnotes-1.52.0/RELEASES.md)

r? ````````@Mark-Simulacrum````````
cc ````````@rust-lang/release````````
2021-05-05 17:52:19 +02:00
Ralf Jung 722bebf163
Rollup merge of #83553 - jfrimmel:addr-of, r=m-ou-se
Update `ptr` docs with regards to `ptr::addr_of!`

This updates the documentation since `ptr::addr_of!` and `ptr::addr_of_mut!` are now stable. One might remove the distinction between the sections `# On packed structs` and `# Examples`, as the old section on packed structs was primarily to prevent users of doing undefined behavior, which is not necessary anymore.

Technically there is now wrong/outdated documentation on stable, but I don't think this is worth a point release 😉

Fixes #83509.

``````````@rustbot`````````` modify labels: T-doc
2021-05-05 17:52:18 +02:00
bors 24acc388da Auto merge of #84886 - Xanewok:update-rls-and-rustfmt, r=Xanewok
Update RLS and Rustfmt

Closes #84537. Closes #84538.

I know there's https://github.com/rust-lang/rust/pull/82208 in progress but I'm not sure which we want to land first.

Also, I'm getting Rustfmt test failures due to inner attributes not permitted:
<details>

```
error: an inner attribute is not permitted in this context
 --> tests/target/issue-3592.rs:4:13
  |
4 |             #![cfg(unix)]
  |             ^^^^^^^^^^^^^
  |
  = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.

error: an inner attribute is not permitted in this context
 --> tests/target/issue-3592.rs:8:13
  |
8 |             #![cfg(not(unix))]
  |             ^^^^^^^^^^^^^^^^^^
  |
  = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.

error: an inner attribute is not permitted in this context
   --> tests/source/match.rs:413:9
    |
413 |         #![allow(simple_match)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.

error: an inner attribute is not permitted in this context
   --> tests/target/match.rs:444:9
    |
444 |         #![allow(simple_match)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.

test test::system_tests ... FAILED
test test::idempotence_tests ... FAILED
```

</details>

but let's see what CI says, first.

cc `@calebcartwright`
2021-05-05 11:05:27 +00:00
Joshua Nelson dcaf74bb6c Add yansi-term as a permitted dependency 2021-05-05 12:36:22 +02:00
Igor Matuszewski 2214a41892 Update RLS and Rustfmt 2021-05-05 12:36:21 +02:00
bors 2d11e25794 Auto merge of #84794 - ChrisDenton:dedup-native-libs, r=petrochenkov
Deduplicate native libs before they are passed to the linker

Stop spamming the linker with the same native library over and over again, if they directly follow from each other. This would help prevent [this situation](https://github.com/MSxDOS/ntapi/issues/2).

Issue #38460 has been open since 2016 so I think it's worth making an incomplete fix that at least addresses the most common symptom and without otherwise changing how Rust handles native libs. This PR is intended to be easy to revert (if necessary) when a more permanent fix is implemented.
2021-05-05 03:56:26 +00:00
bors 45ccf91070 Auto merge of #84915 - Mark-Simulacrum:bitset-xor-eq, r=jackh726
Retain data in vectorized registers for longer

This seems to be a mild performance improvement on the keccak crate at least, though not sure it'll show up more broadly.
2021-05-05 01:23:01 +00:00
bors ae8b84bf04 Auto merge of #84707 - Stupremee:remove-fake-defids-in-rustdoc, r=jyn514,GuillaumeGomez
Get rid of fake `DefId`s in rustdoc

Right now there are *many* errors left, but I wanted to show the current state since all that is left to do is fixing the errors.

Resolves #83183

r? `@jyn514`
2021-05-04 20:56:49 +00:00
bors 8bf0bd9c79 Auto merge of #84900 - hyd-dev:miri, r=RalfJung
Update Miri

This should fix #84848.

r? `@RalfJung`
2021-05-04 18:35:08 +00:00
Justus K b6120bfb35
Add type to differentiate between fake and real DefId's 2021-05-04 19:34:12 +02:00
Mark Rousskov 9d4c0944cb Change bitwise operator to more easily keep data in vector registers 2021-05-04 11:55:18 -04:00
bors dc5f2cd266 Auto merge of #84894 - joshtriplett:clang-12, r=Mark-Simulacrum
Update clang to 12.0.0 on Windows and macOS

Needed for https://github.com/rust-lang/rust/pull/84764 . Tarballs
already uploaded to the CI mirror bucket.
2021-05-04 15:03:50 +00:00
bors a5f164faad Auto merge of #84017 - Smittyvb:int-literal-underscores, r=jyn514
Valid underscores in hex/octal/binary literal docs

Currently hex/octal/binary literals with computed values are displayed like `0_xff_fff_fffu32`, which is invalid since underscores can't be in the middle of integer prefixes. This properly formats prefixed integers.

This causes  [`std::u32::MAX`](https://doc.rust-lang.org/std/u32/constant.MAX.html) to be displayed as
```rust
pub const MAX: u32 = u32::MAX; // 0_xff_fff_fffu32
```

This PR changes it to be displayed as:
```rust
pub const MAX: u32 = u32::MAX; // 0xffff_ffffu32
```
2021-05-04 10:42:13 +00:00
hyd-dev db90c905d0
Update Miri 2021-05-04 17:07:39 +08:00
bors 7a0f1781d0 Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakis
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021

This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition.

r? `@estebank`
2021-05-04 08:09:23 +00:00
Josh Triplett b9ef51f060 Update clang to 12.0.0 on Windows and macOS
Needed for https://github.com/rust-lang/rust/pull/84764 . Tarballs
already uploaded to the CI mirror bucket.
2021-05-03 22:54:50 -07:00
bors c20c9219da Auto merge of #84874 - joshtriplett:ci-extract-llvm-win64-installer, r=Mark-Simulacrum
CI: Extract LLVM win64 installer directly, using 7z

Currently, we have LLVM tarballs for win64, generated by someone running
the installer via wine and tarring up the result.

7z knows how to extract NSIS installers directly, and the result is
identical to our tarball, except that it doesn't include `Uninstall.exe`
(which we don't care about) and it includes the NSIS plugin directory
(which we also don't care about).

This simplifies the process of upgrading CI, and allows us to just
mirror the upstream release .exe directly. This also improves our
supply chain.
2021-05-04 05:40:24 +00:00
bors 0309953232 Auto merge of #84833 - Mark-Simulacrum:thread-local-consts, r=varkor
"const" initialized thread locals in rustc

This appears to give a slight speedup on many of our benchmarks.
2021-05-04 03:14:32 +00:00
bors 14f863c443 Auto merge of #84472 - Aaron1011:conservative-paramenv-and, r=lcnr
Be more conservative about discarding caller_bound in `ParamEnv::and`
2021-05-04 00:48:42 +00:00
Smitty f84b4c51ce Valid underscores in hex/octal/binary literal docs
Currently hex/octal/binary literals with computed values are displayed
like `0_xff_fff_fffu32`, which is invalid since underscores can't be in
the middle of integer prefixes. This properly formats prefixed integers.
2021-05-03 20:11:09 -04:00
Julian Frimmel 389333a21c Update ptr docs with regards to ptr::addr_of!
This updates the documentation since `ptr::addr_of!` and
`ptr::addr_of_mut!` are now stable. One might remove the distinction
between the sections `# On packed structs` and `# Examples`, as the old
section on packed structs was primarily to prevent users of doing unde-
fined behavior, which is not necessary anymore.
There is also a new section in "how to obtain a pointer", which referen-
ces the `ptr::addr_of!` macros.

This commit contains squashed commits from code review.

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
Co-authored-by: Soveu <marx.tomasz@gmail.com>
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-05-03 23:14:17 +02:00
Josh Triplett 22d187a3f6 CI: Extract LLVM win64 installer directly, using 7z
Currently, we have LLVM tarballs for win64, generated by someone running
the installer via wine and tarring up the result.

7z knows how to extract NSIS installers directly, and the result is
identical to our tarball, except that it doesn't include `Uninstall.exe`
(which we don't care about) and it includes the NSIS plugin directory
(which we also don't care about).

This simplifies the process of upgrading CI, and allows us to just
mirror the upstream release .exe directly. This also improves our
supply chain.
2021-05-03 11:23:00 -07:00
bors 716394d658 Auto merge of #84862 - GuillaumeGomez:rollup-cbc93h4, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #84835 (Add link to Issue #34202 in udp docs)
 - #84852 (Change librustdoc write!(.. \n) to writeln!(..); fix comment grammar)
 - #84854 (use double quotes and full path for E0761)
 - #84856 (Correct stability of ErrorKind::OutOfMemory)
 - #84858 (Fix stability attributes of byte-to-string specialization)
 - #84860 (Link to MCP from target tier policy)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-05-03 14:35:12 +00:00
Erin Power b4bfb0e30e Update RELEASES.md for 1.52.0 2021-05-03 15:32:31 +02:00
Guillaume Gomez 2d789b6373
Rollup merge of #84860 - badboy:link-to-mcp, r=GuillaumeGomez
Link to MCP from target tier policy

Promoting new targets requires filing a MCP. Probably good to link to the documentation what that even is.
2021-05-03 15:08:12 +02:00
Guillaume Gomez 55e21e8cca
Rollup merge of #84858 - LingMan:patch-1, r=JohnTitor
Fix stability attributes of byte-to-string specialization
2021-05-03 15:08:11 +02:00
Guillaume Gomez 2604440d8a
Rollup merge of #84856 - kornelski:enomem, r=JohnTitor
Correct stability of ErrorKind::OutOfMemory

Fix for #84744
2021-05-03 15:08:10 +02:00
Guillaume Gomez 377722103e
Rollup merge of #84854 - hi-rustin:rustin-patch-E0761, r=varkor
use double quotes and full path for E0761

close https://github.com/rust-lang/rust/issues/84828
2021-05-03 15:08:09 +02:00
Guillaume Gomez ed1646a785
Rollup merge of #84852 - mautamu:master, r=GuillaumeGomez
Change librustdoc write!(.. \n) to writeln!(..); fix comment grammar

Howdy,

This PR does the following:
1. Updates the grammar of a comment in librustdoc.
2. Replaces a few write!(..\n) macros with writeln!(..\n) for clarity. (Please let me know if there is a reason why this might be wrong!)

Best,
Mautamu
2021-05-03 15:08:07 +02:00
Guillaume Gomez dd5fc8edb8
Rollup merge of #84835 - wcampbell0x2a:add-issue-34202-link, r=m-ou-se
Add link to Issue #34202 in udp docs
2021-05-03 15:08:02 +02:00
Jan-Erik Rediger 9ed197b93c Link to MCP from target tier policy 2021-05-03 13:48:56 +02:00
LingMan eb9f168e1e
Fix stability attributes of byte-to-string specialization 2021-05-03 13:00:34 +02:00
hi-rustin 461f52071d use full path for E0761 2021-05-03 18:57:48 +08:00
bors c825bc431e Auto merge of #83312 - petrochenkov:noinner, r=Aaron1011
parser: Remove support for inner attributes on non-block expressions

Remove support for attributes like
```rust
fn attrs() {
    (#![print_target_and_args(fifth)] 1, 2);

    [#![print_target_and_args(sixth)] 1 , 2];
    [#![print_target_and_args(seventh)] true ; 5];

    match 0 {
        #![print_target_and_args(eighth)]
        _ => {}
    }

    MyStruct { #![print_target_and_args(ninth)] field: true };
}
```
They are
- useless
- unstable (modulo holes like https://github.com/rust-lang/rust/issues/65860)
- pessimize compiler performance, namely token collection for macros (cc https://github.com/rust-lang/rust/pull/82608)

I still want to run crater on this to check whether the stability holes are exploited in practice, and whether such attributes are used at all.
2021-05-03 10:56:15 +00:00
Vadim Petrochenkov 1443c7646d parser: Remove support for inner attributes on non-block expressions 2021-05-03 13:33:53 +03:00
Kornel 2247d46b11 Correct stability of ErrorKind::OutOfMemory 2021-05-03 10:28:19 +01:00
bors e327a823d8 Auto merge of #84845 - wcampbell0x2a:clippy-redundant-field-names, r=joshtriplett
[clippy] remove redundant field names
2021-05-03 08:05:12 +00:00
hi-rustin f758eb664e use double quotes for E0761 2021-05-03 16:02:54 +08:00
mautamu 8db7973f19
Change librustdoc write(.. \n) to writeln(..); fix comment in grammar
More grammar
2021-05-03 02:19:57 -05:00
bors 2428cc4816 Auto merge of #84842 - blkerby:null_lowercase, r=joshtriplett
Replace 'NULL' with 'null'

This replaces occurrences of "NULL" with "null" in docs, comments, and compiler error/lint messages. This is for the sake of consistency, as the lowercase "null" is already the dominant form in Rust. The all-caps NULL looks like the C macro (or SQL keyword), which seems out of place in a Rust context, given that NULL does not exist in the Rust language or standard library (instead having [`ptr::null()`](https://doc.rust-lang.org/stable/std/ptr/fn.null.html)).
2021-05-03 05:41:23 +00:00
wcampbell 962c3416ca
[clippy] remove redundant field names
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
2021-05-02 20:24:17 -04:00
bors 59f551a2dc Auto merge of #84840 - Dylan-DPC:rollup-uzk7w0h, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #84072 (Allow setting `target_family` to multiple values, and implement `target_family="wasm"`)
 - #84744 (Add ErrorKind::OutOfMemory)
 - #84784 (Add help message to suggest const for unused type param)
 - #84811 (RustDoc: Fix bounds linking trait.Foo instead of traitalias.Foo)
 - #84818 (suggestion for unit enum variant when matched with a patern)
 - #84832 (Do not print visibility in external traits)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-05-03 00:17:16 +00:00
Brent Kerby 6679f5ceb1 Change 'NULL' to 'null' 2021-05-02 17:46:00 -06:00
wcampbell e4250a014e
Add link to Issue #34202 in udp docs
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
2021-05-02 19:13:41 -04:00
Dylan DPC 83c49d09b7
Rollup merge of #84832 - Stupremee:dont-print-vis-in-external-traits, r=jyn514
Do not print visibility in external traits

This PR fixes the bug that caused traits, which were re-exported, having visibility modifiers in front of methods, which is invalid.

It would be nice to add a test for this, but I don't even know if tests with multiple crates are possible.

Resolves #81274
2021-05-03 00:32:45 +02:00
Dylan DPC b0c7e64de0
Rollup merge of #84818 - ABouttefeux:enum-suggest, r=jackh726
suggestion for unit enum variant when matched with a patern

resolve #84700

add suggestion for code like
```rust
enum FarmAnimal {
    Worm,
    Cow,
    Bull,
    Chicken { num_eggs: usize },
    Dog (String),
}

fn what_does_the_animal_say(animal: &FarmAnimal) {

    let noise = match animal {
        FarmAnimal::Cow(_) => "moo".to_string(),
        _ => todo!()
    };

    println!("{:?} says: {:?}", animal, noise);
}
```

```
error[E0532]: expected tuple struct or tuple variant, found unit variant `FarmAnimal::Cow`
  --> $DIR/issue-84700.rs:15:9
   |
LL |     Cow,
   |     --- `FarmAnimal::Cow` defined here
...
LL |         FarmAnimal::Cow(_) => "moo".to_string(),
   |         ^^^^^^^^^^^^^^^^^^ help: use this syntax instead: `FarmAnimal::Cow`
   ```
2021-05-03 00:32:44 +02:00
Dylan DPC 37ce3321eb
Rollup merge of #84811 - scottmcm:rustdoc-trait-alias-fix, r=jyn514
RustDoc: Fix bounds linking trait.Foo instead of traitalias.Foo

Fixes #84782

The code was assuming `Trait` when adding bounds to the cache, so add a check on the DefId to see what its kind really is.

r? `@jyn514`

Before:
![image](https://user-images.githubusercontent.com/18526288/116775611-6a751e80-aa53-11eb-84d0-ed6b7782be3c.png)

After:
![image](https://user-images.githubusercontent.com/18526288/116802227-d19cdc80-ab00-11eb-8133-7b34dd750da2.png)
2021-05-03 00:32:43 +02:00
Dylan DPC 0133af504b
Rollup merge of #84784 - JulianKnodt:suggest_const, r=lcnr
Add help message to suggest const for unused type param

r? `@lcnr`
2021-05-03 00:32:42 +02:00