]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoRemove unneeded test change
Esteban Küber [Sat, 26 Nov 2022 03:54:02 +0000 (19:54 -0800)]
Remove unneeded test change

19 months agoFurther tweak the type shortening logic
Esteban Küber [Sat, 26 Nov 2022 03:08:46 +0000 (19:08 -0800)]
Further tweak the type shortening logic

19 months agoTweak shortening logic to be less trigger happy
Esteban Küber [Sat, 26 Nov 2022 02:20:08 +0000 (18:20 -0800)]
Tweak shortening logic to be less trigger happy

19 months agoDetect long types in E0308 and write them to disk
Esteban Küber [Sat, 26 Nov 2022 01:14:25 +0000 (17:14 -0800)]
Detect long types in E0308 and write them to disk

On type error with long types, print an abridged type and write the full
type to disk.

Print the widest possible short type while still fitting in the
terminal.

19 months agoAuto merge of #105008 - Dylan-DPC:rollup-wcd19yu, r=Dylan-DPC
bors [Mon, 28 Nov 2022 13:20:33 +0000 (13:20 +0000)]
Auto merge of #105008 - Dylan-DPC:rollup-wcd19yu, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #104360 (Stabilize native library modifier `verbatim`)
 - #104732 (Refactor `ty::ClosureKind` related stuff)
 - #104795 (Change multiline span ASCII art visual order)
 - #104890 (small method code cleanup)
 - #104907 (Remove `SelectionContext::infcx()` in favor of field access)
 - #104927 (Simplify some binder shifting logic)

Failed merges:

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

19 months agoAuto merge of #102991 - Sp00ph:master, r=scottmcm
bors [Mon, 28 Nov 2022 10:39:47 +0000 (10:39 +0000)]
Auto merge of #102991 - Sp00ph:master, r=scottmcm

Update VecDeque implementation to use head+len instead of head+tail

