]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #84709 - joshtriplett:doc-alias-chdir, r=dtolnay
Ralf Jung [Wed, 5 May 2021 15:52:20 +0000 (17:52 +0200)]
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.

3 years agoRollup merge of #84183 - rust-lang:relnotes-1.52.0, r=pietroalbini
Ralf Jung [Wed, 5 May 2021 15:52:19 +0000 (17:52 +0200)]
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````````

3 years agoRollup merge of #83553 - jfrimmel:addr-of, r=m-ou-se
Ralf Jung [Wed, 5 May 2021 15:52:18 +0000 (17:52 +0200)]
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

3 years agoAuto merge of #7163 - mgacek8:issue7110_needless_collect_with_type_annotations, r...
bors [Wed, 5 May 2021 15:43:02 +0000 (15:43 +0000)]
Auto merge of #7163 - mgacek8:issue7110_needless_collect_with_type_annotations, r=flip1995

needless_collect: Lint cases with type annotations for indirect usage and recognize `BinaryHeap`

fixes #7110
changelog: needless_collect: Lint cases with type annotations for indirect usage and recognize `BinaryHeap`.

3 years agoRemove unneeded call to with_default_session_globals in rustdoc highlight
Guillaume Gomez [Wed, 5 May 2021 15:28:18 +0000 (17:28 +0200)]
Remove unneeded call to with_default_session_globals in rustdoc highlight

3 years agoDisallows `#![feature(no_coverage)]` on stable and beta
Rich Kadel [Mon, 3 May 2021 15:47:43 +0000 (08:47 -0700)]
Disallows `#![feature(no_coverage)]` on stable and beta

using allow_internal_unstable (as recommended)

Fixes: #84836
```shell
$ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc     src/test/run-make-fulldeps/coverage/no_cov_crate.rs
error[E0554]: `#![feature]` may not be used on the dev release channel
 --> src/test/run-make-fulldeps/coverage/no_cov_crate.rs:2:1
  |
2 | #![feature(no_coverage)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0554`.
```

3 years agoBump map_into_keys_values stable version to 1.54.0.
Mara Bos [Wed, 5 May 2021 14:40:06 +0000 (16:40 +0200)]
Bump map_into_keys_values stable version to 1.54.0.

3 years agoAuto merge of #84200 - CDirkx:os, r=m-ou-se
bors [Wed, 5 May 2021 14:15:19 +0000 (14:15 +0000)]
Auto merge of #84200 - CDirkx:os, r=m-ou-se

Move all `sys::ext` modules to `os`

This PR moves all `sys::ext` modules to `os`, centralizing the location of all `os` code and simplifying the dependencies between `os` and `sys`.

Because this also removes all uses `cfg_if!` on publicly exported items, where after #81969 there were still a few left, this should properly work around https://github.com/rust-analyzer/rust-analyzer/issues/6038.

`@rustbot` label: +T-libs-impl

3 years agoAuto merge of #84200 - CDirkx:os, r=m-ou-se
bors [Wed, 5 May 2021 14:15:19 +0000 (14:15 +0000)]
Auto merge of #84200 - CDirkx:os, r=m-ou-se

Move all `sys::ext` modules to `os`

This PR moves all `sys::ext` modules to `os`, centralizing the location of all `os` code and simplifying the dependencies between `os` and `sys`.

Because this also removes all uses `cfg_if!` on publicly exported items, where after #81969 there were still a few left, this should properly work around https://github.com/rust-analyzer/rust-analyzer/issues/6038.

`@rustbot` label: +T-libs-impl

3 years agoAdd regression test for stack overflow in redundant_pattern_matching
flip1995 [Wed, 5 May 2021 13:35:14 +0000 (15:35 +0200)]
Add regression test for stack overflow in redundant_pattern_matching

3 years agoFix stack overflow in `redundant_pattern_matching`
Cameron Steffen [Wed, 5 May 2021 13:57:09 +0000 (08:57 -0500)]
Fix stack overflow in `redundant_pattern_matching`

3 years agoneedless_collect: use `node_type_opt` instead of `node_type`
Mateusz Gacek [Wed, 5 May 2021 11:52:03 +0000 (04:52 -0700)]
needless_collect: use `node_type_opt` instead of `node_type`

It may prevent future ICEs.

3 years agoRevert PR 83866
Pietro Albini [Wed, 5 May 2021 09:57:10 +0000 (11:57 +0200)]
Revert PR 83866

That PR caused multiple test failures when Rust's channel is changed
from nightly to anything else. The commit will have to be landed again
after the test suite is fixed.

3 years agoAuto merge of #7167 - camsteffen:unused-unit-macro, r=flip1995
bors [Wed, 5 May 2021 11:45:34 +0000 (11:45 +0000)]
Auto merge of #7167 - camsteffen:unused-unit-macro, r=flip1995

Fix unused_unit macro false positive

changelog: Fix [`unused_unit`] false positive with macros

Fixes #7055

3 years agoAuto merge of #84886 - Xanewok:update-rls-and-rustfmt, r=Xanewok
bors [Wed, 5 May 2021 11:05:27 +0000 (11:05 +0000)]
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`

