]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #93283 - m1guelperez:master, r=Mark-Simulacrum
Dylan DPC [Fri, 11 Mar 2022 12:38:36 +0000 (13:38 +0100)]
Rollup merge of #93283 - m1guelperez:master, r=Mark-Simulacrum

Fix for localized windows editions in testcase fn read_link() Issue#93211

This PR aims to fix the issue with localized windows versions that do not necessarily have the folder "Documents and settings" in English.

The idea was provided by `@the8472.` We check if the "CI" environment variable is set, then we always check for the "Documents and Settings"-folder, otherwise we check if the folder exists on the local machine, and if not we skip this assert.

Resoles #93211.

2 years agoAuto merge of #94304 - notriddle:notriddle/buffer-args, r=CraftSpider
bors [Fri, 11 Mar 2022 06:47:49 +0000 (06:47 +0000)]
Auto merge of #94304 - notriddle:notriddle/buffer-args, r=CraftSpider

rustdoc: write directly to buffer in `inner_full_print`

This change avoids several temporary allocations for every argument.

2 years agoAuto merge of #94834 - Dylan-DPC:rollup-sza4qc2, r=Dylan-DPC
bors [Fri, 11 Mar 2022 04:32:33 +0000 (04:32 +0000)]
Auto merge of #94834 - Dylan-DPC:rollup-sza4qc2, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #93293 (Implement `MIN`/`MAX` constants for non-zero integers)
 - #94356 (Rename unix::net::SocketAddr::from_path to from_pathname and stabilize it)
 - #94765 (Rename is_{some,ok,err}_with to is_{some,ok,err}_and.)
 - #94819 (configure: don't serialize empty array elements)
 - #94826 (Improve doc wording for retain on some collections)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #94826 - allgoewer:fix-retain-documentation, r=yaahc
Dylan DPC [Fri, 11 Mar 2022 02:32:06 +0000 (03:32 +0100)]
Rollup merge of #94826 - allgoewer:fix-retain-documentation, r=yaahc

Improve doc wording for retain on some collections

I found the documentation wording on the various retain methods on many collections to be unusual.
I tried to invert the relation by switching `such that` with `for which` .

2 years agoRollup merge of #94819 - jonhoo:configure-empty-list, r=Mark-Simulacrum
Dylan DPC [Fri, 11 Mar 2022 02:32:05 +0000 (03:32 +0100)]
Rollup merge of #94819 - jonhoo:configure-empty-list, r=Mark-Simulacrum

configure: don't serialize empty array elements

Before this change:

    $ ./configure --codegen-backends=
    [..]
    $ grep -P '^codegen-backends' config.toml
    codegen-backends = ['']

After this change:

    $ ./configure --codegen-backends=
    [..]
    $ grep -P '^codegen-backends' config.toml
    codegen-backends = []

2 years agoRollup merge of #94765 - m-ou-se:is-some-and, r=Dylan-DPC
Dylan DPC [Fri, 11 Mar 2022 02:32:04 +0000 (03:32 +0100)]
Rollup merge of #94765 - m-ou-se:is-some-and, r=Dylan-DPC

Rename is_{some,ok,err}_with to is_{some,ok,err}_and.

