Commit Graph

242294 Commits

Author SHA1 Message Date
León Orell Valerian Liehr
493792b37b
Rollup merge of #119477 - lukas-code:tooltip-z-index, r=notriddle
rustdoc ui: adjust tooltip z-index to be above sidebar

In https://github.com/rust-lang/rust/pull/115660 the sidebar's z-index was changed to 100. This PR changes the tooltip's z-index to 101 to be above the sidebar again.

Fixes [after beta-backport] https://github.com/rust-lang/rust/issues/119472.
2024-01-03 16:08:27 +01:00
León Orell Valerian Liehr
b41b16971c
Rollup merge of #119476 - fmease:pp-always-const-trait-preds, r=compiler-errors
Pretty-print always-const trait predicates correctly

Follow-up to #119099.

r? fee1-dead
2024-01-03 16:08:27 +01:00
León Orell Valerian Liehr
699a70bdbd
Rollup merge of #119474 - nbdd0121:naked, r=Nilstrieb
Update tracking issue of naked_functions

The original tracking issue #32408 was superseded by the new one #90957 (constrainted naked functions) and therefore is closed.
2024-01-03 16:08:26 +01:00
León Orell Valerian Liehr
3053ced813
Rollup merge of #119444 - compiler-errors:closure-or-coroutine, r=oli-obk
Rename `TyCtxt::is_closure` to `TyCtxt::is_closure_or_coroutine`

This function has always been used to test whether the def-id was a closure **or** coroutine: https://github.com/rust-lang/rust/pull/118311/files#diff-69ebec59f7d38331dd1be84ede7957977dcaa39e30ed2869b04aa8c99b2079ccR552 -- the name is just confusing because it disagrees with other fns named `is_closure`, like `Ty::is_closure`.

So let's rename it.
2024-01-03 16:08:26 +01:00
León Orell Valerian Liehr
34ef194859
Rollup merge of #119434 - taiki-e:rc-is-dangling, r=Mark-Simulacrum
rc: Take *const T in is_dangling

It is not important which one is used since `is_dangling` does not access memory, but `*const` removes the needs of `*const T` -> `*mut T` casts in `from_raw_in`.
2024-01-03 16:08:25 +01:00
León Orell Valerian Liehr
4e265d9fe0
Rollup merge of #119319 - chfogelman:buffered-file-doc, r=the8472
Document that File does not buffer reads/writes

...and refer to `BufReader`/`BufWriter`.

This is a common source of efficiency issues in Rust programs written naively. Including this information with the `File` docs, and adding a link to the wrapper types, will help discoverability.
2024-01-03 16:08:25 +01:00
León Orell Valerian Liehr
907922b472
Rollup merge of #119298 - onur-ozkan:silence-change-tracker-warning-for-ci, r=Mark-Simulacrum
suppress change-tracker warnings in CI containers

Fixes #119296
2024-01-03 16:08:24 +01:00
León Orell Valerian Liehr
893b6f6538
Rollup merge of #119239 - compiler-errors:yield-coercion, r=davidtwco
Remove unnecessary arm in `check_expr_yield`

We always set up the `resume_yield_tys` for async blocks and fns, so this arm was unreachable.
2024-01-03 16:08:24 +01:00
León Orell Valerian Liehr
093bd0888a
Rollup merge of #119086 - RossSmyth:query_panics, r=compiler-errors
Query panic!() to useful diagnostic

Changes some more ICEs from bare panic!()s

Adds an `expect_job()` helper method as that is a moral equivalent of what was happening at the uses.

re:#118955
2024-01-03 16:08:23 +01:00
Ross Smyth
0d421c5ace Add useful panic messages if queries fail to start 2024-01-03 09:51:58 -05:00
Lukas Markeffsky
b1853eb3bd use css variable for z-index of the sidebar
and calculate the z-indices of things that go over the sidebar
2024-01-01 15:42:32 +01:00
León Orell Valerian Liehr
01ac44a664
Pretty-print always-const trait predicates correctly 2024-01-01 14:02:42 +01:00
Carter Hunt Fogelman
5cbe41ae9e Document that File does not buffer reads/writes, refer to BufReader/BufWriter 2023-12-31 16:33:46 -08:00
Lukas Markeffsky
d796ad4209 rustdoc ui: adjust tooltip z-index to be above sidebar 2023-12-31 20:31:56 +01:00
bors
e51e98dde6 Auto merge of #119251 - Enselic:rustc_lint-query-stability, r=cjgillot
rustc_lint: Enforce `rustc::potential_query_instability` lint

