]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #98617 - ChrisDenton:const-unwrap, r=Mark-Simulacrum
Matthias Krüger [Tue, 28 Jun 2022 16:34:33 +0000 (18:34 +0200)]
Rollup merge of #98617 - ChrisDenton:const-unwrap, r=Mark-Simulacrum

Remove feature `const_option` from std

This is part of the effort to reduce the number of unstable features used by std. This one is easy as it's only used in one place.

2 years agoRollup merge of #98611 - GuillaumeGomez:rustdoc-json-glob-ice, r=notriddle
Matthias Krüger [Tue, 28 Jun 2022 16:34:32 +0000 (18:34 +0200)]
Rollup merge of #98611 - GuillaumeGomez:rustdoc-json-glob-ice, r=notriddle

Fix glob import ICE in rustdoc JSON format

Fixes #98003.

r? `@notriddle`

2 years agoRollup merge of #98609 - TaKO8Ki:fix-ice-for-associated-constant-generics, r=lcnr
Matthias Krüger [Tue, 28 Jun 2022 16:34:31 +0000 (18:34 +0200)]
Rollup merge of #98609 - TaKO8Ki:fix-ice-for-associated-constant-generics, r=lcnr

Fix ICE for associated constant generics

Fixes #98432

2 years agoRollup merge of #98606 - lnicola:rust-analyzer-2022-06-28, r=lnicola
Matthias Krüger [Tue, 28 Jun 2022 16:34:30 +0000 (18:34 +0200)]
Rollup merge of #98606 - lnicola:rust-analyzer-2022-06-28, r=lnicola

:arrow_up: rust-analyzer

r? ``@ghost``

2 years agoRollup merge of #98602 - TaKO8Ki:add-regression-test-for-issue-80074, r=Mark-Simulacrum
Matthias Krüger [Tue, 28 Jun 2022 16:34:29 +0000 (18:34 +0200)]
Rollup merge of #98602 - TaKO8Ki:add-regression-test-for-issue-80074, r=Mark-Simulacrum

Add regression test for #80074

closes #80074

2 years agoRollup merge of #98564 - jyn514:remove-tmp-dir, r=Mark-Simulacrum
Matthias Krüger [Tue, 28 Jun 2022 16:34:28 +0000 (18:34 +0200)]
Rollup merge of #98564 - jyn514:remove-tmp-dir, r=Mark-Simulacrum

Remove references to `./tmp` in-tree

These used to be used by codegen-units tests, but were switched from manually specifying directories
to just using `// incremental` in https://github.com/rust-lang/rust/pull/89101.
Remove the old references.

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

2 years agoRollup merge of #98560 - TaKO8Ki:add-regression-test-for-85907, r=Mark-Simulacrum
Matthias Krüger [Tue, 28 Jun 2022 16:34:27 +0000 (18:34 +0200)]
Rollup merge of #98560 - TaKO8Ki:add-regression-test-for-85907, r=Mark-Simulacrum

Add regression test for #85907

closes #85907

2 years agoRollup merge of #98548 - Enselic:allow-typedef-diff-for-rustdoc-json, r=GuillaumeGomez
Matthias Krüger [Tue, 28 Jun 2022 16:34:26 +0000 (18:34 +0200)]
Rollup merge of #98548 - Enselic:allow-typedef-diff-for-rustdoc-json, r=GuillaumeGomez

rustdoc-json: Allow Typedef to be different in sanity assert

Closes #98547

This fix is a natural extension of #98053.

r? `@notriddle`

(Since you reviewed the other PR.)

CC `@GuillaumeGomez`

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

2 years agoAuto merge of #98612 - Dylan-DPC:rollup-7tasikc, r=Dylan-DPC
bors [Tue, 28 Jun 2022 13:46:43 +0000 (13:46 +0000)]
Auto merge of #98612 - Dylan-DPC:rollup-7tasikc, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #97346 (Remove a back-compat hack on lazy TAIT)
 - #98261 (Remove `MAX_SUGGESTION_HIGHLIGHT_LINES`)
 - #98337 ([RFC 2011] Optimize non-consuming operators)
 - #98384 (Fix RSS reporting on macOS)
 - #98420 (translation: lint fix + more migration)
 - #98430 (Refactor iter adapters with less macros)
 - #98555 (Hermit: Fix initializing lazy locks)
 - #98595 (Implement `Send` and `Sync` for `ThinBox<T>`)
 - #98597 (Remove unstable CStr/CString change from 1.62 release note)

Failed merges:

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

2 years agoAdd a fixme comment
Chris Denton [Tue, 28 Jun 2022 11:18:16 +0000 (12:18 +0100)]
Add a fixme comment

2 years agoRemove feature `const_option` from std
Chris Denton [Tue, 28 Jun 2022 10:37:48 +0000 (11:37 +0100)]
Remove feature `const_option` from std

2 years agoRollup merge of #98597 - wwylele:patch-1, r=Mark-Simulacrum
Dylan DPC [Tue, 28 Jun 2022 10:00:08 +0000 (15:30 +0530)]
Rollup merge of #98597 - wwylele:patch-1, r=Mark-Simulacrum

Remove unstable CStr/CString change from 1.62 release note