3 years agoAdd `yansi-term` as a permitted dependency
Joshua Nelson [Sun, 2 May 2021 19:06:24 +0000 (15:06 -0400)]
Add `yansi-term` as a permitted dependency

3 years agoUpdate RLS and Rustfmt
Igor Matuszewski [Mon, 3 May 2021 20:59:35 +0000 (22:59 +0200)]
Update RLS and Rustfmt

3 years agoFix typo in `MaybeUninit::array_assume_init` safety comment
Sebastian Dröge [Wed, 5 May 2021 09:31:38 +0000 (12:31 +0300)]
Fix typo in `MaybeUninit::array_assume_init` safety comment

And also add backticks around `MaybeUninit`.

3 years agoAuto merge of #84794 - ChrisDenton:dedup-native-libs, r=petrochenkov
bors [Wed, 5 May 2021 03:56:26 +0000 (03:56 +0000)]
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.

3 years agoAuto merge of #84915 - Mark-Simulacrum:bitset-xor-eq, r=jackh726
bors [Wed, 5 May 2021 01:23:01 +0000 (01:23 +0000)]
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.

3 years agoFix unused_unit macro false positive
Cameron Steffen [Tue, 4 May 2021 22:20:15 +0000 (17:20 -0500)]
Fix unused_unit macro false positive

3 years agoreplace lit_snip type with &str
Takayuki [Tue, 4 May 2021 21:53:04 +0000 (06:53 +0900)]
replace lit_snip type with &str

3 years agorefactor unseparated_literal_suffix
Takayuki [Tue, 4 May 2021 21:39:38 +0000 (06:39 +0900)]
refactor unseparated_literal_suffix

3 years agomove zero_prefixed_literal to its own module
Takayuki [Tue, 4 May 2021 21:18:58 +0000 (06:18 +0900)]
move zero_prefixed_literal to its own module

