]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #91291 - GuillaumeGomez:const-deref-method, r=camelid
bors [Thu, 2 Dec 2021 06:11:05 +0000 (06:11 +0000)]
Auto merge of #91291 - GuillaumeGomez:const-deref-method, r=camelid

Fix const deref methods display

Fixes https://github.com/rust-lang/rust/issues/90855 (more information in the issue).

r? `@camelid`

2 years agoAuto merge of #91003 - psumbera:sparc64-abi, r=nagisa
bors [Thu, 2 Dec 2021 02:59:44 +0000 (02:59 +0000)]
Auto merge of #91003 - psumbera:sparc64-abi, r=nagisa

fix sparc64 ABI for aggregates with floating point members

Fixes #86163

2 years agoAuto merge of #90446 - cjgillot:late-elided, r=jackh726
bors [Wed, 1 Dec 2021 23:22:43 +0000 (23:22 +0000)]
Auto merge of #90446 - cjgillot:late-elided, r=jackh726

Lint elided lifetimes in path during lifetime resolution.

The lifetime elision lint is known to be brittle and can be redundant with later lifetime resolution errors. This PR aims to remove the redundancy by performing the lint after lifetime resolution.

This PR proposes to carry the information that an elision should be linted against by using a special `LifetimeName`. I am not certain this is the best solution, but it is certainly the easiest.

Fixes https://github.com/rust-lang/rust/issues/60199
Fixes https://github.com/rust-lang/rust/issues/55768
Fixes https://github.com/rust-lang/rust/issues/63110
Fixes https://github.com/rust-lang/rust/issues/71957

2 years agoAuto merge of #91433 - matthiaskrgr:rollup-118ql06, r=matthiaskrgr
bors [Wed, 1 Dec 2021 20:14:07 +0000 (20:14 +0000)]
Auto merge of #91433 - matthiaskrgr:rollup-118ql06, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #88502 (Add slice take methods)
 - #91313 (expand: Turn `ast::Crate` into a first class expansion target)
 - #91424 (Update LLVM with patches for better llvm-cov diagnostics)
 - #91425 (Include lint errors in error count for `-Ztreat-err-as-bug`)
 - #91430 (Add tests for `normalize-docs` overflow errors)

Failed merges:

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

2 years agoRollup merge of #91430 - jyn514:normalize-fallible, r=jackh726
Matthias Krüger [Wed, 1 Dec 2021 19:57:48 +0000 (20:57 +0100)]
Rollup merge of #91430 - jyn514:normalize-fallible, r=jackh726

Add tests for `normalize-docs` overflow errors

`@b-naber` do you understand why using `try_normalize_erasing_regions` doesn't silence these cycle errors? Rustdoc isn't emitting them, rustc is aborting before returning an error, even though the function has `try_` in the name.

cc https://github.com/rust-lang/rust/issues/82692, https://github.com/rust-lang/rust/pull/91255

2 years agoRollup merge of #91425 - jyn514:treat-lint-err-as-bug, r=oli-obk
Matthias Krüger [Wed, 1 Dec 2021 19:57:47 +0000 (20:57 +0100)]
Rollup merge of #91425 - jyn514:treat-lint-err-as-bug, r=oli-obk

Include lint errors in error count for `-Ztreat-err-as-bug`

This was a regression from https://github.com/rust-lang/rust/pull/87337;
the `panic_if_treat_err_as_bug` function only checked the number of hard
errors, not the number of lint errors.

r? `@oli-obk`

2 years agoRollup merge of #91424 - richkadel:llvm-patch-instrproferror, r=tmandry
Matthias Krüger [Wed, 1 Dec 2021 19:57:46 +0000 (20:57 +0100)]
Rollup merge of #91424 - richkadel:llvm-patch-instrproferror, r=tmandry

Update LLVM with patches for better llvm-cov diagnostics

Cherry-picks
https://github.com/llvm/llvm-project/commit/ee88b8d63e475a75ae525563edfa95f6fcaac83a
and
https://github.com/llvm/llvm-project/commit/126e7611c70ca41782aa851c2bec132607eb8127

These patches to LLVM were added to help debug occasional errors that
cause coverage reporting to fail. Prior to this patch, the only messaging
was that the coverage data was malformed. Hopefully the improved
messaging will help identify the root cause of these errors, when they
arise, so we can make corrections to coverage output from Rust.

r? `@tmandry`

2 years agoRollup merge of #91313 - petrochenkov:cratexp, r=Aaron1011
Matthias Krüger [Wed, 1 Dec 2021 19:57:43 +0000 (20:57 +0100)]
Rollup merge of #91313 - petrochenkov:cratexp, r=Aaron1011

expand: Turn `ast::Crate` into a first class expansion target

And stop creating a fake `mod` item for the crate root when expanding a crate, thus addressing FIXMEs left in https://github.com/rust-lang/rust/pull/82238, and making a step towards a proper support for crate-level macro attributes (cc #54726).

I haven't added token collection support for the whole crate in this PR, maybe later.
r? `@Aaron1011`

2 years agoRollup merge of #88502 - ibraheemdev:slice-take, r=dtolnay
Matthias Krüger [Wed, 1 Dec 2021 19:57:42 +0000 (20:57 +0100)]
Rollup merge of #88502 - ibraheemdev:slice-take, r=dtolnay

