]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoRollup merge of #104504 - compiler-errors:fru-syntax-note, r=estebank
Matthias Krüger [Sun, 20 Nov 2022 22:50:27 +0000 (23:50 +0100)]
Rollup merge of #104504 - compiler-errors:fru-syntax-note, r=estebank

Add a detailed note for missing comma typo w/ FRU syntax

Thanks to `@pierwill` for working on this with me!

Fixes #104373, perhaps `@alice-i-cecile` can comment on the new error for the example provided on that issue -- feedback is welcome.

```
error[E0063]: missing field `defaulted` in initializer of `Outer`
  --> $DIR/multi-line-fru-suggestion.rs:14:5
   |
LL |     Outer {
   |     ^^^^^ missing `defaulted`
   |
note: this expression may have been misinterpreted as a `..` range expression
  --> $DIR/multi-line-fru-suggestion.rs:16:16
   |
LL |           inner: Inner {
   |  ________________^
LL | |             a: 1,
LL | |             b: 2,
LL | |         }
   | |_________^ this expression does not end in a comma...
LL |           ..Default::default()
   |           ^^^^^^^^^^^^^^^^^^^^ ... so this is interpreted as a `..` range expression, instead of functional record update syntax
help: to set the remaining fields from `Default::default()`, separate the last named field with a comma
   |
LL |         },
   |          +

error: aborting due to previous error

For more information about this error, try `rustc --explain E0063`.
```

19 months agoRollup merge of #104487 - klensy:ntapi, r=Mark-Simulacrum
Matthias Krüger [Sun, 20 Nov 2022 22:50:27 +0000 (23:50 +0100)]
Rollup merge of #104487 - klensy:ntapi, r=Mark-Simulacrum

update ntapi dep to remove future-incompat warning

This fixes warning https://github.com/rust-lang-ci/rust/actions/runs/3477235400/jobs/5813202075#step:25:217
`warning: the following packages contain code that will be rejected by a future version of Rust: ntapi v0.3.7`