This renames `is_{some,ok,err}_with` to `is_{some,ok,err}_and`. This was discussed on the [tracking issue](https://github.com/rust-lang/rust/issues/93050).

2 years agoRollup merge of #94356 - Thomasdezeeuw:stabilize_unix_socket_creation, r=dtolnay
Dylan DPC [Fri, 11 Mar 2022 02:32:03 +0000 (03:32 +0100)]
Rollup merge of #94356 - Thomasdezeeuw:stabilize_unix_socket_creation, r=dtolnay

Rename unix::net::SocketAddr::from_path to from_pathname and stabilize it

Stabilizes `unix_socket_creation`.

Closes https://github.com/rust-lang/rust/issues/93423
r? `@m-ou-se`

2 years agoRollup merge of #93293 - nvzqz:nonzero-min-max, r=joshtriplett
Dylan DPC [Fri, 11 Mar 2022 02:32:02 +0000 (03:32 +0100)]
Rollup merge of #93293 - nvzqz:nonzero-min-max, r=joshtriplett

Implement `MIN`/`MAX` constants for non-zero integers

This adds the associated [`MIN`](https://doc.rust-lang.org/stable/std/primitive.usize.html#associatedconstant.MIN)/[`MAX`](https://doc.rust-lang.org/stable/std/primitive.usize.html#associatedconstant.MAX) constants to `NonZero{U,I}{8,16,32,64,128,size}`, requested in #89065.

This reimplements #89077 due that PR being stagnant for 4 months. I am fine with closing this in favor of that one if the author revisits it. If so, I'd like to see that PR have the docs link to the `$Int`'s constants.

2 years agoAuto merge of #94276 - scottmcm:primitive-clone, r=oli-obk
bors [Fri, 11 Mar 2022 01:51:49 +0000 (01:51 +0000)]
Auto merge of #94276 - scottmcm:primitive-clone, r=oli-obk

mir-opt: Replace clone on primitives with copy

We can't do it for everything, but it would be nice to at least stop making calls to clone methods in debug from things like derived-clones.

r? `@ghost`

2 years agoImprove doc wording for retain on some collections
Maik Allgöwer [Thu, 10 Mar 2022 23:16:45 +0000 (00:16 +0100)]
Improve doc wording for retain on some collections

2 years agoAuto merge of #94824 - Dylan-DPC:rollup-iamc09j, r=Dylan-DPC
bors [Thu, 10 Mar 2022 23:10:59 +0000 (23:10 +0000)]
Auto merge of #94824 - Dylan-DPC:rollup-iamc09j, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #93950 (Use modern formatting for format! macros)
 - #94274 (Treat unstable lints as unknown)
 - #94368 ([1/2] Implement macro meta-variable expressions)
 - #94719 (Statically compile libstdc++ everywhere if asked)
 - #94728 (Only emit pointer-like metadata for `Box<T, A>` when `A` is ZST)
 - #94790 (enable portable-simd doctests in Miri)
 - #94811 (Update browser-ui-test version)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoMove note about 0 gap to signed integers
Nikolai Vazquez [Thu, 10 Mar 2022 22:52:48 +0000 (17:52 -0500)]
Move note about 0 gap to signed integers

Was accidentally placed on unsigned integers, where it is not relevant.

2 years agoRollup merge of #94811 - GuillaumeGomez:update-browser-ui-test, r=notriddle
Dylan DPC [Thu, 10 Mar 2022 22:13:02 +0000 (23:13 +0100)]
Rollup merge of #94811 - GuillaumeGomez:update-browser-ui-test, r=notriddle

Update browser-ui-test version

It should help with #93784 (the important PR helping in this regard is https://github.com/GuillaumeGomez/browser-UI-test/pull/273).

r? `@notriddle`

2 years agoRollup merge of #94790 - RalfJung:portable-simd-miri, r=Dylan-DPC
Dylan DPC [Thu, 10 Mar 2022 22:13:01 +0000 (23:13 +0100)]
Rollup merge of #94790 - RalfJung:portable-simd-miri, r=Dylan-DPC

enable portable-simd doctests in Miri

With https://github.com/rust-lang/miri/pull/2013 we shouldn't need to disable these tests any more. :)

2 years agoRollup merge of #94728 - compiler-errors:box-allocator-zst-meta, r=michaelwoerister
Dylan DPC [Thu, 10 Mar 2022 22:13:00 +0000 (23:13 +0100)]
Rollup merge of #94728 - compiler-errors:box-allocator-zst-meta, r=michaelwoerister

Only emit pointer-like metadata for `Box<T, A>` when `A` is ZST

Basically copy the change in #94043, but for debuginfo.

r? ``@michaelwoerister``

Fixes #94725

2 years agoRollup merge of #94719 - jonhoo:enable-static-lld, r=Mark-Simulacrum
Dylan DPC [Thu, 10 Mar 2022 22:12:59 +0000 (23:12 +0100)]
Rollup merge of #94719 - jonhoo:enable-static-lld, r=Mark-Simulacrum

Statically compile libstdc++ everywhere if asked

PR #93918 made it so that `-static-libstdc++` was only set in one place,
and was only set during linking, but accidentally also made it so that
it is no longer passed when building LLD, only when building LLVM
itself. This moves the logic for setting `-static-libstdc++` in the
linker flags to `configure_cmake` so that it takes effect for all CMake
invocations in `native.rs`.

As a side-effect, this also causes libstdc++ to be statically compiled
into sanitizers, whereas previously the `llvm-static-stdcpp` flag had no
effect on sanitizers. It also makes it so that LLD will be compiled
statically if `llvm-tools-enabled` is set, even though previously it was
only linked statically if `llvm-static-stdcpp` was set explicitly. Both
of these seem like they match expected behavior than what was there
prior to #93918.

2 years agoRollup merge of #94368 - c410-f3r:metaaaaaaaaaaaaaaaaaaaaaaaaaaa, r=petrochenkov
Dylan DPC [Thu, 10 Mar 2022 22:12:58 +0000 (23:12 +0100)]
Rollup merge of #94368 - c410-f3r:metaaaaaaaaaaaaaaaaaaaaaaaaaaa, r=petrochenkov

[1/2] Implement macro meta-variable expressions

See https://github.com/rust-lang/rust/pull/93545#issuecomment-1050963295

The logic behind `length`, `index` and `count` was removed but the parsing code is still present, i.e., everything is simply ignored like `ignored`.

r? ``@petrochenkov``

2 years agoRollup merge of #94274 - djkoloski:unknown_unstable_lints, r=tmandry
Dylan DPC [Thu, 10 Mar 2022 22:12:57 +0000 (23:12 +0100)]
Rollup merge of #94274 - djkoloski:unknown_unstable_lints, r=tmandry

Treat unstable lints as unknown

This change causes unstable lints to be ignored if the `unknown_lints`
lint is allowed. To achieve this, it also changes lints to apply as soon
as they are processed. Previously, lints in the same set were processed
as a batch and then all simultaneously applied.

Implementation of https://github.com/rust-lang/compiler-team/issues/469

2 years agoRollup merge of #93950 - T-O-R-U-S:use-modern-formatting-for-format!-macros, r=Mark...
Dylan DPC [Thu, 10 Mar 2022 22:12:57 +0000 (23:12 +0100)]
Rollup merge of #93950 - T-O-R-U-S:use-modern-formatting-for-format!-macros, r=Mark-Simulacrum

Use modern formatting for format! macros

This updates the standard library's documentation to use the new format_args syntax.
The documentation is worthwhile to update as it should be more idiomatic
(particularly for features like this, which are nice for users to get acquainted
with). The general codebase is likely more hassle than benefit to update: it'll
hurt git blame, and generally updates can be done by folks updating the code if
(and when) that makes things more readable with the new format.

A few places in the compiler and library code are updated (mostly just due to
already having been done when this commit was first authored).

`eprintln!("{}", e)` becomes `eprintln!("{e}")`, but `eprintln!("{}", e.kind())` remains untouched.

2 years agoconfigure: don't serialize empty array elements
Jon Gjengset [Thu, 10 Mar 2022 20:39:29 +0000 (12:39 -0800)]
configure: don't serialize empty array elements

Before this change:

    $ ./configure --codegen-backends=
    [..]
    $ grep -P '^codegen-backends' config.toml
    codegen-backends = ['']

After this change:

    $ ./configure --codegen-backends=
    [..]
    $ grep -P '^codegen-backends' config.toml
    codegen-backends = []

2 years agoAuto merge of #94814 - matthiaskrgr:rollup-a5sk366, r=matthiaskrgr
bors [Thu, 10 Mar 2022 18:28:45 +0000 (18:28 +0000)]
Auto merge of #94814 - matthiaskrgr:rollup-a5sk366, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #94440 (Better error for normalization errors from parent crates that use `#![feature(generic_const_exprs)]`)
 - #94587 (Document new recommended use of `FromIterator::from_iter`)
 - #94644 (Fix soundness issue in scoped threads.)
 - #94740 (Unify impl blocks by wrapping them into a div)
 - #94753 (Improve rustdoc book)
 - #94796 (Allow `cargo run` instead of `cargo run -p bootstrap`)
 - #94805 (Revert accidental stabilization)
 - #94809 (RustWrapper: add missing include)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #94809 - durin42:llvm-15-modulepass, r=nikic
Matthias Krüger [Thu, 10 Mar 2022 18:00:12 +0000 (19:00 +0100)]
Rollup merge of #94809 - durin42:llvm-15-modulepass, r=nikic

RustWrapper: add missing include

This is required after LLVM change 3c4410dfcaaf (aka
https://reviews.llvm.org/D121168) did some includes cleanup.

r? nikic

2 years agoRollup merge of #94805 - oli-obk:drop_box, r=pnkfelix
Matthias Krüger [Thu, 10 Mar 2022 18:00:11 +0000 (19:00 +0100)]
Rollup merge of #94805 - oli-obk:drop_box, r=pnkfelix

Revert accidental stabilization

fixes #94804

2 years agoRollup merge of #94796 - jyn514:cargo-run-bootstrap, r=Mark-Simulacrum
Matthias Krüger [Thu, 10 Mar 2022 18:00:10 +0000 (19:00 +0100)]
Rollup merge of #94796 - jyn514:cargo-run-bootstrap, r=Mark-Simulacrum

Allow `cargo run` instead of `cargo run -p bootstrap`

This was part of `@Mark-Simulacrum` 's original PR in https://github.com/rust-lang/rust/commit/ecb424f12992a4aebace8a153d5efea040327a01,
but I missed it when writing #92260.

This also has the side effect of allowing `cargo build --bins` instead of `cargo build -p bootstrap --bins`. I'm not sure when you would want to run cargo build/check/test without going through bootstrap, but this still allows you to do so as long as you pass `-p` for all the crates you want to build.

2 years agoRollup merge of #94753 - Urgau:rustdoc-book-improvements, r=GuillaumeGomez
Matthias Krüger [Thu, 10 Mar 2022 18:00:09 +0000 (19:00 +0100)]
Rollup merge of #94753 - Urgau:rustdoc-book-improvements, r=GuillaumeGomez

Improve rustdoc book

This pull-request improves the `rustdoc` book by doing some (light) cleanup, by merging some stuff, by adding some missing stuff (like tracking issues links, for those who had one) and also by moving some chapter's into sub-chapter's to improve the flow of the book.

~~Note that I locally tested with `mdbook-lintcheck` that no links became accidentally broken.~~ (Not enough, ;-))

r? `````@GuillaumeGomez`````

2 years agoRollup merge of #94740 - GuillaumeGomez:unify-impl-blocks, r=notriddle
Matthias Krüger [Thu, 10 Mar 2022 18:00:08 +0000 (19:00 +0100)]
Rollup merge of #94740 - GuillaumeGomez:unify-impl-blocks, r=notriddle

Unify impl blocks by wrapping them into a div

The blanket and "auto traits" sections are wrapped into a `div` with an ID. This PR fixes this incoherence by wrapping each impl section (the "deref impl" and the "inherent impl" sections were missing it). It'll also make some tests simpler to write.

r? `````@notriddle`````

2 years agoRollup merge of #94644 - m-ou-se:scoped-threads-drop-soundness, r=joshtriplett
Matthias Krüger [Thu, 10 Mar 2022 18:00:07 +0000 (19:00 +0100)]
Rollup merge of #94644 - m-ou-se:scoped-threads-drop-soundness, r=joshtriplett

Fix soundness issue in scoped threads.

This was discovered in https://github.com/rust-lang/rust/pull/94559#discussion_r820116323

The `scope()` function returns when all threads are finished, but I accidentally considered a thread 'finished' before dropping their panic payload or ignored return value.

So if a thread returned (or panics with) something that in its `Drop` implementation still uses borrowed stuff, it goes wrong.

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=2a1f19ac4676cdabe43e24e536ff9358

2 years agoRollup merge of #94587 - JKAnderson409:issue-90107-fix, r=scottmcm
Matthias Krüger [Thu, 10 Mar 2022 18:00:06 +0000 (19:00 +0100)]
Rollup merge of #94587 - JKAnderson409:issue-90107-fix, r=scottmcm

Document new recommended use of `FromIterator::from_iter`

#90107
Most of the added prose was paraphrased from the links provided in the issue. The suggested `VecDeque` example seemed to make the point well enough so I just used that.

2 years agoRollup merge of #94440 - compiler-errors:issue-94282, r=lcnr
Matthias Krüger [Thu, 10 Mar 2022 18:00:05 +0000 (19:00 +0100)]
Rollup merge of #94440 - compiler-errors:issue-94282, r=lcnr

Better error for normalization errors from parent crates that use `#![feature(generic_const_exprs)]`

This PR implements a somewhat rudimentary heuristic to suggest using `#![feature(generic_const_exprs)]` in a child crate when a function from a foreign crate (that may have used `#![feature(generic_const_exprs)]`) fails to normalize during codegen.

cc: #79018
cc: #94287

2 years agoUpdate browser-ui-test version
Guillaume Gomez [Thu, 10 Mar 2022 16:49:50 +0000 (17:49 +0100)]
Update browser-ui-test version

2 years agoRustWrapper: add missing include
Augie Fackler [Thu, 10 Mar 2022 16:16:33 +0000 (11:16 -0500)]
RustWrapper: add missing include

This is required after LLVM change 3c4410dfcaaf (aka
https://reviews.llvm.org/D121168) did some includes cleanup.

2 years agoUse implicit capture syntax in format_args
T-O-R-U-S [Sat, 12 Feb 2022 19:16:17 +0000 (23:16 +0400)]
Use implicit capture syntax in format_args

This updates the standard library's documentation to use the new syntax. The
documentation is worthwhile to update as it should be more idiomatic
(particularly for features like this, which are nice for users to get acquainted
with). The general codebase is likely more hassle than benefit to update: it'll
hurt git blame, and generally updates can be done by folks updating the code if
(and when) that makes things more readable with the new format.

A few places in the compiler and library code are updated (mostly just due to
already having been done when this commit was first authored).

2 years agoRevert accidental stabilization
Oli Scherer [Thu, 10 Mar 2022 14:28:28 +0000 (14:28 +0000)]
Revert accidental stabilization

2 years agoAuto merge of #94802 - matthiaskrgr:rollup-4plu0fi, r=matthiaskrgr
bors [Thu, 10 Mar 2022 12:32:01 +0000 (12:32 +0000)]
Auto merge of #94802 - matthiaskrgr:rollup-4plu0fi, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #92150 (Improve suggestion when casting usize to (possibly) wide pointer)
 - #94635 (Merge `#[deprecated]` and `#[rustc_deprecated]`)
 - #94657 (Constify `Index{,Mut}` for `[T]`, `str`, and `[T; N]`)
 - #94746 (diagnostics: use rustc_on_unimplemented to recommend `[].iter()`)
 - #94788 (Account for suggestions for complete removal of lines)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #94788 - estebank:removal-suggestion, r=petrochenkov
Matthias Krüger [Thu, 10 Mar 2022 11:20:54 +0000 (12:20 +0100)]
Rollup merge of #94788 - estebank:removal-suggestion, r=petrochenkov

Account for suggestions for complete removal of lines

Fix  #94192.

2 years agoRollup merge of #94746 - notriddle:notriddle/method-rustc-on-unimplemented, r=davidtwco
Matthias Krüger [Thu, 10 Mar 2022 11:20:53 +0000 (12:20 +0100)]
Rollup merge of #94746 - notriddle:notriddle/method-rustc-on-unimplemented, r=davidtwco

diagnostics: use rustc_on_unimplemented to recommend `[].iter()`

To make this work, the `#[rustc_on_unimplemented]` data needs to be used to
report method resolution errors, which is most of what this commit does.

Fixes #94581

2 years agoRollup merge of #94657 - fee1-dead:const_slice_index, r=oli-obk
Matthias Krüger [Thu, 10 Mar 2022 11:20:52 +0000 (12:20 +0100)]
Rollup merge of #94657 - fee1-dead:const_slice_index, r=oli-obk

Constify `Index{,Mut}` for `[T]`, `str`, and `[T; N]`

Several panic functions were rewired (via `const_eval_select`) to simpler implementations that do not require formatting for compile-time usage.

r? ```@oli-obk```

2 years agoRollup merge of #94635 - jhpratt:merge-deprecated-attrs, r=davidtwco
Matthias Krüger [Thu, 10 Mar 2022 11:20:51 +0000 (12:20 +0100)]
Rollup merge of #94635 - jhpratt:merge-deprecated-attrs, r=davidtwco

Merge `#[deprecated]` and `#[rustc_deprecated]`

The first commit makes "reason" an alias for "note" in `#[rustc_deprecated]`, while still prohibiting it in `#[deprecated]`.

The second commit changes "suggestion" to not just be a feature of `#[rustc_deprecated]`. This is placed behind the new `deprecated_suggestion` feature. This needs a tracking issue; let me know if this PR will be approved and I can create one.

The third commit is what permits `#[deprecated]` to be used when `#![feature(staged_api)]` is enabled. This isn't yet used in stdlib (only tests), as it would require duplicating all deprecation attributes until a bootstrap occurs. I intend to submit a follow-up PR that replaces all uses and removes the remaining `#[rustc_deprecated]` code after the next bootstrap.

`@rustbot` label +T-libs-api +C-feature-request +A-attributes +S-waiting-on-review

2 years agoRollup merge of #92150 - compiler-errors:better_usize_to_wide_ptr_cast, r=petrochenkov
Matthias Krüger [Thu, 10 Mar 2022 11:20:50 +0000 (12:20 +0100)]
Rollup merge of #92150 - compiler-errors:better_usize_to_wide_ptr_cast, r=petrochenkov

Improve suggestion when casting usize to (possibly) wide pointer

I thought #92125 was a wonderful idea, so I went ahead and took a stab at it. Not sure if my approach is the best going forward, but I'm happy with the improvement in the error message.

Iwill definitely address any changes if people are more opinionated with the wordings or want more features.

Also, do I need to add a new error code?

(Fixes #92125)

2 years agoThe `Clone::clone` call is now a `ConstantKind::Val`, not a `ConstantKind::Ty`
Scott McMurray [Thu, 10 Mar 2022 09:50:47 +0000 (01:50 -0800)]
The `Clone::clone` call is now a `ConstantKind::Val`, not a `ConstantKind::Ty`

2 years agoDisable the test on wasm32
Scott McMurray [Wed, 9 Mar 2022 23:50:14 +0000 (15:50 -0800)]
Disable the test on wasm32

Since the expected output has unwind targets

2 years agoshort-circuit the easy cases in `is_copy_modulo_regions`
Scott McMurray [Sun, 6 Mar 2022 07:51:10 +0000 (23:51 -0800)]
short-circuit the easy cases in `is_copy_modulo_regions`

This change is somewhat extensive, since it affects MIR -- since this is called to determine Copy vs Move -- so any test that's `no_core` needs to actually have the normal `impl`s it uses.

2 years agoMove `is_trivially_pure_clone_copy` onto `Ty` instead
Scott McMurray [Sat, 5 Mar 2022 23:19:57 +0000 (15:19 -0800)]
Move `is_trivially_pure_clone_copy` onto `Ty` instead

2 years agomir-opt: Replace clone on primitives with copy
Scott McMurray [Wed, 23 Feb 2022 07:19:57 +0000 (23:19 -0800)]
mir-opt: Replace clone on primitives with copy

We can't do it for everything, but it would be nice to at least stop making calls to clone methods in debug from things like derived-clones.

2 years agoAuto merge of #94764 - nikic:update-llvm-3, r=nagisa
bors [Thu, 10 Mar 2022 08:56:02 +0000 (08:56 +0000)]
Auto merge of #94764 - nikic:update-llvm-3, r=nagisa

Update LLVM submodule

This merges upstream changes from the 14.x release branch.

Fixes #89609.
Fixes #93923.
Fixes #94032.

2 years agoAuto merge of #94059 - b-naber:constantkind-val-transformation, r=lcnr
bors [Thu, 10 Mar 2022 05:53:59 +0000 (05:53 +0000)]
Auto merge of #94059 - b-naber:constantkind-val-transformation, r=lcnr

Treat constant values as mir::ConstantKind::Val

Another step that is necessary for the introduction of Valtrees: we don't want to treat `ty::Const` instances of kind `ty::ConstKind::Value` as `mir::ConstantKind::Ty` anymore.

r? `@oli-obk`

2 years agoAllow `cargo run` instead of `cargo run -p bootstrap`
Joshua Nelson [Thu, 10 Mar 2022 04:37:44 +0000 (22:37 -0600)]
Allow `cargo run` instead of `cargo run -p bootstrap`

This was part of Mark's original PR in https://github.com/rust-lang/rust/commit/ecb424f12992a4aebace8a153d5efea040327a01,
but I missed it when writing #92260.

2 years agoAuto merge of #94787 - matthiaskrgr:rollup-yyou15f, r=matthiaskrgr
bors [Thu, 10 Mar 2022 02:38:43 +0000 (02:38 +0000)]
Auto merge of #94787 - matthiaskrgr:rollup-yyou15f, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #91804 (Make some `Clone` impls `const`)
 - #92541 (Mention intent of `From` trait in its docs)
 - #93057 (Add Iterator::collect_into)
 - #94739 (Suggest `if let`/`let_else` for refutable pat in `let`)
 - #94754 (Warn users about `||` in let chain expressions)
 - #94763 (Add documentation about lifetimes to thread::scope.)
 - #94768 (Ignore `close_read_wakes_up` test on SGX platform)
 - #94772 (Add miri to the well known conditional compilation names and values)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoenable portable-simd doctests in Miri
Ralf Jung [Thu, 10 Mar 2022 00:31:25 +0000 (19:31 -0500)]
enable portable-simd doctests in Miri

2 years agoAuto merge of #94737 - lcnr:pass-stuff-by-value, r=davidtwco
bors [Thu, 10 Mar 2022 00:15:39 +0000 (00:15 +0000)]
Auto merge of #94737 - lcnr:pass-stuff-by-value, r=davidtwco

add `#[rustc_pass_by_value]` to more types

the only interesting changes here should be to `TransitiveRelation`, but I believe to be highly unlikely that we will ever use a non `Copy` type with this type.

2 years agoAccount for suggestions for complete removal of lines
Esteban Kuber [Wed, 9 Mar 2022 22:47:00 +0000 (22:47 +0000)]
Account for suggestions for complete removal of lines

Fix  #94192.

2 years agobetter suggestion for int to wide ptr cast
Michael Goulet [Wed, 9 Mar 2022 23:24:14 +0000 (15:24 -0800)]
better suggestion for int to wide ptr cast

2 years agosuggest enabling generic_const_exprs feature if const is unevaluatable
Michael Goulet [Fri, 4 Mar 2022 05:46:45 +0000 (21:46 -0800)]
suggest enabling generic_const_exprs feature if const is unevaluatable

2 years agoRollup merge of #94772 - Urgau:check-cfg-miri, r=petrochenkov
Matthias Krüger [Wed, 9 Mar 2022 22:14:16 +0000 (23:14 +0100)]
Rollup merge of #94772 - Urgau:check-cfg-miri, r=petrochenkov

Add miri to the well known conditional compilation names and values

This pull request adds `miri` to the list of well known names and values of the conditional compilation checking (`--check-cfg`).

This was brought up in [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/RFC.203013.3A.20Checking.20conditional.20compilation.20at.20compile.20time/near/274513827) when discussing about the future of `--check-cfg`.

r? ``@petrochenkov``

2 years agoRollup merge of #94768 - fortanix:raoul/fix_close_read_wakes_up_test_sgx_platform...
Matthias Krüger [Wed, 9 Mar 2022 22:14:15 +0000 (23:14 +0100)]
Rollup merge of #94768 - fortanix:raoul/fix_close_read_wakes_up_test_sgx_platform, r=dtolnay

Ignore `close_read_wakes_up` test on SGX platform

PR #94714 enabled the `close_read_wakes_up` test for all platforms. This is incorrect. This test should be ignored at least for the SGX platform.

cc: ``@mzohreva`` ``@jethrogb``

2 years agoRollup merge of #94763 - m-ou-se:scoped-threads-lifetime-docs, r=Mark-Simulacrum
Matthias Krüger [Wed, 9 Mar 2022 22:14:14 +0000 (23:14 +0100)]
Rollup merge of #94763 - m-ou-se:scoped-threads-lifetime-docs, r=Mark-Simulacrum

Add documentation about lifetimes to thread::scope.

This resolves the last unresolved question of https://github.com/rust-lang/rust/issues/93203

This was brought up in https://github.com/rust-lang/rust/pull/94559#discussion_r820872694

r? `````@Mark-Simulacrum`````

2 years agoRollup merge of #94754 - c410-f3r:nice-error, r=lcnr
Matthias Krüger [Wed, 9 Mar 2022 22:14:13 +0000 (23:14 +0100)]
Rollup merge of #94754 - c410-f3r:nice-error, r=lcnr

Warn users about `||` in let chain expressions

Or more specifically, warn that `||` operators are forbidden.

This PR is simple so I guess anyone can review 🤷

cc #53667
cc ``@matthewjasper``

2 years agoRollup merge of #94739 - estebank:suggest-let-else, r=oli-obk
Matthias Krüger [Wed, 9 Mar 2022 22:14:11 +0000 (23:14 +0100)]
Rollup merge of #94739 - estebank:suggest-let-else, r=oli-obk

Suggest `if let`/`let_else` for refutable pat in `let`

r? `````@oli-obk`````

2 years agoRollup merge of #93057 - frengor:iter_collect_into, r=m-ou-se
Matthias Krüger [Wed, 9 Mar 2022 22:14:11 +0000 (23:14 +0100)]
Rollup merge of #93057 - frengor:iter_collect_into, r=m-ou-se

Add Iterator::collect_into

This PR adds `Iterator::collect_into` as proposed by ``@cormacrelf`` in #48597 (see https://github.com/rust-lang/rust/pull/48597#issuecomment-842083688).
Followup of #92982.

This adds the following method to the Iterator trait:

```rust
fn collect_into<E: Extend<Self::Item>>(self, collection: &mut E) -> &mut E
```

2 years agoRollup merge of #92541 - asquared31415:from-docs, r=m-ou-se
Matthias Krüger [Wed, 9 Mar 2022 22:14:10 +0000 (23:14 +0100)]
Rollup merge of #92541 - asquared31415:from-docs, r=m-ou-se

Mention intent of `From` trait in its docs

This pr is a docs modification to add to the documentation of the `From` trait a note about its intent as a perfect conversion.  This is already stated in the `TryFrom` docs so this is simply adding that information in a more visible way.

2 years agoRollup merge of #91804 - woppopo:const_clone, r=oli-obk
Matthias Krüger [Wed, 9 Mar 2022 22:14:09 +0000 (23:14 +0100)]
Rollup merge of #91804 - woppopo:const_clone, r=oli-obk

Make some `Clone` impls `const`

Tracking issue: #91805
`Clone::clone_from` and some impls (Option, Result) bounded on `~const Drop`.

```rust
// core::clone
impl const Clone for INTEGER
impl const Clone for FLOAT
impl const Clone for bool
impl const Clone for char
impl const Clone for !
impl<T: ?Sized> const Clone for *const T
impl<T: ?Sized> const Clone for *mut T
impl<T: ?Sized> const Clone for &T

// core::option
impl<T> const Clone for Option<T>
where
    T: ~const Clone + ~const Drop

// core::result
impl<T, E> const Clone for Result<T, E>
where
    T: ~const Clone + ~const Drop,
    E: ~const Clone + ~const Drop,

// core::convert
impl const Clone for Infallible

// core::ptr
impl<T: ?Sized> const Clone for NonNull<T>
impl<T: ?Sized> const Clone for Unique<T>
```

2 years agoPermit `#[deprecated]` in stdlib
Jacob Pratt [Sat, 5 Mar 2022 02:59:18 +0000 (21:59 -0500)]
Permit `#[deprecated]` in stdlib

2 years agoNew `deprecated_suggestion` feature, use in tests
Jacob Pratt [Wed, 16 Feb 2022 23:48:33 +0000 (18:48 -0500)]
New `deprecated_suggestion` feature, use in tests

2 years agoAuto merge of #94779 - GuillaumeGomez:ci-spurious-failures, r=Dylan-DPC
bors [Wed, 9 Mar 2022 20:29:12 +0000 (20:29 +0000)]
Auto merge of #94779 - GuillaumeGomez:ci-spurious-failures, r=Dylan-DPC

Fix spurious CI failures

This should fix the CI error encountered in https://github.com/rust-lang/rust/pull/94774 (and multiple others).

cc `@nikic`

2 years agoFix spurious CI failures
Guillaume Gomez [Wed, 9 Mar 2022 19:47:16 +0000 (20:47 +0100)]
Fix spurious CI failures

2 years agoAdd tracking issue
fren_gor [Wed, 9 Mar 2022 20:12:07 +0000 (21:12 +0100)]
Add tracking issue

2 years agoImplement macro meta-variable expressions
Caio [Wed, 9 Mar 2022 19:46:23 +0000 (16:46 -0300)]
Implement macro meta-variable expressions

2 years agoWarn users about || in let chain expressions
Caio [Wed, 9 Mar 2022 18:04:09 +0000 (15:04 -0300)]
Warn users about || in let chain expressions

2 years agodiagnostics: use rustc_on_unimplemented to recommend `[].iter()`
Michael Howell [Tue, 8 Mar 2022 18:04:20 +0000 (11:04 -0700)]
diagnostics: use rustc_on_unimplemented to recommend `[].iter()`

To make this work, the `#[rustc_on_unimplemented]` data needs to be used to
report method resolution errors, which is most of what this commit does.

Fixes #94581

2 years agoAdd miri to the well known conditional compilation names and values
Loïc BRANSTETT [Wed, 9 Mar 2022 15:52:38 +0000 (16:52 +0100)]
Add miri to the well known conditional compilation names and values

2 years agoAdd documentation about lifetimes to thread::scope.
Mara Bos [Wed, 9 Mar 2022 09:17:49 +0000 (10:17 +0100)]
Add documentation about lifetimes to thread::scope.

2 years agokeep ERROR in message
b-naber [Wed, 9 Mar 2022 12:49:53 +0000 (13:49 +0100)]
keep ERROR in message

2 years agoAlso take in account mdbook redirect in linkchecker
Loïc BRANSTETT [Wed, 9 Mar 2022 10:18:28 +0000 (11:18 +0100)]
Also take in account mdbook redirect in linkchecker

2 years agomanually bless 32-bit stderr
b-naber [Wed, 9 Mar 2022 11:16:33 +0000 (12:16 +0100)]
manually bless 32-bit stderr

2 years agoIgnore `close_read_wakes_up` test on SGX platform
Raoul Strackx [Wed, 9 Mar 2022 11:28:02 +0000 (12:28 +0100)]
Ignore `close_read_wakes_up` test on SGX platform

2 years agoAdd soundness test for dropping scoped thread results before joining.
Mara Bos [Wed, 9 Mar 2022 10:47:53 +0000 (11:47 +0100)]
Add soundness test for dropping scoped thread results before joining.

2 years agoRemove outdated comment.
Mara Bos [Wed, 9 Mar 2022 10:47:46 +0000 (11:47 +0100)]
Remove outdated comment.

2 years agoProperly abort when thread result panics on drop.
Mara Bos [Sat, 5 Mar 2022 17:07:20 +0000 (18:07 +0100)]
Properly abort when thread result panics on drop.

2 years agoFix soundness issue in scoped threads.
Mara Bos [Sat, 5 Mar 2022 16:19:04 +0000 (17:19 +0100)]
Fix soundness issue in scoped threads.

2 years agonormalization change and rebase
b-naber [Tue, 8 Mar 2022 14:05:50 +0000 (15:05 +0100)]
normalization change and rebase

2 years agoRename is_{some,ok,err}_with to is_{some,ok,err}_and.
Mara Bos [Wed, 9 Mar 2022 10:20:36 +0000 (11:20 +0100)]
Rename is_{some,ok,err}_with to is_{some,ok,err}_and.

2 years agobless tests
b-naber [Wed, 16 Feb 2022 09:56:01 +0000 (10:56 +0100)]
bless tests

2 years agotreat all mir::Constant values as ConstantKind::Val
b-naber [Wed, 16 Feb 2022 09:54:36 +0000 (10:54 +0100)]
treat all mir::Constant values as ConstantKind::Val

2 years agoEnable issue-23036.rs on wasm32
Nikita Popov [Wed, 9 Mar 2022 09:03:58 +0000 (10:03 +0100)]
Enable issue-23036.rs on wasm32

2 years agoUse new pass manager on s390x with LLVM 14
Nikita Popov [Wed, 9 Mar 2022 09:00:07 +0000 (10:00 +0100)]
Use new pass manager on s390x with LLVM 14

The problematic compile-time issue should be resolved with this
version.

2 years agoAuto merge of #94515 - estebank:tweak-move-error, r=davidtwco
bors [Wed, 9 Mar 2022 08:58:47 +0000 (08:58 +0000)]
Auto merge of #94515 - estebank:tweak-move-error, r=davidtwco

Tweak move error

Point at method definition that causes type to be consumed.

Fix #94056.

2 years agoUpdate LLVM submodule
Nikita Popov [Wed, 9 Mar 2022 08:51:12 +0000 (09:51 +0100)]
Update LLVM submodule

2 years agoAuto merge of #94761 - Dylan-DPC:rollup-v4emqsy, r=Dylan-DPC
bors [Wed, 9 Mar 2022 06:30:19 +0000 (06:30 +0000)]
Auto merge of #94761 - Dylan-DPC:rollup-v4emqsy, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #94312 (Edit `rustc_trait_selection::infer::lattice` docs)
 - #94583 (Add a team for '`@rustbot` ping fuchsia')
 - #94686 (Do not allow `#[rustc_legacy_const_generics]` on methods)
 - #94699 (BTree: remove dead data needlessly complicating insert)
 - #94756 (Use `unreachable!` for an unreachable code path)
 - #94759 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #94759 - ehuss:update-cargo, r=ehuss
Dylan DPC [Wed, 9 Mar 2022 05:38:53 +0000 (06:38 +0100)]
Rollup merge of #94759 - ehuss:update-cargo, r=ehuss

Update cargo

11 commits in 3d6970d50e30e797b8e26b2b9b1bdf92dc381f34..65c82664263feddc5fe2d424be0993c28d46377a
2022-02-28 19:29:07 +0000 to 2022-03-09 02:32:56 +0000
- Remove remaining 2 warn(clippy::*) instances (rust-lang/cargo#10438)
- Use `available_parallelism` instead of `num_cpus` (rust-lang/cargo#10427)
- Wait up to one second while waiting for curl (rust-lang/cargo#10456)
- Improve code coverage (rust-lang/cargo#10460)
- Don't recommend leaking tokens into the console history (rust-lang/cargo#10458)
- fix some typos (rust-lang/cargo#10454)
- Use `extend` instead of `push`ing in a loop (rust-lang/cargo#10453)
- Use locked_version more (rust-lang/cargo#10449)
- Disable dependabot (rust-lang/cargo#10443)
- Update git2 dependencies (rust-lang/cargo#10442)
- Stop gating stable features (rust-lang/cargo#10434)

2 years agoRollup merge of #94756 - ChrisDenton:unreachable, r=yaahc
Dylan DPC [Wed, 9 Mar 2022 05:38:53 +0000 (06:38 +0100)]
Rollup merge of #94756 - ChrisDenton:unreachable, r=yaahc

Use `unreachable!` for an unreachable code path

Closes #73212

2 years agoRollup merge of #94699 - ssomers:btree_prune_insert, r=Dylan-DPC
Dylan DPC [Wed, 9 Mar 2022 05:38:52 +0000 (06:38 +0100)]
Rollup merge of #94699 - ssomers:btree_prune_insert, r=Dylan-DPC

BTree: remove dead data needlessly complicating insert

Possibly needless instructions generated

r? rust-lang/libs
r? ``@Amanieu``
cc ``@frank-king``

2 years agoRollup merge of #94686 - ChayimFriedman2:issue-94629, r=jackh726
Dylan DPC [Wed, 9 Mar 2022 05:38:51 +0000 (06:38 +0100)]
Rollup merge of #94686 - ChayimFriedman2:issue-94629, r=jackh726

Do not allow `#[rustc_legacy_const_generics]` on methods

It caused an ICE since `item` was `None`.

Fixes #94629.

2 years agoRollup merge of #94583 - dtolnay:fuchsia, r=Mark-Simulacrum
Dylan DPC [Wed, 9 Mar 2022 05:38:50 +0000 (06:38 +0100)]
Rollup merge of #94583 - dtolnay:fuchsia, r=Mark-Simulacrum

Add a team for '@rustbot ping fuchsia'

I was looking for this in response to https://github.com/rust-lang/rust/pull/93858#issuecomment-1041367498.

Depends on https://github.com/rust-lang/team/pull/710.

2 years agoRollup merge of #94312 - pierwill:fix-94311-lattice-docs, r=jackh726
Dylan DPC [Wed, 9 Mar 2022 05:38:50 +0000 (06:38 +0100)]
Rollup merge of #94312 - pierwill:fix-94311-lattice-docs, r=jackh726

Edit `rustc_trait_selection::infer::lattice` docs

Closes #94311.

Removes mentions of outdated/missing type and filename (`infer.rs` and `LatticeValue`).

2 years agoUpdate cargo
Eric Huss [Wed, 9 Mar 2022 04:28:22 +0000 (20:28 -0800)]
Update cargo

2 years agoAuto merge of #94750 - cuviper:dirent64_min, r=joshtriplett
bors [Wed, 9 Mar 2022 02:17:58 +0000 (02:17 +0000)]
Auto merge of #94750 - cuviper:dirent64_min, r=joshtriplett

unix: reduce the size of DirEntry

On platforms where we call `readdir` instead of `readdir_r`, we store
the name as an allocated `CString` for variable length. There's no point
carrying around a full `dirent64` with its fixed-length `d_name` too.

2 years agoUse `unreachable!` for an unreachable code path
Chris Denton [Wed, 9 Mar 2022 00:47:24 +0000 (00:47 +0000)]
Use `unreachable!` for an unreachable code path

2 years agoImprove rustdoc book
Loïc BRANSTETT [Tue, 8 Mar 2022 22:11:37 +0000 (23:11 +0100)]
Improve rustdoc book

2 years agoUpdate GUI tests for impl blocks path changes
Guillaume Gomez [Tue, 8 Mar 2022 17:11:29 +0000 (18:11 +0100)]
Update GUI tests for impl blocks path changes

2 years agoUnify inherent impl blocks by wrapping them into a div
Guillaume Gomez [Tue, 8 Mar 2022 16:40:24 +0000 (17:40 +0100)]
Unify inherent impl blocks by wrapping them into a div