Commit Graph

206023 Commits

Author SHA1 Message Date
Yuki Okushi
aa176c1ba5
Rollup merge of #102071 - andrewpollack:add-needs-unwind-for-binary-size, r=tmandry
Adding needs-unwind for tests testing memory size of Futures/Closures

Adding needs-unwind for tests testing memory size of Futures/Closures

cc. ``@djkoloski``

r? ``@tmandry``
2022-09-22 09:03:54 +09:00
Yuki Okushi
9cbae7dfe5
Rollup merge of #102054 - GuillaumeGomez:sidebar-all-page, r=notriddle
Unify "all items" page's sidebar with other pages

Currently, the "all types" page's sidebar doesn't list the different categories of type available. This PR fixes it.

Before:

![Screenshot from 2022-09-20 17-11-15](https://user-images.githubusercontent.com/3050060/191296348-95d8771d-a887-432e-96bd-d5284d87d743.png)

After:

![Screenshot from 2022-09-20 17-11-09](https://user-images.githubusercontent.com/3050060/191296344-8e7318a3-eb51-4037-ae94-7ae2115363ce.png)

r? `@notriddle`
2022-09-22 09:03:54 +09:00
Yuki Okushi
d8dc60ac8a
Rollup merge of #102033 - andrewpollack:add-unwind-on-pretty, r=tmandry
Adding needs-unwind to nicer-assert-messages compiler ui tests

Tests where unwind is required for asserting on contents of error message

cc. ``@djkoloski``

r? ``@tmandry``
2022-09-22 09:03:53 +09:00
Yuki Okushi
5542e504ab
Rollup merge of #102032 - andrewpollack:bad-signal-compiler-tests, r=tmandry
Adding ignore fuchsia tests for signal interpretation cases

Tests where Signal interpreting is required. Since Fuchsia currently does not return signals of type `libc::SIGSEGV` etc., instead, use generalized `!status.success()` case.

cc. `@djkoloski`

r? `@tmandry`
2022-09-22 09:03:53 +09:00
Yuki Okushi
614e18bf59
Rollup merge of #102030 - est31:tidy_walk_no_reexport, r=Mark-Simulacrum
Don't crate-locally reexport walk functions in tidy

I've moved the walk functions into their own module in #100591 and didn't want to make changing the paths everywhere in tidy part of the PRs diff, so I just reexported the functions locally. This PR removes the crate-local reexport and instead does module level reexports. I'm not sure how much it's worth it and whether the new state is better, idk. Feel free to have any opinion on this.
2022-09-22 09:03:52 +09:00
Yuki Okushi
b08c8cb7e0
Rollup merge of #101952 - Mark-Simulacrum:missing-fallback, r=ehuss
Avoid panicking on missing fallback

This just prints a message but continues on if a fallback is missing, which can happen when we're building a partial set of builders and producing a dev-static build from it (e.g., when no Apple builder runs at all).

Probably the more extensive fix is to allow the build-manifest invoker to specify the expected set of targets & hosts, but that's a far more extensive change. The main risk from this is that we accidentally start falling back to linux docs across all platforms without noticing. I'm not sure that we can do much about that though at this time.

cc `@ehuss` since IIRC you participated in adding this system

This comes up when building a test nightly from a try build, e.g., https://github.com/rust-lang/rust/pull/101855#issuecomment-1250123298. For now I'm going to manually cherry pick this onto that PR for testing purposes.
2022-09-22 09:03:52 +09:00
Steve Heindel
51c752a375 Add note to clippy::non_expressive_names doc 2022-09-21 19:45:57 -04:00
Michael Howell
8b4c0d90dc rustdoc: adjust test to cope with slightly different scrolling behaviour 2022-09-21 16:44:33 -07:00
Frank Steffahn
07767784ad Bless test output changes 2022-09-22 01:32:37 +02:00
Frank Steffahn
696472a586 Fix a typo in error message 2022-09-22 01:28:45 +02:00
Michael Howell
f66769fe8d rustdoc: dynamically show-hide line numbers on code examples 2022-09-21 16:12:15 -07:00
bors
4a4fd12ebf Auto merge of #102106 - djkoloski:sync-from-clippy, r=Manishearth
Update clippy

r? `@Manishearth`
2022-09-21 22:59:40 +00:00
Michael Howell
7a718f3be2 rustdoc: use block flex for line-number CSS
`display: inline-flex` was used as part of
e961d397ca, the original commit that added
these line numbers. Does anyone know why it was done this way?
2022-09-21 15:27:55 -07:00
Venus Xeon-Blonde
758ca9dc3a
Add examples to bool::then and bool::then_some
Added examples to `bool::then` and `bool::then_some` to show the distinction between the eager evaluation of `bool::then_some` and the lazy evaluation of `bool::then`.
2022-09-21 17:07:50 -04:00
Ralf Jung
0f4d7b6de8 OpTy: fix a method taking self rather than &self 2022-09-21 22:20:40 +02:00
bors
9062b780b3 Auto merge of #101558 - JhonnyBillM:session-diagnostic-to-diagnostic-handler-refactor, r=davidtwco
Move and rename `SessionDiagnostic` & `SessionSubdiagnostic` traits and macros

After PR #101434, we want to:
- [x] Move `SessionDiagnostic` to `rustc_errors`.
- [x] Add `emit_` methods that accept `impl SessionDiagnostic` to `Handler`.
- [x] _(optional)_ Rename trait `SessionDiagnostic` to `DiagnosticHandler`.
- [x] _(optional)_ Rename macro `SessionDiagnostic` to `DiagnosticHandler`.
- [x] Update Rustc Dev Guide and Docs to reflect these changes. https://github.com/rust-lang/rustc-dev-guide/pull/1460

Now I am having build issues getting the compiler to build when trying to rename the macro.

<details>
  <summary>See diagnostics errors and context when building.</summary>

```
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
  --> compiler/rustc_attr/src/session_diagnostics.rs:13:10
   |
13 |   #[derive(DiagnosticHandler)]
   |            ^^^^^^^^^^^^^^^^^ in this derive macro expansion
   |
  ::: /Users/jhonny/.cargo/registry/src/github.com-1ecc6299db9ec823/synstructure-0.12.6/src/macros.rs:94:9
   |
94 | /         pub fn $derives(
95 | |             i: $crate::macros::TokenStream
96 | |         ) -> $crate::macros::TokenStream {
   | |________________________________________- in this expansion of `#[derive(DiagnosticHandler)]`
   |
note: the lint level is defined here
  --> compiler/rustc_attr/src/lib.rs:10:9
   |
10 | #![deny(rustc::diagnostic_outside_of_impl)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

```

And also this one:

```
error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
   --> compiler/rustc_attr/src/session_diagnostics.rs:213:32
    |
213 |         let mut diag = handler.struct_span_err_with_code(
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^
```

> **Note**
> Can't find where this message is coming from, because you can see in [this experimental branch](https://github.com/JhonnyBillM/rust/tree/experimental/trying-to-rename-session-diagnostic-macro)  that I updated all errors and diags to say:
> error: diagnostics should only be created in **`DiagnosticHandler`**/`AddSubdiagnostic` impls
> and not:
> error: diagnostics should only be created in **`SessionDiagnostic`**/`AddSubdiagnostic` impls

</details>

I tried building the compiler in different ways (playing with the stages etc), but nothing worked.

## Question

**Do we need to build or do something different when renaming a macro and identifiers?**

For context, see experimental commit f2193a98b4 where the macro and symbols are renamed, but it doesn't compile.
2022-09-21 19:58:39 +00:00
Josh Stone
5d8083360a Allow full relro on powerpc64-unknown-linux-gnu
This was previously limited to partial relro, citing issues on RHEL6,
but that's no longer a supported platform since #95026. We have long
been enabling full relro in RHEL7's own Rust builds for ppc64, without
trouble, so it should be fine to drop this workaround.
2022-09-21 11:53:50 -07:00
bors
db4b4d3bec Auto merge of #102097 - Dylan-DPC:rollup-gc75oh4, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #89891 (`alloc`: add unstable cfg features `no_rc` and `no_sync`)
 - #101995 (Add another example for `uN::carrying_mul`)
 - #102031 (Adding ignore fuchsia tests for Backtrace, ErrorKind cases)
 - #102041 (Improve `-Zmeta-stats` some more)
 - #102045 (fix ConstProp handling of written_only_inside_own_block_locals)
 - #102058 (Clarify Path::extension() semantics in docs abstract)
 - #102059 (Use rebind instead of dummy binder in `SameTypeModuloInfer` relation)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-21 17:17:25 +00:00
David Koloski
0650c4078c Merge commit '7248d06384c6a90de58c04c1f46be88821278d8b' into sync-from-clippy 2022-09-21 13:13:27 -04:00
Urgau
e214385a4d Add missing space between notable trait tooltip and where clause 2022-09-21 19:01:49 +02:00
Andrew Pollack
6c29716d0a Adding ignore fuchsia tests for signal cases 2022-09-21 15:57:19 +00:00
Jhonny Bill Mena
e52e2344dc FIX - adopt new Diagnostic naming in newly migrated modules
FIX - ambiguous Diagnostic link in docs

UPDATE - rename diagnostic_items to IntoDiagnostic and AddToDiagnostic

[Gardening] FIX - formatting via `x fmt`

FIX - rebase conflicts. NOTE: Confirm wheather or not we want to handle TargetDataLayoutErrorsWrapper this way

DELETE - unneeded allow attributes in Handler method

FIX - broken test

FIX - Rebase conflict

UPDATE - rename residual _SessionDiagnostic and fix LintDiag link
2022-09-21 11:43:22 -04:00
Jhonny Bill Mena
5f91719f75 UPDATE - rename SessionSubdiagnostic macro to Subdiagnostic
Also renames:
- sym::AddSubdiagnostic to sym:: Subdiagnostic
- rustc_diagnostic_item = "AddSubdiagnostic" to rustc_diagnostic_item = "Subdiagnostic"
2022-09-21 11:39:53 -04:00
Jhonny Bill Mena
a3396b2070 UPDATE - rename DiagnosticHandler macro to Diagnostic 2022-09-21 11:39:53 -04:00
Jhonny Bill Mena
191fac6826 UPDATE - rename AddSubdiagnostic trait to AddToDiagnostic 2022-09-21 11:39:53 -04:00
Jhonny Bill Mena
19b348fed4 UPDATE - rename DiagnosticHandler trait to IntoDiagnostic 2022-09-21 11:39:52 -04:00
Jhonny Bill Mena
5b8152807c UPDATE - move SessionDiagnostic from rustc_session to rustc_errors 2022-09-21 11:39:52 -04:00
Oli Scherer
47cb378526 Remove unused imports 2022-09-21 15:37:10 +00:00
Oli Scherer
f45b570e08 Add 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'
git-subtree-dir: src/tools/miri
git-subtree-mainline: 3f3167fb59
git-subtree-split: 75dd959a3a
2022-09-21 15:36:26 +00:00
Ralf Jung
3f3167fb59 miri is not in toolstate any more 2022-09-21 15:35:53 +00:00
Oli Scherer
7e23244ef1 HACK: Treat miri as if it were a submodule 2022-09-21 15:35:53 +00:00
Oli Scherer
6cfa7ef2ba Remove miri from the submodule list and require it for CI to pass 2022-09-21 15:35:53 +00:00
Oli Scherer
d9382d03bd Remove miri submodule 2022-09-21 15:35:53 +00:00
Aaron Hill
3d8b3e6ca1
Set 'exec-env:RUST_BACKTRACE=0' in const-eval-select tests
This allows the tests to pass even if the user has RUST_BACKTRACE
set when running 'x.py'
2022-09-21 10:25:03 -05:00
Deadbeef
898c76cd82 Make error messages great again (and fix clippy and add test) 2022-09-21 15:02:15 +00:00
Guillaume Gomez
6069f71e6c Add GUI test for .stab elements in docblocks 2022-09-21 16:40:31 +02:00
Guillaume Gomez
efbde853af Add doc aliases on Sized trait 2022-09-21 16:20:15 +02:00
Guillaume Gomez
150623eb6c Prevent usage of .stab elements to create scrollable areas in doc blocks 2022-09-21 16:12:14 +02:00
Dylan DPC
39bb2a7988
Rollup merge of #102059 - compiler-errors:issue-101984, r=jackh726
Use rebind instead of dummy binder in `SameTypeModuloInfer` relation

Lazy binder usage (sorry, my fault) + assertion in `Binder::dummy`

Fixes #101984
2022-09-21 19:01:09 +05:30
Dylan DPC
77d063b954
Rollup merge of #102058 - mqudsi:path_extension_docs, r=thomcc
Clarify Path::extension() semantics in docs abstract

State up-front and center what shape the returned extension will have, without making the user read through the description and examples.

This is a doc-only change. There are no changes to the API contract and the clarification is in line with what was already stated/promised in the existing doc text - just clarified, summarized, and served bright and early.

Rationale: Various frameworks and libraries for different platforms have their different conventions as to whether an "extension" is ".ext" or just "ext" and anyone that's had to deal with this ambiguity in the past is always double- or triple-checking to make sure the function call returns an extension that matches the expected semantics. Offer the answer to this important question right off the bat instead of making them dig to find it.

```@rustbot``` label +A-docs
2022-09-21 19:01:09 +05:30
Dylan DPC
7d7f55599a
Rollup merge of #102045 - RalfJung:const-prop-regression-fix, r=oli-obk
fix ConstProp handling of written_only_inside_own_block_locals

Fixes a regression introduced by https://github.com/rust-lang/rust/pull/100239, which adds an early return and thus skips some code in `visit_terminator` that must be run for soundness.

Fixes https://github.com/rust-lang/rust/issues/101973
2022-09-21 19:01:08 +05:30
Dylan DPC
4b7c596b3a
Rollup merge of #102041 - nnethercote:improve-meta-stats, r=bjorn3
Improve `-Zmeta-stats` some more

A follow-up to #97384.

r? ```@bjorn3```
2022-09-21 19:01:08 +05:30
Dylan DPC
36e39725fb
Rollup merge of #102031 - andrewpollack:compiler-tests-backtrace, r=tmandry
Adding ignore fuchsia tests for Backtrace, ErrorKind cases

Tests where Backtrace parses are required (invalid since Fuchsia backtraces are not symbolized), and test where ErrorKind is not properly translated from a Fuchsia-style to Unix-style error code

cc. ```@djkoloski```

r? ```@tmandry```
2022-09-21 19:01:07 +05:30
Dylan DPC
9b24a1f9a0
Rollup merge of #101995 - scottmcm:carrying-mul-example, r=Mark-Simulacrum
Add another example for `uN::carrying_mul`

The prose talks about doing this, so might as well add a simple code example of it too.
2022-09-21 19:01:07 +05:30
Dylan DPC
5377c31122
Rollup merge of #89891 - ojeda:modular-alloc, r=Mark-Simulacrum
`alloc`: add unstable cfg features `no_rc` and `no_sync`

In Rust for Linux we are using these to make `alloc` a bit more modular.

See https://github.com/rust-lang/rust/pull/86048 and https://github.com/rust-lang/rust/pull/84266 for similar requests.

Of course, the particular names are not important.
2022-09-21 19:01:06 +05:30
bors
75dd959a3a Auto merge of #2557 - RalfJung:triple-to-string, r=RalfJung
remove unnecessary to_string
2022-09-21 13:26:05 +00:00
Ralf Jung
c672c35ad6 format > to_string 2022-09-21 15:25:30 +02:00
Ralf Jung
33284ec099 remove unnecessary to_string 2022-09-21 15:24:06 +02:00
bors
7248d06384 Auto merge of #9471 - jplatte:patch-1, r=xFrednet
Add matches! checking to nonstandard_macro_braces

changelog: Enhancement: [`nonstandard_macro_braces`]: Now includes `matches!()` in the default lint config
  [#9471](https://github.com/rust-lang/rust-clippy/pull/9471)
2022-09-21 12:56:19 +00:00
bors
351afbbe1c Auto merge of #2555 - oli-obk:libffi-is-unhappy, r=RalfJung
Only support libffi on unix for now
2022-09-21 12:49:24 +00:00