by upgrading `sysinfo` version (https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md#0267)

There was some breaking changes in `sysinfo`:
* 0.25.0 (System::refresh_cpu behaviour changed: it only computes CPU usage and doesn't retrieve CPU frequency.) not affected?
* 0.26.0 (Switch memory unit from kilobytes to bytes) fixed.

19 months agoRollup merge of #104461 - mati865:gnullvm-aarch64-fixup, r=Mark-Simulacrum
Matthias Krüger [Sun, 20 Nov 2022 22:50:26 +0000 (23:50 +0100)]
Rollup merge of #104461 - mati865:gnullvm-aarch64-fixup, r=Mark-Simulacrum

Fix building of `aarch64-pc-windows-gnullvm`

That change had been lost during rebase of my last PR (https://github.com/rust-lang/rust/pull/103894).

19 months agoRollup merge of #101310 - zachs18:rc_get_unchecked_mut_docs_soundness, r=Mark-Simulacrum
Matthias Krüger [Sun, 20 Nov 2022 22:50:26 +0000 (23:50 +0100)]
Rollup merge of #101310 - zachs18:rc_get_unchecked_mut_docs_soundness, r=Mark-Simulacrum

Clarify and restrict when `{Arc,Rc}::get_unchecked_mut` is allowed.

(Tracking issue for `{Arc,Rc}::get_unchecked_mut`: #63292)

(I'm using `Rc` in this comment, but it applies for `Arc` all the same).

As currently documented, `Rc::get_unchecked_mut` can lead to unsoundness when multiple `Rc`/`Weak` pointers to the same allocation exist. The current documentation only requires that other `Rc`/`Weak` pointers to the same allocation "must not be dereferenced for the duration of the returned borrow". This can lead to unsoundness in (at least) two ways: variance, and `Rc<str>`/`Rc<[u8]>` aliasing. ([playground link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d7e2d091c389f463d121630ab0a37320)).

This PR changes the documentation of `Rc::get_unchecked_mut` to restrict usage to when all `Rc<T>`/`Weak<T>` have the exact same `T` (including lifetimes). I believe this is sufficient to prevent unsoundness, while still allowing `get_unchecked_mut` to be called on an aliased `Rc` as long as the safety contract is upheld by the caller.

## Alternatives

* A less strict, but still sound alternative would be to say that the caller must only write values which are valid for all aliased `Rc`/`Weak` inner types. (This was [mentioned](https://github.com/rust-lang/rust/issues/63292#issuecomment-568284090) in the tracking issue). This may be too complicated to clearly express in the documentation.
* A more strict alternative would be to say that there must not be any aliased `Rc`/`Weak` pointers, i.e. it is required that get_mut would return `Some(_)`. (This was also mentioned in the tracking issue). There is at least one codebase that this would cause to become unsound ([here](https://github.com/kaimast/lsm-rs/blob/be5a164d770d850d905e510e2966ad4b1cc9aa5e/src/memtable.rs#L166), where additional locking is used to ensure unique access to an aliased `Rc<T>`;  I saw this because it was linked on the tracking issue).

19 months agoAuto merge of #104646 - matthiaskrgr:rollup-7xnhzf0, r=matthiaskrgr
bors [Sun, 20 Nov 2022 19:14:14 +0000 (19:14 +0000)]
Auto merge of #104646 - matthiaskrgr:rollup-7xnhzf0, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #104537 (fix std::thread docs are unclear regarding stack sizes)
 - #104558 (Don't assume `FILE_ID_BOTH_DIR_INFO` will be aligned)
 - #104564 (interpret: use Either over Result when it is not representing an error condition)
 - #104568 (clarify that realloc refreshes pointer provenance even when the allocation remains in-place)
 - #104611 (rustdoc: use real buttons for scrape examples controls)
 - #104640 (Migrate kdb style to CSS variables)

Failed merges:

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

19 months agoRollup merge of #104640 - GuillaumeGomez:migrate-kdb-css, r=notriddle
Matthias Krüger [Sun, 20 Nov 2022 17:21:49 +0000 (18:21 +0100)]
Rollup merge of #104640 - GuillaumeGomez:migrate-kdb-css, r=notriddle

Migrate kdb style to CSS variables

r? `@notriddle`

19 months agoRollup merge of #104611 - notriddle:notriddle/scrape-examples-button, r=GuillaumeGomez
Matthias Krüger [Sun, 20 Nov 2022 17:21:49 +0000 (18:21 +0100)]
Rollup merge of #104611 - notriddle:notriddle/scrape-examples-button, r=GuillaumeGomez

rustdoc: use real buttons for scrape examples controls

This makes the expand and switch controls keyboard-accessible.

Preview: https://notriddle.com/notriddle-rustdoc-demos/scrape-examples-button/test_dingus/fn.test.html

19 months agoRollup merge of #104568 - RalfJung:realloc, r=Amanieu
Matthias Krüger [Sun, 20 Nov 2022 17:21:48 +0000 (18:21 +0100)]
Rollup merge of #104568 - RalfJung:realloc, r=Amanieu

clarify that realloc refreshes pointer provenance even when the allocation remains in-place

This [matches what C does](https://en.cppreference.com/w/c/memory/realloc):

> The original pointer ptr is invalidated and any access to it is undefined behavior (even if reallocation was in-place).

Cc `@rust-lang/wg-allocators`

19 months agoRollup merge of #104564 - RalfJung:either, r=oli-obk
Matthias Krüger [Sun, 20 Nov 2022 17:21:48 +0000 (18:21 +0100)]
Rollup merge of #104564 - RalfJung:either, r=oli-obk

interpret: use Either over Result when it is not representing an error condition

r? `@oli-obk`

19 months agoRollup merge of #104558 - thomcc:unalign-diriter, r=ChrisDenton
Matthias Krüger [Sun, 20 Nov 2022 17:21:47 +0000 (18:21 +0100)]
Rollup merge of #104558 - thomcc:unalign-diriter, r=ChrisDenton

Don't assume `FILE_ID_BOTH_DIR_INFO` will be aligned

Fixes #104530. See that issue for info.

r? `@ChrisDenton`

19 months agoRollup merge of #104537 - HintringerFabian:docs_default_min_stack_size, r=the8472
Matthias Krüger [Sun, 20 Nov 2022 17:21:47 +0000 (18:21 +0100)]
Rollup merge of #104537 - HintringerFabian:docs_default_min_stack_size, r=the8472

fix std::thread docs are unclear regarding stack sizes

Improves the documentation about the default stack size of a spawned thread
Fixes #102671

19 months agoExtend GUI tests to check kbd colors
Guillaume Gomez [Sun, 20 Nov 2022 13:32:10 +0000 (14:32 +0100)]
Extend GUI tests to check kbd colors

19 months agoMigrate kdb colors to CSS variables
Guillaume Gomez [Sun, 20 Nov 2022 13:32:27 +0000 (14:32 +0100)]
Migrate kdb colors to CSS variables

19 months agoAuto merge of #104617 - RalfJung:miri, r=RalfJung
bors [Sun, 20 Nov 2022 12:57:48 +0000 (12:57 +0000)]
Auto merge of #104617 - RalfJung:miri, r=RalfJung

update Miri

r? `@thomcc` for the lib changes (removing a `cfg(miri)` that is no longer needed)

19 months agocfg(miri) no longer needed in sys/unix/time.rs
Ralf Jung [Sat, 19 Nov 2022 22:50:57 +0000 (23:50 +0100)]
cfg(miri) no longer needed in sys/unix/time.rs

19 months agoupdate lockfile
Ralf Jung [Sun, 20 Nov 2022 08:15:12 +0000 (09:15 +0100)]
update lockfile

19 months agoAuto merge of #2683 - RalfJung:align_offset, r=RalfJung
bors [Sun, 20 Nov 2022 10:16:02 +0000 (10:16 +0000)]
Auto merge of #2683 - RalfJung:align_offset, r=RalfJung

make align_offset always work on no-provenance pointers

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

19 months agoAuto merge of #103390 - compiler-errors:metadata-mod-regions, r=eholk
bors [Sun, 20 Nov 2022 10:09:39 +0000 (10:09 +0000)]
Auto merge of #103390 - compiler-errors:metadata-mod-regions, r=eholk

Check fat pointer metadata compatibility modulo regions

Regions don't really mean anything anyways during hir typeck.

If this `erase_regions` makes anyone nervous, it's probably equally valid to just equate the types using a type relation, but regardless we should _not_ be using strict type equality while region variables are present.

Fixes #103384

19 months agomake align_offset always work on no-provenance pointers
Ralf Jung [Sun, 20 Nov 2022 10:01:00 +0000 (11:01 +0100)]
make align_offset always work on no-provenance pointers

19 months agoAuto merge of #2681 - RalfJung:seed, r=oli-obk
bors [Sun, 20 Nov 2022 09:49:34 +0000 (09:49 +0000)]
Auto merge of #2681 - RalfJung:seed, r=oli-obk

make miri-seed a regular integer, and also set layout-seed in many-seeds

This makes the seed format consistent between `-Zlayout-seed` and `-Zmiri-seed`.

19 months agomake miri-seed a regular integer, and also set layout-seed in many-seeds
Ralf Jung [Sun, 20 Nov 2022 08:38:02 +0000 (09:38 +0100)]
make miri-seed a regular integer, and also set layout-seed in many-seeds

19 months agoImprove documentation of Stack size
Fabian Hintringer [Thu, 17 Nov 2022 15:59:17 +0000 (16:59 +0100)]
Improve documentation of Stack size

19 months agoAuto merge of #98914 - fee1-dead-contrib:min-deref-patterns, r=compiler-errors
bors [Sun, 20 Nov 2022 07:16:42 +0000 (07:16 +0000)]
Auto merge of #98914 - fee1-dead-contrib:min-deref-patterns, r=compiler-errors

Minimal implementation of implicit deref patterns for Strings

cc `@compiler-errors` `@BoxyUwU` https://github.com/rust-lang/lang-team/issues/88 #87121

~~I forgot to add a feature gate, will do so in a minute~~ Done

19 months agoAuto merge of #2680 - RalfJung:rustup, r=RalfJung
bors [Sun, 20 Nov 2022 07:06:11 +0000 (07:06 +0000)]
Auto merge of #2680 - RalfJung:rustup, r=RalfJung

Rustup

19 months agofix unused warning in a test
Ralf Jung [Sun, 20 Nov 2022 07:04:36 +0000 (08:04 +0100)]
fix unused warning in a test

19 months agoMerge from rustc
Ralf Jung [Sun, 20 Nov 2022 06:48:27 +0000 (07:48 +0100)]
Merge from rustc

19 months agoPreparing for merge from rustc
Ralf Jung [Sun, 20 Nov 2022 06:48:21 +0000 (07:48 +0100)]
Preparing for merge from rustc

19 months agoAuto merge of #104629 - JohnTitor:rollup-vp3m98i, r=JohnTitor
bors [Sun, 20 Nov 2022 04:28:21 +0000 (04:28 +0000)]
Auto merge of #104629 - JohnTitor:rollup-vp3m98i, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #103901 (Add tracking issue for `const_arguments_as_str`)
 - #104112 (rustdoc: Add copy to the description of repeat)
 - #104435 (`VecDeque::resize` should re-use the buffer in the passed-in element)
 - #104467 (Fix substraction with overflow in `wrong_number_of_generic_args.rs`)
 - #104608 (Cleanup macro matching recovery)
 - #104626 (Fix doctest errors related to rustc_middle)

Failed merges:

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

19 months agoRollup merge of #104626 - reez12g:issue-99144-2, r=jyn514
Yuki Okushi [Sun, 20 Nov 2022 04:16:00 +0000 (13:16 +0900)]
Rollup merge of #104626 - reez12g:issue-99144-2, r=jyn514

Fix doctest errors related to rustc_middle

Helps with https://github.com/rust-lang/rust/issues/99144

19 months agoRollup merge of #104608 - Nilstrieb:fixmed, r=compiler-errors
Yuki Okushi [Sun, 20 Nov 2022 04:15:59 +0000 (13:15 +0900)]
Rollup merge of #104608 - Nilstrieb:fixmed, r=compiler-errors

Cleanup macro matching recovery

The retry has been implemented already in #104335. Also removes a `HACK` comment that's not really needed anymore because the "don't recover during macro matching" isn't really a hack but correct behavior.

19 months agoRollup merge of #104467 - fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compi...
Yuki Okushi [Sun, 20 Nov 2022 04:15:59 +0000 (13:15 +0900)]
Rollup merge of #104467 - fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compiler-errors

Fix substraction with overflow in `wrong_number_of_generic_args.rs`

Fixes #104287

This issue happens in the `suggest_moving_args_from_assoc_fn_to_trait_for_qualified_path` function, which seems to run before the error checking facilities can catch an invalid use of generic arguments. Thus we get a subtraction with overflow because the code implicitly assumes that the source program makes sense (or is this assumption not true even if the program is correct?).

19 months agoRollup merge of #104435 - scottmcm:iter-repeat-n, r=thomcc
Yuki Okushi [Sun, 20 Nov 2022 04:15:59 +0000 (13:15 +0900)]
Rollup merge of #104435 - scottmcm:iter-repeat-n, r=thomcc

`VecDeque::resize` should re-use the buffer in the passed-in element

Today it always copies it for *every* appended element, but one of those clones is avoidable.

This adds `iter::repeat_n` (https://github.com/rust-lang/rust/issues/104434) as the primitive needed to do this.  If this PR is acceptable, I'll also use this in `Vec` rather than its custom `ExtendElement` type & infrastructure that is harder to share between multiple different containers:

https://github.com/rust-lang/rust/blob/101e1822c3e54e63996c8aaa014d55716f3937eb/library/alloc/src/vec/mod.rs#L2479-L2492

19 months agoRollup merge of #104112 - yancyribbens:add-copy-to-repeat-description, r=JohnTitor
Yuki Okushi [Sun, 20 Nov 2022 04:15:58 +0000 (13:15 +0900)]
Rollup merge of #104112 - yancyribbens:add-copy-to-repeat-description, r=JohnTitor

rustdoc: Add copy to the description of repeat

Small nit, but it's more clear to say `copy` here instead of defining `repeat` in terms of itself.

19 months agoRollup merge of #103901 - H4x5:fmt-arguments-as-str-tracking-issue, r=the8472
Yuki Okushi [Sun, 20 Nov 2022 04:15:58 +0000 (13:15 +0900)]
Rollup merge of #103901 - H4x5:fmt-arguments-as-str-tracking-issue, r=the8472

Add tracking issue for `const_arguments_as_str`

Tracking issue: #103900

The original PR didn't create a tracking issue.

19 months agoFix doctest errors related to rustc_middle
reez12g [Sun, 20 Nov 2022 02:10:45 +0000 (11:10 +0900)]
Fix doctest errors related to rustc_middle

19 months agorustdoc: fix test case
Michael Howell [Sun, 20 Nov 2022 01:21:46 +0000 (18:21 -0700)]
rustdoc: fix test case

19 months agoAuto merge of #104522 - RalfJung:try_normalize_after_erasing_regions, r=oli-obk
bors [Sun, 20 Nov 2022 01:16:52 +0000 (01:16 +0000)]
Auto merge of #104522 - RalfJung:try_normalize_after_erasing_regions, r=oli-obk

try_normalize_after_erasing_regions: promote an assertion to always run

In https://github.com/rust-lang/miri/issues/2433 this assertion has been seen to trigger, so it might be worth actually checking this? Regressing debug assertions are very easy to miss until much later, and then they become quite hard to debug.

19 months agorustdoc: add test case for scraped example expand GUI
Michael Howell [Sun, 20 Nov 2022 00:42:07 +0000 (17:42 -0700)]
rustdoc: add test case for scraped example expand GUI

19 months agoAuto merge of #2679 - RalfJung:clock_gettime, r=RalfJung
bors [Sat, 19 Nov 2022 22:48:10 +0000 (22:48 +0000)]
Auto merge of #2679 - RalfJung:clock_gettime, r=RalfJung

implement clock_gettime on macos

and pull in rustc changes so we can test this against https://github.com/rust-lang/rust/pull/103594.

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

19 months agoimplement clock_gettime on macos
Ralf Jung [Sat, 19 Nov 2022 19:21:48 +0000 (20:21 +0100)]
implement clock_gettime on macos

19 months agoAuto merge of #104470 - ehuss:cdb-dupe-last-command, r=jyn514
bors [Sat, 19 Nov 2022 22:25:18 +0000 (22:25 +0000)]
Auto merge of #104470 - ehuss:cdb-dupe-last-command, r=jyn514

Don't duplicate last cdb debuginfo test command

cdb scripts interpret a blank line to mean "repeat the last command", similar to what happens when running the debugger from a console. The code for compiletest that constructs the debugger script was inserting a blank line between the last command and the "quit" command. This caused the last command to be executed twice. This can cause some confusion since the `-check` lines are expecting the output in a certain order. But printing the last command twice causes that order-assumption to fail, and that can cause confusion.

This fixes it by removing the blank line.

AFAICT, gdb and lldb scripts don't have the same behavior with blank lines (and the gdb code doesn't add any blank lines anyways).

19 months agorustdoc: fix scrape-examples JS path
Michael Howell [Sat, 19 Nov 2022 19:28:17 +0000 (12:28 -0700)]
rustdoc: fix scrape-examples JS path

19 months agorustdoc: use real buttons for scrape examples controls
Michael Howell [Sat, 19 Nov 2022 19:27:40 +0000 (12:27 -0700)]
rustdoc: use real buttons for scrape examples controls

19 months agoAuto merge of #102795 - lukas-code:constify-is-aligned-via-align-offset, r=oli-obk
bors [Sat, 19 Nov 2022 18:57:39 +0000 (18:57 +0000)]
Auto merge of #102795 - lukas-code:constify-is-aligned-via-align-offset, r=oli-obk

Constify `is_aligned` via `align_offset`

Alternative to https://github.com/rust-lang/rust/pull/102753

Make `align_offset` work in const eval (and not always return `usize::MAX`) and then use that to constify `is_aligned{_to}`.

Tracking Issue: https://github.com/rust-lang/rust/issues/104203

19 months agoAdd a UI test to ensure rustc doesn't do arithmetic overflows
Mahmoud Mazouz [Sat, 19 Nov 2022 17:54:19 +0000 (18:54 +0100)]
Add a UI test to ensure rustc doesn't do arithmetic overflows

This relies on the CI testing a rustc that's compiled with overflow-checks = true

19 months agoFix substraction with overflow in `wrong_number_of_generic_args.rs`
Mahmoud Mazouz [Sat, 19 Nov 2022 17:53:36 +0000 (18:53 +0100)]
Fix substraction with overflow in `wrong_number_of_generic_args.rs`

Rarranging the substration and equality check into an addition and an equality
check is sufficient.

Algebra is cool, isn't it?

Co-authored-by: Michael Goulet <michael@errs.io>
19 months agoCleanup macro matching recovery
Nilstrieb [Sat, 19 Nov 2022 16:46:04 +0000 (17:46 +0100)]
Cleanup macro matching recovery

The retry has been implemented already.

19 months agoupdate provenance test
Lukas Markeffsky [Fri, 18 Nov 2022 12:59:21 +0000 (13:59 +0100)]
update provenance test

* fix allocation alignment for 16bit platforms
* add edge case where `stride % align != 0` on pointers with provenance

19 months agofix assembly test on apple
Lukas Markeffsky [Wed, 16 Nov 2022 20:07:51 +0000 (21:07 +0100)]
fix assembly test on apple

19 months agoUpdate comment on pointer-to-usize transmute
Lukas [Wed, 16 Nov 2022 14:08:35 +0000 (15:08 +0100)]
Update comment on pointer-to-usize transmute

Co-authored-by: Ralf Jung <post@ralfj.de>
19 months agoRevert "don't call `align_offset` during const eval, ever"
Lukas Markeffsky [Wed, 16 Nov 2022 10:41:18 +0000 (11:41 +0100)]
Revert "don't call `align_offset` during const eval, ever"

This reverts commit f3a577bfae376c0222e934911865ed14cddd1539.

19 months agofix const `align_offset` implementation
Lukas Markeffsky [Tue, 15 Nov 2022 14:55:37 +0000 (15:55 +0100)]
fix const `align_offset` implementation

19 months agofix assembly test on windows
Lukas Markeffsky [Fri, 11 Nov 2022 14:52:49 +0000 (15:52 +0100)]
fix assembly test on windows

19 months agoreplace potential ICE with graceful error (`no_core` only)
Lukas Markeffsky [Fri, 11 Nov 2022 09:01:06 +0000 (10:01 +0100)]
replace potential ICE with graceful error (`no_core` only)

19 months agodocs cleanup
Lukas Markeffsky [Wed, 9 Nov 2022 19:18:00 +0000 (20:18 +0100)]
docs cleanup

* Fix doc examples for Platforms with underaligned integer primitives.
* Mutable pointer doc examples use mutable pointers.
* Fill out tracking issue.
* Minor formatting changes.

19 months agoalways use `align_offset` in `is_aligned_to` + add assembly test
Lukas Markeffsky [Sun, 23 Oct 2022 10:30:46 +0000 (12:30 +0200)]
always use `align_offset` in `is_aligned_to` + add assembly test

19 months agoSchrödinger's pointer
Lukas Markeffsky [Sat, 22 Oct 2022 22:47:21 +0000 (00:47 +0200)]
Schrödinger's pointer

It's aligned *and* not aligned!

19 months agoaddress more review comments
Lukas Markeffsky [Sat, 22 Oct 2022 19:20:04 +0000 (21:20 +0200)]
address more review comments

* `cfg` only the body of `align_offset`
* put explicit panics back
* explain why `ptr.align_offset(align) == 0` is slow

19 months agodocument `is_aligned{,_to}`
Lukas Markeffsky [Sat, 22 Oct 2022 17:15:03 +0000 (19:15 +0200)]
document `is_aligned{,_to}`

19 months agodon't call `align_offset` during const eval, ever
Lukas Markeffsky [Sat, 22 Oct 2022 15:31:07 +0000 (17:31 +0200)]
don't call `align_offset` during const eval, ever

19 months agomark `align_offset` as `#[must_use]`
Lukas Markeffsky [Thu, 20 Oct 2022 17:46:31 +0000 (19:46 +0200)]
mark `align_offset` as `#[must_use]`

19 months agoadd coretests for `is_aligned`
Lukas Markeffsky [Fri, 7 Oct 2022 19:46:28 +0000 (21:46 +0200)]
add coretests for `is_aligned`

19 months agoconstify `pointer::is_aligned{,_to}`
Lukas Markeffsky [Fri, 7 Oct 2022 20:24:31 +0000 (22:24 +0200)]
constify `pointer::is_aligned{,_to}`

19 months agoadd coretests for const `align_offset`
Lukas Markeffsky [Fri, 7 Oct 2022 18:59:23 +0000 (20:59 +0200)]
add coretests for const `align_offset`

19 months agoAuto merge of #104607 - matthiaskrgr:rollup-9s589me, r=matthiaskrgr
bors [Sat, 19 Nov 2022 15:40:04 +0000 (15:40 +0000)]
Auto merge of #104607 - matthiaskrgr:rollup-9s589me, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #103117 (Use `IsTerminal` in place of `atty`)
 - #103969 (Partial support for running UI tests with `download-rustc`)
 - #103989 (Fix build of std for thumbv7a-pc-windows-msvc)
 - #104076 (fix sysroot issue which appears for ci downloaded rustc)
 - #104469 (Make "long type" printing type aware and trim types in E0275)
 - #104497 (detect () to avoid redundant <> suggestion for type)
 - #104577 (Don't focus on notable trait parent when hiding it)
 - #104587 (Update cargo)
 - #104593 (Improve spans for RPITIT object-safety errors)
 - #104604 (Migrate top buttons style to CSS variables)

Failed merges:

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

19 months agomake const `align_offset` useful
Lukas Markeffsky [Fri, 7 Oct 2022 20:23:34 +0000 (22:23 +0200)]
make const `align_offset` useful

19 months agounify inherent impls of `CompileTimeEvalContext`
Lukas Markeffsky [Thu, 20 Oct 2022 18:15:37 +0000 (20:15 +0200)]
unify inherent impls of `CompileTimeEvalContext`

19 months agoconstify `exact_div` intrinsic
Lukas Markeffsky [Fri, 7 Oct 2022 18:57:34 +0000 (20:57 +0200)]
constify `exact_div` intrinsic

19 months agoRollup merge of #104604 - GuillaumeGomez:migrate-top-button-to-css-var, r=notriddle
Matthias Krüger [Sat, 19 Nov 2022 14:35:23 +0000 (15:35 +0100)]
Rollup merge of #104604 - GuillaumeGomez:migrate-top-button-to-css-var, r=notriddle

Migrate top buttons style to CSS variables

No UI changes.

r? `@notriddle`

19 months agoRollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, r=fee1-dead
Matthias Krüger [Sat, 19 Nov 2022 14:35:23 +0000 (15:35 +0100)]
Rollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, r=fee1-dead

Improve spans for RPITIT object-safety errors

No reason why we can't point at the `impl Trait` that causes the object-safety violation.

Also [drive-by: Add is_async fn to hir::IsAsync](https://github.com/rust-lang/rust/pull/104593/commits/c4165f3a965e258531928180195637455299c6f3), which touches clippy too.

19 months agoRollup merge of #104587 - weihanglo:update-cargo, r=weihanglo
Matthias Krüger [Sat, 19 Nov 2022 14:35:22 +0000 (15:35 +0100)]
Rollup merge of #104587 - weihanglo:update-cargo, r=weihanglo

Update cargo

3 commits in 16b097879b6f117c8ae698aab054c87f26ff325e..eb5d35917b2395194593c9ca70c3778f60c1573b
2022-11-14 23:28:16 +0000 to 2022-11-17 22:08:43 +0000
- Fix several tests that are waiting 60 seconds for publishing to time out (rust-lang/cargo#11388)
- Implement RFC 3139: alternative registry authentication support (rust-lang/cargo#10592)
- Fix cargo install --index when used with registry.default (rust-lang/cargo#11302)

r? `@ghost`

19 months agoRollup merge of #104577 - GuillaumeGomez:remove-focus-on-blur, r=notriddle
Matthias Krüger [Sat, 19 Nov 2022 14:35:22 +0000 (15:35 +0100)]
Rollup merge of #104577 - GuillaumeGomez:remove-focus-on-blur, r=notriddle

Don't focus on notable trait parent when hiding it

I clicked on a notable trait icon so the popup remained and then clicked on the settings menu. When the settings menu was blurred, it scrolled back to when the notable trait was, which isn't great.

r? `@notriddle`

19 months agoRollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-dead
Matthias Krüger [Sat, 19 Nov 2022 14:35:21 +0000 (15:35 +0100)]
Rollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-dead

detect () to avoid redundant <> suggestion for type

fix #104379

19 months agoRollup merge of #104469 - estebank:long-types, r=oli-obk
Matthias Krüger [Sat, 19 Nov 2022 14:35:21 +0000 (15:35 +0100)]
Rollup merge of #104469 - estebank:long-types, r=oli-obk

Make "long type" printing type aware and trim types in E0275

Instead of simple string cutting, use a custom printer to hide parts of long printed types.

On E0275, check for type length before printing.

19 months agoRollup merge of #104076 - ozkanonur:fix-ci-rustc-sysroot, r=jyn514
Matthias Krüger [Sat, 19 Nov 2022 14:35:20 +0000 (15:35 +0100)]
Rollup merge of #104076 - ozkanonur:fix-ci-rustc-sysroot, r=jyn514

fix sysroot issue which appears for ci downloaded rustc

Currently when compiler is downloaded rather than compiled, sysroot is being `ci-rustc-sysroot` because of https://github.com/rust-lang/rust/blob/7eef946fc0e0eff40e588eab77b09b287accbec3/src/bootstrap/compile.rs#L1125-L1131 this.

And rustdoc is overriding the downloaded one at the end of the process.

With the condition I add, we simply check if the current compiler stage is target build stage, if so use the proper sysroot instead of `ci-rustc-sysroot`.

Resolves #103206

19 months agoRollup merge of #103989 - arlosi:arm32-panic, r=Amanieu
Matthias Krüger [Sat, 19 Nov 2022 14:35:20 +0000 (15:35 +0100)]
Rollup merge of #103989 - arlosi:arm32-panic, r=Amanieu

Fix build of std for thumbv7a-pc-windows-msvc

Attempting to build std for the tier-3 target `thumbv7a-pc-windows-msvc` fails with the following error:
```
Building stage1 std artifacts (x86_64-pc-windows-msvc -> thumbv7a-pc-windows-msvc)
..
LLVM ERROR: WinEH not implemented for this target
error: could not compile `panic_unwind`
```

EH (unwinding) is not supported by LLVM for 32 bit arm msvc targets. This changes panic unwind to use the dummy implementation for `thumbv7a-pc-windows-msvc`.

19 months agoRollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514
Matthias Krüger [Sat, 19 Nov 2022 14:35:19 +0000 (15:35 +0100)]
Rollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514

Partial support for running UI tests with `download-rustc`

Right now trying to run UI tests with `download-rustc` results in a bunch of test failures, requiring someone who wants to only work on tests to also build the full compiler. This PR **partially** addresses the problem by solving a lot of the errors (but not all).

* This installs the `rust-src` component on CI toolchains, since the test output depends on whether the standard library source code is installed; We can't just symlink the current source because the `rustc-dev` component already includes the compiler sources, but not the library sources, and mixing things is worse IMO.
* This ensures the `$SRC_DIR` normalization done by compiletest correctly handles the source code added above.
* This unconditionally sets `remap-prefix` to the prefix used in the downloaded toolchain, to ensure compiletest normalizes it.

19 months agoRollup merge of #103117 - joshtriplett:use-is-terminal, r=eholk
Matthias Krüger [Sat, 19 Nov 2022 14:35:18 +0000 (15:35 +0100)]
Rollup merge of #103117 - joshtriplett:use-is-terminal, r=eholk

Use `IsTerminal` in place of `atty`

In any crate that can use nightly features, use `IsTerminal` rather than
`atty`:

- Use `IsTerminal` in `rustc_errors`
- Use `IsTerminal` in `rustc_driver`
- Use `IsTerminal` in `rustc_log`
- Use `IsTerminal` in `librustdoc`

19 months agoAuto merge of #104571 - clubby789:remove-vec-rc-opt, r=the8472
bors [Sat, 19 Nov 2022 12:44:57 +0000 (12:44 +0000)]
Auto merge of #104571 - clubby789:remove-vec-rc-opt, r=the8472

Revert Vec/Rc storage reuse opt

Remove the optimization for using storage added by #104205.
The perf wins were pretty small, and it relies on non-guarenteed behaviour. On platforms that don't implement shrinking in place, the performance will be significantly worse.

While it could be gated to platforms that do this (such as GNU), I don't think it's worth the overhead of maintaining it for very small gains. (#104565, #104563)

cc `@RalfJung` `@matthiaskrgr`

Fixes #104565
Fixes #104563

19 months agoMerge from rustc
Ralf Jung [Sat, 19 Nov 2022 12:40:56 +0000 (13:40 +0100)]
Merge from rustc

19 months agoPreparing for merge from rustc
Ralf Jung [Sat, 19 Nov 2022 12:40:47 +0000 (13:40 +0100)]
Preparing for merge from rustc

19 months agoMigrate top buttons style to CSS variables
Guillaume Gomez [Sat, 19 Nov 2022 10:07:13 +0000 (11:07 +0100)]
Migrate top buttons style to CSS variables

19 months agoUpdate browser-ui-test version to 0.13.2
Guillaume Gomez [Fri, 18 Nov 2022 23:27:37 +0000 (00:27 +0100)]
Update browser-ui-test version to 0.13.2

19 months agoExtend GUI test to check notable traits blur behaviour
Guillaume Gomez [Fri, 18 Nov 2022 23:25:37 +0000 (00:25 +0100)]
Extend GUI test to check notable traits blur behaviour

19 months agoAuto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, r=oli-obk
bors [Sat, 19 Nov 2022 09:30:35 +0000 (09:30 +0000)]
Auto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, r=oli-obk

Revert "Normalize opaques with escaping bound vars"

This caused a perf regression in #103423, cc `@skyzh` this should fix #103423.

reverts #100980

r? `@oli-obk`

19 months agoAuto merge of #104600 - Dylan-DPC:rollup-glw1e8b, r=Dylan-DPC
bors [Sat, 19 Nov 2022 06:40:38 +0000 (06:40 +0000)]
Auto merge of #104600 - Dylan-DPC:rollup-glw1e8b, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #104001 (Improve generating Custom entry function)
 - #104411 (nll: correctly deal with bivariance)
 - #104528 (Properly link `{Once,Lazy}{Cell,Lock}` in docs)
 - #104553 (Improve accuracy of asinh and acosh)
 - #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)
 - #104566 (couple of clippy::perf fixes)
 - #104575 (deduplicate tests)
 - #104580 (diagnostics: only show one suggestion for method -> assoc fn)

Failed merges:

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

19 months agoRollup merge of #104580 - notriddle:notriddle/issue-102354-hide-sugg, r=compiler...
Dylan DPC [Sat, 19 Nov 2022 06:24:47 +0000 (11:54 +0530)]
Rollup merge of #104580 - notriddle:notriddle/issue-102354-hide-sugg, r=compiler-errors

diagnostics: only show one suggestion for method -> assoc fn

Fixes #102354

19 months agoRollup merge of #104575 - lcnr:dedup-tests, r=jackh726
Dylan DPC [Sat, 19 Nov 2022 06:24:46 +0000 (11:54 +0530)]
Rollup merge of #104575 - lcnr:dedup-tests, r=jackh726

deduplicate tests

originally added in #100514. Using revisions for this reduces the amount of tests in the repo

19 months agoRollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obk
Dylan DPC [Sat, 19 Nov 2022 06:24:46 +0000 (11:54 +0530)]
Rollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obk

couple of clippy::perf fixes

19 months agoRollup merge of #104554 - BoxyUwU:less_unchecked_pls, r=lcnr
Dylan DPC [Sat, 19 Nov 2022 06:24:45 +0000 (11:54 +0530)]
Rollup merge of #104554 - BoxyUwU:less_unchecked_pls, r=lcnr

Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less

there are only like 3 or 4 call sites left after this but it wasnt obvious to me how to remove them

19 months agoRollup merge of #104553 - mwillsey:asinh-acosh-accuracy, r=thomcc
Dylan DPC [Sat, 19 Nov 2022 06:24:45 +0000 (11:54 +0530)]
Rollup merge of #104553 - mwillsey:asinh-acosh-accuracy, r=thomcc

Improve accuracy of asinh and acosh

This PR addresses the inaccuracy of `asinh` and `acosh` identified by the [Herbie](http://herbie.uwplse.org/) tool, `@pavpanchekha,` `@finnbear` in #104548. It also adds a couple tests that failed in the existing implementations and now pass.

Closes #104548

r? rust-lang/libs

19 months agoRollup merge of #104528 - WaffleLapkin:lazy_lock_docfix, r=matklad
Dylan DPC [Sat, 19 Nov 2022 06:24:44 +0000 (11:54 +0530)]
Rollup merge of #104528 - WaffleLapkin:lazy_lock_docfix, r=matklad

Properly link `{Once,Lazy}{Cell,Lock}` in docs

See https://github.com/rust-lang/rust/issues/74465#issuecomment-1317947443

19 months agoRollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errors
Dylan DPC [Sat, 19 Nov 2022 06:24:44 +0000 (11:54 +0530)]
Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errors

nll: correctly deal with bivariance

fixes #104409

when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions.

r? types cc ``@RalfJung``

19 months agoRollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3
Dylan DPC [Sat, 19 Nov 2022 06:24:43 +0000 (11:54 +0530)]
Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3

Improve generating Custom entry function

This commit is aimed at making compiler-generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316.

Currently, this moves the entry function name and Call convention to the target spec.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoHide the items while waiting for the ACP
Scott McMurray [Sat, 19 Nov 2022 03:46:18 +0000 (19:46 -0800)]
Hide the items while waiting for the ACP

19 months agoImprove spans for RPITIT object-safety errors
Michael Goulet [Sat, 19 Nov 2022 02:32:55 +0000 (02:32 +0000)]
Improve spans for RPITIT object-safety errors

19 months agoAuto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser
bors [Sat, 19 Nov 2022 02:28:47 +0000 (02:28 +0000)]
Auto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser

Use liballoc's specialised in-place vec collection

liballoc already specialises in-place vector collection, so manually
reimplementing it in `IdFunctor::try_map_id` was superfluous.

19 months agodrive-by: Add is_async fn to hir::IsAsync
Michael Goulet [Sat, 19 Nov 2022 02:22:24 +0000 (02:22 +0000)]
drive-by: Add is_async fn to hir::IsAsync

19 months agoFix invalid focus when blurring notable traits popover
Guillaume Gomez [Fri, 18 Nov 2022 23:25:21 +0000 (00:25 +0100)]
Fix invalid focus when blurring notable traits popover

19 months agoAuto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearth
bors [Fri, 18 Nov 2022 23:20:53 +0000 (23:20 +0000)]
Auto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearth

Rollup of 8 pull requests

Successful merges:

 - #102977 (remove HRTB from `[T]::is_sorted_by{,_key}`)
 - #103378 (Fix mod_inv termination for the last iteration)
 - #103456 (`unchecked_{shl|shr}` should use `u32` as the RHS)
 - #103701 (Simplify some pointer method implementations)
 - #104047 (Diagnostics `icu4x` based list formatting.)
 - #104338 (Enforce that `dyn*` coercions are actually pointer-sized)
 - #104498 (Edit docs for `rustc_errors::Handler::stash_diagnostic`)
 - #104556 (rustdoc: use `code-header` class to format enum variants)

Failed merges:

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