Stop allowing `rustc::potential_query_instability` on all of `rustc_lint` and instead allow it on a case-by-case basis if it is safe to do so. In this particular crate, all lints were safe to allow.

Part of https://github.com/rust-lang/rust/issues/84447 which is E-help-wanted.
2023-12-31 17:31:09 +00:00
Gary Guo
86bd81fe83 Update tracking issue of naked_functions
The original tracking issue was superseded by a new one
(constrainted naked functions) and therefore is closed.
2023-12-31 17:09:46 +00:00
bors
67b6975051 Auto merge of #119066 - notriddle:notriddle/sidebar-source-redesign, r=GuillaumeGomez
rustdoc: clean up source sidebar hide button

This is a redesign of the feature, with parts pulled from https://github.com/rust-lang/rust/pull/119049 but with a button that looks more like a button and matches the one used on other sidebar pages.

Preview:

* http://notriddle.com/rustdoc-html-demo-8/source-sidebar-resize/src/std/lib.rs.html
* http://notriddle.com/rustdoc-html-demo-8/source-sidebar-resize/std/index.html

| | Before | After |
|--|--|--|
| Closed | ![image](https://github.com/rust-lang/rust/assets/1593513/092bed75-79c3-412f-8e7b-557f30dfb1e3) | ![image](https://github.com/rust-lang/rust/assets/1593513/b68e1ee9-9aef-484d-a5b1-2fd29c9d72ea)
| Open | ![image](https://github.com/rust-lang/rust/assets/1593513/95cf9545-25b1-48ec-820b-02e1aec99839) | ![image](https://github.com/rust-lang/rust/assets/1593513/923532f6-59e0-4d7c-9976-21699c30d42e)
| Mobile Closed | ![image](https://github.com/rust-lang/rust/assets/1593513/9bc00cc5-937c-4120-94be-94c7cb6d5297) | ![image](https://github.com/rust-lang/rust/assets/1593513/76a744d8-aac2-46fe-abb9-3b34e2d3ccaa)
| Mobile Open | ![image](https://github.com/rust-lang/rust/assets/1593513/d19a94fe-47b1-462d-a280-44fc215b9b72) | ![image](https://github.com/rust-lang/rust/assets/1593513/2b2e3dec-b610-4b12-8a72-35b86359ba45)
2023-12-31 15:32:15 +00:00
Martin Nordholts
295d6003ac rustc_lint: Enforce rustc::potential_query_instability lint
Stop allowing `rustc::potential_query_instability` on all of
`rustc_lint` and instead allow it on a case-by-case basis if it is safe
to do so. In this particular crate, all lints were safe to allow.
2023-12-31 14:50:57 +01:00
Martin Nordholts
231dbbcb6a rustc_lint: Make LintLevelsProvider::current_specs() return &FxIndexMap
So that lint iteration order becomes predicitable. Discovered with
`rustc::potential_query_instability`.
2023-12-31 14:35:28 +01:00
bors
1c20462338 Auto merge of #119470 - bjorn3:sync_cg_clif-2023-12-31, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The main highlight this time is a fix for https://github.com/rust-lang/rustc_codegen_cranelift/issues/1437.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-12-31 13:32:56 +00:00
bjorn3
d1d134e464 Merge commit '6d355f6844323db03bfd608899613e363e701951' into sync_cg_clif-2023-12-31 2023-12-31 13:29:53 +00:00
bjorn3
6d355f6844
Merge pull request #1440 from rust-lang/ci_speedup_and_cleanup
Slightly reduce CI runtime and reduce log verbosity
2023-12-31 14:26:48 +01:00
bjorn3
c55aaa55a7 Remove no longer needed config option from setup_rust_fork.sh 2023-12-31 12:39:20 +00:00
bjorn3
02183f79e4 Suppress default config change warnings 2023-12-31 12:22:38 +00:00
bjorn3
d58de3ea81 Suppress progress notifications for all git commands 2023-12-31 11:53:42 +00:00
bjorn3
3fa4efffb0 Install ripgrep using the system package manager 2023-12-31 11:14:50 +00:00
bjorn3
e2502acd15 Update the GHA artifacts actions to v4 2023-12-31 11:04:53 +00:00
bjorn3
4b239facd7 Install hyperfine using the system package manager 2023-12-31 11:01:07 +00:00
bjorn3
75f1c2b5a7 Rustup to rustc 1.77.0-nightly (2a3e63551 2023-12-30) 2023-12-31 10:46:02 +00:00
bors
fcfe05aa75 Auto merge of #119441 - Urgau:check-cfg-simplify-bootstrap-args, r=onur-ozkan
Simplify bootstrap `--check-cfg` arguments

This PR simplifies the generated check-cfg arguments generated for the no-values case.

For the `bootstrap` cfg:

```diff
- --check-cfg=cfg(bootstrap,values())
+ --check-cfg=cfg(bootstrap)
```

Those are equivalent, so there isn't any semantic difference; but the invocation is short and less distracting.

`@rustbot` label +F-check-cfg
2023-12-31 04:18:15 +00:00
bors
64d5515cc3 Auto merge of #119447 - Nilstrieb:STACKOVERFLOW, r=compiler-errors
Fix `<BoundConstness as Display>`

There was infinite recursion, which is not very good. I'm not sure what the best way to implement this is, I just did something that felt right.

r? `@fmease`
2023-12-31 00:43:25 +00:00
bors
d868bc2842 Auto merge of #119284 - Nadrieril:fix-bodiless-arm-parse, r=cjgillot
Don't drop a hir node after lowering

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

It seems that all hir nodes that get allocated an id must be placed within the hir on pain of ICEs. In https://github.com/rust-lang/rust/pull/118527 I dropped guards on never patterns since they're not useful, which caused the ICE.
2023-12-30 22:44:33 +00:00
bors
2a3e63551f Auto merge of #119443 - Urgau:move-around-builtin-diag-context, r=Nilstrieb
Move around the code responsible for decorating builtin diagnostics

This PR move the code responsible for decorating builtin diagnostics into a separate sub-module for ease of use and readability.

While my original intention was to also move the check-cfg unexpected logic in their own function I changed my mind after moving the match altogether. I can move those if desired.

Fixes https://github.com/rust-lang/rust/pull/119425#discussion_r1438446596

r? `@Nilstrieb`
2023-12-30 20:41:15 +00:00
bors
5a345b325b Auto merge of #119446 - Nilstrieb:bitflags2.0-hell, r=compiler-errors
Update to bitflags 2 in the compiler

This involves lots of breaking changes. There are two big changes that force changes. The first is that the bitflag types now don't automatically implement normal derive traits, so we need to derive them manually.

Additionally, bitflags now have a hidden inner type by default, which breaks our custom derives. The bitflags docs recommend using the impl form in these cases, which I did.

r? compiler
2023-12-30 18:39:57 +00:00
Nilstrieb
ffafcd8819 Update to bitflags 2 in the compiler
This involves lots of breaking changes. There are two big changes that
force changes. The first is that the bitflag types now don't
automatically implement normal derive traits, so we need to derive them
manually.

Additionally, bitflags now have a hidden inner type by default, which
breaks our custom derives. The bitflags docs recommend using the impl
form in these cases, which I did.
2023-12-30 18:17:28 +01:00
Urgau
a236bdd77f bootstrap: extract --check-cfg arg generation and add unit tests for it 2023-12-30 18:10:28 +01:00
Michael Goulet
847cd6c9de Use the right type for upvars 2023-12-30 16:32:44 +00:00
Nilstrieb
e36a24ec8f Fix <BoundConstness as Display>
There was infinite recursion, which is not very good. I'm not sure what
the best way to implement this is, I just did something that felt right.
2023-12-30 17:22:20 +01:00
bors
a2541e861e Auto merge of #119436 - semarie:openbsd-available_parallelism, r=Mark-Simulacrum
openbsd: available_parallelism: use the right API

use the standard `sysconf(_SC_NPROCESSORS_ONLN)` way to get the number of  available processors (capable of running processes), and fallback to `sysctl([CTL_HW, HW_NCPU])` (number of CPUs configured) only on error.

it permits to differenciate CPUs online (capable of running processes) vs CPUs configured (not necessary  capable of running processes).

while here, use the common code path for BSDs for doing that, and avoid code  duplication.

Problem initially reported to me by Jiri Navratil.
2023-12-30 15:37:26 +00:00
Michael Goulet
07adee7072 is_coroutine -> is_coroutine_or_closure 2023-12-30 15:24:15 +00:00
Urgau
429287243b Move around the code responsible for decorating builtin diagnostics 2023-12-30 16:17:14 +01:00
Urgau
df375765b9 Simplify bootstrap check-cfg arguments 2023-12-30 15:20:24 +01:00
bors
e45a937a11 Auto merge of #119438 - Zalathar:prepare-mappings, r=cjgillot
coverage: Prepare mappings separately from injecting statements

These two tasks historically needed to be interleaved, but after various recent changes (including #116046 and #116917) they can now be fully separated.

---

`@rustbot` label +A-code-coverage
2023-12-30 13:39:44 +00:00
bjorn3
5c95200e96 Rustup to rustc 1.77.0-nightly (3cdd004e5 2023-12-29) 2023-12-30 12:06:21 +00:00
bors
d59f06fc64 Auto merge of #119437 - matthiaskrgr:rollup-esf96p6, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #119158 (Clean up alloc::sync::Weak Clone implementation)
 - #119386 (fix typo in `IpAddr::to_canonical`)
 - #119413 (solaris support on bootstrap lock)
 - #119424 (Primitive docs: fix confusing `Send` in `&T`'s list)
 - #119425 (Fix invalid check-cfg Cargo feature diagnostic help)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-30 11:40:42 +00:00
Zalathar
3f67118ae7 coverage: Make coverage_counters a local variable
This avoids the awkwardness of having to create it in the pass's constructor,
and then mutate it later to actually create the counters.
2023-12-30 22:36:11 +11:00
Zalathar
e1a2babc06 coverage: Prepare mappings separately from injecting statements
These two tasks historically needed to be interleaved, but after various recent
changes (including #116046 and #116917) they can now be fully separated.
2023-12-30 22:34:15 +11:00
bjorn3
fa9cce061e Sync from rust 3cdd004e55 2023-12-30 11:00:12 +00:00
Matthias Krüger
e930ea274e
Rollup merge of #119425 - Urgau:check-cfg-fix-cargo-diag-bug, r=Nilstrieb
Fix invalid check-cfg Cargo feature diagnostic help

#118213 added specialized diagnostic for Cargo `feature` cfg. However when providing an empty `#[cfg(feature)]` condition the suggestion would suggest adding `feature` as a feature in `Cargo.toml` (wtf!).

This PR removes the invalid logic, which even brings a nice improvement.

```diff
   --> $DIR/cargo-feature.rs:18:7
    |
 LL | #[cfg(feature)]
-   |       ^^^^^^^
+   |       ^^^^^^^- help: specify a config value: `= "bitcode"`
    |
    = note: expected values for `feature` are: `bitcode`
-   = help: consider defining `feature` as feature in `Cargo.toml`
```

The first commit add a test showing the bug and the second commit fixes the bug.

`@rustbot` label +F-check-cfg
2023-12-30 11:42:04 +01:00
Matthias Krüger
19580d56c2
Rollup merge of #119424 - ojeda:send-sync, r=est31
Primitive docs: fix confusing `Send` in `&T`'s list

The two lists in this document describe what traits are implemented on references when their underlying `T` also implements them. However, while it is true that `T: Send + Sync` implies `&T: Send` (which is what the sentence is trying to explain), it is confusing to have `Send` in the list because `T: Send` is not needed for that. In particular, the "also require" part may be interpreted as "both `T: Send` and `T: Sync` are required".

Instead, move `Send` back to where it was before commit 7a477869b7 ("Makes docs for references a little less confusing"), i.e. to the `&mut` list (where no extra nota is needed, i.e. it fits naturally) and move the `Sync` definition/note to the bottom as something independent.
2023-12-30 11:42:04 +01:00