Commit Graph

211661 Commits

Author SHA1 Message Date
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
Ding Xiang Fei
9cd12cdf78
inference test for #104649 2022-11-28 01:48:35 +08: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
Pratush Rai
d742407917 suggested changes 2022-11-27 22:23:16 +05:30
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
Ralf Jung
60d5d65a4d interpret: get rid of run() function 2022-11-27 15:20:26 +01: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
Lukas Wirth
e4c9915218
notify the rust-analyzer team on changes to the rust-analyzer subtree 2022-11-27 13:28:48 +01: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
Vincenzo Palazzo
ee6f18ef59
make simple check of prinf function.
With this commit we start to make some simple
check when the name resolution fails, and
we generate some helper message in case the
name is a C name like in the case of the `printf`
and suggest the correct rust method.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-11-27 11:50:02 +01: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
Maybe Waffle
ea447924ce micro doc fixes 2022-11-27 07:19:30 +00:00
Maybe Waffle
fa89f53352 Simplify ty::ClosureKind::extends
This is valid per the comment of the `ClosureKind` defition
2022-11-27 07:19:30 +00:00
Maybe Waffle
4b6e1d1c5f Add TyCtxt::is_fn_trait 2022-11-27 07:19:29 +00:00
Maybe Waffle
d0c7ed3bea Remove ty::ClosureKind::from_def_id
…in favour of `TyCtxt::fn_trait_kind_from_def_id`
2022-11-27 07:18:36 +00:00
Maybe Waffle
881862ecb7 Rename fn_trait_kind_from_{from_lang=>def_id} to better convey meaning 2022-11-27 07:14:49 +00:00
bors
5ac7e08aaf Auto merge of #103786 - tshepang:obsolete, r=jyn514
Don't build `compiler_builtins` with `-C panic=abort`
2022-11-27 07:12:30 +00:00
Pratush Rai
8d148988ca suggested changes 2022-11-27 10:05:19 +05:30
bors
0e9eee6811 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
2022-11-27 04:09:53 +00:00