3 years agoAuto merge of #84707 - Stupremee:remove-fake-defids-in-rustdoc, r=jyn514,GuillaumeGomez
bors [Tue, 4 May 2021 20:56:49 +0000 (20:56 +0000)]
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`

3 years agoneedless_collect: Add `BinaryHeap` for indirect usage lint
Mateusz Gacek [Tue, 4 May 2021 19:36:20 +0000 (12:36 -0700)]
needless_collect: Add `BinaryHeap` for indirect usage lint

3 years agoFix copy_iterator uitest
Mateusz Gacek [Tue, 4 May 2021 06:58:41 +0000 (23:58 -0700)]
Fix copy_iterator uitest

3 years agoneedless_collect: Lint cases with type annotations
Mateusz Gacek [Mon, 3 May 2021 20:36:08 +0000 (13:36 -0700)]
needless_collect: Lint cases with type annotations

3 years agoOnly compute Obligation `cache_key` once in `register_obligation_at`
Esteban Küber [Tue, 4 May 2021 18:57:53 +0000 (11:57 -0700)]
Only compute Obligation `cache_key` once  in `register_obligation_at`

3 years agoAuto merge of #84900 - hyd-dev:miri, r=RalfJung
bors [Tue, 4 May 2021 18:35:08 +0000 (18:35 +0000)]
Auto merge of #84900 - hyd-dev:miri, r=RalfJung

Update Miri

This should fix #84848.

r? `@RalfJung`

3 years agoAdd type to differentiate between fake and real DefId's
Justus K [Thu, 29 Apr 2021 19:36:54 +0000 (21:36 +0200)]
Add type to differentiate between fake and real DefId's

3 years agomove mixed_case_hex_literals to its own module
Takayuki [Tue, 4 May 2021 17:21:26 +0000 (02:21 +0900)]
move mixed_case_hex_literals to its own module

3 years agomove unseparated_literal_suffix to its own module
Takayuki [Tue, 4 May 2021 17:10:24 +0000 (02:10 +0900)]
move unseparated_literal_suffix to its own module

3 years agomove unneeded_field_pattern to its own module
Takayuki [Tue, 4 May 2021 16:44:38 +0000 (01:44 +0900)]
move unneeded_field_pattern to its own module

3 years agoChange bitwise operator to more easily keep data in vector registers
Mark Rousskov [Tue, 4 May 2021 15:53:57 +0000 (11:53 -0400)]
Change bitwise operator to more easily keep data in vector registers

3 years agoDo not ICE on invalid const param
Esteban Küber [Tue, 4 May 2021 15:41:40 +0000 (08:41 -0700)]
Do not ICE on invalid const param

When encountering a path that can't have generics, do not call
`generics_of`. This would happen when writing something like
`path::this_is_a_mod<const_val>`.

Fix #84831.

3 years agoRetry clang+llvm download
Mark Rousskov [Tue, 4 May 2021 15:07:16 +0000 (11:07 -0400)]
Retry clang+llvm download

We've been seeing a pretty high rate of spurious network failures (e.g., openssl
connection reset by peer). Not clear why, but let's add a retry.

3 years agoAuto merge of #84894 - joshtriplett:clang-12, r=Mark-Simulacrum
bors [Tue, 4 May 2021 15:03:50 +0000 (15:03 +0000)]
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.

3 years agoAuto merge of #7157 - camsteffen:hash-pat, r=flip1995
bors [Tue, 4 May 2021 14:45:43 +0000 (14:45 +0000)]
Auto merge of #7157 - camsteffen:hash-pat, r=flip1995

SpanlessHash add Pat

changelog: none

Closes #7149

3 years agoSpanlessHash Pat
Cameron Steffen [Tue, 4 May 2021 13:43:15 +0000 (08:43 -0500)]
SpanlessHash Pat

3 years agoCTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs
Ralf Jung [Tue, 4 May 2021 11:43:50 +0000 (13:43 +0200)]
CTFE engine: rename copy â†’ copy_intrinsic, move to intrinsics.rs

3 years agomove unneeded_wildcard_pattern to its own module
Takayuki [Tue, 4 May 2021 10:50:48 +0000 (19:50 +0900)]
move unneeded_wildcard_pattern to its own module

3 years agoAuto merge of #84017 - Smittyvb:int-literal-underscores, r=jyn514
bors [Tue, 4 May 2021 10:42:13 +0000 (10:42 +0000)]
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
```

3 years agoRemove `rustc_middle::mir::interpret::CheckInAllocMsg::NullPointerTest`
hyd-dev [Tue, 4 May 2021 10:27:02 +0000 (18:27 +0800)]
Remove `rustc_middle::mir::interpret::CheckInAllocMsg::NullPointerTest`

3 years agoUpdate Miri
hyd-dev [Tue, 4 May 2021 09:07:39 +0000 (17:07 +0800)]
Update Miri

3 years agomove redundant_pattern to its own module
Takayuki [Tue, 4 May 2021 08:28:32 +0000 (17:28 +0900)]
move redundant_pattern to its own module

3 years agomove double_neg to its own module
Takayuki [Tue, 4 May 2021 08:20:22 +0000 (17:20 +0900)]
move double_neg to its own module

3 years agoAuto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakis
bors [Tue, 4 May 2021 08:09:23 +0000 (08:09 +0000)]
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`

3 years agoAuto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakis
bors [Tue, 4 May 2021 08:09:23 +0000 (08:09 +0000)]
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`

3 years agomove builtin_type_shadow to its own module
Takayuki [Tue, 4 May 2021 08:04:10 +0000 (17:04 +0900)]
move builtin_type_shadow to its own module

3 years agomove misc_early to misc_early/mod.rs
Takayuki [Tue, 4 May 2021 07:38:34 +0000 (16:38 +0900)]
move misc_early to misc_early/mod.rs

3 years agoHandle incorrect placement of parentheses in trait bounds more gracefully
Esteban Küber [Tue, 4 May 2021 06:48:56 +0000 (23:48 -0700)]
Handle incorrect placement of parentheses in trait bounds more gracefully