(See #99805)

This changes `alloc::collections::VecDeque`'s internal representation from using head and tail indices to using a head index and a length field. It has a few advantages over the current design:
* It allows the buffer to be of length 0, which means the `VecDeque::new` new longer has to allocate and could be changed to a `const fn`
* It allows the `VecDeque` to fill the buffer completely, unlike the old implementation, which always had to leave a free space
* It removes the restriction for the size to be a power of two, allowing it to properly `shrink_to_fit`, unlike the old `VecDeque`
* The above points also combine to allow the `Vec<T> -> VecDeque<T>` conversion to be very cheap and guaranteed O(1). I mention this in the `From<Vec<T>>` impl, but it's not a strong guarantee just yet, as that would likely need some form of API change proposal.

All the tests seem to pass for the new `VecDeque`, with some slight adjustments.

r? `@scottmcm`

19 months agoRollup merge of #104927 - compiler-errors:binder-shifting-logic, r=oli-obk
Dylan DPC [Mon, 28 Nov 2022 10:12:12 +0000 (15:42 +0530)]
Rollup merge of #104927 - compiler-errors:binder-shifting-logic, r=oli-obk

Simplify some binder shifting logic

Not sure if worth, but we'll see

19 months agoRollup merge of #104907 - compiler-errors:selcx-infcx, r=oli-obk
Dylan DPC [Mon, 28 Nov 2022 10:12:11 +0000 (15:42 +0530)]
Rollup merge of #104907 - compiler-errors:selcx-infcx, r=oli-obk

Remove `SelectionContext::infcx()` in favor of field access

Encapsulation doesn't seem particularly important here, and having two choices is always more confusing than having one.

r? types

19 months agoRollup merge of #104890 - lcnr:small-cleanup, r=fee1-dead
Dylan DPC [Mon, 28 Nov 2022 10:12:11 +0000 (15:42 +0530)]
Rollup merge of #104890 - lcnr:small-cleanup, r=fee1-dead

small method code cleanup

19 months agoRollup merge of #104795 - estebank:multiline-spans, r=TaKO8Ki
Dylan DPC [Mon, 28 Nov 2022 10:12:10 +0000 (15:42 +0530)]
Rollup merge of #104795 - estebank:multiline-spans, r=TaKO8Ki

Change multiline span ASCII art visual order

Tweak the ASCII art for nested multiline spans so that we minimize line overlaps.

Partially addresses https://github.com/rust-lang/rust/issues/61017.

19 months agoRollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errors
Dylan DPC [Mon, 28 Nov 2022 10:12:10 +0000 (15:42 +0530)]
Rollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errors

Refactor `ty::ClosureKind` related stuff

I've tried to fix all duplication and weirdness, but if I missed something do tell :p

r? `@compiler-errors`

19 months agoRollup merge of #104360 - petrochenkov:stabverb, r=TaKO8Ki
Dylan DPC [Mon, 28 Nov 2022 10:12:09 +0000 (15:42 +0530)]
Rollup merge of #104360 - petrochenkov:stabverb, r=TaKO8Ki

Stabilize native library modifier `verbatim`

Stabilization report - https://github.com/rust-lang/rust/pull/104360#issuecomment-1312724787.

cc https://github.com/rust-lang/rust/issues/81490
Closes https://github.com/rust-lang/rust/issues/99425

19 months agofix clippy tests
Esteban Küber [Mon, 28 Nov 2022 08:41:31 +0000 (00:41 -0800)]
fix clippy tests

19 months agoTweak output
Esteban Küber [Wed, 23 Nov 2022 22:51:24 +0000 (14:51 -0800)]
Tweak output

19 months agoChange multiline span ASCII art visual order
Esteban Küber [Wed, 23 Nov 2022 22:28:45 +0000 (14:28 -0800)]
Change multiline span ASCII art visual order

19 months agoAuto merge of #104915 - weihanglo:update-cargo, r=ehuss
bors [Mon, 28 Nov 2022 03:16:58 +0000 (03:16 +0000)]
Auto merge of #104915 - weihanglo:update-cargo, r=ehuss

Update cargo

5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744 2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000

- fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420)
- add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401)
- chore: Upgrade to env_logger (rust-lang/cargo#11417)
- Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343)
- temporarily disable test `lto::test_profile` (rust-lang/cargo#11419)

r+ `@ghost`

19 months agoAuto merge of #104990 - matthiaskrgr:rollup-oskk8v3, r=matthiaskrgr
bors [Mon, 28 Nov 2022 00:18:22 +0000 (00:18 +0000)]
Auto merge of #104990 - matthiaskrgr:rollup-oskk8v3, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #104955 (Switch rustdoc-gui test to function call)
 - #104976 (Prefer doc comments over `//`-comments in compiler)
 - #104984 (Remove Crate::primitives field)
 - #104989 (update Miri)

Failed merges:

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

19 months agoFix `pretty-std` test
Markus Everling [Sun, 27 Nov 2022 22:08:14 +0000 (23:08 +0100)]
Fix `pretty-std` test

19 months agoRollup merge of #104989 - RalfJung:miri, r=RalfJung
Matthias Krüger [Sun, 27 Nov 2022 21:14:09 +0000 (22:14 +0100)]
Rollup merge of #104989 - RalfJung:miri, r=RalfJung

update Miri

r? `@ghost`

19 months agoRollup merge of #104984 - GuillaumeGomez:remote-crate-primitives, r=notriddle
Matthias Krüger [Sun, 27 Nov 2022 21:14:09 +0000 (22:14 +0100)]
Rollup merge of #104984 - GuillaumeGomez:remote-crate-primitives, r=notriddle

Remove Crate::primitives field

It is a new approach to #90447. Instead of removing primitives from everywhere (ie from `BadImplStripper`), I just removed them from the `Crate` type, allowing to reduce its size.

cc `@camelid`
r? `@notriddle`

19 months agoRollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillot
Matthias Krüger [Sun, 27 Nov 2022 21:14:08 +0000 (22:14 +0100)]
Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillot

Prefer doc comments over `//`-comments in compiler

Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.

19 months agoRollup merge of #104955 - GuillaumeGomez:migrate-to-func, r=notriddle
Matthias Krüger [Sun, 27 Nov 2022 21:14:08 +0000 (22:14 +0100)]
Rollup merge of #104955 - GuillaumeGomez:migrate-to-func, r=notriddle

Switch rustdoc-gui test to function call

r? `@notriddle`

19 months agoAuto merge of #104506 - joshtriplett:style-principles-readability-in-plain-text,...
bors [Sun, 27 Nov 2022 21:07:04 +0000 (21:07 +0000)]
Auto merge of #104506 - joshtriplett:style-principles-readability-in-plain-text, r=compiler-errors

Expand a style-guide principle: readability in plain text

19 months agoAuto merge of #2702 - RalfJung:rustup, r=RalfJung
bors [Sun, 27 Nov 2022 19:54:04 +0000 (19:54 +0000)]
Auto merge of #2702 - RalfJung:rustup, r=RalfJung

Rustup

No changes happened on the rustc side, but I want to do a push next and would rather make josh's life easier by integrating some recent history first.

19 months agoclippy
Ralf Jung [Sun, 27 Nov 2022 19:50:53 +0000 (20:50 +0100)]
clippy

19 months agoadvice on josh pushing
Ralf Jung [Sun, 27 Nov 2022 19:47:49 +0000 (20:47 +0100)]
advice on josh pushing

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

19 months agoPreparing for merge from rustc
Ralf Jung [Sun, 27 Nov 2022 19:51:50 +0000 (20:51 +0100)]
Preparing for merge from rustc

19 months agofix type
lcnr [Sun, 27 Nov 2022 19:48:31 +0000 (20:48 +0100)]
fix type

Co-authored-by: fee1-dead <ent3rm4n@gmail.com>
19 months agoStabilize native library modifier `verbatim`
Vadim Petrochenkov [Sun, 13 Nov 2022 10:03:01 +0000 (13:03 +0300)]
Stabilize native library modifier `verbatim`

19 months agoAuto merge of #2694 - RalfJung:retag-deref-check, r=saethlin
bors [Sun, 27 Nov 2022 19:03:21 +0000 (19:03 +0000)]
Auto merge of #2694 - RalfJung:retag-deref-check, r=saethlin

fix handling of spurious accesses during retag

The `dereferenceable` attribute we emit for LLVM is checked during retag in Stacked Borrows.
However, we currently don't properly do that for retagging of `&mut !Unpin`, which this PR fixes.
Also this adjusts retagging to inform the data race model of the accesses as well.

Fixes https://github.com/rust-lang/miri/issues/2648.
Also fixes https://github.com/rust-lang/miri/issues/2693 since the same issue arose for retagging as well.

r? `@saethlin`

19 months agoAuto merge of #104983 - matthiaskrgr:rollup-018sk73, r=matthiaskrgr
bors [Sun, 27 Nov 2022 17:10:58 +0000 (17:10 +0000)]
Auto merge of #104983 - matthiaskrgr:rollup-018sk73, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #95836 (Use `rust_out{exe_suffix}` for doctests)
 - #104882 (notify lcnr on changes to `ObligationCtxt`)
 - #104892 (Explain how to get the discriminant out of a `#[repr(T)] enum` with payload)
 - #104917 (Allow non-org members to label `requires-debug-assertions`)
 - #104931 (Pretty-print generators with their `generator_kind`)
 - #104934 (Remove redundant `all` in cfg)
 - #104944 (Support unit tests for jsondoclint)
 - #104946 (rustdoc: improve popover focus handling JS)

Failed merges:

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

19 months agoFix natvis `VecDeque` formatter
Markus Everling [Sun, 27 Nov 2022 14:55:13 +0000 (15:55 +0100)]
Fix natvis `VecDeque` formatter

19 months agoAdd rustdoc test for Deref to primitive types
Guillaume Gomez [Sun, 27 Nov 2022 15:31:52 +0000 (16:31 +0100)]
Add rustdoc test for Deref to primitive types

19 months agoRemove Crate::primitives field
Guillaume Gomez [Sun, 27 Nov 2022 15:31:34 +0000 (16:31 +0100)]
Remove Crate::primitives field

19 months agoRollup merge of #104946 - notriddle:notriddle/popover-menu-focus, r=GuillaumeGomez
Matthias Krüger [Sun, 27 Nov 2022 15:03:09 +0000 (16:03 +0100)]
Rollup merge of #104946 - notriddle:notriddle/popover-menu-focus, r=GuillaumeGomez

rustdoc: improve popover focus handling JS

This commit fixes a few inconsistencies and erratic behavior from the notable traits, settings, and sidebar popups:

* It makes it so that pressing Escape closes the mobile sidebar. This is a bit difficult to do on iPhone, but on other setups like desktop tiling window managers, it's easy and makes sense.
* It makes sure that pressing escape while a notable trait popover is open focuses the popover's toggle button, instead of leaving nothing focused, since that makes more sense with keyboard navigation. Clicking the settings, help, or sidebar buttons, however, will not focus the notable trait popover toggle button.
* It ensures that notable trait and settings popovers are exclusive with the mobile sidebar. Nothing should ever overlap a popover, and there should never be more than one popover open at once.

19 months agoRollup merge of #104944 - aDotInTheVoid:jsondoclint-unit-tests, r=jyn514
Matthias Krüger [Sun, 27 Nov 2022 15:03:09 +0000 (16:03 +0100)]
Rollup merge of #104944 - aDotInTheVoid:jsondoclint-unit-tests, r=jyn514

Support unit tests for jsondoclint

r? ````@ghost````

19 months agoRollup merge of #104934 - ChrisDenton:all-anybody-wants, r=thomcc
Matthias Krüger [Sun, 27 Nov 2022 15:03:08 +0000 (16:03 +0100)]
Rollup merge of #104934 - ChrisDenton:all-anybody-wants, r=thomcc

Remove redundant `all` in cfg

This appears to have been accidentally left in after removing the other branches https://github.com/rust-lang/rust/commit/45bf1ed1a1123122ded05ae2eedaf0f190e52726

(hat tip to kangalioo for the git archaeology)

19 months agoRollup merge of #104931 - Swatinem:async-pretty, r=eholk
Matthias Krüger [Sun, 27 Nov 2022 15:03:08 +0000 (16:03 +0100)]
Rollup merge of #104931 - Swatinem:async-pretty, r=eholk

Pretty-print generators with their `generator_kind`

After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally.

This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.

19 months agoRollup merge of #104917 - compiler-errors:requires-debug-assertions, r=Mark-Simulacrum
Matthias Krüger [Sun, 27 Nov 2022 15:03:07 +0000 (16:03 +0100)]
Rollup merge of #104917 - compiler-errors:requires-debug-assertions, r=Mark-Simulacrum

Allow non-org members to label `requires-debug-assertions`

`jruderman` tried to add this in #104916, for example. I think I've seen this happen before as well.

19 months agoRollup merge of #104892 - lukas-code:discriminant, r=scottmcm
Matthias Krüger [Sun, 27 Nov 2022 15:03:07 +0000 (16:03 +0100)]
Rollup merge of #104892 - lukas-code:discriminant, r=scottmcm

Explain how to get the discriminant out of a `#[repr(T)] enum` with payload

example stolen from https://github.com/rust-lang/reference/pull/1055

````@rustbot```` label A-docs

19 months agoRollup merge of #104882 - lcnr:notify-ocx, r=Mark-Simulacrum
Matthias Krüger [Sun, 27 Nov 2022 15:03:06 +0000 (16:03 +0100)]
Rollup merge of #104882 - lcnr:notify-ocx, r=Mark-Simulacrum

notify lcnr on changes to `ObligationCtxt`

Right now the `ObligationCtxt` has an API which should prevent leaking any important details of the trait solver. This allows us to freely use it without having to worry about causing issues for the [trait solver rewrite](https://github.com/orgs/rust-lang/projects/26/views/1).

I would like to keep it this way ^^

19 months agoRollup merge of #95836 - workingjubilee:doctest-exe, r=notriddle
Matthias Krüger [Sun, 27 Nov 2022 15:03:06 +0000 (16:03 +0100)]
Rollup merge of #95836 - workingjubilee:doctest-exe, r=notriddle

Use `rust_out{exe_suffix}` for doctests

This was mentioned as an issue to me by ````@bruxisma.```` There are 3 separate instances where "rust_out" can become part of the name of a Rust executable, so I am mostly just hoping that this fixes the problem, given that the other sites which it can slip in seem to be well-behaved.

19 months agoAuto merge of #104048 - cjgillot:split-lifetime, r=compiler-errors
bors [Sun, 27 Nov 2022 14:30:19 +0000 (14:30 +0000)]
Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errors

Separate lifetime ident from lifetime resolution in HIR

Drive-by: change how suggested generic args are computed.
Fixes https://github.com/rust-lang/rust/issues/103815

I recommend reviewing commit-by-commit.

19 months agoAuto merge of #2685 - Nilstrieb:cargo-miri-wasm, r=RalfJung
bors [Sun, 27 Nov 2022 13:31:05 +0000 (13:31 +0000)]
Auto merge of #2685 - Nilstrieb:cargo-miri-wasm, r=RalfJung

Use `.wasm` extension when building for wasm in cargo-miri

WASM uses the `.wasm` file extension for its binaries (just like how windows uses `.exe`), so we need to set that as well.

I'm not sure whether gating this behind the wasm target is a good idea, maybe it makes more sense to always do it just like on windows.

19 months agoAuto merge of #2701 - RalfJung:smoke, r=RalfJung
bors [Sun, 27 Nov 2022 12:45:34 +0000 (12:45 +0000)]
Auto merge of #2701 - RalfJung:smoke, r=RalfJung

run_tests_minimal: actually run the smoke test on the desired target

19 months agorun_tests_minimal: actually run the smoke test on the desired target
Ralf Jung [Sun, 27 Nov 2022 12:26:31 +0000 (13:26 +0100)]
run_tests_minimal: actually run the smoke test on the desired target

19 months agoAuto merge of #2700 - RalfJung:begingroup, r=RalfJung
bors [Sun, 27 Nov 2022 12:21:26 +0000 (12:21 +0000)]
Auto merge of #2700 - RalfJung:begingroup, r=RalfJung

CI: fix begingroup printing

19 months agoCI: fix begingroup printing
Ralf Jung [Sun, 27 Nov 2022 12:20:44 +0000 (13:20 +0100)]
CI: fix begingroup printing

19 months agoPrefer doc comments over `//`-comments in compiler
Maybe Waffle [Sun, 27 Nov 2022 11:15:06 +0000 (11:15 +0000)]
Prefer doc comments over `//`-comments in compiler

19 months agoAuto merge of #103917 - oli-obk:layout_math, r=RalfJung,lcnr
bors [Sun, 27 Nov 2022 10:35:00 +0000 (10:35 +0000)]
Auto merge of #103917 - oli-obk:layout_math, r=RalfJung,lcnr

Various cleanups around scalar layout restrictions

Pulled out of https://github.com/rust-lang/rust/pull/103724

19 months agoUse `.wasm` extension when building for wasm in cargo-miri
nils [Mon, 21 Nov 2022 08:01:26 +0000 (09:01 +0100)]
Use `.wasm` extension when building for wasm in cargo-miri

WASM uses the `.wasm` file extension for its binaries (just like how
windows uses `.exe`), so we need to set that as well.

19 months agoUse `TyCtxt::is_fn_trait` is a couple more places
Maybe Waffle [Tue, 22 Nov 2022 19:03:26 +0000 (19:03 +0000)]
Use `TyCtxt::is_fn_trait` is a couple more places

19 months agomicro doc fixes
Maybe Waffle [Tue, 22 Nov 2022 18:52:07 +0000 (18:52 +0000)]
micro doc fixes

19 months agoSimplify `ty::ClosureKind::extends`
Maybe Waffle [Tue, 22 Nov 2022 18:35:58 +0000 (18:35 +0000)]
Simplify `ty::ClosureKind::extends`

This is valid per the comment of the `ClosureKind` defition

19 months agoAdd `TyCtxt::is_fn_trait`
Maybe Waffle [Tue, 22 Nov 2022 18:31:23 +0000 (18:31 +0000)]
Add `TyCtxt::is_fn_trait`

19 months agoRemove `ty::ClosureKind::from_def_id`
Maybe Waffle [Tue, 22 Nov 2022 18:24:50 +0000 (18:24 +0000)]
Remove `ty::ClosureKind::from_def_id`

…in favour of `TyCtxt::fn_trait_kind_from_def_id`

19 months agoRename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaning
Maybe Waffle [Tue, 22 Nov 2022 18:12:12 +0000 (18:12 +0000)]
Rename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaning

19 months agoAuto merge of #103786 - tshepang:obsolete, r=jyn514
bors [Sun, 27 Nov 2022 07:12:30 +0000 (07:12 +0000)]
Auto merge of #103786 - tshepang:obsolete, r=jyn514

Don't build `compiler_builtins` with `-C panic=abort`

19 months agoAuto merge of #96451 - JakobDegen:dest-prop, r=tmiasko
bors [Sun, 27 Nov 2022 04:09:53 +0000 (04:09 +0000)]
Auto merge of #96451 - JakobDegen:dest-prop, r=tmiasko

Fix Dest Prop

Closes #82678, #79191 .

This was not originally a total re-write of the pass but is has gradually turned into one. Notable changes:

 1. Significant improvements to documentation all around. The top of the file has been extended with a more precise argument for soundness. The code should be fairly readable, and I've done my best to add useful comments wherever possible. I would very much like for the bus factor to not be one on this code.
 3. Improved handling of conflicts that are not visible in normal dataflow.  This was the cause of #79191. Handling this correctly requires us to make decision about the semantics and specifically evaluation order of basically all MIR constructs (see specifically #68364 #71117.  The way this is implemented is based on my preferred resolution to these questions around the semantics of assignment statements.
 4. Some re-architecting to improve performance. More details below.
 5. Possible future improvements to this optimization are documented, and the code is written with the needs of those improvements in mind. The hope is that adding support for more precise analyses will not require a full re-write of this opt, but just localized changes.

### Regarding Performance

The previous approach had some performance issues; letting `l` be the number of locals and `s` be the number of statements/terminators, the runtime of the pass was `O(l^2 * s)`, both in theory and in practice. This version is smarter about not calculating unnecessary things and doing more caching. Our runtime is now dominated by one invocation of `MaybeLiveLocals` for each "round," and the number of rounds is less than 5 in over 90% of cases. This means it's linear-ish in practice.

r? `@oli-obk` who reviewed the last version of this, but review from anyone else would be more than welcome

19 months agoAttempt to solve problem with globs
Jubilee Young [Sun, 27 Nov 2022 02:47:52 +0000 (18:47 -0800)]
Attempt to solve problem with globs

19 months agoUse target exe_suffix for doctests
Jubilee Young [Sat, 9 Apr 2022 05:28:33 +0000 (22:28 -0700)]
Use target exe_suffix for doctests

This will use rust_out.exe for doctests on Windows,
rust_out.wasm for doctests in the wasm case, and
also handles cross-compiling or user-provided targets.

19 months agoUpdate cargo
Weihang Lo [Fri, 25 Nov 2022 22:37:04 +0000 (22:37 +0000)]
Update cargo

5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744
2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000
- fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420)
- add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401)
- chore: Upgrade to env_logger (rust-lang/cargo#11417)
- Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343)
- temporarily disable test `lto::test_profile` (rust-lang/cargo#11419)

19 months agoRewrite dest prop.
Jakob Degen [Sun, 24 Apr 2022 21:34:24 +0000 (17:34 -0400)]
Rewrite dest prop.

This fixes a number of correctness issues from the previous version. Additionally, we use a new
strategy which has much better performance charactersitics and also finds more opportunities to
apply the optimization.

19 months agoAuto merge of #104818 - scottmcm:refactor-extend-func, r=the8472
bors [Sun, 27 Nov 2022 00:58:50 +0000 (00:58 +0000)]
Auto merge of #104818 - scottmcm:refactor-extend-func, r=the8472

Stop peeling the last iteration of the loop in `Vec::resize_with`

`resize_with` uses the `ExtendWith` code that peels the last iteration:
https://github.com/rust-lang/rust/blob/341d8b8a2c290b4535e965867e876b095461ff6e/library/alloc/src/vec/mod.rs#L2525-L2529

But that's kinda weird for `ExtendFunc` because it does the same thing on the last iteration anyway:
https://github.com/rust-lang/rust/blob/341d8b8a2c290b4535e965867e876b095461ff6e/library/alloc/src/vec/mod.rs#L2494-L2502

So this just has it use the normal `extend`-from-`TrustedLen` code instead.

r? `@ghost`

19 months agonits
Ralf Jung [Sat, 26 Nov 2022 23:06:00 +0000 (00:06 +0100)]
nits

19 months agomake Stacked Borrows retags act like data races
Ralf Jung [Sat, 26 Nov 2022 13:46:06 +0000 (14:46 +0100)]
make Stacked Borrows retags act like data races

19 months agoslightly adjust and synchronize Machine passing for SB and DataRace
Ralf Jung [Sat, 26 Nov 2022 13:42:27 +0000 (14:42 +0100)]
slightly adjust and synchronize Machine passing for SB and DataRace

19 months ago!Unpin retags must still be reads, to check dereferenceable
Ralf Jung [Sat, 26 Nov 2022 12:22:19 +0000 (13:22 +0100)]
!Unpin retags must still be reads, to check dereferenceable

also fix ICE on deallocation error and avoid redundant find_granting on retag

19 months agoAdd second test case in `make_contiguous_head_to_end`
Markus Everling [Sat, 26 Nov 2022 22:08:57 +0000 (23:08 +0100)]
Add second test case in `make_contiguous_head_to_end`

19 months agoImprove slow path in `make_contiguous`
Markus Everling [Sat, 26 Nov 2022 21:48:20 +0000 (22:48 +0100)]
Improve slow path in `make_contiguous`

19 months agoAuto merge of #104950 - jyn514:revert-preview, r=Mark-Simulacrum
bors [Sat, 26 Nov 2022 21:47:17 +0000 (21:47 +0000)]
Auto merge of #104950 - jyn514:revert-preview, r=Mark-Simulacrum

Revert "Don't set `is_preview` for clippy and rustfmt"

This reverts commit fb3e724d7602675f147a9b80e70fb6bd6512738c, which broke `rustup update` for anyone with clippy or rustfmt installed.

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

r? `@Mark-Simulacrum`

`@bors` p=50 fixes nightly

19 months agoSwitch rustdoc-gui test to function call
Guillaume Gomez [Sat, 26 Nov 2022 21:35:05 +0000 (22:35 +0100)]
Switch rustdoc-gui test to function call

19 months agorustdoc: pass "true" to reset focus for notable traits
Michael Howell [Sat, 26 Nov 2022 21:32:57 +0000 (14:32 -0700)]
rustdoc: pass "true" to reset focus for notable traits

19 months agoRevert "Don't set `is_preview` for clippy and rustfmt"
Joshua Nelson [Sat, 26 Nov 2022 20:23:53 +0000 (15:23 -0500)]
Revert "Don't set `is_preview` for clippy and rustfmt"

This reverts commit fb3e724d7602675f147a9b80e70fb6bd6512738c, which broke `rustup update` for anyone with clippy or rustfmt installed.

19 months agoPretty-print generators with their `generator_kind`
Arpad Borsos [Fri, 25 Nov 2022 08:53:58 +0000 (09:53 +0100)]
Pretty-print generators with their `generator_kind`

After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally.

This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.

19 months agoAuto merge of #104945 - GuillaumeGomez:rollup-ygzbpbe, r=GuillaumeGomez
bors [Sat, 26 Nov 2022 17:58:12 +0000 (17:58 +0000)]
Auto merge of #104945 - GuillaumeGomez:rollup-ygzbpbe, r=GuillaumeGomez

Rollup of 7 pull requests

Successful merges:

 - #104786 (Use the power of adding helper function to simplify code w/ `Mutability`)
 - #104788 (Do not record unresolved const vars in generator interior)
 - #104909 (Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`)
 - #104921 (Remove unnecessary binder from `get_impl_future_output_ty`)
 - #104924 (jsondoclint: Accept trait alias is places where trait expected.)
 - #104928 (rustdoc: use flexbox CSS to align sidebar button instead of position)
 - #104943 (jsondoclint: Handle using enum variants and glob using enums.)

Failed merges:

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

19 months agorustdoc: improve popover focus handling JS
Michael Howell [Sat, 26 Nov 2022 16:52:58 +0000 (09:52 -0700)]
rustdoc: improve popover focus handling JS

This commit fixes a few inconsistencies and erratic behavior from the
notable traits, settings, and sidebar popups:

* It makes it so that pressing Escape closes the mobile sidebar.
  This is a bit difficult to do on iPhone, but on other setups like
  desktop tiling window managers, it's easy and makes sense.
* It makes sure that pressing escape while a notable trait popover is
  open focuses the popover's toggle button, instead of leaving nothing
  focused, since that makes more sense with keyboard navigation. Clicking
  the settings, help, or sidebar buttons, however, will not focus the
  notable trait popover toggle button.
* It ensures that notable trait and settings popovers are exclusive
  with the mobile sidebar. Nothing should ever overlap a popover, and
  there should never be more than one popover open at once.

19 months agoRollup merge of #104943 - aDotInTheVoid:jsondoclint-use-enum, r=GuillaumeGomez
Guillaume Gomez [Sat, 26 Nov 2022 16:47:26 +0000 (17:47 +0100)]
Rollup merge of #104943 - aDotInTheVoid:jsondoclint-use-enum, r=GuillaumeGomez

jsondoclint: Handle using enum variants and glob using enums.

More work on jsondoclint for `core.json`

Closes #104942

r? `@GuillaumeGomez`

`@rustbot` modify labels: +A-testsuite

19 months agoRollup merge of #104928 - notriddle:notriddle/sidebar-toggle-flexbox, r=GuillaumeGomez
Guillaume Gomez [Sat, 26 Nov 2022 16:47:25 +0000 (17:47 +0100)]
Rollup merge of #104928 - notriddle:notriddle/sidebar-toggle-flexbox, r=GuillaumeGomez

rustdoc: use flexbox CSS to align sidebar button instead of position

This accomplishes the same thing with significantly less code.

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-toggle-flexbox/src/test_dingus/lib.rs.html

19 months agoRollup merge of #104924 - aDotInTheVoid:jsondocck-trait-alias, r=GuillaumeGomez
Guillaume Gomez [Sat, 26 Nov 2022 16:47:25 +0000 (17:47 +0100)]
Rollup merge of #104924 - aDotInTheVoid:jsondocck-trait-alias, r=GuillaumeGomez

jsondoclint: Accept trait alias is places where trait expected.

More work to make `jsondoclint` work for `core.json`

Closes #104923

r? `@GuillaumeGomez`

`@rustbot` modify labels: +A-testsuite

19 months agoRollup merge of #104921 - compiler-errors:no-binder-on-fut-ty, r=cjgillot
Guillaume Gomez [Sat, 26 Nov 2022 16:47:24 +0000 (17:47 +0100)]
Rollup merge of #104921 - compiler-errors:no-binder-on-fut-ty, r=cjgillot

Remove unnecessary binder from `get_impl_future_output_ty`

We never construct an `async fn` with a higher-ranked `impl Future` bound anyways, and basically all the call-sites already skip the binder.

19 months agoRollup merge of #104909 - compiler-errors:normalize_opaque_types-is-misleading, r...
Guillaume Gomez [Sat, 26 Nov 2022 16:47:24 +0000 (17:47 +0100)]
Rollup merge of #104909 - compiler-errors:normalize_opaque_types-is-misleading, r=fee1-dead

Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`

1. The query name is a bit misleading, since it doesn't do any associated type normalization, and
2. since it only takes a predicate list, it sounds a bit more powerful than it actually is.

19 months agoRollup merge of #104788 - compiler-errors:unresolved-ct-in-gen, r=fee1-dead
Guillaume Gomez [Sat, 26 Nov 2022 16:47:23 +0000 (17:47 +0100)]
Rollup merge of #104788 - compiler-errors:unresolved-ct-in-gen, r=fee1-dead

Do not record unresolved const vars in generator interior

Don't record types in the generator interior when we see unresolved const variables.

We already do this for associated types -- this is important to avoid unresolved inference variables in the generator results during writeback, since the writeback results get stable hashed in incremental mode.

Fixes #104787

19 months agoRollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors
Guillaume Gomez [Sat, 26 Nov 2022 16:47:23 +0000 (17:47 +0100)]
Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors

Use the power of adding helper function to simplify code w/ `Mutability`

r? `@compiler-errors`

19 months agoAdd a test that makes sense
Nixon Enraght-Moony [Sat, 26 Nov 2022 16:24:43 +0000 (16:24 +0000)]
Add a test that makes sense

19 months agofix broken link fragment
Lukas Markeffsky [Sat, 26 Nov 2022 15:56:29 +0000 (16:56 +0100)]
fix broken link fragment

19 months agoSupport unit tests for jsondoclint
Nixon Enraght-Moony [Sat, 26 Nov 2022 15:32:49 +0000 (15:32 +0000)]
Support unit tests for jsondoclint

19 months agoAuto merge of #2696 - RalfJung:no-std-windows, r=RalfJung
bors [Sat, 26 Nov 2022 15:15:22 +0000 (15:15 +0000)]
Auto merge of #2696 - RalfJung:no-std-windows, r=RalfJung

make no_std work on Windows

Also fixes https://github.com/rust-lang/miri/issues/1123 by cherry-picking a patch by `@DrMeepster.`

19 months agosupport no_std on Windows
Ralf Jung [Sat, 26 Nov 2022 14:58:44 +0000 (15:58 +0100)]
support no_std on Windows

19 months agorefactor try_resolve_did and also support resolving crates/modules
Ralf Jung [Sat, 26 Nov 2022 14:58:28 +0000 (15:58 +0100)]
refactor try_resolve_did and also support resolving crates/modules

19 months agoexplain how to get the discriminant out of a `#[repr(T)] enum`
Lukas Markeffsky [Fri, 25 Nov 2022 15:13:52 +0000 (16:13 +0100)]
explain how to get the discriminant out of a `#[repr(T)] enum`

19 months agojsondoclint: Handle using enum variants and glob using enums.
Nixon Enraght-Moony [Sat, 26 Nov 2022 15:06:46 +0000 (15:06 +0000)]
jsondoclint: Handle using enum variants and glob using enums.

Closes #104942

19 months agoAuto merge of #104731 - compiler-errors:early-binder-iter-size-hint, r=cjgillot
bors [Sat, 26 Nov 2022 14:59:30 +0000 (14:59 +0000)]
Auto merge of #104731 - compiler-errors:early-binder-iter-size-hint, r=cjgillot

Add size hints to early binder iterator adapters

probably doesn't do anything, but definitely doesn't hurt

19 months agoadd namespace to resolve_path
DrMeepster [Wed, 9 Nov 2022 08:39:03 +0000 (00:39 -0800)]
add namespace to resolve_path

19 months agoAuto merge of #2695 - RalfJung:ci-pretty, r=RalfJung
bors [Sat, 26 Nov 2022 13:53:27 +0000 (13:53 +0000)]
Auto merge of #2695 - RalfJung:ci-pretty, r=RalfJung

prettify our CI logs

19 months agoprettify our CI logs
Ralf Jung [Sat, 26 Nov 2022 13:03:41 +0000 (14:03 +0100)]
prettify our CI logs

19 months agoAuto merge of #2690 - Nilstrieb:cargo-miri-smoke-test-ci-so-that-cargo-miri-actually...
bors [Sat, 26 Nov 2022 13:24:26 +0000 (13:24 +0000)]
Auto merge of #2690 - Nilstrieb:cargo-miri-smoke-test-ci-so-that-cargo-miri-actually-works-kinda, r=RalfJung

Test a small cargo-miri smoke test even in `run_tests_minimal`

This makes sure that cargo-miri works on all targets.

Implements the first step of https://github.com/rust-lang/miri/pull/2685#issuecomment-1325155967 to get that PR tested.

19 months agoupdate lockfile
Ralf Jung [Sat, 26 Nov 2022 13:16:45 +0000 (14:16 +0100)]
update lockfile

19 months agoAuto merge of #2647 - saethlin:current-span, r=RalfJung
bors [Sat, 26 Nov 2022 13:02:15 +0000 (13:02 +0000)]
Auto merge of #2647 - saethlin:current-span, r=RalfJung

Track local frames incrementally during execution

https://github.com/rust-lang/miri/pull/2646 currently introduces a performance regression. This change removes that regression, and provides a minor perf improvement.

The existing lazy strategy for tracking the span we want to display is as efficient as it is only because we often create a `CurrentSpan` then never call `.get()`. Most of the calls to the `before_memory_read` and `before_memory_write` hooks do not create any event that we store in `AllocHistory`. But data races are totally different, any memory read or write may race, so every call to those hooks needs to access to the current local span.

So this changes to a strategy where we update some state in a `Thread` and `FrameExtra` incrementally, upon entering and existing each function call.

Before:
```
Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/backtraces/Cargo.toml
  Time (mean ± σ):      5.532 s ±  0.022 s    [User: 5.444 s, System: 0.073 s]
  Range (min … max):    5.516 s …  5.569 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/mse/Cargo.toml
  Time (mean ± σ):     831.4 ms ±   3.0 ms    [User: 783.8 ms, System: 46.7 ms]
  Range (min … max):   828.7 ms … 836.1 ms    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/serde1/Cargo.toml
  Time (mean ± σ):      1.975 s ±  0.021 s    [User: 1.914 s, System: 0.059 s]
  Range (min … max):    1.939 s …  1.990 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/serde2/Cargo.toml
  Time (mean ± σ):      4.060 s ±  0.051 s    [User: 3.983 s, System: 0.071 s]
  Range (min … max):    3.972 s …  4.100 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/slice-get-unchecked/Cargo.toml
  Time (mean ± σ):     784.9 ms ±   8.2 ms    [User: 746.5 ms, System: 37.7 ms]
  Range (min … max):   772.9 ms … 793.3 ms    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/unicode/Cargo.toml
  Time (mean ± σ):      1.679 s ±  0.006 s    [User: 1.623 s, System: 0.055 s]
  Range (min … max):    1.673 s …  1.687 s    5 runs
```
After:
```
Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/backtraces/Cargo.toml
  Time (mean ± σ):      5.330 s ±  0.037 s    [User: 5.232 s, System: 0.084 s]
  Range (min … max):    5.280 s …  5.383 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/mse/Cargo.toml
  Time (mean ± σ):     818.9 ms ±   3.7 ms    [User: 776.8 ms, System: 41.3 ms]
  Range (min … max):   813.5 ms … 822.5 ms    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/serde1/Cargo.toml
  Time (mean ± σ):      1.927 s ±  0.011 s    [User: 1.864 s, System: 0.061 s]
  Range (min … max):    1.917 s …  1.945 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/serde2/Cargo.toml
  Time (mean ± σ):      3.974 s ±  0.020 s    [User: 3.893 s, System: 0.076 s]
  Range (min … max):    3.956 s …  4.004 s    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/slice-get-unchecked/Cargo.toml
  Time (mean ± σ):     780.0 ms ±   5.3 ms    [User: 740.3 ms, System: 39.0 ms]
  Range (min … max):   771.2 ms … 784.5 ms    5 runs

Benchmark 1: cargo +miri miri run --manifest-path /home/ben/miri/bench-cargo-miri/unicode/Cargo.toml
  Time (mean ± σ):      1.643 s ±  0.007 s    [User: 1.584 s, System: 0.058 s]
  Range (min … max):    1.635 s …  1.654 s    5 runs
```
(This change is marginal, but the point is that it avoids a much more significant regression)