(Discovered in https://github.com/rust-lang/rust/pull/98571#discussion_r907469604)

The change to move CStr/CString to core/alloc is currently behind feature flags as stated in https://github.com/rust-lang/rust/issues/98314

2 years agoRollup merge of #98595 - cuviper:send-sync-thinbox, r=m-ou-se
Dylan DPC [Tue, 28 Jun 2022 10:00:07 +0000 (15:30 +0530)]
Rollup merge of #98595 - cuviper:send-sync-thinbox, r=m-ou-se

Implement `Send` and `Sync` for `ThinBox<T>`

Just like `Box<T>`, `ThinBox<T>` owns its data on the heap, so it should
implement `Send` and `Sync` when `T` does.

This extends tracking issue #92791.

2 years agoRollup merge of #98555 - mkroening:hermit-lock-init, r=m-ou-se
Dylan DPC [Tue, 28 Jun 2022 10:00:06 +0000 (15:30 +0530)]
Rollup merge of #98555 - mkroening:hermit-lock-init, r=m-ou-se

Hermit: Fix initializing lazy locks

Closes https://github.com/hermitcore/rusty-hermit/issues/322.

The initialization function of hermit's `Condvar` is not called since https://github.com/rust-lang/rust/pull/97647 and was erroneously removed in https://github.com/rust-lang/rust/pull/97879.

r? ``@m-ou-se``

CC: ``@stlankes``
2 years agoRollup merge of #98430 - camsteffen:flatten-refactor, r=joshtriplett
Dylan DPC [Tue, 28 Jun 2022 10:00:05 +0000 (15:30 +0530)]
Rollup merge of #98430 - camsteffen:flatten-refactor, r=joshtriplett

Refactor iter adapters with less macros

Just some code cleanup. Introduced a util `and_then_or_clear` for each of chain, flatten and fuse iter adapter impls. This reduces code nicely for flatten, but admittedly the other modules are more of a lateral move replacing macros with a function. But I think consistency across the modules and avoiding macros when possible is good.

2 years agoRollup merge of #98420 - davidtwco:translation-lint-fixes-and-more-migration, r=compi...
Dylan DPC [Tue, 28 Jun 2022 10:00:04 +0000 (15:30 +0530)]
Rollup merge of #98420 - davidtwco:translation-lint-fixes-and-more-migration, r=compiler-errors

translation: lint fix + more migration

- Unfortunately, the diagnostic lints are very broken and trigger much more often than they should. This PR corrects the conditional which checks if the function call being made is to a diagnostic function so that it returns in every intended case.
- The `rustc_lint_diagnostics` attribute is used by the diagnostic translation/struct migration lints to identify calls where non-translatable diagnostics or diagnostics outwith impls are being created. Any function used in creating a diagnostic should be annotated with this attribute so this PR adds the attribute to many more functions.
- Port the diagnostics from the `rustc_privacy` crate and enable the lints for that crate.

r? ``@compiler-errors``

2 years agoRollup merge of #98384 - rdzhaafar:fix-macos-rss-reporting, r=davidtwco,michaelwoerister
Dylan DPC [Tue, 28 Jun 2022 10:00:03 +0000 (15:30 +0530)]
Rollup merge of #98384 - rdzhaafar:fix-macos-rss-reporting, r=davidtwco,michaelwoerister

Fix RSS reporting on macOS

> NOTE: This is a duplicate of #98164, which I closed because I borked my rustc fork

Currently, `rustc_data_structures::profiling::get_resident_set_size()` always returns `None` on macOS. This is because
macOS does not implement procfs used in the unix version of the function:

```rust
...
else if #[cfg(unix)] {
        pub fn get_resident_set_size() -> Option<usize> {
            let field = 1;
            let contents = fs::read("/proc/self/statm").ok()?;
            let contents = String::from_utf8(contents).ok()?;
            let s = contents.split_whitespace().nth(field)?;
            let npages = s.parse::<usize>().ok()?;
            Some(npages * 4096)
        }
...
```

The proposed solution uses libproc, and more specifically `proc_pidinfo`, which has been available on macOS since 10.5 if the function signature inside libproc.h is to be believed:

```c
int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
```

2 years agoRollup merge of #98337 - c410-f3r:assert-compiler, r=oli-obk
Dylan DPC [Tue, 28 Jun 2022 10:00:02 +0000 (15:30 +0530)]
Rollup merge of #98337 - c410-f3r:assert-compiler, r=oli-obk

[RFC 2011] Optimize non-consuming operators

Tracking issue: https://github.com/rust-lang/rust/issues/44838
Fifth step of https://github.com/rust-lang/rust/pull/96496

The most non-invasive approach that will probably have very little to no performance impact.

## Current behaviour

Captures are handled "on-the-fly", i.e., they are performed in the same place expressions are located.

```rust
// `let a = 1; let b = 2; assert!(a > 1 && b < 100);`

if !(
  { ***try capture `a` and then return `a`*** } > 1 && { ***try capture `b` and then return `b`*** } < 100
) {
  panic!( ... );
}
```

As such, some overhead is likely to occur (Specially with very large chains of conditions).

## New behaviour for non-consuming operators

When an operator is known to not take `self`, then it is possible to capture variables **AFTER** the condition.

```rust
// `let a = 1; let b = 2; assert!(a > 1 && b < 100);`

if !( a > 1 && b < 100 ) {
  { ***try capture `a`*** }
  { ***try capture `b`*** }
  panic!( ... );
}
```

So the possible impact on the runtime execution time will be diminished.

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

2 years agoRollup merge of #98261 - WaffleLapkin:attempt_to_remove_max_suggestion_highlight_line...
Dylan DPC [Tue, 28 Jun 2022 10:00:01 +0000 (15:30 +0530)]
Rollup merge of #98261 - WaffleLapkin:attempt_to_remove_max_suggestion_highlight_lines, r=flip1995

Remove `MAX_SUGGESTION_HIGHLIGHT_LINES`

After #97798 the `MAX_SUGGESTION_HIGHLIGHT_LINES` constant doesn't really make sense since we always show full suggestions. This PR removes last usages of the constant and the constant itself.

r? ``@flip1995`` (this mostly does changes in clippy)

2 years agoRollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk
Dylan DPC [Tue, 28 Jun 2022 10:00:00 +0000 (15:30 +0530)]
Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk

Remove a back-compat hack on lazy TAIT

This PR's motivation is here: https://github.com/rust-lang/rust/issues/72614#issuecomment-1134595446
~~But removing a hack doesn't seem to reject the code on the issue, there're some more hacks?~~
r? ``@oli-obk``

2 years agoAuto merge of #98396 - cjgillot:iwfchir, r=petrochenkov
bors [Tue, 28 Jun 2022 09:48:18 +0000 (09:48 +0000)]
Auto merge of #98396 - cjgillot:iwfchir, r=petrochenkov

Do not access HIR to check impl wf.

r? `@ghost`

2 years agoAdd regression test for glob import ICE in rustdoc JSON
Guillaume Gomez [Tue, 28 Jun 2022 09:46:24 +0000 (11:46 +0200)]
Add regression test for glob import ICE in rustdoc JSON

2 years agoFix glob import ICE in rustdoc JSON format
Guillaume Gomez [Tue, 28 Jun 2022 09:46:03 +0000 (11:46 +0200)]
Fix glob import ICE in rustdoc JSON format

2 years agofix ice for associated constant generics
Takayuki Maeda [Tue, 28 Jun 2022 09:29:07 +0000 (18:29 +0900)]
fix ice for associated constant generics

2 years agotest/rustdoc-json/assoc_type.rs: Maximize chance of detecting future ICEs
Martin Nordholts [Tue, 28 Jun 2022 09:02:14 +0000 (11:02 +0200)]
test/rustdoc-json/assoc_type.rs: Maximize chance of detecting future ICEs

2 years agorustdoc-json: Add assoc type ICE regression test
Martin Nordholts [Sun, 26 Jun 2022 18:22:04 +0000 (20:22 +0200)]
rustdoc-json: Add assoc type ICE regression test

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Tue, 28 Jun 2022 06:54:21 +0000 (09:54 +0300)]
:arrow_up: rust-analyzer