Fix #84772.

3 years agoUpdate clang to 12.0.0 on Windows and macOS
Josh Triplett [Tue, 4 May 2021 05:54:50 +0000 (22:54 -0700)]
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.

3 years agoAuto merge of #84874 - joshtriplett:ci-extract-llvm-win64-installer, r=Mark-Simulacrum
bors [Tue, 4 May 2021 05:40:24 +0000 (05:40 +0000)]
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.

3 years agoAuto merge of #84833 - Mark-Simulacrum:thread-local-consts, r=varkor
bors [Tue, 4 May 2021 03:14:32 +0000 (03:14 +0000)]
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.

3 years agoAuto merge of #84472 - Aaron1011:conservative-paramenv-and, r=lcnr
bors [Tue, 4 May 2021 00:48:42 +0000 (00:48 +0000)]
Auto merge of #84472 - Aaron1011:conservative-paramenv-and, r=lcnr

Be more conservative about discarding caller_bound in `ParamEnv::and`

3 years agoValid underscores in hex/octal/binary literal docs
Smitty [Thu, 8 Apr 2021 21:18:25 +0000 (17:18 -0400)]
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.

3 years agoRemove SpanInterner::get
Joshua Nelson [Mon, 3 May 2021 21:32:06 +0000 (17:32 -0400)]
Remove SpanInterner::get

- It's used exactly once, so it's trivial to replace
- It doesn't match the normal convention for containers: normally
`get()` returns and option and indexing panics. Instead `get()` panicked
  and there's no indexing operation available.

3 years agoUpdate `ptr` docs with regards to `ptr::addr_of!`
Julian Frimmel [Sat, 27 Mar 2021 10:44:39 +0000 (11:44 +0100)]
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>
3 years agoplatform-support: Center the contents of the `std` and `host` columns
Josh Triplett [Mon, 3 May 2021 20:01:40 +0000 (13:01 -0700)]
platform-support: Center the contents of the `std` and `host` columns

3 years agoClarify documentation for `[T]::contains`. Fixes #84877.
Jim Blandy [Mon, 3 May 2021 19:01:16 +0000 (12:01 -0700)]
Clarify documentation for `[T]::contains`. Fixes #84877.

3 years agoCI: Extract LLVM win64 installer directly, using 7z
Josh Triplett [Mon, 3 May 2021 18:23:00 +0000 (11:23 -0700)]
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.

3 years agoUnify rustc and rustdoc parsing of `cfg()`
Joshua Nelson [Thu, 22 Apr 2021 17:28:43 +0000 (13:28 -0400)]
Unify rustc and rustdoc parsing of `cfg()`

This extracts a new `parse_cfg` function that's used between both.

- Treat `#[doc(cfg(x), cfg(y))]` the same as `#[doc(cfg(x)]
  #[doc(cfg(y))]`. Previously it would be completely ignored.
- Treat `#[doc(inline, cfg(x))]` the same as `#[doc(inline)]
  #[doc(cfg(x))]`. Previously, the cfg would be ignored.
- Pass the cfg predicate through to rustc_expand to be validated

Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
3 years agoWire up tidy dependency checks for cg_clif
bjorn3 [Mon, 3 May 2021 16:40:07 +0000 (18:40 +0200)]
Wire up tidy dependency checks for cg_clif

3 years agoTake build dependencies into account during license checks
bjorn3 [Mon, 3 May 2021 16:38:52 +0000 (18:38 +0200)]
Take build dependencies into account during license checks

The comment says that build dependencies shouldn't matter unless they do
some kind of codegen. It is safer to always check it though.

3 years agoRemove obsolete crate exceptions
bjorn3 [Mon, 3 May 2021 16:36:38 +0000 (18:36 +0200)]
Remove obsolete crate exceptions

3 years agoFix RESTRICTED_DEPENDENCY_CRATES to list rustc_driver instead of rustc_middle
bjorn3 [Mon, 3 May 2021 16:36:06 +0000 (18:36 +0200)]
Fix RESTRICTED_DEPENDENCY_CRATES to list rustc_driver instead of rustc_middle

