Commit Graph

209336 Commits

Author SHA1 Message Date
Yuki Okushi
2a6a8f4d30
Rollup merge of #103749 - est31:reduce_irrefutable_let_else_span, r=cjgillot
Reduce span of let else irrefutable_let_patterns warning

Huge spans aren't good for IDE users as they underline constructs that are possibly multiline.

Similar PR to #90761 which did the same for the `unused_macros` lint.
2022-11-01 12:03:41 +09:00
Yuki Okushi
2125181b7d
Rollup merge of #103692 - smoelius:walk_generic_arg, r=fee1-dead
Add `walk_generic_arg`

Could this please be added?

I could use it for a Clippy lint.
2022-11-01 12:03:41 +09:00
Yuki Okushi
d1ca70809f
Rollup merge of #103674 - ehuss:split-debuginfo-doc-unstable, r=davidtwco
Update note about unstable split-debuginfo flag.

split-debuginfo was effectively stabilized in #98051. The note about it requiring `-Z unstable-options` is no longer accurate.

The rules for when it is gated and when it is supported are somewhat complex. I considered removing the note entirely, or making it more generic, but opted to instead try to summarize the current state.
2022-11-01 12:03:40 +09:00
Yuki Okushi
a6ac6b20f3
Rollup merge of #103007 - albertlarsan68:better-python-discovery, r=jyn514
Add better python discovery

The Microsoft Store version of Python installs itself as `pythonM.m`, with `M` being the major version and `m` the minor.

The `x.ps1` script will now search for python executables whose command matches the regex `python\d`.
The `\d` at the end is to protect from using the `pythonw` versions, which do not work as standard python.
2022-11-01 12:03:40 +09:00
Mark Rousskov
a0c21e4e7e Remove let_underscore_must_use from list of uplifted lints 2022-10-31 20:55:03 -04:00
bors
024207ab43 Auto merge of #102950 - oli-obk:check_miri, r=RalfJung
Enable `x.py check` for miri

Now that the miri subtree is working properly, let's add it to x.py check.

cc `@rust-lang/miri`
2022-10-31 23:03:39 +00:00
Michael Goulet
2768c2fb25 Add bug! back to late_bound_vars query 2022-10-31 21:25:08 +00:00
Michael Goulet
4427af0827 Make external/local late-bound region registration more explicit 2022-10-31 21:25:08 +00:00
Michael Goulet
f27bdf1750 Collect late-bound regions from all closure parents in closure_mapping 2022-10-31 21:25:08 +00:00
Michael Goulet
630dff6ba7 tests 2022-10-31 21:25:08 +00:00
Michael Goulet
5ba1556e0d Create NLL infer vars for late-bound regions from closures 2022-10-31 21:25:08 +00:00
Michael Howell
6432bb71b6 rustdoc: rename syntax highlighting CSS class attribute to attr
Link classes use the abbreviation `attr`, so why shouldn't
syntax highlighting?
2022-10-31 13:55:39 -07:00
Michael Howell
5e6480494a rustdoc: remove unnecessary CSS .search-results { clear: both }
Since the tabs use flexbox instead of float as of
44d9b8d070, clearing does nothing.
2022-10-31 11:53:00 -07:00
bors
95a3a7277b Auto merge of #103795 - thomcc:untest, r=Mark-Simulacrum
Include both benchmarks and tests in the numbers given to `TeFiltered{,Out}`

Fixes #103794

