Commit Graph

211497 Commits

Author SHA1 Message Date
Andres Suarez
9d66ab0f9d Add as_mut_os_string to &mut PathBuf and as_mut_os_str to &mut Path
Implements rust-lang/libs-team#140
2022-11-28 12:06:59 -05:00
bors
8a09420ac4 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
2022-11-28 13:20:33 +00:00
bors
69df0f2c2f 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`
2022-11-28 10:39:47 +00:00
Dylan DPC
d5de2a8e64
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
2022-11-28 15:42:12 +05:30
Dylan DPC
9178bc059f
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
2022-11-28 15:42:11 +05:30
Dylan DPC
8a84dd8fcc
Rollup merge of #104890 - lcnr:small-cleanup, r=fee1-dead
small method code cleanup
2022-11-28 15:42:11 +05:30
Dylan DPC
79fe15c8b0
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.
2022-11-28 15:42:10 +05:30
Dylan DPC
f90484df8a
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`
2022-11-28 15:42:10 +05:30
Dylan DPC
f33d4094f0
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
2022-11-28 15:42:09 +05:30
Esteban Küber
136ffa2ab1 fix clippy tests 2022-11-28 00:41:31 -08:00
Esteban Küber
6f64432a39 Tweak output 2022-11-28 00:11:12 -08:00
Esteban Küber
ab04080b56 Change multiline span ASCII art visual order 2022-11-28 00:11:12 -08:00
bors
dd12cd6dc6 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`
2022-11-28 03:16:58 +00:00
bors
8c6bf2bee7 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
2022-11-28 00:18:22 +00:00
Markus Everling
b1c3c6380f Fix pretty-std test 2022-11-27 23:15:55 +01:00
Matthias Krüger
2ccb38b92d
Rollup merge of #104989 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2022-11-27 22:14:09 +01:00
Matthias Krüger
5ea36cfc1c
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`
2022-11-27 22:14:09 +01:00
Matthias Krüger
86304f5149
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.
2022-11-27 22:14:08 +01:00
Matthias Krüger
53cfcfbfed
Rollup merge of #104955 - GuillaumeGomez:migrate-to-func, r=notriddle
Switch rustdoc-gui test to function call

r? `@notriddle`
2022-11-27 22:14:08 +01:00
bors
07e664c41a Auto merge of #104506 - joshtriplett:style-principles-readability-in-plain-text, r=compiler-errors
Expand a style-guide principle: readability in plain text
2022-11-27 21:07:04 +00:00
bors
f8fbc6da3c 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.
2022-11-27 19:54:04 +00:00
Ralf Jung
598c3da627 clippy 2022-11-27 20:53:17 +01:00
Ralf Jung
6d1e99e96e advice on josh pushing 2022-11-27 20:52:17 +01:00
Ralf Jung
7c12ed1d5d Merge from rustc 2022-11-27 20:51:52 +01:00
Ralf Jung
187ba67781 Preparing for merge from rustc 2022-11-27 20:51:50 +01:00
lcnr
99c3dda066
fix type
Co-authored-by: fee1-dead <ent3rm4n@gmail.com>
2022-11-27 20:48:31 +01:00
Vadim Petrochenkov
5b0e80ecf3 Stabilize native library modifier verbatim 2022-11-27 22:36:32 +03:00
bors
66354f0043 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`
2022-11-27 19:03:21 +00:00
bors
1eb62b1235 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
2022-11-27 17:10:58 +00:00
Markus Everling
cd68bd9bab Fix natvis VecDeque formatter 2022-11-27 18:09:56 +01:00
Guillaume Gomez
23c3941942 Add rustdoc test for Deref to primitive types 2022-11-27 16:31:52 +01:00
Guillaume Gomez
5856e40885 Remove Crate::primitives field 2022-11-27 16:31:34 +01:00
Matthias Krüger
55cf566f04
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.
2022-11-27 16:03:09 +01:00
Matthias Krüger
e3165a3808
Rollup merge of #104944 - aDotInTheVoid:jsondoclint-unit-tests, r=jyn514
Support unit tests for jsondoclint

r? ````@ghost````
2022-11-27 16:03:09 +01:00
Matthias Krüger
8d90647641
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 45bf1ed1a1

(hat tip to kangalioo for the git archaeology)
2022-11-27 16:03:08 +01:00
Matthias Krüger
6e6c42c61c
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.
2022-11-27 16:03:08 +01:00
Matthias Krüger
9ebffb7c3c
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.
2022-11-27 16:03:07 +01:00
Matthias Krüger
9ba78ac08b
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
2022-11-27 16:03:07 +01:00
Matthias Krüger
5d05cf8473
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 ^^
2022-11-27 16:03:06 +01:00
Matthias Krüger
7ce937fe4a
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.
2022-11-27 16:03:06 +01:00
bors
454784afba 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.
2022-11-27 14:30:19 +00:00
bors
a83b105b4c 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.
2022-11-27 13:31:05 +00:00
bors
9f8df93b09 Auto merge of #2701 - RalfJung:smoke, r=RalfJung
run_tests_minimal: actually run the smoke test on the desired target
2022-11-27 12:45:34 +00:00
Ralf Jung
c6587b0160 run_tests_minimal: actually run the smoke test on the desired target 2022-11-27 13:26:31 +01:00
bors
5a14c5af09 Auto merge of #2700 - RalfJung:begingroup, r=RalfJung
CI: fix begingroup printing
2022-11-27 12:21:26 +00:00
Ralf Jung
b20efbd79f CI: fix begingroup printing 2022-11-27 13:20:44 +01:00
Maybe Waffle
1d42936b18 Prefer doc comments over //-comments in compiler 2022-11-27 11:19:04 +00:00
bors
df04d28163 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
2022-11-27 10:35:00 +00:00
nils
958d5918b0 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.
2022-11-27 10:25:32 +01:00
Maybe Waffle
5ba0056346 Use TyCtxt::is_fn_trait is a couple more places 2022-11-27 07:20:28 +00:00