3 years agoChange `std::sys::unix::ext::fs::PermissionsExt::from_mode` to `std::os::imp::unix...
Christiaan Dirkx [Sun, 25 Apr 2021 11:10:19 +0000 (13:10 +0200)]
Change `std::sys::unix::ext::fs::PermissionsExt::from_mode` to `std::os::imp::unix::fs::PermissionsExt::from_mode` in Clippy

3 years agoChange `std::sys::unix::ext::fs::PermissionsExt::from_mode` to `std::os::imp::unix...
Christiaan Dirkx [Sun, 25 Apr 2021 11:10:19 +0000 (13:10 +0200)]
Change `std::sys::unix::ext::fs::PermissionsExt::from_mode` to `std::os::imp::unix::fs::PermissionsExt::from_mode` in Clippy

3 years agoAllow documenting on `hermit`
Christiaan Dirkx [Sun, 18 Apr 2021 02:16:02 +0000 (04:16 +0200)]
Allow documenting on `hermit`

3 years agoRework `os` to avoid using `cfg_if!` with public items
Christiaan Dirkx [Wed, 14 Apr 2021 19:36:13 +0000 (21:36 +0200)]
Rework `os` to avoid using `cfg_if!` with public items

3 years agoMove `std::sys::sgx::ext` to `std::os::fortanix_sgx`
Christiaan Dirkx [Thu, 4 Mar 2021 14:45:27 +0000 (15:45 +0100)]
Move `std::sys::sgx::ext` to `std::os::fortanix_sgx`

3 years agoMove `std::sys::wasi::ext` to `std::os::wasi`
Christiaan Dirkx [Thu, 4 Mar 2021 14:39:31 +0000 (15:39 +0100)]
Move `std::sys::wasi::ext` to `std::os::wasi`

3 years agoMove `std::sys::unix::ext` to `std::os::unix`
Christiaan Dirkx [Thu, 4 Mar 2021 14:26:41 +0000 (15:26 +0100)]
Move `std::sys::unix::ext` to `std::os::unix`

3 years agoMove `std::sys::windows::ext` to `std::os::windows`
Christiaan Dirkx [Thu, 4 Mar 2021 14:15:26 +0000 (15:15 +0100)]
Move `std::sys::windows::ext` to `std::os::windows`

3 years agoMove `std::sys::hermit::ext` to `std::os::hermit`
Christiaan Dirkx [Thu, 4 Mar 2021 13:14:44 +0000 (14:14 +0100)]
Move `std::sys::hermit::ext` to `std::os::hermit`

3 years agoCleanup `std::os`
Christiaan Dirkx [Thu, 4 Mar 2021 13:03:26 +0000 (14:03 +0100)]
Cleanup `std::os`

3 years agoAuto merge of #7156 - hellow554:single_char_strip, r=flip1995
bors [Mon, 3 May 2021 14:44:44 +0000 (14:44 +0000)]
Auto merge of #7156 - hellow554:single_char_strip, r=flip1995

[single_char_pattern] add strip_prefix and strip_suffix

Title says it all. Adjusted ui tests.

I added the second commit in case you don't like that I moved that table into `single_char_pattern.rs` directly. I don't see any reason why it shouldn't be in that file. It isn't used anywhere else.

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: add strip_prefix and strip_suffix to single_char_pattern lint

3 years agoAuto merge of #84862 - GuillaumeGomez:rollup-cbc93h4, r=GuillaumeGomez
bors [Mon, 3 May 2021 14:35:12 +0000 (14:35 +0000)]
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

3 years agomove PATTERN_METHODS table directly into file
Marcel Hellwig [Mon, 3 May 2021 14:21:27 +0000 (16:21 +0200)]
move PATTERN_METHODS table directly into file

also removed rustfmt::skip

3 years agoadd strip_{prefix,suffix} to PATTERN_METHODS
Marcel Hellwig [Mon, 3 May 2021 14:18:41 +0000 (16:18 +0200)]
add strip_{prefix,suffix} to PATTERN_METHODS

this will warn, if a single_char_pattern is used in one of the above
methods

3 years agoAuto merge of #7154 - camsteffen:better-conf, r=flip1995
bors [Mon, 3 May 2021 14:13:51 +0000 (14:13 +0000)]
Auto merge of #7154 - camsteffen:better-conf, r=flip1995

`Conf` macro improvements part 2

changelog: none

Follow-up to #7150

I made the default value required again for `define_Conf!` so that it can be parsed by the magic Python. I guess it's just as well for readability.

r? `@flip1995`

3 years agoUpdate config contributing docs
Cameron Steffen [Sun, 2 May 2021 22:53:01 +0000 (17:53 -0500)]
Update config contributing docs