2 years agoAuto merge of #98324 - conradludgate:write-vectored-vec, r=Mark-Simulacrum
bors [Tue, 28 Jun 2022 06:25:19 +0000 (06:25 +0000)]
Auto merge of #98324 - conradludgate:write-vectored-vec, r=Mark-Simulacrum

attempt to optimise vectored write

benchmarked:

old:
```
test io::cursor::tests::bench_write_vec                     ... bench:          68 ns/iter (+/- 2)
test io::cursor::tests::bench_write_vec_vectored            ... bench:         913 ns/iter (+/- 31)
```

new:
```
test io::cursor::tests::bench_write_vec                     ... bench:          64 ns/iter (+/- 0)
test io::cursor::tests::bench_write_vec_vectored            ... bench:         747 ns/iter (+/- 27)
```

More unsafe than I wanted (and less gains) in the end, but it still does the job

2 years agoAuto merge of #98222 - cjgillot:single-wf, r=michaelwoerister
bors [Tue, 28 Jun 2022 03:44:33 +0000 (03:44 +0000)]
Auto merge of #98222 - cjgillot:single-wf, r=michaelwoerister

Only keep a single query for well-formed checking

There are currently 3 queries to perform wf checks on different item-likes.  This complexity is not required.

This PR replaces the query by:
- one query per item;
- one query to invoke it for a whole module.

This allows to remove HIR `ParItemLikeVisitor`.

2 years agoadd regression test for #80074
Takayuki Maeda [Tue, 28 Jun 2022 03:28:04 +0000 (12:28 +0900)]
add regression test for #80074

2 years agoRemove unstable CStr/CString change from 1.62 release note
Weiyi Wang [Mon, 27 Jun 2022 23:35:33 +0000 (19:35 -0400)]
Remove unstable CStr/CString change from 1.62 release note