`#[bench]` is broken on nightly without this, sadly. It apparently has no test coverage. In addition to manually testing, I've added a run-make smokecheck for this (which would have caught the issue), but it would be nice to have a better way to test, err, libtest. For now we should get this in ASAP IMO
2022-10-31 18:50:06 +00:00
Vadim Petrochenkov
84317518ff resolve: Turn the binding from #[macro_export] into a proper Import 2022-10-31 21:25:00 +04:00
Amanieu d'Antras
56074b5231 Rewrite implementation of #[alloc_error_handler]
The new implementation doesn't use weak lang items and instead changes
`#[alloc_error_handler]` to an attribute macro just like
`#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by
the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom`
function is defined in any crate then the compiler shim will call
`__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with
`default_alloc_error_handler`: `__rg_oom` was previously defined in the
alloc crate and would attempt to reference the `oom` lang item, even if
it didn't exist. This worked as long as `__rg_oom` was excluded from
linking since it was not called.

This is a prerequisite for the stabilization of
`default_alloc_error_handler` (#102318).
2022-10-31 16:32:57 +00:00
Vadim Petrochenkov
637bfe68a1 resolve: Not all imports have their own NodeId 2022-10-31 20:25:27 +04:00
tyggja
7fe1622b71
Update mod.rs 2022-10-31 12:17:30 -04:00
Sky
3e23d60a32
Add tracking issue for string_extend_from_within 2022-10-31 12:01:20 -04:00
mejrs
cbeb244b05 Add more track_caller 2022-10-31 16:14:29 +01:00
Mark Rousskov
b123a660dd Enable RUSTC_BOOTSTRAP for a few steps 2022-10-31 11:06:49 -04:00
Michael Howell
492ee6ae05 rustdoc: add test case for associated type margins 2022-10-31 07:47:42 -07:00
Michael Woerister
0cd2dd7263 [debuginfo] Make debuginfo type names for slices and str consistent.
Before this PR, the compiler would emit the debuginfo name `slice$<T>`
for all kinds of slices, regardless of whether they are behind a
reference or not and regardless of the kind of reference. As a
consequence, the types `Foo<&[T]>`, `Foo<[T]>`, and `Foo<&mut [T]>`
would end up with the same type name `Foo<slice$<T> >` in debuginfo,
making it impossible to disambiguate between them by name. Similarly,
`&str` would get the name `str` in debuginfo, so the debuginfo name for
`Foo<str>` and `Foo<&str>` would be the same. In contrast,
`*const [bool]` and `*mut [bool]` would be `ptr_const$<slice$<bool> >`
and `ptr_mut$<slice$<bool> >`, i.e. the encoding does not lose
information about the type.

This PR removes all special handling for slices and `str`. The types
`&[bool]`, `&mut [bool]`, and `&str` thus get the names
`ref$<slice2$<bool> >`, `ref_mut$<slice2$<bool> >`, and
`ref$<str$>` respectively -- as one would expect.
2022-10-31 15:43:44 +01:00
Ralf Jung
b35e2bf947 bump up recursion limit for miri crate 2022-10-31 15:41:50 +01:00
Thom Chiovoloni
bf88755f88
Add ignore-cross-compile to the #[bench] smoketest, and move it back to run-make 2022-10-31 05:53:54 -07:00
Thom Chiovoloni
656b9a48b6
move libtest bench smoketest to run-make-fulldeps 2022-10-31 05:19:02 -07:00
bors
2afca78a0b Auto merge of #103797 - Dylan-DPC:rollup-ps589fi, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #103338 (Fix unreachable_pub suggestion for enum with fields)
 - #103603 (Lang item cleanups)
 - #103732 (Revert "Make the `c` feature for `compiler-builtins` opt-in instead of inferred")
 - #103766 (Add tracking issue to `error_in_core`)
 - #103789 (Update E0382.md)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-31 12:07:07 +00:00
Camille GILLOT
abc1ad7106 Use AdtDef to check enum. 2022-10-31 11:21:46 +00:00
Camille GILLOT
65f77b7eb5 Use adt_def for ADT collection. 2022-10-31 11:21:46 +00:00
Camille GILLOT
6802e1da38 Use AdtDef in wfcheck. 2022-10-31 11:21:46 +00:00
Thom Chiovoloni
8c71820e17
smoketest that libtest doesn't panic in #[bench] 2022-10-31 04:21:26 -07:00
ouz-a
a1672ad5b8 Remove bounds check with enum cast 2022-10-31 14:10:37 +03:00
Guillaume Gomez
5062a7712d Add test for tuple struct field generation in search index 2022-10-31 11:21:27 +01:00
Guillaume Gomez
e802e996c0 Don't generate tuple struct fields into the search index 2022-10-31 11:21:06 +01:00
Ralf Jung
fa2aa1cedb interpret: move type_name implementation to an interpreter-independent helper file 2022-10-31 11:04:03 +01:00
Dylan DPC
4a254d557a
Rollup merge of #103789 - domfarolino:e0382, r=Dylan-DPC
Update E0382.md

Remove extra period after sentence.
2022-10-31 14:52:57 +05:30
Dylan DPC
d80bcf8316
Rollup merge of #103766 - lukas-code:error-in-core, r=Dylan-DPC
Add tracking issue to `error_in_core`

This was merged in https://github.com/rust-lang/rust/pull/99917 without a tracking issue, so I'm creating one now: https://github.com/rust-lang/rust/issues/103765
2022-10-31 14:52:57 +05:30
Dylan DPC
3affb05737
Rollup merge of #103732 - Mark-Simulacrum:revert-compiler-builtins, r=jyn514
Revert "Make the `c` feature for `compiler-builtins` opt-in instead of inferred"

This reverts commit 3acb505ee5 (PR #101833).

The changes in this commit caused several bugs/incompatibilities (https://github.com/rust-lang/rust/pull/101833#issuecomment-1270191721, https://github.com/rust-lang/rust/issues/102560). For now we're reverting this commit and will re-land it alongside fixes for those bugs.

Re-opens #101172
cc #102560
cc #102579
2022-10-31 14:52:56 +05:30
Dylan DPC
c1c2922aa1
Rollup merge of #103603 - camsteffen:refactor-lang, r=oli-obk
Lang item cleanups

Various cleanups related to lang items.
2022-10-31 14:52:56 +05:30
Dylan DPC
5ee0fb1c68
Rollup merge of #103338 - l4l:enum-unreachable-pub, r=nagisa
Fix unreachable_pub suggestion for enum with fields

Resolves #103317
2022-10-31 14:52:55 +05:30
Thom Chiovoloni
b56cb9e032
Include both benchmarks and tests in the numbers given to TeFiltered{,Out} 2022-10-31 00:42:10 -07:00
Albert Larsan
c83ddaef94
Add better python discovery
`x.ps1` and `x` will now search for python executables like `python3.9`
and `python3.10.exe`
2022-10-31 08:33:24 +01:00
Michael Howell
791f04e5a4 rustdoc: add margins to all impl-item toggles, not just methods
Fixes #103782
2022-10-30 23:10:59 -07:00
Dominic Farolino
b978bba6a9
Update E0382.md 2022-10-31 00:41:12 -04:00
bors
4596f4f8b5 Auto merge of #103787 - notriddle:rollup-q1vmxsb, r=notriddle
Rollup of 8 pull requests

Successful merges:

 - #97971 (Enable varargs support for calling conventions other than C or cdecl )
 - #101428 (Add mir building test directory)
 - #101944 (rustdoc: clean up `#toggle-all-docs`)
 - #102101 (check lld version to choose correct option to disable multi-threading in tests)
 - #102689 (Add a tier 3 target for the Sony PlayStation 1)
 - #103746 (rustdoc: add support for incoherent impls on structs and traits)
 - #103758 (Add regression test for reexports in search results)
 - #103764 (All verbosity checks in `PrettyPrinter` now go through `PrettyPrinter::should_print_verbose`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-31 03:40:22 +00:00