3 years agorustbuild: Pass a `threads` flag that works to windows-gnu lld
Vadim Petrochenkov [Mon, 3 May 2021 13:38:11 +0000 (16:38 +0300)]
rustbuild: Pass a `threads` flag that works to windows-gnu lld

MinGW driver for COFF LLD doesn't currently translate GNU-style `--threads=N` to native `/threads:N`, so we have to pass the option in its native form to avoid an error.

Also pass the `threads` flag to lld-link as well

3 years agoUpdate RELEASES.md for 1.52.0
Erin Power [Wed, 14 Apr 2021 09:34:20 +0000 (11:34 +0200)]
Update RELEASES.md for 1.52.0

3 years agoRollup merge of #84860 - badboy:link-to-mcp, r=GuillaumeGomez
Guillaume Gomez [Mon, 3 May 2021 13:08:12 +0000 (15:08 +0200)]
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.

3 years agoRollup merge of #84858 - LingMan:patch-1, r=JohnTitor
Guillaume Gomez [Mon, 3 May 2021 13:08:11 +0000 (15:08 +0200)]
Rollup merge of #84858 - LingMan:patch-1, r=JohnTitor

Fix stability attributes of byte-to-string specialization

3 years agoRollup merge of #84856 - kornelski:enomem, r=JohnTitor
Guillaume Gomez [Mon, 3 May 2021 13:08:10 +0000 (15:08 +0200)]
Rollup merge of #84856 - kornelski:enomem, r=JohnTitor

Correct stability of ErrorKind::OutOfMemory

Fix for #84744

3 years agoRollup merge of #84854 - hi-rustin:rustin-patch-E0761, r=varkor
Guillaume Gomez [Mon, 3 May 2021 13:08:09 +0000 (15:08 +0200)]
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

3 years agoRollup merge of #84852 - mautamu:master, r=GuillaumeGomez
Guillaume Gomez [Mon, 3 May 2021 13:08:07 +0000 (15:08 +0200)]
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

3 years agoRollup merge of #84835 - wcampbell0x2a:add-issue-34202-link, r=m-ou-se
Guillaume Gomez [Mon, 3 May 2021 13:08:02 +0000 (15:08 +0200)]
Rollup merge of #84835 - wcampbell0x2a:add-issue-34202-link, r=m-ou-se

Add link to Issue #34202 in udp docs

3 years agoLink to MCP from target tier policy
Jan-Erik Rediger [Mon, 3 May 2021 11:48:56 +0000 (13:48 +0200)]
Link to MCP from target tier policy

3 years agouse `else if` in std library
wcampbell [Mon, 3 May 2021 00:06:17 +0000 (20:06 -0400)]
use `else if` in std library

Clippy: Decreases indentation and improves readability

Signed-off-by: wcampbell <wcampbell1995@gmail.com>
3 years agoFix stability attributes of byte-to-string specialization
LingMan [Mon, 3 May 2021 11:00:34 +0000 (13:00 +0200)]
Fix stability attributes of byte-to-string specialization

3 years agouse full path for E0761
hi-rustin [Mon, 3 May 2021 10:57:48 +0000 (18:57 +0800)]
use full path for E0761

3 years agoAuto merge of #83312 - petrochenkov:noinner, r=Aaron1011
bors [Mon, 3 May 2021 10:56:15 +0000 (10:56 +0000)]
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.

3 years agoparser: Remove support for inner attributes on non-block expressions
Vadim Petrochenkov [Fri, 19 Mar 2021 23:52:07 +0000 (02:52 +0300)]
parser: Remove support for inner attributes on non-block expressions

3 years agoCorrect stability of ErrorKind::OutOfMemory
Kornel [Mon, 3 May 2021 09:28:19 +0000 (10:28 +0100)]
Correct stability of ErrorKind::OutOfMemory

3 years agoAuto merge of #84845 - wcampbell0x2a:clippy-redundant-field-names, r=joshtriplett
bors [Mon, 3 May 2021 08:05:12 +0000 (08:05 +0000)]
Auto merge of #84845 - wcampbell0x2a:clippy-redundant-field-names, r=joshtriplett

[clippy] remove redundant field names

3 years agouse double quotes for E0761
hi-rustin [Mon, 3 May 2021 08:02:54 +0000 (16:02 +0800)]
use double quotes for E0761