]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoAuto merge of #102737 - RalfJung:poll_fn_pin, r=Mark-Simulacrum
bors [Fri, 28 Oct 2022 23:27:33 +0000 (23:27 +0000)]
Auto merge of #102737 - RalfJung:poll_fn_pin, r=Mark-Simulacrum

poll_fn and Unpin: fix pinning

See [IRLO](https://internals.rust-lang.org/t/surprising-soundness-trouble-around-pollfn/17484) for details: currently `poll_fn` is very subtle to use, since it does not pin the closure, so creating a `Pin::get_unchcked(&mut capture)` inside the closure is unsound. This leads to actual miscompilations with `futures::join!`.

IMO the proper fix is to pin the closure when the future is pinned, which is achieved by changing the `Unpin` implementation. This is a breaking change though. 1.64.0 was *just* released, so maybe this is still okay?

The alternative would be to add some strong comments to the docs saying that closure captures are *not pinned* and doing `Pin::get_unchecked` on them is unsound.

20 months agoSpecialize ToString for Symbol
Cameron Steffen [Thu, 27 Oct 2022 21:14:48 +0000 (16:14 -0500)]
Specialize ToString for Symbol

20 months agoAdd a test for TAIT used with impl/dyn Trait inside RPIT
xxchan [Fri, 28 Oct 2022 20:58:19 +0000 (22:58 +0200)]
Add a test for TAIT used with impl/dyn Trait inside RPIT

20 months agorelative futex and condvar timeouts can work with isolation
Ralf Jung [Fri, 28 Oct 2022 14:13:10 +0000 (16:13 +0200)]
relative futex and condvar timeouts can work with isolation

20 months agoAuto merge of #2630 - RalfJung:windows-parking, r=RalfJung
bors [Fri, 28 Oct 2022 20:19:28 +0000 (20:19 +0000)]
Auto merge of #2630 - RalfJung:windows-parking, r=RalfJung

Implement thread parking for Windows

Cc https://github.com/rust-lang/miri/issues/2628

Based on code by `@DrMeepster.` However I adjusted `WakeByAddressSingle`: I don't think the futex value is compared *again* after the thread is woken up. I see nothing in the Windows docs indicating such a comparison, and the Linux futex does not behave like that either. So we only check the value before sleeping, same as on Linux.

20 months agoAuto merge of #103683 - fee1-dead-contrib:fix-deferred-cast-checks-constness, r=oli-obk
bors [Fri, 28 Oct 2022 19:28:41 +0000 (19:28 +0000)]
Auto merge of #103683 - fee1-dead-contrib:fix-deferred-cast-checks-constness, r=oli-obk

Retain ParamEnv constness when running deferred cast checks

Fixes #103677.

20 months agoEmit proper error when casting to Ddyn-star
Michael Goulet [Fri, 28 Oct 2022 17:32:34 +0000 (17:32 +0000)]
Emit proper error when casting to Ddyn-star

20 months agoAuto merge of #103071 - wesleywiser:fix_inlined_line_numbers, r=davidtwco
bors [Fri, 28 Oct 2022 16:27:56 +0000 (16:27 +0000)]
Auto merge of #103071 - wesleywiser:fix_inlined_line_numbers, r=davidtwco

Fix line numbers for MIR inlined code

`should_collapse_debuginfo` detects if the specified span is part of a
macro expansion however it does this by checking if the span is anything
other than a normal (non-expanded) kind, then the span sequence is
walked backwards to the root span.

This doesn't work when the MIR inliner inlines code as it creates spans
with expansion information set to `ExprKind::Inlined` and results in the
line number being attributed to the inline callsite rather than the
normal line number of the inlined code.

Fixes #103068

20 months agocleanup some test cfg
Ralf Jung [Fri, 28 Oct 2022 14:00:42 +0000 (16:00 +0200)]
cleanup some test cfg

20 months agotest most sync primitives on Windows
Ralf Jung [Fri, 28 Oct 2022 13:57:40 +0000 (15:57 +0200)]
test most sync primitives on Windows

20 months agosimplify Linux futex impl a bit
Ralf Jung [Fri, 28 Oct 2022 13:50:41 +0000 (15:50 +0200)]
simplify Linux futex impl a bit

20 months agothreadleak_ignored should now pass with preemption (the issue has been fixed a while...
Ralf Jung [Fri, 28 Oct 2022 13:48:58 +0000 (15:48 +0200)]
threadleak_ignored should now pass with preemption (the issue has been fixed a while ago)

20 months agoimplement thread parking on Windows
Ralf Jung [Fri, 28 Oct 2022 13:48:07 +0000 (15:48 +0200)]
implement thread parking on Windows

20 months agoAuto merge of #102674 - CastilloDel:master, r=oli-obk
bors [Fri, 28 Oct 2022 12:52:17 +0000 (12:52 +0000)]
Auto merge of #102674 - CastilloDel:master, r=oli-obk

Remove allow(rustc::potential_query_instability) in rustc_const_eval

The use of FxHashMap has been replaced with FxIndexMap.

Related to #84447

20 months agoRemove unneeded attribute.
Markus Reiter [Fri, 28 Oct 2022 12:17:34 +0000 (14:17 +0200)]
Remove unneeded attribute.

20 months agoRetain ParamEnv constness when running deferred cast checks
Deadbeef [Fri, 28 Oct 2022 11:46:12 +0000 (11:46 +0000)]
Retain ParamEnv constness when running deferred cast checks

Fixes #103677.

20 months agoAuto merge of #2627 - RalfJung:ignore-windows, r=RalfJung
bors [Fri, 28 Oct 2022 11:50:15 +0000 (11:50 +0000)]
Auto merge of #2627 - RalfJung:ignore-windows, r=RalfJung

update ignore-windows comments

Turns out 2 of these tests can actually be enabled. :)

20 months agoupdate ignore-windows comments
Ralf Jung [Fri, 28 Oct 2022 09:42:42 +0000 (11:42 +0200)]
update ignore-windows comments

20 months agoAuto merge of #103671 - matthiaskrgr:rollup-iuugpep, r=matthiaskrgr
bors [Fri, 28 Oct 2022 09:41:40 +0000 (09:41 +0000)]
Auto merge of #103671 - matthiaskrgr:rollup-iuugpep, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #102642 (Add tests for static async functions in traits)
 - #103283 (Add suggestions for unsafe impl error codes)
 - #103523 (Fix unwanted merge of inline doc comments for impl blocks)
 - #103550 (diagnostics: do not suggest static candidates as traits to import)
 - #103641 (Don't carry MIR location in `ConstraintCategory::CallArgument`)

Failed merges:

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

20 months agorustdoc-json-types: Improve ItemSummary::path docs
Nixon Enraght-Moony [Fri, 28 Oct 2022 00:43:37 +0000 (01:43 +0100)]
rustdoc-json-types: Improve ItemSummary::path docs

20 months agoAuto merge of #2626 - RalfJung:pthread_setname_np, r=RalfJung
bors [Fri, 28 Oct 2022 08:32:23 +0000 (08:32 +0000)]
Auto merge of #2626 - RalfJung:pthread_setname_np, r=RalfJung

pthread_setname_np returns an int on macOS

Fixes https://github.com/rust-lang/miri/issues/2625

20 months agopthread_setname_np returns an int on macOS
Ralf Jung [Fri, 28 Oct 2022 08:31:43 +0000 (10:31 +0200)]
pthread_setname_np returns an int on macOS

20 months agoAuto merge of #103672 - matthiaskrgr:rollup-dyk3civ, r=matthiaskrgr
bors [Fri, 28 Oct 2022 06:49:38 +0000 (06:49 +0000)]
Auto merge of #103672 - matthiaskrgr:rollup-dyk3civ, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #103585 (Migrate source line numbers CSS to CSS variables)
 - #103608 (Remap early bound lifetimes in return-position `impl Trait` in traits too)
 - #103609 (Emit a nicer error on `impl Self {`)
 - #103631 (Add test for issue 36007)
 - #103643 (rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags)
 - #103645 (Update cargo)

Failed merges:

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

20 months agoRollup merge of #103645 - weihanglo:update-cargo, r=weihanglo
Matthias Krüger [Fri, 28 Oct 2022 05:06:48 +0000 (07:06 +0200)]
Rollup merge of #103645 - weihanglo:update-cargo, r=weihanglo

Update cargo

6 commits in 9210810d1fd7b51ae0439a0a363cc50e36963455..7e484fc1a766f56dbc95380f45719698e0c82749 2022-10-25 22:31:50 +0000 to 2022-10-27 15:20:57 +0000
- fix(publish): Block until it is in index (rust-lang/cargo#11062)
- Add Accept-Encoding request header to enable compression (rust-lang/cargo#11292)
- Update contrib docs for highfive transition (rust-lang/cargo#11294)
- Migrate from highfive to triagebot (rust-lang/cargo#11293)
- Fix dupe word typos (rust-lang/cargo#11287)
- Fix confusing error messages when using -Zsparse-registry (rust-lang/cargo#11283)

20 months agoRollup merge of #103643 - notriddle:notriddle/summary-focus-visible, r=GuillaumeGomez
Matthias Krüger [Fri, 28 Oct 2022 05:06:47 +0000 (07:06 +0200)]
Rollup merge of #103643 - notriddle:notriddle/summary-focus-visible, r=GuillaumeGomez

rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags

We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.

20 months agoRollup merge of #103631 - Rageking8:Add-test-for-issue-36007, r=compiler-errors
Matthias Krüger [Fri, 28 Oct 2022 05:06:47 +0000 (07:06 +0200)]
Rollup merge of #103631 - Rageking8:Add-test-for-issue-36007, r=compiler-errors

Add test for issue 36007

Fixes #36007

r? ``@compiler-errors``

20 months agoRollup merge of #103609 - BoxyUwU:fix_impl_self_cycle, r=compiler-errors
Matthias Krüger [Fri, 28 Oct 2022 05:06:46 +0000 (07:06 +0200)]
Rollup merge of #103609 - BoxyUwU:fix_impl_self_cycle, r=compiler-errors

Emit a nicer error on `impl Self {`

currently it emits a "cycle detected error" but this PR makes it emit a more user friendly error specifically saying that `Self` is disallowed in that position. this is a pretty hacky fix so i dont expect this to be merged (I basically only made this PR because i wanted to see if CI passes)

r? ``@compiler-errors``

20 months agoRollup merge of #103608 - compiler-errors:rpitit-early-lt, r=cjgillot
Matthias Krüger [Fri, 28 Oct 2022 05:06:46 +0000 (07:06 +0200)]
Rollup merge of #103608 - compiler-errors:rpitit-early-lt, r=cjgillot

Remap early bound lifetimes in return-position `impl Trait` in traits too

Fixes part of #103457

r? ``@cjgillot,`` though feel free to reassign, just thought you'd have sufficient context to review.

20 months agoRollup merge of #103585 - GuillaumeGomez:source-line-css, r=notriddle
Matthias Krüger [Fri, 28 Oct 2022 05:06:45 +0000 (07:06 +0200)]
Rollup merge of #103585 - GuillaumeGomez:source-line-css, r=notriddle

Migrate source line numbers CSS to CSS variables

Part of https://github.com/rust-lang/rust/pull/98460.

No UI changes.

r? ``@notriddle``

20 months agoRollup merge of #103641 - compiler-errors:issue-103624, r=cjgillot
Matthias Krüger [Fri, 28 Oct 2022 05:06:43 +0000 (07:06 +0200)]
Rollup merge of #103641 - compiler-errors:issue-103624, r=cjgillot

Don't carry MIR location in `ConstraintCategory::CallArgument`

It turns out that `ConstraintCategory::CallArgument` cannot just carry a MIR location in it, since we may bubble them up to totally different MIR bodies.

So instead, revert the commit a6b5f95fb028f9feb4a2957c06b35035be2c6155, and instead just erase regions from the original `Option<Ty<'tcx>>` that it carried, so that it doesn't ICE with the changes in #103220.

Best reviewed in parts -- the first is just a revert, and the second is where the meaningful changes happen.

Fixes #103624

20 months agoRollup merge of #103550 - notriddle:notriddle/no-suggest-static-candidates, r=wesleywiser
Matthias Krüger [Fri, 28 Oct 2022 05:06:43 +0000 (07:06 +0200)]
Rollup merge of #103550 - notriddle:notriddle/no-suggest-static-candidates, r=wesleywiser

diagnostics: do not suggest static candidates as traits to import

If it's a static candidate, then it's already implemented. Do not suggest it a second time for implementing.

Partial fix for #102354

20 months agoRollup merge of #103523 - GuillaumeGomez:inline-doc-comment-impl-block, r=notriddle
Matthias Krüger [Fri, 28 Oct 2022 05:06:42 +0000 (07:06 +0200)]
Rollup merge of #103523 - GuillaumeGomez:inline-doc-comment-impl-block, r=notriddle

Fix unwanted merge of inline doc comments for impl blocks

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

We need this merge mechanism for inlined items but it's completely unwanted for impl blocks (at least the doc comments are, not the other attributes) since we want to keep what `cfg()` is put on the `pub use` or other attributes.

r? ``@notriddle``

20 months agoRollup merge of #103283 - nbarrios1337:unsafe-impl-suggestions, r=cjgillot
Matthias Krüger [Fri, 28 Oct 2022 05:06:42 +0000 (07:06 +0200)]
Rollup merge of #103283 - nbarrios1337:unsafe-impl-suggestions, r=cjgillot

Add suggestions for unsafe impl error codes

Adds suggestions for users to add `unsafe` to trait impls that should be `unsafe`, and remove `unsafe` from trait impls that do not require `unsafe`

With the folllowing code:

```rust
struct Foo {}

struct Bar {}

trait Safe {}

unsafe trait Unsafe {}

impl Safe for Foo {} // ok

impl Unsafe for Foo {} // E0200

unsafe impl Safe for Bar {} // E0199

unsafe impl Unsafe for Bar {} // ok

// omitted empty main fn
```

The current rustc output is:
```
error[E0199]: implementing the trait `Safe` is not unsafe
  --> e0200.rs:13:1
   |
13 | unsafe impl Safe for Bar {} // E0199
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0200]: the trait `Unsafe` requires an `unsafe impl` declaration
  --> e0200.rs:11:1
   |
11 | impl Unsafe for Foo {} // E0200
   | ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0199, E0200.
For more information about an error, try `rustc --explain E0199`.
```

With this PR, the future rustc output would be:
```
error[E0199]: implementing the trait `Safe` is not unsafe
  --> ../../temp/e0200.rs:13:1
   |
13 | unsafe impl Safe for Bar {} // E0199
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: remove `unsafe` from this trait implementation
   |
13 - unsafe impl Safe for Bar {} // E0199
13 + impl Safe for Bar {} // E0199
   |

error[E0200]: the trait `Unsafe` requires an `unsafe impl` declaration
  --> ../../temp/e0200.rs:11:1
   |
11 | impl Unsafe for Foo {} // E0200
   | ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the trait `Unsafe` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
help: add `unsafe` to this trait implementation
   |
11 | unsafe impl Unsafe for Foo {} // E0200
   | ++++++

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0199, E0200.
For more information about an error, try `rustc --explain E0199`.
```

``@rustbot`` label +T-compiler +A-diagnostics +A-suggestion-diagnostics

20 months agoRollup merge of #102642 - bryangarza:afit-tests, r=compiler-errors
Matthias Krüger [Fri, 28 Oct 2022 05:06:41 +0000 (07:06 +0200)]
Rollup merge of #102642 - bryangarza:afit-tests, r=compiler-errors

Add tests for static async functions in traits

This patch adds test cases for AFIT, the majority of which are currently expected to run as `check-fail`.

---

Note: I grabbed the cases from https://hackmd.io/SwRcXCiWQV-WRJ4BYs53fA

Also, I'm not sure if the `async-associated-types2` and `async-associated-types2-desugared` are correct, I modified them a bit from the examples in the HackMD.

20 months agoadd test for issue 98634
Rageking8 [Fri, 21 Oct 2022 10:37:35 +0000 (18:37 +0800)]
add test for issue 98634

20 months agoDo fewer passes and generally be more efficient when filtering tests
Ben Kimock [Tue, 26 Jul 2022 21:40:48 +0000 (17:40 -0400)]
Do fewer passes and generally be more efficient when filtering tests

21 months agorustdoc: remove redundant `div.search-container`
Michael Howell [Thu, 27 Oct 2022 20:36:27 +0000 (13:36 -0700)]
rustdoc: remove redundant `div.search-container`

This wrapper DIV was originally added in
89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's
size to be calculated without using `calc()`. This `width` hack can be
removed using flexbox.

21 months agoAuto merge of #103654 - flip1995:clippy_backport, r=Manishearth
bors [Fri, 28 Oct 2022 00:34:32 +0000 (00:34 +0000)]
Auto merge of #103654 - flip1995:clippy_backport, r=Manishearth

Move clippy::uninlined_format_args back to pedantic

Before `beta` is branched tomorrow we want to move this lint back to `pedantic` so that it is not enabled by default.

Clippy PR: https://github.com/rust-lang/rust-clippy/pull/9728
Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.60uninlined_format_args.60.20category/near/306306974

r? `@Manishearth`

21 months agoUpdate tests based on feedback
Bryan Garza [Thu, 27 Oct 2022 22:55:50 +0000 (22:55 +0000)]
Update tests based on feedback

- Add comment to some tests that will break when #102745 is implemented
- Mark a test with known-bug
- Delete duplicate test

21 months agoUpdate src/test/ui/async-await/in-trait/async-example.rs
Bryan Garza [Thu, 27 Oct 2022 22:47:30 +0000 (15:47 -0700)]
Update src/test/ui/async-await/in-trait/async-example.rs

Co-authored-by: Michael Goulet <michael@errs.io>
21 months agoAdd additional tests for static AFIT
Bryan Garza [Fri, 7 Oct 2022 16:15:13 +0000 (16:15 +0000)]
Add additional tests for static AFIT

21 months agoUpdate tests based on feedback
Bryan Garza [Fri, 7 Oct 2022 16:08:56 +0000 (16:08 +0000)]
Update tests based on feedback

21 months agoUpdate static AFIT tests based on feedback
Bryan Garza [Tue, 4 Oct 2022 23:35:49 +0000 (23:35 +0000)]
Update static AFIT tests based on feedback

21 months agoAdd tests for static async functions in traits
Bryan Garza [Tue, 4 Oct 2022 01:27:11 +0000 (01:27 +0000)]
Add tests for static async functions in traits

This patch adds test cases for AFIT, the majority of which are currently
expected to run as `check-fail`.

21 months agoAuto merge of #2624 - WaffleLapkin:iforgor💀, r=RalfJung
bors [Thu, 27 Oct 2022 22:48:45 +0000 (22:48 +0000)]
Auto merge of #2624 - WaffleLapkin:iforgor💀, r=RalfJung

Implement `ptr_mask` intrinsic

I promised I'll implement it, but then forgot 😅

21 months agoAuto merge of #103629 - matthiaskrgr:rollup-r94tqfa, r=matthiaskrgr
bors [Thu, 27 Oct 2022 21:36:07 +0000 (21:36 +0000)]
Auto merge of #103629 - matthiaskrgr:rollup-r94tqfa, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #103110 (remove redundant Send impl for references)
 - #103255 (Clean up hidden type registration)
 - #103394 (Clarify documentation about the memory layout of `UnsafeCell`)
 - #103408 (Clean return-position `impl Trait` in traits correctly in rustdoc)
 - #103505 (rustdoc: parse self-closing tags and attributes in `invalid_html_tags`)
 - #103524 (rustc_metadata: Add struct and variant constructors to module children at encoding time)
 - #103544 (Add flag to forbid recovery in the parser)
 - #103616 (rustdoc: remove CSS workaround for Firefox 29)

Failed merges:

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

21 months agotidy + move logic to fn
Boxy [Thu, 27 Oct 2022 21:29:16 +0000 (22:29 +0100)]
tidy + move logic to fn

21 months agouse proper spans
Boxy [Thu, 27 Oct 2022 21:18:26 +0000 (22:18 +0100)]
use proper spans

21 months agoDoIt
Boxy [Thu, 27 Oct 2022 20:48:41 +0000 (21:48 +0100)]
DoIt

21 months agoMove clippy::uninlined_format_args back to pedantic
Philipp Krones [Thu, 27 Oct 2022 20:24:24 +0000 (22:24 +0200)]
Move clippy::uninlined_format_args back to pedantic

21 months agoImplement `ptr_mask` intrinsic
Maybe Waffle [Thu, 27 Oct 2022 18:23:58 +0000 (22:23 +0400)]
Implement `ptr_mask` intrinsic

21 months agoOnly ban duplication across parameters.
Camille GILLOT [Thu, 27 Oct 2022 17:24:38 +0000 (17:24 +0000)]
Only ban duplication across parameters.

21 months agoIgnore test on mingw32
Gary Guo [Wed, 26 Oct 2022 21:07:56 +0000 (22:07 +0100)]
Ignore test on mingw32

21 months agoUpdate cargo
Weihang Lo [Thu, 27 Oct 2022 17:18:26 +0000 (01:18 +0800)]
Update cargo

6 commits in 9210810d1fd7b51ae0439a0a363cc50e36963455..7e484fc1a766f56dbc95380f45719698e0c82749
2022-10-25 22:31:50 +0000 to 2022-10-27 15:20:57 +0000
- fix(publish): Block until it is in index (rust-lang/cargo#11062)
- Add Accept-Encoding request header to enable compression (rust-lang/cargo#11292)
- Update contrib docs for highfive transition (rust-lang/cargo#11294)
- Migrate from highfive to triagebot (rust-lang/cargo#11293)
- Fix dupe word typos (rust-lang/cargo#11287)
- Fix confusing error messages when using -Zsparse-registry (rust-lang/cargo#11283)

21 months agorustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags
Michael Howell [Thu, 27 Oct 2022 16:48:06 +0000 (09:48 -0700)]
rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags

We really shouldn't be overriding this kind of stuff unless the browser
default is really broken (like outlining the thing that isn't clickable).
This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.

21 months agoErase regions from CallArgument, add test + bless
Michael Goulet [Thu, 27 Oct 2022 16:22:06 +0000 (16:22 +0000)]
Erase regions from CallArgument, add test + bless

21 months agoRevert "Make ClosureOutlivesRequirement not rely on an unresolved type"
Michael Goulet [Thu, 27 Oct 2022 16:15:11 +0000 (16:15 +0000)]
Revert "Make ClosureOutlivesRequirement not rely on an unresolved type"

This reverts commit a6b5f95fb028f9feb4a2957c06b35035be2c6155.

21 months agoUpdate miri
Maybe Waffle [Thu, 27 Oct 2022 15:10:33 +0000 (19:10 +0400)]
Update miri

21 months agoadd test for issue 36007
Rageking8 [Thu, 27 Oct 2022 14:56:20 +0000 (22:56 +0800)]
add test for issue 36007

21 months agoUpdate tooling
Maybe Waffle [Thu, 27 Oct 2022 14:32:17 +0000 (18:32 +0400)]
Update tooling

21 months agoIntroduce UnordMap, UnordSet, and UnordBag (see MCP 533)
Michael Woerister [Thu, 27 Oct 2022 13:23:26 +0000 (13:23 +0000)]
Introduce UnordMap, UnordSet, and UnordBag (see MCP 533)

MCP 533: https://github.com/rust-lang/compiler-team/issues/533

Also, as an example, substitute UnordMap for FxHashMap in
used_trait_imports query result.

21 months agoRollup merge of #103616 - rust-lang:notriddle/moz-box-sizing, r=GuillaumeGomez
Matthias Krüger [Thu, 27 Oct 2022 13:03:58 +0000 (15:03 +0200)]
Rollup merge of #103616 - rust-lang:notriddle/moz-box-sizing, r=GuillaumeGomez

rustdoc: remove CSS workaround for Firefox 29

CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/

This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/

21 months agoRollup merge of #103544 - Nilstrieb:no-recovery-pls, r=compiler-errors
Matthias Krüger [Thu, 27 Oct 2022 13:03:58 +0000 (15:03 +0200)]
Rollup merge of #103544 - Nilstrieb:no-recovery-pls, r=compiler-errors

Add flag to forbid recovery in the parser

To start the effort of fixing #103534, this adds a new flag to the parser, which forbids the parser from doing recovery, which it shouldn't do in macros.

This doesn't add any new checks for recoveries yet and is just here to bikeshed the names for the functions here before doing more.

r? `@compiler-errors`

21 months agoRollup merge of #103524 - petrochenkov:modchild4, r=cjgillot
Matthias Krüger [Thu, 27 Oct 2022 13:03:57 +0000 (15:03 +0200)]
Rollup merge of #103524 - petrochenkov:modchild4, r=cjgillot

rustc_metadata: Add struct and variant constructors to module children at encoding time

instead of decoding time.

Continuation of https://github.com/rust-lang/rust/pull/95899.
The last time it caused some ICEs from generator use, but not everything seems ok.

21 months agoRollup merge of #103505 - notriddle:notriddle/rustdoc-self-closing-tags, r=GuillaumeGomez
Matthias Krüger [Thu, 27 Oct 2022 13:03:57 +0000 (15:03 +0200)]
Rollup merge of #103505 - notriddle:notriddle/rustdoc-self-closing-tags, r=GuillaumeGomez

rustdoc: parse self-closing tags and attributes in `invalid_html_tags`

Fixes #103460

21 months agoRollup merge of #103408 - compiler-errors:rpitit-rustdoc, r=GuillaumeGomez
Matthias Krüger [Thu, 27 Oct 2022 13:03:56 +0000 (15:03 +0200)]
Rollup merge of #103408 - compiler-errors:rpitit-rustdoc, r=GuillaumeGomez

Clean return-position `impl Trait` in traits correctly in rustdoc

Fixes #103403

21 months agoRollup merge of #103394 - Pointerbender:unsafecell-docs, r=Amanieu
Matthias Krüger [Thu, 27 Oct 2022 13:03:56 +0000 (15:03 +0200)]
Rollup merge of #103394 - Pointerbender:unsafecell-docs, r=Amanieu

Clarify documentation about the memory layout of `UnsafeCell`

This PR addresses a [comment](https://github.com/rust-lang/rust/pull/101717#issuecomment-1279908390) by `@RalfJung` in PR #101717 to further clarify the documentation of `UnsafeCell<T>`. The previous PR was merged already before we had a chance to correct this, hence this second PR :)

To goal of this PR is:

1. Split the paragraph about the memory layout of `UnsafeCell<T>` and the usage of `UnsafeCell::(raw_)get()` into two paragraphs, so that it is easier to digest for the reader.
2. Slightly simplify the previously added examples in order to reduce redundancy between the new examples and the examples that already [existed](https://github.com/rust-lang/rust/blob/ddd119b2fed57eb6b19c44c18108de95c564a48d/library/core/src/cell.rs#L1858-L1908) before these 2 PRs (which remained untouched by both PRs).

21 months agoRollup merge of #103255 - oli-obk:opaque_wrong_eq_relation, r=compiler-errors
Matthias Krüger [Thu, 27 Oct 2022 13:03:55 +0000 (15:03 +0200)]
Rollup merge of #103255 - oli-obk:opaque_wrong_eq_relation, r=compiler-errors

Clean up hidden type registration

work on https://github.com/rust-lang/rust/issues/101186

Actually passing down the relation and using it instead of `eq` for the hidden type comparison has *no* effect whatsoever and allows for no further improvements at the call sites. I decided the increased complexity was not worth it and thus did not include that change in this PR.

r? `@compiler-errors`

21 months agoRollup merge of #103110 - RalfJung:manual-send, r=thomcc
Matthias Krüger [Thu, 27 Oct 2022 13:03:55 +0000 (15:03 +0200)]
Rollup merge of #103110 - RalfJung:manual-send, r=thomcc

remove redundant Send impl for references

Also explain why the other instance is not redundant, move it next to the trait they are implementing, and out of the redundant module. This seems to go back all the way to https://github.com/rust-lang/rust/commit/35ca50bd5676db31a8074a216d1aadad7d434de8, not sure why the module was added.

The instance for `&mut` is the default instance we get anyway, and we don't have anything similar for `Sync`, so IMO we should be consistent and not have the redundant instance here, either.

21 months agoAdd tests for source line numbers colors
Guillaume Gomez [Wed, 26 Oct 2022 15:51:20 +0000 (17:51 +0200)]
Add tests for source line numbers colors

21 months agoMigrate line numbers CSS to CSS variables
Guillaume Gomez [Thu, 27 Oct 2022 11:07:07 +0000 (13:07 +0200)]
Migrate line numbers CSS to CSS variables

21 months agoAccept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions
Maybe Waffle [Thu, 27 Oct 2022 10:45:02 +0000 (14:45 +0400)]
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions

Functions in answer:

- `Ty::is_freeze`
- `Ty::is_sized`
- `Ty::is_unpin`
- `Ty::is_copy_modulo_regions`

21 months agoAuto merge of #103623 - matthiaskrgr:rollup-318yc1t, r=matthiaskrgr
bors [Thu, 27 Oct 2022 10:05:16 +0000 (10:05 +0000)]
Auto merge of #103623 - matthiaskrgr:rollup-318yc1t, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #103035 (Even nicer errors from assert_unsafe_precondition)
 - #103106 (Try to say that memory outside the AM is always exposed)
 - #103475 (Make param index generation a bit more robust)
 - #103525 (Move a wf-check into the site where the value is instantiated)
 - #103564 (library: allow some unused things in Miri)
 - #103586 (Process registered region obligation in `resolve_regions_with_wf_tys`)
 - #103592 (rustdoc: remove redundant CSS selector `.notable-traits .notable`)
 - #103593 (Remove an unused parser function (`Expr::returns`))
 - #103611 (Add test for issue 103574)

Failed merges:

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

21 months agoAuto merge of #2623 - RalfJung:cron, r=RalfJung
bors [Thu, 27 Oct 2022 07:38:19 +0000 (07:38 +0000)]
Auto merge of #2623 - RalfJung:cron, r=RalfJung

change cronjob time

This way it is again in my morning.

21 months agochange cronjob time
Ralf Jung [Thu, 27 Oct 2022 07:36:40 +0000 (09:36 +0200)]
change cronjob time

21 months agoRollup merge of #103611 - Rageking8:fix-103574, r=lcnr
Matthias Krüger [Thu, 27 Oct 2022 07:25:12 +0000 (09:25 +0200)]
Rollup merge of #103611 - Rageking8:fix-103574, r=lcnr

Add test for issue 103574

Fixes #103574

Together with some slight formatting.

r? `@lcnr`

21 months agoRollup merge of #103593 - compiler-errors:nit-remove-returns, r=fee1-dead
Matthias Krüger [Thu, 27 Oct 2022 07:25:12 +0000 (09:25 +0200)]
Rollup merge of #103593 - compiler-errors:nit-remove-returns, r=fee1-dead

Remove an unused parser function (`Expr::returns`)

I removed the only usage in #97474

21 months agoRollup merge of #103592 - notriddle:notriddle/notable-traits-notable, r=GuillaumeGomez
Matthias Krüger [Thu, 27 Oct 2022 07:25:11 +0000 (09:25 +0200)]
Rollup merge of #103592 - notriddle:notriddle/notable-traits-notable, r=GuillaumeGomez

rustdoc: remove redundant CSS selector `.notable-traits .notable`

The margin was already being set to 0 only a few lines lower.

21 months agoRollup merge of #103586 - compiler-errors:issue-103573, r=jackh726
Matthias Krüger [Thu, 27 Oct 2022 07:25:11 +0000 (09:25 +0200)]
Rollup merge of #103586 - compiler-errors:issue-103573, r=jackh726

Process registered region obligation in `resolve_regions_with_wf_tys`

Fixes #103573

21 months agoRollup merge of #103564 - RalfJung:miri-unused, r=thomcc
Matthias Krüger [Thu, 27 Oct 2022 07:25:10 +0000 (09:25 +0200)]
Rollup merge of #103564 - RalfJung:miri-unused, r=thomcc

library: allow some unused things in Miri

Should help for https://github.com/rust-lang/rust/pull/102950.

21 months agoRollup merge of #103525 - oli-obk:const_impl_on_non_const_trait, r=lcnr
Matthias Krüger [Thu, 27 Oct 2022 07:25:10 +0000 (09:25 +0200)]
Rollup merge of #103525 - oli-obk:const_impl_on_non_const_trait, r=lcnr

Move a wf-check into the site where the value is instantiated

r? ``@lcnr``

21 months agoRollup merge of #103475 - oli-obk:generic_param_indices, r=lcnr
Matthias Krüger [Thu, 27 Oct 2022 07:25:09 +0000 (09:25 +0200)]
Rollup merge of #103475 - oli-obk:generic_param_indices, r=lcnr

Make param index generation a bit more robust

r? ````@lcnr````

While not really necessary for closure and anon const ids, it's strictly more correct

21 months agoRollup merge of #103106 - saethlin:from_exposed_docs, r=thomcc
Matthias Krüger [Thu, 27 Oct 2022 07:25:09 +0000 (09:25 +0200)]
Rollup merge of #103106 - saethlin:from_exposed_docs, r=thomcc

Try to say that memory outside the AM is always exposed

cc ``@Gankra`` ``@thomcc``

I want to confidently tell people that they can use `from_exposed_addr` to get a pointer for doing MMIO and/or other hardware interactions done with volatile reads/writes at particular addresses outside the Rust AM. Currently, the docs indicate that would be UB.

With this change, now the docs indicate that this is intended to be a valid use of `from_exposed_addr`.

r? ``@RalfJung``

21 months agoRollup merge of #103035 - saethlin:assert_unsafe_precondition3, r=thomcc
Matthias Krüger [Thu, 27 Oct 2022 07:25:08 +0000 (09:25 +0200)]
Rollup merge of #103035 - saethlin:assert_unsafe_precondition3, r=thomcc

Even nicer errors from assert_unsafe_precondition

For example, now running `cargo test` with this patch I get things like:
```
$ cargo +stage1 test
    Finished test [unoptimized + debuginfo] target(s) in 0.01s
     Running unittests src/lib.rs (target/debug/deps/malloc_buf-9d105ddf86862995)

running 5 tests
thread 'tests::test_null_buf' panicked at 'unsafe precondition violated: is_aligned_and_not_null(data) &&
    crate::mem::size_of::<T>().saturating_mul(len) <= isize::MAX as usize', /home/ben/rust/library/core/src/slice/raw.rs:93:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread panicked while panicking. aborting.
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/tmp/malloc_buf-1.0.0/target/debug/deps/malloc_buf-9d105ddf86862995` (signal: 6, SIGABRT: process abort signal)
```

This is still not perfect, but these are better for another PR:
* `stringify!` is trying to do clever pretty-printing on the `expr` inside `assert_unsafe_precondition` and can even add a newline.
* It would be nice to print a bit more information about where the problem is. Perhaps this is `cfg_attr(debug_assertions, track_caller)`, or perhaps it the function name added to `Location`.

cc ``@RalfJung`` this is what I was thinking of for https://github.com/rust-lang/rust/pull/102732#discussion_r989068907

21 months agoAuto merge of #103601 - compiler-errors:no-opaque-probe-in-nll-relate, r=oli-obk
bors [Thu, 27 Oct 2022 07:24:39 +0000 (07:24 +0000)]
Auto merge of #103601 - compiler-errors:no-opaque-probe-in-nll-relate, r=oli-obk

Remove `commit_if_ok` probe from NLL type relation

It was not really necessary to add the `commit_if_ok` in #100092 -- I added it to protect us against weird inference error messages due to recursive RPIT calls, but we are always on the error path when this happens anyways, and I can't come up with an example that makes this manifest.

Fixes #103599

r? `@oli-obk` since you reviewed #100092, feel free to re-roll.

:b: :loudspeaker:  beta-nominating this since it's on beta (which forks in ~a week~ two days :fearful:) -- worst case we could revert the original PR on beta and land this on nightly, to give it some extra soak time...

21 months agoMove mir building mir-opt tests to own directory
Jakob Degen [Thu, 27 Oct 2022 00:42:29 +0000 (17:42 -0700)]
Move mir building mir-opt tests to own directory

21 months agoReplace `mir_map.0` dump with `built` phase change dump
Jakob Degen [Mon, 5 Sep 2022 03:00:31 +0000 (20:00 -0700)]
Replace `mir_map.0` dump with `built` phase change dump

21 months agoadd "Memory layout" subsection to documentation of `UnsafeCell` for additional clarity
Pointerbender [Thu, 27 Oct 2022 04:32:36 +0000 (06:32 +0200)]
add "Memory layout" subsection to documentation of `UnsafeCell` for additional clarity

21 months agorustdoc: remove CSS workaround for Firefox 29
Michael Howell [Thu, 27 Oct 2022 04:13:20 +0000 (21:13 -0700)]
rustdoc: remove CSS workaround for Firefox 29

CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/

This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/

21 months agoAuto merge of #103605 - ehuss:mentions-spec, r=Mark-Simulacrum
bors [Thu, 27 Oct 2022 03:15:31 +0000 (03:15 +0000)]
Auto merge of #103605 - ehuss:mentions-spec, r=Mark-Simulacrum

Add Target Tier Policy notification.

This adds a notification posted to PRs when they add/modify a target spec.

This was hard-coded in highfive. I forgot to include this in https://github.com/rust-lang/rust/pull/103492.

21 months agoadd tests and slight formatting
Rageking8 [Thu, 27 Oct 2022 02:11:49 +0000 (10:11 +0800)]
add tests and slight formatting

21 months agoPrint the precondition we violated, and visible through output capture
Ben Kimock [Fri, 14 Oct 2022 03:01:58 +0000 (23:01 -0400)]
Print the precondition we violated, and visible through output capture

Co-authored-by: Ralf Jung <post@ralfj.de>
21 months agoRemap early bound lifetimes too
Michael Goulet [Mon, 24 Oct 2022 03:33:42 +0000 (03:33 +0000)]
Remap early bound lifetimes too

21 months agoAuto merge of #103604 - JohnTitor:rollup-q4ns2gh, r=JohnTitor
bors [Wed, 26 Oct 2022 23:58:24 +0000 (23:58 +0000)]
Auto merge of #103604 - JohnTitor:rollup-q4ns2gh, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #103432 (rustdoc: don't mark Box<T> as Iterator, Read, etc)
 - #103526 (More dupe typos again)
 - #103537 (rustdoc: combine shared CSS between `.*-line-numbers`)
 - #103549 (llvm-16: Don't initialize removed legacy passes)
 - #103558 (Update cargo)
 - #103567 (ptr::eq: clarify that comparing dyn Trait is fragile)
 - #103579 (:arrow_up: rust-analyzer)
 - #103580 (Fix typo in docs for `guaranteed_ne`)
 - #103596 (thread::set_name: debug-assert that things went well)
 - #103598 (rustc_lexer::TokenKind improve docs)

Failed merges:

 - #103585 (Migrate source line numbers CSS to CSS variables)

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

21 months agoAdd Target Tier Policy notification.
Eric Huss [Wed, 26 Oct 2022 23:45:24 +0000 (16:45 -0700)]
Add Target Tier Policy notification.

21 months agoRollup merge of #103598 - tshepang:token-kind-docs, r=jackh726
Yuki Okushi [Wed, 26 Oct 2022 23:30:59 +0000 (08:30 +0900)]
Rollup merge of #103598 - tshepang:token-kind-docs, r=jackh726

rustc_lexer::TokenKind improve docs

21 months agoRollup merge of #103596 - RalfJung:thread-setname, r=cuviper
Yuki Okushi [Wed, 26 Oct 2022 23:30:59 +0000 (08:30 +0900)]
Rollup merge of #103596 - RalfJung:thread-setname, r=cuviper

thread::set_name: debug-assert that things went well

r? `@cuviper`

21 months agoRollup merge of #103580 - lukas-code:guaranteed_ne, r=GuillaumeGomez
Yuki Okushi [Wed, 26 Oct 2022 23:30:58 +0000 (08:30 +0900)]
Rollup merge of #103580 - lukas-code:guaranteed_ne, r=GuillaumeGomez

Fix typo in docs for `guaranteed_ne`

`==` -> `!=`

21 months agoRollup merge of #103579 - lnicola:rust-analyzer-2022-10-26, r=lnicola
Yuki Okushi [Wed, 26 Oct 2022 23:30:57 +0000 (08:30 +0900)]
Rollup merge of #103579 - lnicola:rust-analyzer-2022-10-26, r=lnicola

:arrow_up: rust-analyzer

r? ``@ghost``

21 months agoRollup merge of #103567 - RalfJung:ptr-eq-dyn-trait, r=dtolnay
Yuki Okushi [Wed, 26 Oct 2022 23:30:57 +0000 (08:30 +0900)]
Rollup merge of #103567 - RalfJung:ptr-eq-dyn-trait, r=dtolnay

ptr::eq: clarify that comparing dyn Trait is fragile

Also remove the dyn trait example from `ptr::eq` since those tests are not actually guaranteed to pass due to how unstable vtable comparison is.

Cc ``@rust-lang/libs-api``
Cc discussion following https://github.com/rust-lang/rust/pull/80505