Add slice take methods

Revival of #62282

This PR adds the following slice methods:

- `take`
- `take_mut`
- `take_first`
- `take_first_mut`
- `take_last`
- `take_last_mut`

r? `@LukasKalbertodt`

2 years agoUse `try_normalize_erasing_regions` instead of a custom infer context
Joshua Nelson [Wed, 1 Dec 2021 19:00:27 +0000 (19:00 +0000)]
Use `try_normalize_erasing_regions` instead of a custom infer context

This unfortunately is still giving an unsilenceable overflow error :(

2 years agoAuto merge of #91275 - camelid:deny-test-warnings, r=jyn514
bors [Wed, 1 Dec 2021 16:41:52 +0000 (16:41 +0000)]
Auto merge of #91275 - camelid:deny-test-warnings, r=jyn514

Deny warnings in rustdoc non-UI tests

These warnings were silently ignored since they did not appear in a
`.stderr` file and did not fail the test. With this change, warnings in
tests are denied, causing the tests to fail if they have warnings.

This change has already led me to find a bug in rustdoc (#91274) and a
useless test (`src/test/rustdoc/primitive/primitive-generic-impl.rs`,
though its uselessness is unrelated to its warnings).

r? `@jyn514`

2 years agoInclude lint errors in error count for `-Ztreat-err-as-bug`
Joshua Nelson [Wed, 1 Dec 2021 16:32:55 +0000 (16:32 +0000)]
Include lint errors in error count for `-Ztreat-err-as-bug`

This was a regression from https://github.com/rust-lang/rust/pull/87337;
the `panic_if_treat_err_as_bug` function only checked the number of hard
errors, not the number of lint errors.

2 years agoUpdate LLVM with patches for better llvm-cov diagnostics
Rich Kadel [Tue, 30 Nov 2021 23:40:55 +0000 (15:40 -0800)]
Update LLVM with patches for better llvm-cov diagnostics

Cherry-picks
https://github.com/llvm/llvm-project/commit/ee88b8d63e475a75ae525563edfa95f6fcaac83a
and
https://github.com/llvm/llvm-project/commit/126e7611c70ca41782aa851c2bec132607eb8127

These patches to LLVM were added to help debug occasional errors that
cause coverage reporting to fail. Prior to this patch, the only messaging
was that the coverage data was malformed. Hopefully the improved
messaging will help identify the root cause of these errors, when they
arise, so we can make corrections to coverage output from Rust.

2 years agoAuto merge of #91255 - b-naber:normalization-ice, r=jackh276
bors [Wed, 1 Dec 2021 13:33:33 +0000 (13:33 +0000)]
Auto merge of #91255 - b-naber:normalization-ice, r=jackh276

Implement version of normalize_erasing_regions that allows for normalization failure

Fixes https://github.com/rust-lang/rust/issues/59324
Fixes https://github.com/rust-lang/rust/issues/67684
Fixes https://github.com/rust-lang/rust/issues/69398
Fixes https://github.com/rust-lang/rust/issues/71113
Fixes https://github.com/rust-lang/rust/issues/82079
Fixes #85103
Fixes https://github.com/rust-lang/rust/issues/88856
Fixes #91231
Fixes https://github.com/rust-lang/rust/issues/91234

Previously we called `normalize_erasing_regions` inside `layout_of`. `normalize_erasing_regions` assumes that the normalization succeeds. Since some `layout_of` calls happen before typecheck has finished, we introduce a new variant that allows for returning an error.

2 years agorebase
b-naber [Wed, 1 Dec 2021 12:14:19 +0000 (13:14 +0100)]
rebase

2 years agoaddress review
b-naber [Tue, 30 Nov 2021 23:20:57 +0000 (00:20 +0100)]
address review

2 years agofix query description
b-naber [Fri, 26 Nov 2021 22:41:22 +0000 (23:41 +0100)]
fix query description

2 years agoremove static_assert_size on InterpError
b-naber [Fri, 26 Nov 2021 22:39:48 +0000 (23:39 +0100)]
remove static_assert_size on InterpError

2 years agomore fixed issues
b-naber [Fri, 26 Nov 2021 22:37:24 +0000 (23:37 +0100)]
more fixed issues

2 years agoadd tests and bless existing ones
b-naber [Fri, 26 Nov 2021 17:37:29 +0000 (18:37 +0100)]
add tests and bless existing ones

2 years agoimplement version of normalize_erasing_regions that doesn't assume value is normalizable
b-naber [Fri, 26 Nov 2021 16:41:22 +0000 (17:41 +0100)]
implement version of normalize_erasing_regions that doesn't assume value is normalizable

2 years agoAuto merge of #91418 - matthiaskrgr:rollup-vn9f9w3, r=matthiaskrgr
bors [Wed, 1 Dec 2021 09:51:00 +0000 (09:51 +0000)]
Auto merge of #91418 - matthiaskrgr:rollup-vn9f9w3, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #87160 (When recovering from a `:` in a pattern, use adequate AST pattern)
 - #90985 (Use `get_diagnostic_name` more)
 - #91087 (Remove all migrate.nll.stderr files)
 - #91207 (Add support for LLVM coverage mapping format versions 5 and 6)
 - #91298 (Improve error message for `E0659` if the source is not available)
 - #91346 (Add `Option::inspect` and `Result::{inspect, inspect_err}`)
 - #91404 (Fix bad `NodeId` limit checking.)

Failed merges:

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

2 years agoRollup merge of #91404 - nnethercote:fix-bad-NodeId-limit-checking, r=dtolnay
Matthias Krüger [Wed, 1 Dec 2021 09:50:23 +0000 (10:50 +0100)]
Rollup merge of #91404 - nnethercote:fix-bad-NodeId-limit-checking, r=dtolnay

Fix bad `NodeId` limit checking.

`Resolver::next_node_id` converts a `u32` to a `usize` (which is
possibly bigger), does a checked add, and then converts the result back
to a `u32`. The `usize` conversion completely subverts the checked add!

This commit removes the conversion to/from `usize`.

2 years agoRollup merge of #91346 - ibraheemdev:result-inspect, r=dtolnay
Matthias Krüger [Wed, 1 Dec 2021 09:50:22 +0000 (10:50 +0100)]
Rollup merge of #91346 - ibraheemdev:result-inspect, r=dtolnay

Add `Option::inspect` and `Result::{inspect, inspect_err}`

```rust
// core::result

impl Result<T, E> {
    pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self;
    pub fn inspect_err<F: FnOnce(&E)>(self, f: F) -> Self;
}

// core::option

impl Option<T> {
    pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self;
}
```

2 years agoRollup merge of #91298 - FabianWolff:issue-91028-source-avail, r=cjgillot
Matthias Krüger [Wed, 1 Dec 2021 09:50:21 +0000 (10:50 +0100)]
Rollup merge of #91298 - FabianWolff:issue-91028-source-avail, r=cjgillot

Improve error message for `E0659` if the source is not available

Fixes #91028. The fix is similar to those in #89233 and #87088. With this change, instead of the dangling
```
note: `Option` could also refer to the enum defined here
```
I get
```
note: `Option` could also refer to an enum from prelude
```
If the standard library source code _is_ available, the output does not change.

2 years agoRollup merge of #91207 - richkadel:rk-bump-coverage-version, r=tmandry
Matthias Krüger [Wed, 1 Dec 2021 09:50:20 +0000 (10:50 +0100)]
Rollup merge of #91207 - richkadel:rk-bump-coverage-version, r=tmandry

Add support for LLVM coverage mapping format versions 5 and 6

This PR cherry-pick's Swatinem's initial commit in unsubmitted PR #90047.

My additional commit augments Swatinem's great starting point, but adds full support for LLVM
Coverage Mapping Format version 6, conditionally, if compiling with LLVM 13.

Version 6 requires adding the compilation directory when file paths are
relative, and since Rustc coverage maps use relative paths, we should
add the expected compilation directory entry.

Note, however, that with the compilation directory, coverage reports
from `llvm-cov show` can now report file names (when the report includes
more than one file) with the full absolute path to the file.

This would be a problem for test results, but the workaround (for the
rust coverage tests) is to include an additional `llvm-cov show`
parameter: `--compilation-dir=.`

2 years agoRollup merge of #91087 - rukai:fix_test_nll_revisions, r=jackh726
Matthias Krüger [Wed, 1 Dec 2021 09:50:19 +0000 (10:50 +0100)]
Rollup merge of #91087 - rukai:fix_test_nll_revisions, r=jackh726

Remove all migrate.nll.stderr files

There are a few ui tests that setup the revisions like:
```rust
// revisions: migrate nll`
// [nll]compile-flags: -Zborrowck=mir
```

However most of them fail to disable the nll compare mode like this:
```rust
// ignore-compare-mode-nll
```

This ends up generating confusing files ending in `.migrate.nll.stderr` because the nll compare mode is run on top of the migrate revision.

This PR fixes this by adding `ignore-compare-mode-nll` to these tests.

I would have just made these tests use compare modes instead but I assume the reason these tests are messing around with revisions instead of just letting the nll compare mode do its thing is to enforce error annotations for both migrate and nll.
Relying on just compare modes would only have the error annotations for migrate.

2 years agoRollup merge of #90985 - camsteffen:diag-name-usage, r=jackh726
Matthias Krüger [Wed, 1 Dec 2021 09:50:18 +0000 (10:50 +0100)]
Rollup merge of #90985 - camsteffen:diag-name-usage, r=jackh726

Use `get_diagnostic_name` more

2 years agoRollup merge of #87160 - estebank:colon-recovery, r=nagisa
Matthias Krüger [Wed, 1 Dec 2021 09:50:18 +0000 (10:50 +0100)]
Rollup merge of #87160 - estebank:colon-recovery, r=nagisa

When recovering from a `:` in a pattern, use adequate AST pattern

If the suggestion to use `::` instead of `:` in the pattern isn't correct, a second resolution error will be emitted.

2 years agofix sparc64 ABI for aggregates with floating point members
Petr Sumbera [Wed, 1 Dec 2021 09:03:45 +0000 (10:03 +0100)]
fix sparc64 ABI for aggregates with floating point members

2 years agoAuto merge of #91324 - eggyal:avoid-uneccesary-clone-of-annotatable, r=Aaron1011
bors [Wed, 1 Dec 2021 06:18:39 +0000 (06:18 +0000)]
Auto merge of #91324 - eggyal:avoid-uneccesary-clone-of-annotatable, r=Aaron1011

Avoid uneccessary clone of Annotatable

Addresses FIXME comment created in #82608

r? `@Aaron1011`

2 years agoFix bad `NodeId` limit checking.
Nicholas Nethercote [Tue, 30 Nov 2021 20:22:29 +0000 (07:22 +1100)]
Fix bad `NodeId` limit checking.

`Resolver::next_node_id` converts a `u32` to a `usize` (which is
possibly bigger), does a checked add, and then converts the result back
to a `u32`. The `usize` conversion completely subverts the checked add!

This commit removes the conversion to/from `usize`.

2 years agoAuto merge of #91406 - matthiaskrgr:rollup-a2whn8m, r=matthiaskrgr
bors [Wed, 1 Dec 2021 02:51:15 +0000 (02:51 +0000)]
Auto merge of #91406 - matthiaskrgr:rollup-a2whn8m, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #91294 (Visit type in process_projection_elem.)
 - #91340 (Bump compiler_builtins to 0.1.55 to bring in fixes for targets lackin…)
 - #91366 (Only show notable traits if both types are the same)
 - #91397 (Emit a warning on generic parameters with doc comments)

Failed merges:

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

2 years agoRollup merge of #91397 - jyn514:generic-param-docs, r=wesleywiser
Matthias Krüger [Tue, 30 Nov 2021 22:43:33 +0000 (23:43 +0100)]
Rollup merge of #91397 - jyn514:generic-param-docs, r=wesleywiser

Emit a warning on generic parameters with doc comments

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

2 years agoRollup merge of #91366 - notriddle:notriddle/only-show-notable-if-types-are-the-same...
Matthias Krüger [Tue, 30 Nov 2021 22:43:32 +0000 (23:43 +0100)]
Rollup merge of #91366 - notriddle:notriddle/only-show-notable-if-types-are-the-same, r=GuillaumeGomez

Only show notable traits if both types are the same

Checking only their DefId doesn't work because all slices have the same
fake DefId.

Fixes #91347

2 years agoRollup merge of #91340 - cr1901:no-atomic, r=Mark-Simulacrum
Matthias Krüger [Tue, 30 Nov 2021 22:43:31 +0000 (23:43 +0100)]
Rollup merge of #91340 - cr1901:no-atomic, r=Mark-Simulacrum

Bump compiler_builtins to 0.1.55 to bring in fixes for targets lackin…

…g atomic support.

This fixes a "Cannot select" LLVM error when compiling `compiler_builtins` for targets lacking atomics, like MSP430. Se https://github.com/rust-lang/compiler-builtins/issues/441 for more info. This PR is a more general version of #91248.

2 years agoRollup merge of #91294 - cjgillot:process-elem, r=jackh726
Matthias Krüger [Tue, 30 Nov 2021 22:43:31 +0000 (23:43 +0100)]
Rollup merge of #91294 - cjgillot:process-elem, r=jackh726

Visit type in process_projection_elem.

Instead of reimplementing it for each visitor.

2 years agoMerge Implicit and ImplicitMissing.
Camille GILLOT [Fri, 26 Nov 2021 22:07:21 +0000 (23:07 +0100)]
Merge Implicit and ImplicitMissing.

2 years agoHandle `allow(elided_lifetimes_in_paths)`.
Camille GILLOT [Sun, 31 Oct 2021 17:39:39 +0000 (18:39 +0100)]
Handle `allow(elided_lifetimes_in_paths)`.

2 years agoComplete test.
Camille GILLOT [Sun, 31 Oct 2021 17:24:55 +0000 (18:24 +0100)]
Complete test.

2 years agoSimplify lowering.
Camille GILLOT [Sun, 31 Oct 2021 16:54:47 +0000 (17:54 +0100)]
Simplify lowering.

2 years agoLint elided lifetimes in path during lifetime resolution.
Camille GILLOT [Sun, 11 Jul 2021 13:04:57 +0000 (15:04 +0200)]
Lint elided lifetimes in path during lifetime resolution.

2 years agoFlatten match.
Camille GILLOT [Sun, 31 Oct 2021 16:21:32 +0000 (17:21 +0100)]
Flatten match.

2 years agoMove report_elision_failure in diagnostics.rs.
Camille GILLOT [Sun, 31 Oct 2021 16:11:28 +0000 (17:11 +0100)]
Move report_elision_failure in diagnostics.rs.

2 years agoAdd conditional support for coverage map version 6
Rich Kadel [Thu, 25 Nov 2021 00:58:49 +0000 (16:58 -0800)]
Add conditional support for coverage map version 6

This commit augments Swatinem's initial commit in uncommitted PR #90047,
which was a great starting point, but did not fully support LLVM
Coverage Mapping Format version 6.

Version 6 requires adding the compilation directory when file paths are
relative, and since Rustc coverage maps use relative paths, we should
add the expected compilation directory entry.

Note, however, that with the compilation directory, coverage reports
from `llvm-cov show` can now report file names (when the report includes
more than one file) with the full absolute path to the file.

This would be a problem for test results, but the workaround (for the
rust coverage tests) is to include an additional `llvm-cov show`
parameter: `--compilation-dir=.`

2 years agoReturn ConstStability instead of &ConstStability in Item::const_stability
Guillaume Gomez [Mon, 29 Nov 2021 09:24:51 +0000 (10:24 +0100)]
Return ConstStability instead of &ConstStability in Item::const_stability

2 years agoImprove code by replacing &str with Symbol in render_stability_since_raw
Guillaume Gomez [Mon, 29 Nov 2021 09:20:11 +0000 (10:20 +0100)]
Improve code by replacing &str with Symbol in render_stability_since_raw

2 years agoAdd test for const deref methods display
Guillaume Gomez [Sat, 27 Nov 2021 13:38:15 +0000 (14:38 +0100)]
Add test for const deref methods display

2 years agoFix display for "const" deref methods in rustdoc
Guillaume Gomez [Sat, 27 Nov 2021 13:37:30 +0000 (14:37 +0100)]
Fix display for "const" deref methods in rustdoc

2 years agoUpdate src/librustdoc/clean/types.rs
Michael Howell [Tue, 30 Nov 2021 21:22:15 +0000 (14:22 -0700)]
Update src/librustdoc/clean/types.rs

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2 years agoUpdate src/librustdoc/clean/types.rs
Michael Howell [Tue, 30 Nov 2021 21:22:03 +0000 (14:22 -0700)]
Update src/librustdoc/clean/types.rs

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2 years agoEmit a warning on generic parameters with doc comments
Joshua Nelson [Tue, 30 Nov 2021 18:47:01 +0000 (18:47 +0000)]
Emit a warning on generic parameters with doc comments

2 years agoAuto merge of #91352 - nnethercote:RawVec-reserve_for_push, r=dtolnay
bors [Tue, 30 Nov 2021 13:52:38 +0000 (13:52 +0000)]
Auto merge of #91352 - nnethercote:RawVec-reserve_for_push, r=dtolnay

Introduce `RawVec::reserve_for_push`.

If `Vec::push`'s capacity check fails it calls `RawVec::reserve`, which
then also does a capacity check.

This commit introduces `reserve_for_push` which skips the redundant
capacity check, for some slight compile time speed-ups.

I tried lots of minor variations on this, e.g. different inlining
attributes. This was the best one I could find.

r? `@ghost`

2 years agoAuto merge of #91388 - JohnTitor:rollup-640o1e5, r=JohnTitor
bors [Tue, 30 Nov 2021 10:45:22 +0000 (10:45 +0000)]
Auto merge of #91388 - JohnTitor:rollup-640o1e5, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #91243 (Don't treat unnormalized function arguments as well-formed)
 - #91250 (Refactor EmitterWriter::emit_suggestion_default )
 - #91317 (tests: Ignore `test/debuginfo/rc_arc.rs` on windows-gnu)
 - #91323 (CTFE: support assert_zero_valid and assert_uninit_valid)
 - #91358 (Fix small typo)
 - #91360 (:arrow_up: rust-analyzer)
 - #91368 (Don't re-export `MirPass`)
 - #91383 (Add `drop_while` as doc alias to `Iterator::skip_while`)

Failed merges:

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

2 years agoRollup merge of #91383 - ScriptDevil:drop-while-doc-alias, r=joshtriplett
Yuki Okushi [Tue, 30 Nov 2021 08:29:13 +0000 (17:29 +0900)]
Rollup merge of #91383 - ScriptDevil:drop-while-doc-alias, r=joshtriplett

Add `drop_while` as doc alias to `Iterator::skip_while`

`skip_while` is commonly referred to as `drop_while` in other languages (clojure/c++/haskell). This recently came up in [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.E2.9C.94.20DropWhile/near/262203352) as well.

This pull request adds 'drop_while' as a doc-alias for 'skip_while'.

r? `@joshtriplett`

2 years agoRollup merge of #91368 - ecstatic-morse:mir-pass-reexport, r=cjgillot
Yuki Okushi [Tue, 30 Nov 2021 08:29:12 +0000 (17:29 +0900)]
Rollup merge of #91368 - ecstatic-morse:mir-pass-reexport, r=cjgillot

Don't re-export `MirPass`

`rust-analyzer` wants to use the `rustc_const_eval` one by default, which is weird.

r? ``@cjgillot``

2 years agoRollup merge of #91360 - lnicola:rust-analyzer-2021-11-29, r=lnicola
Yuki Okushi [Tue, 30 Nov 2021 08:29:11 +0000 (17:29 +0900)]
Rollup merge of #91360 - lnicola:rust-analyzer-2021-11-29, r=lnicola

:arrow_up: rust-analyzer

r? ```@ghost```

2 years agoRollup merge of #91358 - kd-collective:fix_typo, r=cjgillot
Yuki Okushi [Tue, 30 Nov 2021 08:29:10 +0000 (17:29 +0900)]
Rollup merge of #91358 - kd-collective:fix_typo, r=cjgillot

Fix small typo

Fix a typo in code commenting!
`accross` -> `across`

2 years agoRollup merge of #91323 - RalfJung:assert-type, r=oli-obk
Yuki Okushi [Tue, 30 Nov 2021 08:29:09 +0000 (17:29 +0900)]
Rollup merge of #91323 - RalfJung:assert-type, r=oli-obk

CTFE: support assert_zero_valid and assert_uninit_valid

This ensures the implementation of all three type-based assert_ intrinsics remains consistent in Miri.

`assert_inhabited` recently got stabilized in https://github.com/rust-lang/rust/pull/90896 (meaning stable `const fn` can call it), so do the same with these other intrinsics.

Cc ```@rust-lang/wg-const-eval```

2 years agoRollup merge of #91317 - petrochenkov:debugnu, r=Mark-Simulacrum
Yuki Okushi [Tue, 30 Nov 2021 08:29:08 +0000 (17:29 +0900)]
Rollup merge of #91317 - petrochenkov:debugnu, r=Mark-Simulacrum

tests: Ignore `test/debuginfo/rc_arc.rs` on windows-gnu

The tests checks some pretty-printer output, but pretty-printers are not embedded on windows-gnu.

Regressed in https://github.com/rust-lang/rust/pull/85448.

2 years agoRollup merge of #91250 - rukai:remove_trailing_whitespace, r=wesleywiser
Yuki Okushi [Tue, 30 Nov 2021 08:29:07 +0000 (17:29 +0900)]
Rollup merge of #91250 - rukai:remove_trailing_whitespace, r=wesleywiser

Refactor EmitterWriter::emit_suggestion_default

Makes progress towards https://github.com/rust-lang/rust/issues/89979

Split into 2 commits:
* the first commit is purely a refactor and I verified that `./x.py test src/test/ui --stage 1` and  `./x.py test src/test/rustdoc-ui --stage 1` continue to pass on this commit.
* ~~the second commit removes the empty trailing line from diff style suggestions.~~ - I discovered an issue with this so its just the refactor now.

r? diagnostics

2 years agoRollup merge of #91243 - jackh726:issue-91068, r=nikomatsakis
Yuki Okushi [Tue, 30 Nov 2021 08:29:06 +0000 (17:29 +0900)]
Rollup merge of #91243 - jackh726:issue-91068, r=nikomatsakis

Don't treat unnormalized function arguments as well-formed

Partial revert of #88312

r? ``@pnkfelix``
cc ``@nikomatsakis``

2 years agoAuto merge of #91330 - cjgillot:no-ee-features, r=Aaron1011
bors [Tue, 30 Nov 2021 07:40:08 +0000 (07:40 +0000)]
Auto merge of #91330 - cjgillot:no-ee-features, r=Aaron1011

Remove eval_always for lib_features.

r? `@Aaron1011`

2 years agoAdd `drop_while` as doc alias to `Iterator::skip_while`
Ashok Gautham Jadatharan [Tue, 30 Nov 2021 04:57:16 +0000 (10:27 +0530)]
Add `drop_while` as doc alias to `Iterator::skip_while`

2 years agoAuto merge of #91379 - ehuss:update-cargo, r=ehuss
bors [Tue, 30 Nov 2021 04:15:31 +0000 (04:15 +0000)]
Auto merge of #91379 - ehuss:update-cargo, r=ehuss

Update cargo

6 commits in 7f08ace4f1305de7f3b1b0e2f765911957226bd4..294967c53f0c70d598fc54ca189313c86c576ea7
2021-11-24 17:54:39 +0000 to 2021-11-29 19:04:22 +0000
- Fix some tests with output collisions. (rust-lang/cargo#10137)
- Description of the targets that can be applied (rust-lang/cargo#10109)
- Improve unused patch message when source URLs mismatched (rust-lang/cargo#10130)
- Add a note about doctest xcompile. (rust-lang/cargo#10132)
- book: add edit links to specific pages (rust-lang/cargo#10124)
- Add crate type flag to rustc command (rust-lang/cargo#10093)

2 years agoUpdate cargo
Eric Huss [Tue, 30 Nov 2021 02:11:17 +0000 (18:11 -0800)]
Update cargo

2 years agoAuto merge of #91244 - dtolnay:lossy, r=Mark-Simulacrum
bors [Tue, 30 Nov 2021 01:08:56 +0000 (01:08 +0000)]
Auto merge of #91244 - dtolnay:lossy, r=Mark-Simulacrum

Eliminate bunch of copies of error codepath from Utf8LossyChunksIter

Using a macro to stamp out 7 identical copies of the nontrivial slicing logic to exit this loop didn't seem like a necessary use of a macro. The early return case can be handled by `break` without practically any changes to the logic inside the loop.

All this code is from early 2014 (#12062&mdash;nearly 8 years ago; pre-1.0) so it's possible there were compiler limitations that forced the macro way at the time.

Confirmed that `x.py bench library/alloc --stage 0 --test-args from_utf8_lossy` is unaffected on my machine.

2 years agoRemove all migrate.nll.stderr files
Lucas Kent [Sat, 20 Nov 2021 12:13:40 +0000 (23:13 +1100)]
Remove all migrate.nll.stderr files

2 years agoIntroduce `RawVec::reserve_for_push`.
Nicholas Nethercote [Mon, 29 Nov 2021 10:15:51 +0000 (21:15 +1100)]
Introduce `RawVec::reserve_for_push`.

If `Vec::push`'s capacity check fails it calls `RawVec::reserve`, which
then also does a capacity check.

This commit introduces `reserve_for_push` which skips the redundant
capacity check, for some slight compile time speed-ups.

I tried lots of minor variations on this, e.g. different inlining
attributes. This was the best one I could find.

2 years agoDon't re-export `MirPass`
Dylan MacKenzie [Mon, 29 Nov 2021 20:58:15 +0000 (12:58 -0800)]
Don't re-export `MirPass`

2 years agoBless nll
Jack Huey [Mon, 29 Nov 2021 20:24:44 +0000 (15:24 -0500)]
Bless nll

2 years agoOnly show notable traits if both types are the same
Michael Howell [Mon, 29 Nov 2021 19:18:57 +0000 (12:18 -0700)]
Only show notable traits if both types are the same

Checking only their DefId doesn't work because all slices have the same
fake DefId.

Fixes #91347

2 years agoreview comments: clean up
Esteban Kuber [Sun, 21 Nov 2021 04:56:32 +0000 (04:56 +0000)]
review comments: clean up

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 29 Nov 2021 16:53:28 +0000 (18:53 +0200)]
:arrow_up: rust-analyzer

2 years agoCTFE: support assert_zero_valid and assert_uninit_valid
Ralf Jung [Sun, 28 Nov 2021 18:00:37 +0000 (13:00 -0500)]
CTFE: support assert_zero_valid and assert_uninit_valid

2 years agoFix small typo
kijima [Mon, 29 Nov 2021 16:31:10 +0000 (01:31 +0900)]
Fix small typo

2 years agoAuto merge of #91299 - cjgillot:expect-ldid, r=petrochenkov
bors [Mon, 29 Nov 2021 15:02:01 +0000 (15:02 +0000)]
Auto merge of #91299 - cjgillot:expect-ldid, r=petrochenkov

Take a LocalDefId in expect_*item.

Items and item-likes are always HIR owners.
When trying to find such nodes, there is no ambiguity, the `LocalDefId` and the `HirId::owner` always match.
In such cases, `local_def_id_to_hir_id` does not carry any meaningful information, so we can just skip calling it altogether.

2 years agoAuto merge of #91350 - matthiaskrgr:rollup-nleabdj, r=matthiaskrgr
bors [Mon, 29 Nov 2021 10:34:52 +0000 (10:34 +0000)]
Auto merge of #91350 - matthiaskrgr:rollup-nleabdj, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #91049 (Add a caveat to std::os::windows::fs::symlink_file)
 - #91281 (Add demonstration test for #91161)
 - #91327 (Delete an unreachable codepath from format_args implementation)
 - #91336 (Remove unused root_parent.)
 - #91349 (Accumulate all values of `-C remark` option)

Failed merges:

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

2 years agoRollup merge of #91349 - tmiasko:accumulate-remark-args, r=nikic
Matthias Krüger [Mon, 29 Nov 2021 09:41:38 +0000 (10:41 +0100)]
Rollup merge of #91349 - tmiasko:accumulate-remark-args, r=nikic

Accumulate all values of `-C remark` option

When `-C remark=...` option is specified multiple times,
accumulate all values instead of using only the last one.

r? `@nikic`

2 years agoRollup merge of #91336 - cjgillot:root_parent, r=matthewjasper
Matthias Krüger [Mon, 29 Nov 2021 09:41:37 +0000 (10:41 +0100)]
Rollup merge of #91336 - cjgillot:root_parent, r=matthewjasper

Remove unused root_parent.

2 years agoRollup merge of #91327 - dtolnay:exact, r=michaelwoerister
Matthias Krüger [Mon, 29 Nov 2021 09:41:36 +0000 (10:41 +0100)]
Rollup merge of #91327 - dtolnay:exact, r=michaelwoerister

Delete an unreachable codepath from format_args implementation

2 years agoRollup merge of #91281 - scottmcm:non-exhaustive-as-test, r=Mark-Simulacrum
Matthias Krüger [Mon, 29 Nov 2021 09:41:34 +0000 (10:41 +0100)]
Rollup merge of #91281 - scottmcm:non-exhaustive-as-test, r=Mark-Simulacrum

Add demonstration test for #91161

Since cross-crate things are hard to demonstrate in playground, here's a test showing that something currently works that shouldn't.

cc https://github.com/rust-lang/rust/issues/91161 that tracks fixing the problem (and updating this test)

2 years agoRollup merge of #91049 - dimo414:patch-1, r=kennytm
Matthias Krüger [Mon, 29 Nov 2021 09:41:33 +0000 (10:41 +0100)]
Rollup merge of #91049 - dimo414:patch-1, r=kennytm

Add a caveat to std::os::windows::fs::symlink_file

This is similar to the note on [Python's `os.symlink()`](https://docs.python.org/3/library/os.html#os.symlink). Some additional notes in https://github.com/dimo414/bkt/issues/3.

2 years agoAccumulate all values of `-C remark` option
Tomasz Miąsko [Sat, 13 Nov 2021 00:00:00 +0000 (00:00 +0000)]
Accumulate all values of `-C remark` option

When `-C remark=...` option is specified multiple times,
accumulate all values instead of using only the last one.

2 years agoAuto merge of #91043 - camsteffen:descendant-eq, r=petrochenkov
bors [Mon, 29 Nov 2021 07:46:36 +0000 (07:46 +0000)]
Auto merge of #91043 - camsteffen:descendant-eq, r=petrochenkov

Add fast path to `is_descendant_of`

2 years agoAuto merge of #91344 - RalfJung:miri, r=RalfJung
bors [Mon, 29 Nov 2021 04:40:31 +0000 (04:40 +0000)]
Auto merge of #91344 - RalfJung:miri, r=RalfJung

update Miri

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

2 years agoadd `Option::inspect` and `Result::{inspect, inspect_err}`
Ibraheem Ahmed [Mon, 29 Nov 2021 04:31:32 +0000 (23:31 -0500)]
add `Option::inspect` and `Result::{inspect, inspect_err}`

2 years agoBump compiler_builtins to 0.1.55 to bring in fixes for targets lacking atomic support.
William D. Jones [Sun, 28 Nov 2021 22:53:50 +0000 (17:53 -0500)]
Bump compiler_builtins to 0.1.55 to bring in fixes for targets lacking atomic support.

2 years agoupdate Miri
Ralf Jung [Mon, 29 Nov 2021 01:37:49 +0000 (20:37 -0500)]
update Miri

2 years agoAuto merge of #91338 - matthiaskrgr:rollup-46ry8wi, r=matthiaskrgr
bors [Mon, 29 Nov 2021 01:35:33 +0000 (01:35 +0000)]
Auto merge of #91338 - matthiaskrgr:rollup-46ry8wi, r=matthiaskrgr

Rollup of 3 pull requests

Successful merges:

 - #90131 (Fix a format_args span to be expansion)
 - #90832 (Add 1.57.0 release notes)
 - #90833 (Emit LLVM optimization remarks when enabled with `-Cremark`)

Failed merges:

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

2 years agoRollup merge of #90833 - tmiasko:optimization-remarks, r=nikic
Matthias Krüger [Sun, 28 Nov 2021 22:45:17 +0000 (23:45 +0100)]
Rollup merge of #90833 - tmiasko:optimization-remarks, r=nikic

Emit LLVM optimization remarks when enabled with `-Cremark`

The default diagnostic handler considers all remarks to be disabled by
default unless configured otherwise through LLVM internal flags:
`-pass-remarks`, `-pass-remarks-missed`, and `-pass-remarks-analysis`.
This behaviour makes `-Cremark` ineffective on its own.

Fix this by configuring a custom diagnostic handler that enables
optimization remarks based on the value of `-Cremark` option. With
`-Cremark=all` enabling all remarks.

Fixes #90924.

r? `@nikic`

2 years agoRollup merge of #90832 - cuviper:relnotes-1.57.0, r=Mark-Simulacrum
Matthias Krüger [Sun, 28 Nov 2021 22:45:16 +0000 (23:45 +0100)]
Rollup merge of #90832 - cuviper:relnotes-1.57.0, r=Mark-Simulacrum

Add 1.57.0 release notes

2 years agoRollup merge of #90131 - camsteffen:fmt-args-span-fix, r=cjgillot
Matthias Krüger [Sun, 28 Nov 2021 22:45:15 +0000 (23:45 +0100)]
Rollup merge of #90131 - camsteffen:fmt-args-span-fix, r=cjgillot

Fix a format_args span to be expansion

I found this while exploring solutions for rust-lang/rust-clippy#7843.

r? `@m-ou-se`

2 years agoAdd parent crate assert to register_expn_id
Cameron Steffen [Sun, 28 Nov 2021 22:35:31 +0000 (16:35 -0600)]
Add parent crate assert to register_expn_id

2 years agoAdd fast path to is_descendant_of
Cameron Steffen [Fri, 19 Nov 2021 15:43:03 +0000 (09:43 -0600)]
Add fast path to is_descendant_of

2 years agoAuto merge of #90681 - workingjubilee:update-libc, r=JohnTitor
bors [Sun, 28 Nov 2021 22:29:57 +0000 (22:29 +0000)]
Auto merge of #90681 - workingjubilee:update-libc, r=JohnTitor

Update libc to 0.2.108

Changelog:
https://github.com/rust-lang/libc/releases/tag/0.2.107
https://github.com/rust-lang/libc/releases/tag/0.2.108
Primarily intended to pull in rust-lang/libc@fd331f65f214ea75b6210b415b5fd8650be15c73
This should help with https://github.com/rust-lang/rust/pull/90044

2 years agoRemove unused root_parent.
Camille GILLOT [Thu, 21 Oct 2021 17:22:44 +0000 (19:22 +0200)]
Remove unused root_parent.

2 years agoRemove eval_always for lib_features.
Camille GILLOT [Thu, 20 May 2021 18:57:09 +0000 (20:57 +0200)]
Remove eval_always for lib_features.

2 years agoTake a LocalDefId in expect_*item.
Camille GILLOT [Wed, 20 Oct 2021 20:38:10 +0000 (22:38 +0200)]
Take a LocalDefId in expect_*item.

2 years agoDelete an unreachable codepath from format_args implementation
David Tolnay [Sun, 28 Nov 2021 19:52:38 +0000 (11:52 -0800)]
Delete an unreachable codepath from format_args implementation