Michael Howell
e6ffd96e41
Rollup merge of #103764 - SarthakSingh31:issue-94187-2, r=compiler-errors
All verbosity checks in `PrettyPrinter` now go through `PrettyPrinter::should_print_verbose`

Follow-up to #103428. That pr only partially fixed #94187. In some cases (like closures) `std::any::type_name` was still producing a different output when `-Zverbose` was enabled.

This pr fixes those cases and adds a new function `PrettyPrinter::should_print_verbose`. This function should always be used over `self.tcx().sess.verbose()` inside a `impl PrettyPrinter`.

Maybe closes #94187 now.

r? ``@compiler-errors``
2022-10-30 19:31:40 -07:00
Michael Howell
4473fcd6f2
Rollup merge of #103758 - GuillaumeGomez:reexports-search-result-test, r=notriddle
Add regression test for reexports in search results

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

r? ``@notriddle``
2022-10-30 19:31:39 -07:00
Michael Howell
c61a32aff2
Rollup merge of #103746 - notriddle:notriddle/incoherent-dyn-trait, r=GuillaumeGomez
rustdoc: add support for incoherent impls on structs and traits

Fixes #103170
2022-10-30 19:31:39 -07:00
Michael Howell
16ca46297b
Rollup merge of #102689 - ayrtonm:master, r=cjgillot
Add a tier 3 target for the Sony PlayStation 1

This adds a tier 3 target, `mipsel-sony-psx`, for the Sony PlayStation 1. I've tested it pretty thoroughly with [this SDK](https://github.com/ayrtonm/psx-sdk-rs) I wrote for it.

From the [tier 3 target policy](https://doc.rust-lang.org/rustc/target-tier-policy.html#tier-3-target-policy) (I've omitted the subpoints for brevity, but read over everything)
> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I'd be the designated developer

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

The target name follows the conventions of the existing PSP target (`mipsel-sony-psp`) and uses `psx` following the convention of the broader [PlayStation homebrew community](https://psx-spx.consoledev.net/).

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

No legal issues with this target.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

👍

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

The psx supports `core` and `alloc`, but will likely not support `std` anytime soon.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

This target has an SDK and a `cargo-psx` tool for formatting binaries as psx executables. Documentation and examples are provided in the [psx-sdk-rs README](https://github.com/ayrtonm/psx-sdk-rs#psx-sdk-rs), the SDK and cargo tool are both available through crates.io and docs.rs has [SDK documentation](https://docs.rs/psx/latest/psx/).

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

👍

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

No problem
2022-10-30 19:31:38 -07:00
Michael Howell
f404246ce2
Rollup merge of #102101 - BelovDV:new-check-lld-version, r=petrochenkov
check lld version to choose correct option to disable multi-threading in tests

Testing compiler with 'use-lld = true' may be incorrect with old lld.
Flag, disabling multi-threading, should consider lld version.

r? ``@petrochenkov``
2022-10-30 19:31:38 -07:00