(Discovered in https://github.com/rust-lang/rust/pull/98571#discussion_r907469604)

The change to move CStr/CString to core/alloc is currently behind feature flags as stated in https://github.com/rust-lang/rust/issues/98314

2 years agoImplement `Send` and `Sync` for `ThinBox<T>`
Josh Stone [Mon, 27 Jun 2022 22:49:59 +0000 (15:49 -0700)]
Implement `Send` and `Sync` for `ThinBox<T>`

Just like `Box<T>`, `ThinBox<T>` owns its data on the heap, so it should
implement `Send` and `Sync` when `T` does.

2 years agoAuto merge of #98591 - matthiaskrgr:rollup-7dok1wq, r=matthiaskrgr
bors [Mon, 27 Jun 2022 22:22:58 +0000 (22:22 +0000)]
Auto merge of #98591 - matthiaskrgr:rollup-7dok1wq, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #98331 (Fix rustdoc argument error)
 - #98506 (Fix span issues in object safety suggestions)
 - #98563 (interpret: refactor allocation info query)
 - #98576 (small regions refactoring)
 - #98577 (Fix "kind" for associated types in trait implementations in rustdoc JSON)
 - #98578 (Remove eddyb from miri failure pings)
 - #98579 (liballoc tests: avoid int2ptr cast)
 - #98581 (Add triagebot mentions.)
 - #98587 (libcore tests: avoid int2ptr casts)

Failed merges:

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

2 years agoRollup merge of #98587 - RalfJung:core-tests, r=thomcc
Matthias Krüger [Mon, 27 Jun 2022 20:35:14 +0000 (22:35 +0200)]
Rollup merge of #98587 - RalfJung:core-tests, r=thomcc

libcore tests: avoid int2ptr casts

We don't need any of these pointers to actually be dereferenceable so using `ptr::invalid` should be fine. And then we can run Miri with strict provenance enforcement on the tests.

2 years agoRollup merge of #98581 - ehuss:triagebot-mentions, r=Mark-Simulacrum
Matthias Krüger [Mon, 27 Jun 2022 20:35:14 +0000 (22:35 +0200)]
Rollup merge of #98581 - ehuss:triagebot-mentions, r=Mark-Simulacrum

Add triagebot mentions.

This migrates the configuration of mentions from highfive to triagebot.

I also fixed a few broken paths (error_codes.rs src/librustdoc/html/static/themes src/librustdoc/html/static/themes/ayu.css).

2 years agoRollup merge of #98579 - RalfJung:alloc-tests, r=thomcc
Matthias Krüger [Mon, 27 Jun 2022 20:35:13 +0000 (22:35 +0200)]
Rollup merge of #98579 - RalfJung:alloc-tests, r=thomcc

liballoc tests: avoid int2ptr cast

I think we don't need `ptr::from_exposed_addr` here; `ptr::invalid` should be enough for this test. (And this makes Miri less unhappy when running these tests.)

2 years agoRollup merge of #98578 - rust-lang:oli-obk-patch-1, r=eddyb
Matthias Krüger [Mon, 27 Jun 2022 20:35:11 +0000 (22:35 +0200)]
Rollup merge of #98578 - rust-lang:oli-obk-patch-1, r=eddyb

Remove eddyb from miri failure pings

r? `@eddyb`

2 years agoRollup merge of #98577 - GuillaumeGomez:associated-items, r=notriddle
Matthias Krüger [Mon, 27 Jun 2022 20:35:11 +0000 (22:35 +0200)]
Rollup merge of #98577 - GuillaumeGomez:associated-items, r=notriddle

Fix "kind" for associated types in trait implementations in rustdoc JSON

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

Contrary to what is suggested in the issue, I really think we should distinguish between associated items and "normal" constants and types.

cc `@CraftSpider` `@SimonSapin`
r? `@notriddle`

2 years agoRollup merge of #98576 - lcnr:region-stuff-cool-beans, r=jackh726
Matthias Krüger [Mon, 27 Jun 2022 20:35:09 +0000 (22:35 +0200)]
Rollup merge of #98576 - lcnr:region-stuff-cool-beans, r=jackh726

small regions refactoring

these commits should be fairly self-contained

r? rust-lang/types

2 years agoRollup merge of #98563 - RalfJung:interpret-alloc-check, r=oli-obk
Matthias Krüger [Mon, 27 Jun 2022 20:35:08 +0000 (22:35 +0200)]
Rollup merge of #98563 - RalfJung:interpret-alloc-check, r=oli-obk

interpret: refactor allocation info query

We now have an infallible function that also tells us which kind of allocation we are talking about.
Also we do longer have to distinguish between data and function allocations for liveness.

This will help us to avoid "catching" `InterpError`s in Miri.
r? `@oli-obk`

2 years agoRollup merge of #98506 - compiler-errors:object-safety-suggestions, r=oli-obk
Matthias Krüger [Mon, 27 Jun 2022 20:35:07 +0000 (22:35 +0200)]
Rollup merge of #98506 - compiler-errors:object-safety-suggestions, r=oli-obk

Fix span issues in object safety suggestions

Fixes #98500

2 years agoRollup merge of #98331 - GuillaumeGomez:rustdoc-arg-error, r=notriddle
Matthias Krüger [Mon, 27 Jun 2022 20:35:06 +0000 (22:35 +0200)]
Rollup merge of #98331 - GuillaumeGomez:rustdoc-arg-error, r=notriddle

Fix rustdoc argument error

Fixes #88756.

It's a take over of #88831. I cherry-picked the commits, fixed the merge conflict and the failing test.

cc `@inashivb` `@jyn514`

r? `@notriddle`

2 years agoAuto merge of #97307 - SparrowLii:parallel, r=cjgillot
bors [Mon, 27 Jun 2022 19:42:09 +0000 (19:42 +0000)]
Auto merge of #97307 - SparrowLii:parallel, r=cjgillot

catch unwind in parallel mode during wfcheck

Update #75760
When performing wfcheck, from the test results, the parallel mode will stop all checks when an `item`'s check failed, (e.g. the first ui test failure raised from [here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs#L249))while the serial mode will output each `item`'s check result via `catch_unwind`. This leads to inconsistencies in the final output of the two mode.
In my local environment, this modification prevents the following ui tests from failing when set `parallel-compiler = true` in `config.toml`:

```
    [ui] src/test\ui\associated-types\defaults-cyclic-fail-1.rs
    [ui] src/test\ui\associated-types\defaults-cyclic-fail-2.rs
    [ui] src/test\ui\associated-types\hr-associated-type-bound-2.rs
    [ui] src/test\ui\associated-types\impl-wf-cycle-1.rs
    [ui] src/test\ui\associated-types\impl-wf-cycle-2.rs
    [ui] src/test\ui\issues\issue-20413.rs
    [ui] src/test\ui\parallel_test\defaults-cyclic-fail-para.rs
```

2 years agoAdd triagebot mentions.
Eric Huss [Mon, 27 Jun 2022 15:57:06 +0000 (08:57 -0700)]
Add triagebot mentions.

2 years agolibcore tests: avoid int2ptr casts
Ralf Jung [Mon, 27 Jun 2022 15:09:53 +0000 (11:09 -0400)]
libcore tests: avoid int2ptr casts

2 years agoAuto merge of #98566 - matthiaskrgr:rollup-43etyls, r=matthiaskrgr
bors [Mon, 27 Jun 2022 16:28:58 +0000 (16:28 +0000)]
Auto merge of #98566 - matthiaskrgr:rollup-43etyls, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #97389 (Improve memory ordering diagnostics)
 - #97780 (Check ADT field is well-formed before checking it is sized)
 - #98530 (compiletest: add issue number param to `known-bug`)
 - #98556 (Fix builds on Windows (closes #98546))
 - #98561 (Fix spelling in SAFETY comment)

Failed merges:

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

2 years agomake AllocKind actually public
Ralf Jung [Mon, 27 Jun 2022 14:58:30 +0000 (10:58 -0400)]
make AllocKind actually public

2 years agoliballoc tests: avoid int2ptr cast
Ralf Jung [Mon, 27 Jun 2022 14:50:56 +0000 (10:50 -0400)]
liballoc tests: avoid int2ptr cast

2 years agoRemove eddyb from miri failure pings
Oli Scherer [Mon, 27 Jun 2022 14:08:19 +0000 (16:08 +0200)]
Remove eddyb from miri failure pings

2 years agolower-generic vs. outlive
lcnr [Mon, 27 Jun 2022 14:06:46 +0000 (16:06 +0200)]
lower-generic vs. outlive

2 years agoAdd test for associated items in rustdoc JSON
Guillaume Gomez [Mon, 27 Jun 2022 13:59:18 +0000 (15:59 +0200)]
Add test for associated items in rustdoc JSON

2 years agoFix kind for associated types in rustdoc JSON output for trait implementations
Guillaume Gomez [Mon, 27 Jun 2022 13:59:02 +0000 (15:59 +0200)]
Fix kind for associated types in rustdoc JSON output for trait implementations

2 years agofold_region: remove unused parameter
lcnr [Mon, 27 Jun 2022 13:55:03 +0000 (15:55 +0200)]
fold_region: remove unused parameter

2 years agooutside of borrowck, do not provide an implicit_region_bound
lcnr [Mon, 27 Jun 2022 13:48:54 +0000 (15:48 +0200)]
outside of borrowck, do not provide an implicit_region_bound

see comment added to the field in `VerifyBoundCx`.

2 years agoRemove a back-compat hack on lazy TAIT
Yuki Okushi [Tue, 24 May 2022 08:55:13 +0000 (17:55 +0900)]
Remove a back-compat hack on lazy TAIT

2 years agoFinish rustdoc error improvement
Guillaume Gomez [Tue, 21 Jun 2022 10:05:59 +0000 (12:05 +0200)]
Finish rustdoc error improvement

2 years agoAdd test for help output with -W
Shivani Bhardwaj [Thu, 27 Jan 2022 08:17:10 +0000 (13:47 +0530)]
Add test for help output with -W

2 years agoAdd test for default rustdoc run
Shivani Bhardwaj [Wed, 15 Sep 2021 01:28:59 +0000 (06:58 +0530)]
Add test for default rustdoc run

2 years agoFix `rustdoc` argument error
Shivani Bhardwaj [Fri, 10 Sep 2021 18:35:16 +0000 (00:05 +0530)]
Fix `rustdoc` argument error

2 years agocatch unwind of every iter in parallel mode during wfcheck
SparrowLii [Mon, 27 Jun 2022 08:39:10 +0000 (16:39 +0800)]
catch unwind of every iter in parallel mode during wfcheck

2 years agoprivacy: deny diagnostic migration lints
David Wood [Wed, 22 Jun 2022 13:17:14 +0000 (14:17 +0100)]
privacy: deny diagnostic migration lints

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoprivacy: port "in public interface" diag
David Wood [Wed, 22 Jun 2022 13:11:39 +0000 (14:11 +0100)]
privacy: port "in public interface" diag

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoprivacy: port unnamed "item is private" diag
David Wood [Wed, 22 Jun 2022 12:42:30 +0000 (13:42 +0100)]
privacy: port unnamed "item is private" diag

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoprivacy: port "item is private" diag
David Wood [Wed, 22 Jun 2022 12:31:24 +0000 (13:31 +0100)]
privacy: port "item is private" diag

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoprivacy: port "field is private" diag
David Wood [Wed, 22 Jun 2022 13:17:34 +0000 (14:17 +0100)]
privacy: port "field is private" diag

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agovarious: add `rustc_lint_diagnostics` to diag fns
David Wood [Wed, 22 Jun 2022 12:24:35 +0000 (13:24 +0100)]
various: add `rustc_lint_diagnostics` to diag fns

The `rustc_lint_diagnostics` attribute is used by the diagnostic
translation/struct migration lints to identify calls where
non-translatable diagnostics or diagnostics outwith impls are being
created. Any function used in creating a diagnostic should be annotated
with this attribute so this commit adds the attribute to many more
functions.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agolint: fix condition in diagnostic lints
David Wood [Wed, 22 Jun 2022 10:25:10 +0000 (11:25 +0100)]
lint: fix condition in diagnostic lints

Unfortunately, the diagnostic lints are very broken and trigger much
more often than they should. Correct the conditional which checks if the
function call being made is to a diagnostic function so that it returns
in every intended case.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoRollup merge of #98561 - Wilfred:patch-4, r=fee1-dead
Matthias Krüger [Mon, 27 Jun 2022 06:06:49 +0000 (08:06 +0200)]
Rollup merge of #98561 - Wilfred:patch-4, r=fee1-dead

Fix spelling in SAFETY comment

"can not" should be "cannot", and add punctuation.

2 years agoRollup merge of #98556 - BlaCoiso:patch-1, r=jyn514
Matthias Krüger [Mon, 27 Jun 2022 06:06:48 +0000 (08:06 +0200)]
Rollup merge of #98556 - BlaCoiso:patch-1, r=jyn514

Fix builds on Windows (closes #98546)

closes https://github.com/rust-lang/rust/issues/98546

2 years agoRollup merge of #98530 - davidkna:known-bug-ref, r=Mark-Simulacrum
Matthias Krüger [Mon, 27 Jun 2022 06:06:47 +0000 (08:06 +0200)]
Rollup merge of #98530 - davidkna:known-bug-ref, r=Mark-Simulacrum

compiletest: add issue number param to `known-bug`

I was getting some errors while testing this, but I'm pretty sure that was unrelated to my changes.

Closes #98436

> Basically, instead of `// known-bug`, do `// known-bug #00000` or maybe `// known-bug chalk#00`?
>
> From: https://rust-lang.zulipchat.com/#narrow/stream/326866-t-types.2Fnominated/topic/.2398095.3A.20NLL.3A.20unsound.20verification.20of.20higher.20ranked.20outlives.E2.80.A6/near/287258738

I also added an `unknown` escape-hatch because I didn't find corresponding issues for every `// known-bug`.

The syntax also ended up being `// known-bug: `, because of `set_name_value_directive`.

2 years agoRollup merge of #97780 - compiler-errors:field-wfcheck-before-sized, r=jackh726
Matthias Krüger [Mon, 27 Jun 2022 06:06:46 +0000 (08:06 +0200)]
Rollup merge of #97780 - compiler-errors:field-wfcheck-before-sized, r=jackh726

Check ADT field is well-formed before checking it is sized

Fixes #96810.

There is one diagnostics regression, in [`src/test/ui/generic-associated-types/bugs/issue-80626.stderr`](https://github.com/rust-lang/rust/pull/97780/files#diff-53795946378e78a0af23a10277c628ff79091c18090fdc385801ee70c1ba6963). I am not super concerned about it, since it's GAT related.
We _could_ fix it, possibly by using the `FieldSized` obligation cause code instead of `BuiltinDerivedObligation`. But that would require changing `Sized` trait confirmation and the `adt_sized_constraint` query.

2 years agoRollup merge of #97389 - m-ou-se:memory-ordering-diagnostics, r=estebank
Matthias Krüger [Mon, 27 Jun 2022 06:06:45 +0000 (08:06 +0200)]
Rollup merge of #97389 - m-ou-se:memory-ordering-diagnostics, r=estebank

Improve memory ordering diagnostics

Before:

![image](https://user-images.githubusercontent.com/783247/170234545-891cac30-eaa2-4186-847b-35cd51e00f2b.png)

After:

![image](https://user-images.githubusercontent.com/783247/170239684-645f186f-5a02-4eb9-8651-2e5fe9591352.png)

---

Before this change, the compiler suggests the failure ordering is too strong and suggests choosing a weaker ordering. After this change, it instead suggests the success ordering is not strong enough, and suggests chosing a stronger one. This is more likely to be correct.

Also, before this change, the compiler suggested downgrading an invalid AcqRel failure ordering to Relaxed, without mentioning Acquire as an option.

2 years agoAuto merge of #98285 - nikic:update-llvm-5, r=cuviper
bors [Mon, 27 Jun 2022 05:36:50 +0000 (05:36 +0000)]
Auto merge of #98285 - nikic:update-llvm-5, r=cuviper

Rebase LLVM submodule

This is a rebase of our LLVM fork onto LLVM 14.0.5, which is intended to be the last release of the 14.x series. Additionally:

 * I've dropped three patches that were needed to build on FreeBSD 11, which is no longer necessary after #97944.
 * I've dropped some cherry-picks that were later reverted.
 * I've cherry-picked https://github.com/llvm/llvm-project/commit/caa2a829cdf905a5e8664d96a464d414b2adb42e for https://github.com/rust-lang/rust/issues/96797 (fyi `@Amanieu)`

2 years agoRemove references to `./tmp` in-tree
Joshua Nelson [Mon, 27 Jun 2022 04:25:12 +0000 (23:25 -0500)]
Remove references to `./tmp` in-tree

These used to be used by codegen-units tests, but were switched from manually specifying directories
to just using `// incremental` in https://github.com/rust-lang/rust/pull/89101.
Remove the old references.

2 years agoAuto merge of #98221 - cjgillot:single-coh, r=lcnr
bors [Mon, 27 Jun 2022 02:56:06 +0000 (02:56 +0000)]
Auto merge of #98221 - cjgillot:single-coh, r=lcnr

Perform coherence checking per impl.

r? `@ghost`

2 years agointerpret: refactor allocation info query
Ralf Jung [Mon, 27 Jun 2022 02:49:38 +0000 (22:49 -0400)]
interpret: refactor allocation info query

We now have an infallible function that also tells us which kind of allocation we are talking about.
Also we do longer have to distinguish between data and function allocations for liveness.

2 years agoFix spelling in SAFETY comment
Wilfred Hughes [Mon, 27 Jun 2022 02:17:34 +0000 (19:17 -0700)]
Fix spelling in SAFETY comment

"can not" should be "cannot", and add punctuation.

2 years agoadd regression test for #85907
Takayuki Maeda [Mon, 27 Jun 2022 01:07:19 +0000 (10:07 +0900)]
add regression test for #85907

2 years agoAuto merge of #98212 - petrochenkov:addlinkargs, r=lqd
bors [Mon, 27 Jun 2022 00:27:40 +0000 (00:27 +0000)]
Auto merge of #98212 - petrochenkov:addlinkargs, r=lqd

rustc_target: Add convenience functions for adding linker arguments

They ensure that lld and non-lld linker flavors get the same set of arguments.

The second commit also adds some tests checking for linker argument inconsistencies, and tweaks some arguments to fix those inconsistencies.

2 years agoFix builds on Windows (closes #98546)
BlaCoiso [Sun, 26 Jun 2022 22:27:44 +0000 (23:27 +0100)]
Fix builds on Windows (closes #98546)

2 years agoAuto merge of #98187 - mystor:fast_span_call_site, r=eddyb
bors [Sun, 26 Jun 2022 21:28:24 +0000 (21:28 +0000)]
Auto merge of #98187 - mystor:fast_span_call_site, r=eddyb

proc_macro/bridge: cache static spans in proc_macro's client thread-local state

This is the second part of https://github.com/rust-lang/rust/pull/86822, split off as requested in https://github.com/rust-lang/rust/pull/86822#pullrequestreview-1008655452. This patch removes the RPC calls required for the very common operations of `Span::call_site()`, `Span::def_site()` and `Span::mixed_site()`.

Some notes:

This part is one of the ones I don't love as a final solution from a design standpoint, because I don't like how the spans are serialized immediately at macro invocation. I think a more elegant solution might've been to reserve special IDs for `call_site`, `def_site`, and `mixed_site` at compile time (either starting at 1 or from `u32::MAX`) and making reading a Span handle automatically map these IDs to the relevant values, rather than doing extra serialization.

This would also have an advantage for potential future work to allow `proc_macro` to operate more independently from the compiler (e.g. to reduce the necessity of `proc-macro2`), as methods like `Span::call_site()` could be made to function without access to the compiler backend.

That was unfortunately tricky to do at the time, as this was the first part I wrote of the patches. After the later part (#98188, #98189), the other uses of `InternedStore` are removed meaning that a custom serialization strategy for `Span` is easier to implement.

If we want to go that path, we'll still need the majority of the work to split the bridge object and introduce the `Context` trait for free methods, and it will be easier to do after `Span` is the only user of `InternedStore` (after #98189).

2 years agoHermit: Make Mutex::init a no-op
Martin Kröning [Sun, 26 Jun 2022 21:20:41 +0000 (23:20 +0200)]
Hermit: Make Mutex::init a no-op

2 years agoHermit: Fix initializing lazy locks
Martin Kröning [Sun, 26 Jun 2022 20:52:19 +0000 (22:52 +0200)]
Hermit: Fix initializing lazy locks

2 years agocompiletest: add issue number param to `known-bug`
David Knaack [Sun, 26 Jun 2022 08:51:23 +0000 (10:51 +0200)]
compiletest: add issue number param to `known-bug`

2 years agoAuto merge of #98545 - matthiaskrgr:rollup-njely29, r=matthiaskrgr
bors [Sun, 26 Jun 2022 19:02:00 +0000 (19:02 +0000)]
Auto merge of #98545 - matthiaskrgr:rollup-njely29, r=matthiaskrgr

Rollup of 11 pull requests

Successful merges:

 - #97140 (std: use an event-flag-based thread parker on SOLID)
 - #97295 ([rustc_parse] Forbid `let`s in certain places)
 - #97743 (make const_err show up in future breakage reports)
 - #97908 (Stabilize NonZero* checked operations constness.)
 - #98297 (Transform help popup into a pocket menu)
 - #98428 (macros: use typed identifiers in diag and subdiag derive)
 - #98528 (Respect --color when building rustbuild itself)
 - #98535 (Add regression test for generic const in rustdoc)
 - #98538 (Add a ui test for issue #91883)
 - #98540 (Add regression test for #87558)
 - #98541 (Update `std::alloc::System` doc example code style)

Failed merges:

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

2 years agoRollup merge of #98541 - Veykril:patch-2, r=Dylan-DPC
Matthias Krüger [Sun, 26 Jun 2022 17:47:09 +0000 (19:47 +0200)]
Rollup merge of #98541 - Veykril:patch-2, r=Dylan-DPC

Update `std::alloc::System` doc example code style

`return` on the last line of a block is unidiomatic so I don't think the example should be using that here

2 years agoRollup merge of #98540 - TaKO8Ki:add-regression-test-for-87558, r=Mark-Simulacrum
Matthias Krüger [Sun, 26 Jun 2022 17:47:08 +0000 (19:47 +0200)]
Rollup merge of #98540 - TaKO8Ki:add-regression-test-for-87558, r=Mark-Simulacrum

Add regression test for #87558

Fixes #87558

2 years agoRollup merge of #98538 - TaKO8Ki:add-test-for-issue-91883, r=Mark-Simulacrum
Matthias Krüger [Sun, 26 Jun 2022 17:47:07 +0000 (19:47 +0200)]
Rollup merge of #98538 - TaKO8Ki:add-test-for-issue-91883, r=Mark-Simulacrum

Add a ui test for issue #91883

closes #91883

2 years agoRollup merge of #98535 - GuillaumeGomez:regression-test-92859, r=lcnr
Matthias Krüger [Sun, 26 Jun 2022 17:47:06 +0000 (19:47 +0200)]
Rollup merge of #98535 - GuillaumeGomez:regression-test-92859, r=lcnr

Add regression test for generic const in rustdoc

Fixes #92859.

r? ```@lcnr```

2 years agoRollup merge of #98528 - jyn514:bootstrap-color, r=Mark-Simulacrum
Matthias Krüger [Sun, 26 Jun 2022 17:47:05 +0000 (19:47 +0200)]
Rollup merge of #98528 - jyn514:bootstrap-color, r=Mark-Simulacrum

Respect --color when building rustbuild itself

Separated out from https://github.com/rust-lang/rust/pull/95503.

2 years agoRollup merge of #98428 - davidtwco:translation-derive-typed-identifiers, r=oli-obk
Matthias Krüger [Sun, 26 Jun 2022 17:47:04 +0000 (19:47 +0200)]
Rollup merge of #98428 - davidtwco:translation-derive-typed-identifiers, r=oli-obk

macros: use typed identifiers in diag and subdiag derive

Using typed identifiers instead of strings with the Fluent identifiers in the diagnostic and subdiagnostic derives - this enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers, namely that use of a non-existent Fluent identifier will not compile.

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

2 years agoRollup merge of #98297 - GuillaumeGomez:help-pocket-menu, r=notriddle
Matthias Krüger [Sun, 26 Jun 2022 17:47:03 +0000 (19:47 +0200)]
Rollup merge of #98297 - GuillaumeGomez:help-pocket-menu, r=notriddle

Transform help popup into a pocket menu

Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup.

You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot:

![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png)

r? ``````````@jsha``````````

2 years agoRollup merge of #97908 - iago-lito:stabilize_nonzero_checked_ops_constness, r=scottmcm
Matthias Krüger [Sun, 26 Jun 2022 17:47:02 +0000 (19:47 +0200)]
Rollup merge of #97908 - iago-lito:stabilize_nonzero_checked_ops_constness, r=scottmcm

Stabilize NonZero* checked operations constness.

Partial stabilization for #97547 (continued).

2 years agoRollup merge of #97743 - RalfJung:const-err-future-breakage, r=estebank
Matthias Krüger [Sun, 26 Jun 2022 17:47:01 +0000 (19:47 +0200)]
Rollup merge of #97743 - RalfJung:const-err-future-breakage, r=estebank

make const_err show up in future breakage reports

As tracked in https://github.com/rust-lang/rust/issues/71800, const_err should become a hard error Any Day Now (TM). I'd love to move forward with that sooner rather than later; it has been deny-by-default for many years and a future incompat lint since https://github.com/rust-lang/rust/pull/80394 (landed more than a year ago). Some CTFE errors are already hard errors since https://github.com/rust-lang/rust/pull/86194. But before we truly make it a hard error in all cases, we now have one more intermediate step we can take -- to make it show up in future breakage reports.

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

2 years agoRollup merge of #97295 - c410-f3r:yet-another-let-chain, r=compiler-errors
Matthias Krüger [Sun, 26 Jun 2022 17:47:00 +0000 (19:47 +0200)]
Rollup merge of #97295 - c410-f3r:yet-another-let-chain, r=compiler-errors

[rustc_parse] Forbid `let`s in certain places

Currently only forbids in locals to resolve https://github.com/rust-lang/rust/pull/94927#issuecomment-1099605024 but feel free to point any other places.

2 years agoRollup merge of #97140 - joboet:solid_parker, r=m-ou-se
Matthias Krüger [Sun, 26 Jun 2022 17:46:59 +0000 (19:46 +0200)]
Rollup merge of #97140 - joboet:solid_parker, r=m-ou-se

std: use an event-flag-based thread parker on SOLID

`Mutex` and `Condvar` are being replaced by more efficient implementations, which need thread parking themselves (see #93740). Therefore, the generic `Parker` needs to be replaced on all platforms where the new lock implementation will be used, which, after #96393, are SOLID, SGX and Hermit (more PRs coming soon).

SOLID, conforming to the [μITRON specification](http://www.ertl.jp/ITRON/SPEC/FILE/mitron-400e.pdf), has event flags, which are a thread parking primitive very similar to `Parker`. However, they do not make any atomic ordering guarantees (even though those can probably be assumed) and necessitate a system call even when the thread token is already available. Hence, this `Parker`, like the Windows parker, uses an extra atomic state variable.

I future-proofed the code by wrapping the event flag in a `WaitFlag` structure, as both SGX and Hermit can share the Parker implementation, they just have slightly different primitives (SGX uses signals and Hermit has a thread blocking API).

`````@kawadakk````` I assume you are the target maintainer? Could you test this for me?

2 years agoproc_macro: Rename ExpnContext to ExpnGlobals, and unify method on Server trait
Nika Layzell [Sun, 26 Jun 2022 16:48:33 +0000 (12:48 -0400)]
proc_macro: Rename ExpnContext to ExpnGlobals, and unify method on Server trait

2 years agoattempt to optimise vectored write
Conrad Ludgate [Tue, 21 Jun 2022 05:42:25 +0000 (06:42 +0100)]
attempt to optimise vectored write

2 years agoAuto merge of #98190 - nnethercote:optimize-derive-Debug-code, r=scottmcm
bors [Sun, 26 Jun 2022 15:00:04 +0000 (15:00 +0000)]
Auto merge of #98190 - nnethercote:optimize-derive-Debug-code, r=scottmcm

Improve `derive(Debug)`

r? `@ghost`

2 years agoUpdate `std::alloc::System` docs
Lukas Wirth [Sun, 26 Jun 2022 14:31:29 +0000 (16:31 +0200)]
Update `std::alloc::System` docs