]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #98706 - flip1995:clippyup, r=Dylan-DPC
bors [Fri, 1 Jul 2022 01:30:37 +0000 (01:30 +0000)]
Auto merge of #98706 - flip1995:clippyup, r=Dylan-DPC

Update Clippy

r? `@Manishearth`

2 years agoAdd a `--build-dir` flag to rustbuild
Thom Chiovoloni [Thu, 30 Jun 2022 22:50:48 +0000 (15:50 -0700)]
Add a `--build-dir` flag to rustbuild

2 years agoOptimize `Vec::insert` for the case where `index == len`.
Nicholas Nethercote [Thu, 30 Jun 2022 20:46:30 +0000 (06:46 +1000)]
Optimize `Vec::insert` for the case where `index == len`.

By skipping the call to `copy` with a zero length. This makes it closer
to `push`.

I did this recently for `SmallVec`
(https://github.com/servo/rust-smallvec/pull/282) and it was a big perf win in
one case. Although I don't have a specific use case in mind, it seems
worth doing it for `Vec` as well.

Things to note:
- In the `index < len` case, the number of conditions checked is
  unchanged.
- In the `index == len` case, the number of conditions checked increases
  by one, but the more expensive zero-length copy is avoided.
- In the `index > len` case the code now reserves space for the extra
  element before panicking. This seems like an unimportant change.

2 years agoRemove some commented-out code.
Nicholas Nethercote [Tue, 28 Jun 2022 05:09:37 +0000 (15:09 +1000)]
Remove some commented-out code.

This was accidentally left behind in a previous commit.

2 years agoRemove some unnecessary `pub`s.
Nicholas Nethercote [Tue, 28 Jun 2022 02:16:12 +0000 (12:16 +1000)]
Remove some unnecessary `pub`s.

2 years agoRemove `Substructure::self_args`.
Nicholas Nethercote [Tue, 28 Jun 2022 01:56:03 +0000 (11:56 +1000)]
Remove `Substructure::self_args`.

It's unused.

2 years agoRemove `{Method,Trait}Def::is_unsafe`.
Nicholas Nethercote [Tue, 28 Jun 2022 01:44:37 +0000 (11:44 +1000)]
Remove `{Method,Trait}Def::is_unsafe`.

They are always `false`.

2 years agofix grammar in useless doc comment lint
Andy Russell [Thu, 30 Jun 2022 20:17:38 +0000 (16:17 -0400)]
fix grammar in useless doc comment lint

2 years agoRemove `Substructure::method_ident`.
Nicholas Nethercote [Tue, 28 Jun 2022 01:37:44 +0000 (11:37 +1000)]
Remove `Substructure::method_ident`.

It's unused.

2 years agoRemove unnecessary fields from `EnumNonMatchingCollapsed`.
Nicholas Nethercote [Mon, 27 Jun 2022 22:56:54 +0000 (08:56 +1000)]
Remove unnecessary fields from `EnumNonMatchingCollapsed`.

The `&[ast::Variant]` field isn't used.

The `Vec<Ident>` field is only used for its length, but that's always
the same as the length of the `&[Ident]` and so isn't necessary.

2 years agoUse `split_{first,last}` in `cs_fold1`.
Nicholas Nethercote [Tue, 28 Jun 2022 02:58:36 +0000 (12:58 +1000)]
Use `split_{first,last}` in `cs_fold1`.

It makes the code a little nicer to read.

2 years agoSpecialize a few tests depending on opt-level.
Camille GILLOT [Tue, 17 May 2022 14:18:40 +0000 (16:18 +0200)]
Specialize a few tests depending on opt-level.

2 years agoAllow inlining `#[inline]` functions.
Camille GILLOT [Mon, 13 Dec 2021 17:03:22 +0000 (18:03 +0100)]
Allow inlining `#[inline]` functions.

2 years agoTest enabling MIR inliner
Wesley Wiser [Fri, 1 Oct 2021 02:03:49 +0000 (22:03 -0400)]
Test enabling MIR inliner

2 years agoDo not error on the param_env during inlining.
Camille GILLOT [Fri, 6 May 2022 19:37:14 +0000 (21:37 +0200)]
Do not error on the param_env during inlining.

This created unexpected diagnostics while compiling alga:
    cannot satisfy `<Self as Module>::Ring == _`

Turns out that we don't need this diagnostic as we disable inlining when
it would trigger an ICE.

2 years agoSkip inlining if there are normalization issues.
Camille GILLOT [Sat, 30 Apr 2022 16:10:33 +0000 (18:10 +0200)]
Skip inlining if there are normalization issues.

2 years agoRecover when failing to normalize closure signature.
Camille GILLOT [Fri, 4 Feb 2022 22:18:28 +0000 (23:18 +0100)]
Recover when failing to normalize closure signature.

2 years agoDo not ICE when failing to resolve.
Camille GILLOT [Fri, 4 Feb 2022 17:53:06 +0000 (18:53 +0100)]
Do not ICE when failing to resolve.

2 years agoCheck history earlier.
Camille GILLOT [Mon, 13 Dec 2021 12:46:30 +0000 (13:46 +0100)]
Check history earlier.

2 years agoDon't assert polymorphization has taken effect in const eval
Wesley Wiser [Fri, 1 Oct 2021 01:58:49 +0000 (21:58 -0400)]
Don't assert polymorphization has taken effect in const eval

Const eval no longer runs MIR optimizations so unless this is getting
run as part of a MIR optimization like const-prop, there can be unused
type parameters even if polymorphization is enabled.

2 years agorustdoc: fix 98690
pinkforest [Thu, 30 Jun 2022 10:31:02 +0000 (20:31 +1000)]
rustdoc: fix 98690

2 years agoui: improve suggestion test by addig the help message
Vincenzo Palazzo [Wed, 29 Jun 2022 23:31:10 +0000 (23:31 +0000)]
ui: improve suggestion test by addig the help message

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2 years agoRequest to be notified of MIR changes
Celina G. Val [Thu, 30 Jun 2022 18:18:56 +0000 (11:18 -0700)]
Request to be notified of MIR changes

Adding myself (celinval) to be notified of PRs that changes the MIR.

2 years agoRollup merge of #98717 - RalfJung:make-tidy-less-annoying, r=jyn514
Matthias Krüger [Thu, 30 Jun 2022 17:55:57 +0000 (19:55 +0200)]
Rollup merge of #98717 - RalfJung:make-tidy-less-annoying, r=jyn514

get rid of tidy 'unnecessarily ignored' warnings

I think these warnings are quite pointless: when I say `allow(foo)` in my code, that doesn't necessarily mean that I expect `foo` to happen -- it just means that I am okay with `foo` happening.

For example, having to add and remove `ignore-tidy-linelength` as the longest line in the file keeps growing and shrinking is just annoying and doesn't benefit anyone, IMO. This usually incurs *two* CI roundtrips: first CI tells you that line lengths in your test file are ignored unnecessarily, so you go and remove that attribute; then CI tells you that now your line numbers changed, so you re-bless your tests (often takes >5min if parts of rustc need rebuilding because `./x.py fmt` changed something somewhere). That's just a lot of wasted effort and time and patience.

2 years agoRollup merge of #98709 - GuillaumeGomez:rm-decl-for-old-browsers, r=Dylan-DPC
Matthias Krüger [Thu, 30 Jun 2022 17:55:56 +0000 (19:55 +0200)]
Rollup merge of #98709 - GuillaumeGomez:rm-decl-for-old-browsers, r=Dylan-DPC

Remove unneeded methods declaration for old web browsers

All these methods were not defined for IE mostly. But since we don't support it anymore, no need to keep them around.

cc ```@jsha```
r? ```@notriddle```

2 years agoRollup merge of #98695 - tshepang:or-pattern, r=compiler-errors
Matthias Krüger [Thu, 30 Jun 2022 17:55:55 +0000 (19:55 +0200)]
Rollup merge of #98695 - tshepang:or-pattern, r=compiler-errors

use "or pattern"

2 years agoRollup merge of #98688 - RalfJung:from-mplace, r=oli-obk
Matthias Krüger [Thu, 30 Jun 2022 17:55:54 +0000 (19:55 +0200)]
Rollup merge of #98688 - RalfJung:from-mplace, r=oli-obk

interpret: add From<&MplaceTy> for PlaceTy

We have a similar instance for `&MPlaceTy` to `OpTy`. Also add the same for `&mut`.

This avoids having to write `&(*place).into()`, which we have a few times here and at least twice in Miri (and it comes up again in my current patch).

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

2 years agoRollup merge of #98684 - matthiaskrgr:ice-test-72793, r=oli-obk
Matthias Krüger [Thu, 30 Jun 2022 17:55:54 +0000 (19:55 +0200)]
Rollup merge of #98684 - matthiaskrgr:ice-test-72793, r=oli-obk

add test for 72793

Fixes #72793

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

2 years agoRollup merge of #98677 - lyming2007:issue-98492-fix, r=lcnr
Matthias Krüger [Thu, 30 Jun 2022 17:55:53 +0000 (19:55 +0200)]
Rollup merge of #98677 - lyming2007:issue-98492-fix, r=lcnr

For diagnostic information of Boolean, remind it as use the type: 'bool'

Fixes #98492.

It helps programmers coming from other languages
modified:   compiler/rustc_resolve/src/late/diagnostics.rs

2 years agoRollup merge of #98671 - GuillaumeGomez:source-sidebar-fixes, r=notriddle
Matthias Krüger [Thu, 30 Jun 2022 17:55:52 +0000 (19:55 +0200)]
Rollup merge of #98671 - GuillaumeGomez:source-sidebar-fixes, r=notriddle

Fix source sidebar bugs

This PR fixes the following two bugs:

![Screenshot from 2022-06-29 14-39-58](https://user-images.githubusercontent.com/3050060/176449070-3e3762da-2bfe-4acf-8eb0-34f6eb4c94ed.png)
![Screenshot from 2022-06-29 15-05-09](https://user-images.githubusercontent.com/3050060/176449073-b164820b-bd71-4b1a-990c-bba4e5fce196.png)

I added regression tests to prevent them to happen again.

I think we should backport it to beta as well.

You can test it [here](https://rustdoc.crud.net/imperio/source-sidebar-fixes/src/std/lib.rs.html).

cc ```@jsha```
r? ```@notriddle```

2 years agoRollup merge of #98670 - krasimirgg:llvm-15-LLVMConstExtractValue, r=nikic
Matthias Krüger [Thu, 30 Jun 2022 17:55:52 +0000 (19:55 +0200)]
Rollup merge of #98670 - krasimirgg:llvm-15-LLVMConstExtractValue, r=nikic

llvm-wrapper: adapt for LLVMConstExtractValue removal

`LLVMConstExtractValue` was removed recently from LLVM: https://github.com/llvm/llvm-project/commit/5548e807b5777fdda167b6795e0e05432a6163f1.

This adapts llvm-wrapper to use the new alternative where available, following https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/LLVMConstExtractValue.20removal.

2 years agoRollup merge of #98503 - RalfJung:scope-race, r=m-ou-se
Matthias Krüger [Thu, 30 Jun 2022 17:55:51 +0000 (19:55 +0200)]
Rollup merge of #98503 - RalfJung:scope-race, r=m-ou-se

fix data race in thread::scope

Puts the `ScopeData` into an `Arc` so it sticks around as long as we need it.
This means one extra `Arc::clone` per spawned scoped thread, which I hope is fine.

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

2 years agoRollup merge of #97629 - guswynn:exclusive_struct, r=m-ou-se
Matthias Krüger [Thu, 30 Jun 2022 17:55:50 +0000 (19:55 +0200)]
Rollup merge of #97629 - guswynn:exclusive_struct, r=m-ou-se

[core] add `Exclusive` to sync

(discussed here: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Adding.20.60SyncWrapper.60.20to.20std)

`Exclusive` is a wrapper that exclusively allows mutable access to the inner value if you have exclusive access to the wrapper. It acts like a compile time mutex, and hold an unconditional `Sync` implementation.

## Justification for inclusion into std
- This wrapper unblocks actual problems:
  - The example that I hit was a vector of `futures::future::BoxFuture`'s causing a central struct in a script to be non-`Sync`. To work around it, you either write really difficult code, or wrap the futures in a needless mutex.
- Easy to maintain: this struct is as simple as a wrapper can get, and its `Sync` implementation has very clear reasoning
- Fills a gap: `&/&mut` are to `RwLock` as `Exclusive` is to `Mutex`

## Public Api
```rust
// core::sync
#[derive(Default)]
struct Exclusive<T: ?Sized> { ... }

impl<T: ?Sized> Sync for Exclusive {}

impl<T> Exclusive<T> {
    pub const fn new(t: T) -> Self;
    pub const fn into_inner(self) -> T;
}

impl<T: ?Sized> Exclusive<T> {
    pub const fn get_mut(&mut self) -> &mut T;
    pub const fn get_pin_mut(Pin<&mut self>) -> Pin<&mut T>;
    pub const fn from_mut(&mut T) -> &mut Exclusive<T>;
    pub const fn from_pin_mut(Pin<&mut T>) -> Pin<&mut Exclusive<T>>;
}

impl<T: Future> Future for Exclusive { ... }

impl<T> From<T> for Exclusive<T> { ... }
impl<T: ?Sized> Debug for Exclusive { ... }
```

## Naming
This is a big bikeshed, but I felt that `Exclusive` captured its general purpose quite well.

## Stability and location
As this is so simple, it can be in `core`. I feel that it can be stabilized quite soon after it is merged, if the libs teams feels its reasonable to add. Also, I don't really know how unstable feature work in std/core's codebases, so I might need help fixing them

## Tips for review
The docs probably are the thing that needs to be reviewed! I tried my best, but I'm sure people have more experience than me writing docs for `Core`

### Implementation:
The API is mostly pulled from https://docs.rs/sync_wrapper/latest/sync_wrapper/struct.SyncWrapper.html (which is apache 2.0 licenesed), and the implementation is trivial:
- its an unsafe justification for pinning
- its an unsafe justification for the `Sync` impl (mostly reasoned about by ````@danielhenrymantilla```` here: https://github.com/Actyx/sync_wrapper/pull/2)
- and forwarding impls, starting with derivable ones and `Future`

2 years agoclarify that ExactSizeIterator::len returns the remaining length
The 8472 [Thu, 30 Jun 2022 17:45:36 +0000 (19:45 +0200)]
clarify that ExactSizeIterator::len returns the remaining length

2 years agorustdoc: filter '_ lifetimes from ty::PolyTraitRef
Michael Howell [Thu, 30 Jun 2022 17:35:50 +0000 (10:35 -0700)]
rustdoc: filter '_ lifetimes from ty::PolyTraitRef

Fixes #98697

2 years agoFlip RustAnalyzer to stable=true
Josh Stone [Thu, 30 Jun 2022 17:07:48 +0000 (10:07 -0700)]
Flip RustAnalyzer to stable=true

2 years agoFor diagnostic information of Boolean, remind it as use the type: 'bool'
Yiming Lei [Wed, 29 Jun 2022 16:09:34 +0000 (09:09 -0700)]
For diagnostic information of Boolean, remind it as use the type: 'bool'
It helps programmers coming from other languages
modified:   compiler/rustc_resolve/src/late/diagnostics.rs

modified:   src/test/ui/lint/recommend-literal.rs
modified:   src/test/ui/lint/recommend-literal.stderr

modified:   compiler/rustc_resolve/src/late/diagnostics.rs
modified:   src/test/ui/lint/recommend-literal.rs
modified:   src/test/ui/lint/recommend-literal.stderr

modified:   compiler/rustc_resolve/src/late/diagnostics.rs
modified:   src/test/ui/lint/recommend-literal.rs
modified:   src/test/ui/lint/recommend-literal.stderr

2 years agoget rid of some tidy 'unnecessarily ignored' warnings
Ralf Jung [Thu, 30 Jun 2022 15:23:51 +0000 (11:23 -0400)]
get rid of some tidy 'unnecessarily ignored' warnings

2 years agoadd ice test for #97047
Matthias Krüger [Thu, 30 Jun 2022 14:42:39 +0000 (16:42 +0200)]
add ice test for #97047

Fixes #97047

2 years agoAdd test to ensure that scroll position is kept when opening/closing source sidebar
Guillaume Gomez [Wed, 29 Jun 2022 21:21:46 +0000 (23:21 +0200)]
Add test to ensure that scroll position is kept when opening/closing source sidebar

2 years agoFix scroll when source sidebar is open on mobile
Guillaume Gomez [Wed, 29 Jun 2022 21:21:26 +0000 (23:21 +0200)]
Fix scroll when source sidebar is open on mobile

2 years agoadd issue number to fixme
lcnr [Thu, 30 Jun 2022 13:53:17 +0000 (15:53 +0200)]
add issue number to fixme

2 years agoadd logging to `write_resolution`
lcnr [Thu, 30 Jun 2022 12:48:49 +0000 (14:48 +0200)]
add logging to `write_resolution`

2 years agollvm-wrapper: adapt for LLVMConstExtractValue removal
Krasimir Georgiev [Wed, 29 Jun 2022 14:00:40 +0000 (14:00 +0000)]
llvm-wrapper: adapt for LLVMConstExtractValue removal

2 years agoRemove unneeded methods declaration for old web browsers
Guillaume Gomez [Thu, 30 Jun 2022 11:23:13 +0000 (13:23 +0200)]
Remove unneeded methods declaration for old web browsers

2 years agoUpdate Cargo.lock
Philipp Krones [Thu, 30 Jun 2022 09:35:55 +0000 (11:35 +0200)]
Update Cargo.lock

2 years agoAuto merge of #98377 - davidv1992:add-lifetimes-to-argument-temporaries, r=oli-obk
bors [Thu, 30 Jun 2022 09:20:52 +0000 (09:20 +0000)]
Auto merge of #98377 - davidv1992:add-lifetimes-to-argument-temporaries, r=oli-obk

Added llvm lifetime annotations to function call argument temporaries.

The goal of this change is to ensure that llvm will do stack slot
optimization on these temporaries. This ensures that in code like:
```rust
const A: [u8; 1024] = [0; 1024];

fn copy_const() {
    f(A);
    f(A);
}
```
we only use 1024 bytes of stack space, instead of 2048 bytes.

I am new to developing for the rust compiler, and as such not entirely sure, but I believe this should be sufficient to close #98156.

Also, this does not contain a test case to ensure this keeps working, primarily because I am not sure how to go about testing this. I would love some suggestions as to how that could be approached.

2 years agoMerge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
Philipp Krones [Thu, 30 Jun 2022 08:50:09 +0000 (10:50 +0200)]
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup

2 years agoAuto merge of #9069 - flip1995:rustup, r=flip1995
bors [Thu, 30 Jun 2022 08:32:54 +0000 (08:32 +0000)]
Auto merge of #9069 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

2 years agoBump Clippy version -> 0.1.64
Philipp Krones [Thu, 30 Jun 2022 08:29:22 +0000 (10:29 +0200)]
Bump Clippy version -> 0.1.64

2 years agoBump nightly version -> 2022-06-30
Philipp Krones [Thu, 30 Jun 2022 08:28:58 +0000 (10:28 +0200)]
Bump nightly version -> 2022-06-30

2 years agoFix dogfood
Philipp Krones [Thu, 30 Jun 2022 08:28:04 +0000 (10:28 +0200)]
Fix dogfood

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Thu, 30 Jun 2022 08:27:25 +0000 (10:27 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoAuto merge of #98698 - RalfJung:miri, r=RalfJung
bors [Thu, 30 Jun 2022 06:37:48 +0000 (06:37 +0000)]
Auto merge of #98698 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/98599
r? `@ghost`

2 years agoAuto merge of #9068 - tamaroning:fix-typo-2022-6-30, r=giraffate,xFrednet
bors [Thu, 30 Jun 2022 06:18:19 +0000 (06:18 +0000)]
Auto merge of #9068 - tamaroning:fix-typo-2022-6-30, r=giraffate,xFrednet

fix typo in Clippy Lints page

https://rust-lang.github.io/rust-clippy/master/#significant_drop_in_scrutinee

changelog: none

2 years agoadd regression test for #50439
Takayuki Maeda [Thu, 30 Jun 2022 04:43:29 +0000 (13:43 +0900)]
add regression test for #50439

2 years agoUpdate large_const_arrays.rs
tamaron [Thu, 30 Jun 2022 04:21:17 +0000 (13:21 +0900)]
Update large_const_arrays.rs

2 years agoAuto merge of #8666 - Jarcho:while_let_loop_7913, r=dswij
bors [Thu, 30 Jun 2022 04:04:08 +0000 (04:04 +0000)]
Auto merge of #8666 - Jarcho:while_let_loop_7913, r=dswij

Don't lint `while_let_loop` when significant drop order would change

fixes #7226
fixes #7913
fixes #5717

For #5717 it may not stay fully fixed. This is only completely fixed right now due to all the allowed drop impls have `#[may_dangle]` on their drop impls. This may get changed in the future based on how significant drops are determined, but the example listed with `RefCell` shouldn't break.

changelog: Don't lint `while_let_loop` when the order of significant drops would change

2 years agoAuto merge of #98649 - RalfJung:guardians-of-mir, r=oli-obk
bors [Thu, 30 Jun 2022 03:50:35 +0000 (03:50 +0000)]
Auto merge of #98649 - RalfJung:guardians-of-mir, r=oli-obk

move MIR syntax into a dedicated file and ping some people whenever it changes

Adding or changing MIR operations/statements/whatever should be under significant scrutiny wrt their wider impact, specified semantics, and so on. So let's start by putting all that into a dedicated file and pinging some people whenever that file changes.

This PR only moves definitions around, and then fiddles with imports until it all works again.

2 years agofix
tamaron [Thu, 30 Jun 2022 02:59:23 +0000 (11:59 +0900)]
fix

2 years agoadd regression test for #79494
Takayuki Maeda [Wed, 29 Jun 2022 02:29:51 +0000 (11:29 +0900)]
add regression test for #79494

use MCVE

2 years agoupdate Miri
Ralf Jung [Thu, 30 Jun 2022 02:14:03 +0000 (22:14 -0400)]
update Miri

2 years agoSkip ffi-unwind lint test with `-Cpanic=abort`
Gary Guo [Thu, 30 Jun 2022 01:12:39 +0000 (02:12 +0100)]
Skip ffi-unwind lint test with `-Cpanic=abort`

2 years agouse "or pattern"
Tshepang Mbambo [Thu, 30 Jun 2022 01:05:51 +0000 (03:05 +0200)]
use "or pattern"

2 years agoAuto merge of #98691 - matthiaskrgr:rollup-ymsa64p, r=matthiaskrgr
bors [Thu, 30 Jun 2022 01:02:24 +0000 (01:02 +0000)]
Auto merge of #98691 - matthiaskrgr:rollup-ymsa64p, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #96727 (Make TAIT behave exactly like RPIT)
 - #98681 (rustdoc-json: Make default value of blanket impl assoc types work)
 - #98682 (add tests for ICE 94432)
 - #98683 (add test for ice 68875)
 - #98685 (Replace `sort_modules_alphabetically` boolean with enum)
 - #98687 (add test for 47814)

Failed merges:

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

2 years agoui test: add test of blanklet implementation
Vincenzo Palazzo [Wed, 22 Jun 2022 22:06:34 +0000 (23:06 +0100)]
ui test: add test of blanklet implementation

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2 years agoadd blanket impl suggestion to the local traits
Vincenzo Palazzo [Sat, 14 May 2022 23:28:10 +0000 (01:28 +0200)]
add blanket impl suggestion to the local traits

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2 years agoUpdate RELEASES.md
Tomasz Miąsko [Thu, 30 Jun 2022 00:00:00 +0000 (00:00 +0000)]
Update RELEASES.md

Clarify that flow sensitive checks now understand that *visibly*
uninhabited call expressions never return.

The change influences checks of reachable and unreachable code alike,
not just dead code like previous wording would imply.

2 years agofix doc issues
Ralf Jung [Wed, 29 Jun 2022 23:18:30 +0000 (19:18 -0400)]
fix doc issues

2 years agoRollup merge of #98687 - matthiaskrgr:test_47814, r=compiler-errors
Matthias Krüger [Wed, 29 Jun 2022 22:23:55 +0000 (00:23 +0200)]
Rollup merge of #98687 - matthiaskrgr:test_47814, r=compiler-errors

add test for 47814

not sure if the issue should actually get closed though, hm

r? ``@compiler-errors``

2 years agoRollup merge of #98685 - camelid:sorting-flag, r=GuillaumeGomez
Matthias Krüger [Wed, 29 Jun 2022 22:23:54 +0000 (00:23 +0200)]
Rollup merge of #98685 - camelid:sorting-flag, r=GuillaumeGomez

Replace `sort_modules_alphabetically` boolean with enum

This fixes the long-standing FIXME there and makes the code easier to
understand. The reference to modules in both the old and new names seems
potentially wrong since I believe it applies to all items.

r? ``@GuillaumeGomez``

2 years agoRollup merge of #98683 - matthiaskrgr:ice-test-68875, r=compiler-errors
Matthias Krüger [Wed, 29 Jun 2022 22:23:53 +0000 (00:23 +0200)]
Rollup merge of #98683 - matthiaskrgr:ice-test-68875, r=compiler-errors

add test for ice 68875

Fixes #68875

2 years agoRollup merge of #98682 - matthiaskrgr:test-94432, r=compiler-errors
Matthias Krüger [Wed, 29 Jun 2022 22:23:52 +0000 (00:23 +0200)]
Rollup merge of #98682 - matthiaskrgr:test-94432, r=compiler-errors

add tests for ICE 94432

Fixes #94432

2 years agoRollup merge of #98681 - Enselic:rustdoc-json-default-assoc-type-blanket-impl, r...
Matthias Krüger [Wed, 29 Jun 2022 22:23:51 +0000 (00:23 +0200)]
Rollup merge of #98681 - Enselic:rustdoc-json-default-assoc-type-blanket-impl, r=GuillaumeGomez

rustdoc-json: Make default value of blanket impl assoc types work

Closes #98658

r? ``@GuillaumeGomez``

``@rustbot`` labels +A-rustdoc-json

2 years agoRollup merge of #96727 - oli-obk:no_expect, r=lcnr
Matthias Krüger [Wed, 29 Jun 2022 22:23:50 +0000 (00:23 +0200)]
Rollup merge of #96727 - oli-obk:no_expect, r=lcnr

Make TAIT behave exactly like RPIT

fixes https://github.com/rust-lang/rust/issues/96552

This makes type-alias-impl-trait behave like return-position-impl-trait. Unfortunately it also causes some cases to stop compiling due to "needing type annotations" and makes panicking cause fallback for the hidden type to `()`.

All of these are addressable, but we should probably address them for RPIT and TAIT together

r? ``@lcnr``

2 years agoAuto merge of #98520 - RalfJung:invalid, r=compiler-errors
bors [Wed, 29 Jun 2022 22:21:43 +0000 (22:21 +0000)]
Auto merge of #98520 - RalfJung:invalid, r=compiler-errors

interpret: adjust error from constructing an invalid value

2 years agoUpdate browser-ui-test version to 0.9.7
Guillaume Gomez [Wed, 29 Jun 2022 21:20:21 +0000 (23:20 +0200)]
Update browser-ui-test version to 0.9.7

2 years agointerpret: add From<&MplaceTy> for PlaceTy
Ralf Jung [Wed, 29 Jun 2022 21:07:24 +0000 (17:07 -0400)]
interpret: add From<&MplaceTy> for PlaceTy

2 years agoadd test for 47814
Matthias Krüger [Wed, 29 Jun 2022 20:27:18 +0000 (22:27 +0200)]
add test for 47814

not sure if the issue should actually get closed though, hm

r? @compiler-errors

2 years agoadd ice test for 46511
Matthias Krüger [Wed, 29 Jun 2022 20:16:36 +0000 (22:16 +0200)]
add ice test for 46511

Fixes #46511

2 years agoReplace `sort_modules_alphabetically` boolean with enum
Noah Lev [Wed, 29 Jun 2022 20:04:43 +0000 (13:04 -0700)]
Replace `sort_modules_alphabetically` boolean with enum

This fixes the long-standing FIXME there and makes the code easier to
understand. The reference to modules in both the old and new names seems
potentially wrong since I believe it applies to all items.

2 years agoping more people
Ralf Jung [Wed, 29 Jun 2022 12:58:26 +0000 (08:58 -0400)]
ping more people

Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2 years agomove MIR syntax into a dedicated file and ping some people whenever it changes
Ralf Jung [Wed, 29 Jun 2022 00:05:23 +0000 (20:05 -0400)]
move MIR syntax into a dedicated file and ping some people whenever it changes

2 years agoadd test for 72793
Matthias Krüger [Wed, 29 Jun 2022 19:55:10 +0000 (21:55 +0200)]
add test for 72793

Fixes #72793

r? @oli-obk

2 years agoadd test for ice 68875
Matthias Krüger [Wed, 29 Jun 2022 19:38:42 +0000 (21:38 +0200)]
add test for ice 68875

Fixes #68875

2 years agoadd tests for ICE 94432
Matthias Krüger [Wed, 29 Jun 2022 19:30:19 +0000 (21:30 +0200)]
add tests for ICE 94432

Fixes #94432

2 years agorustdoc-json: Make default value of blanket impl assoc types work
Martin Nordholts [Wed, 29 Jun 2022 18:34:56 +0000 (20:34 +0200)]
rustdoc-json: Make default value of blanket impl assoc types work

2 years agoAuto merge of #98680 - matthiaskrgr:rollup-1bkrrn9, r=matthiaskrgr
bors [Wed, 29 Jun 2022 18:42:19 +0000 (18:42 +0000)]
Auto merge of #98680 - matthiaskrgr:rollup-1bkrrn9, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #98434 (Ensure that `static_crt` is set in the bootstrapper whenever using `cc-rs` to get a compiler command line.)
 - #98636 (Triagebot: Fix mentions word wrapping.)
 - #98642 (Fix #98260)
 - #98643 (Improve pretty printing of valtrees for references)
 - #98646 (rustdoc: fix bugs in main.js popover help and settings)
 - #98647 (Update cargo)
 - #98652 (`alloc`: clean and ensure `no_global_oom_handling`  builds are warning-free)
 - #98660 (Unbreak stage1 tests via ignore-stage1 in `proc-macro/invalid-punct-ident-1.rs`.)
 - #98665 (Use verbose help for deprecation suggestion)
 - #98668 (Avoid some `&str` to `String` conversions with `MultiSpan::push_span_label`)

Failed merges:

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

2 years agoRollup merge of #98668 - TaKO8Ki:avoid-many-&str-to-string-conversions, r=Dylan-DPC
Matthias Krüger [Wed, 29 Jun 2022 18:35:07 +0000 (20:35 +0200)]
Rollup merge of #98668 - TaKO8Ki:avoid-many-&str-to-string-conversions, r=Dylan-DPC

Avoid some `&str` to `String` conversions with `MultiSpan::push_span_label`

This patch removes some`&str` to `String` conversions with `MultiSpan::push_span_label`.

2 years agoRollup merge of #98665 - ChrisDenton:deprecated-suggestion, r=compiler-errors
Matthias Krüger [Wed, 29 Jun 2022 18:35:06 +0000 (20:35 +0200)]
Rollup merge of #98665 - ChrisDenton:deprecated-suggestion, r=compiler-errors

Use verbose help for deprecation suggestion

Fixes #98631

r? `@compiler-errors`

2 years agoRollup merge of #98660 - eddyb:invalid-punct-stage1, r=lqd
Matthias Krüger [Wed, 29 Jun 2022 18:35:05 +0000 (20:35 +0200)]
Rollup merge of #98660 - eddyb:invalid-punct-stage1, r=lqd

Unbreak stage1 tests via ignore-stage1 in `proc-macro/invalid-punct-ident-1.rs`.

#98188 broke `./x.py test --stage 1` (which I thought we ran in PR CI, cc `@rust-lang/infra)` i.e. the default `./x.py test` in dev checkouts, as the panic in `src/test/ui/proc-macro/invalid-punct-ident-1.rs` moved from the server (`rustc`) to the client (proc macro), and that means it's now affected by #59998.

I made the test look like `src/test/ui-fulldeps/issue-76270-panic-in-libproc-macro.rs` tho I'm a bit confused why that one is in `src/test/ui-fulldeps`, it should still work in `src/test/ui`, no? (cc `@Aaron1011)`

2 years agoRollup merge of #98652 - ojeda:warning-free-no_global_oom_handling, r=joshtriplett
Matthias Krüger [Wed, 29 Jun 2022 18:35:04 +0000 (20:35 +0200)]
Rollup merge of #98652 - ojeda:warning-free-no_global_oom_handling, r=joshtriplett

`alloc`: clean and ensure `no_global_oom_handling`  builds are warning-free

Rust 1.62.0 introduced a couple new `unused_imports` warnings
in `no_global_oom_handling` builds, making a total of 5 warnings.

<details>

```txt
warning: unused import: `Unsize`
 --> library/alloc/src/boxed/thin.rs:6:33
  |
6 | use core::marker::{PhantomData, Unsize};
  |                                 ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `from_fn`
  --> library/alloc/src/string.rs:51:18
   |
51 | use core::iter::{from_fn, FusedIterator};
   |                  ^^^^^^^

warning: unused import: `core::ops::Deref`
  --> library/alloc/src/vec/into_iter.rs:12:5
   |
12 | use core::ops::Deref;
   |     ^^^^^^^^^^^^^^^^

warning: associated function `shrink` is never used
   --> library/alloc/src/raw_vec.rs:424:8
    |
424 |     fn shrink(&mut self, cap: usize) -> Result<(), TryReserveError> {
    |        ^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: associated function `forget_remaining_elements` is never used
   --> library/alloc/src/vec/into_iter.rs:126:19
    |
126 |     pub(crate) fn forget_remaining_elements(&mut self) {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^
```

</details>

This PR cleans them and ensures no new ones are introduced
so that projects compiling `alloc` without infallible allocations
do not see them (and may want to enable `-Dwarnings`).

The couple `dead_code` ones may be reverted when some fallible
allocation support starts using them.

2 years agoRollup merge of #98647 - ehuss:update-cargo, r=ehuss
Matthias Krüger [Wed, 29 Jun 2022 18:35:03 +0000 (20:35 +0200)]
Rollup merge of #98647 - ehuss:update-cargo, r=ehuss

Update cargo

2 commits in a5e08c4703f202e30cdaf80ca3e7c00baa59c496..dbff32b27893b899ae2397f3d56d1be111041d56
2022-06-23 20:12:03 +0000 to 2022-06-24 19:25:13 +0000
- Fetch GitHub commits by long hash more efficiently (rust-lang/cargo#10079)
- refactor(test): Clarify asserts are for UI (rust-lang/cargo#10778)

2 years agoRollup merge of #98646 - notriddle:notriddle/main.js, r=GuillaumeGomez
Matthias Krüger [Wed, 29 Jun 2022 18:35:02 +0000 (20:35 +0200)]
Rollup merge of #98646 - notriddle:notriddle/main.js, r=GuillaumeGomez

rustdoc: fix bugs in main.js popover help and settings

2 years agoRollup merge of #98643 - voidc:valtree-ref-pretty, r=lcnr
Matthias Krüger [Wed, 29 Jun 2022 18:35:01 +0000 (20:35 +0200)]
Rollup merge of #98643 - voidc:valtree-ref-pretty, r=lcnr

Improve pretty printing of valtrees for references

This implements the changes outlined in https://github.com/rust-lang/rust/issues/66451#issuecomment-1168859638.

r? `@lcnr`
Fixes #66451

2 years agoRollup merge of #98642 - yanchen4791:issue-98260-fix, r=spastorino
Matthias Krüger [Wed, 29 Jun 2022 18:35:00 +0000 (20:35 +0200)]
Rollup merge of #98642 - yanchen4791:issue-98260-fix, r=spastorino

Fix #98260

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

2 years agoRollup merge of #98636 - ehuss:mentions-wrapping, r=Mark-Simulacrum
Matthias Krüger [Wed, 29 Jun 2022 18:34:59 +0000 (20:34 +0200)]
Rollup merge of #98636 - ehuss:mentions-wrapping, r=Mark-Simulacrum

Triagebot: Fix mentions word wrapping.

I forgot that GitHub's markdown treats newlines as hard breaks. This was causing some ugly-looking word wrapping in the triagebot mention messages. This fixes it so that the lines are not hard-wrapped.

2 years agoRollup merge of #98434 - dpaoliello:staticcrt, r=jyn514
Matthias Krüger [Wed, 29 Jun 2022 18:34:58 +0000 (20:34 +0200)]
Rollup merge of #98434 - dpaoliello:staticcrt, r=jyn514

Ensure that `static_crt` is set in the bootstrapper whenever using `cc-rs` to get a compiler command line.

When attempting to build rustc with LLVM on Windows, I noticed that the CRT flag provided to the C and C++ Compilers was inconsistent:

```
"-DCMAKE_C_FLAGS=-nologo -MT -Brepro" "-DCMAKE_CXX_FLAGS=-nologo -MD -Brepro"
```

Since the bootstrapper also sets the various `LLVM_USE_CRT` variables, this resulted in cl.exe reporting a bunch of warnings:

```
cl : Command line warning D9025 : overriding '/MD' with '/MT'
```

The root cause for this is that `cc_detect::find` was creating a `cc::Build` twice, but didn't set `static_crt` the second time.

It's possible that this what is also causing #81381

2 years agofix ICE with -Wrust-2021-incompatible-closure-captures
Matthias Krüger [Tue, 28 Jun 2022 20:46:15 +0000 (22:46 +0200)]
fix ICE with -Wrust-2021-incompatible-closure-captures

Fixes #93117
Fixes #96258

2 years agoDon't lint `while_let_loop` when drop order would change
Jason Newcomb [Fri, 8 Apr 2022 17:21:04 +0000 (13:21 -0400)]
Don't lint `while_let_loop` when drop order would change