Commit graph

215013 commits

Author SHA1 Message Date
Yuki Okushi 96d4d491d0
Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
Remove dead code in rustdoc stripper

No changes when this code is removed.

cc `@aDotInTheVoid`
r? `@notriddle`
2023-01-14 12:04:35 +09:00
Yuki Okushi 9b502a4765
Rollup merge of #106762 - WaffleLapkin:atomicptr+as_mut_ptr, r=m-ou-se
Add `AtomicPtr::as_mut_ptr`

See https://github.com/rust-lang/rust/issues/66893#issuecomment-720125447

r? thomcc
2023-01-14 12:04:35 +09:00
Yuki Okushi 6486b02105
Rollup merge of #106707 - ehuss:remove-dupe-sha-1, r=Mark-Simulacrum
Remove duplicate sha-1 dependency

[`sha-1`](https://crates.io/crates/sha-1) is more or less a duplicate of [`sha1`](https://crates.io/crates/sha1). The `sha-1` is deprecated and no longer updated. This updates the dependencies to use the new name.

Some other dependencies that got updated as a consequence:
* The updated pest dependencies are currently only used by mdbook, and shouldn't have any issues.
* ucd-trie 0.1.3 to 0.1.5: No changelog, but looks like some tables were updated for new unicode versions: https://github.com/BurntSushi/ucd-generate/commits/master/ucd-trie. This is only used by pest (and thus mdbook).
* thiserror 1.33 to 1.38: Nothing significant in the notes at https://github.com/dtolnay/thiserror/releases.
2023-01-14 12:04:34 +09:00
Yuki Okushi 15846678e4
Rollup merge of #106693 - notriddle:notriddle/toggle-trunc, r=GuillaumeGomez
rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle

This swaps things around so that the class that gets used more often has the shorter name.
2023-01-14 12:04:34 +09:00
Yuki Okushi feac18c0d6
Rollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
mv binary_heap.rs binary_heap/mod.rs

I confess this request is somewhat selfish, as it's made in order to ease synchronisation with my [copse](https://crates.io/crates/copse) crate (see eggyal/copse#6 for explanation). I wholly understand that such grounds may be insufficient to justify merging this request—but no harm in asking, right?
2023-01-14 12:04:33 +09:00
Yuki Okushi 233169ff0a
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
Check compiler docs in PR CI

Fixes #106624
2023-01-14 12:04:33 +09:00
Yuki Okushi b6b4429063
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
rustdoc: fix outdated lint section of the book
2023-01-14 12:04:32 +09:00
Yuki Okushi 6d8ac8389e
Rollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
Added error documentation for write_fmt

This continuation of work at rust-lang#98861
2023-01-14 12:04:32 +09:00
Yuki Okushi 6702f20ca7
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
reword Option::as_ref and Option::map examples

The description for the examples of `Option::as_ref` and `Option::map` imply that the example is only doing type conversion, when it is actually finding the length of a string.

Changes the wording to imply that some operation is being run on the value contained in the `Option`

closes #104476
2023-01-14 12:04:31 +09:00
bors a11eb4f267 Auto merge of #106822 - matthiaskrgr:rollup-46bi4pi, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #104645 (Add log-backtrace option to show backtraces along with logging)
 - #106465 (Bump `IMPLIED_BOUNDS_ENTAILMENT` to Deny + ReportNow)
 - #106489 (Fix linker detection for linker (drivers) with a version postfix (e.g. clang-12 instead of clang))
 - #106585 (When suggesting writing a fully qualified path probe for appropriate types)
 - #106641 (Provide help on closures capturing self causing borrow checker errors)
 - #106678 (Warn when using panic-strategy abort for proc-macro crates)
 - #106701 (Fix `mpsc::SyncSender` spinning behavior)
 - #106793 (Normalize test output more thoroughly)
 - #106797 (riscv: Fix ELF header flags)
 - #106813 (Remove redundant session field)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-13 21:25:50 +00:00
Michael Howell 1d328de3ec rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle
This swaps things around so that the class that gets used more often has
the shorter name.
2023-01-13 12:38:03 -07:00
Matthias Krüger f7093826a4
Rollup merge of #106813 - oli-obk:sess_cleanup, r=GuillaumeGomez,petrochenkov
Remove redundant session field

There was already a session available in the resolver, so we access that session.
2023-01-13 19:16:45 +01:00
Matthias Krüger 278e02a5b6
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
riscv: Fix ELF header flags

The previous version added both `EF_RISCV_FLOAT_ABI_DOUBLE` and `EF_RISCV_RVC` if the "D" extension was enabled on riscv64 targets. riscv32 targets were not accounted for. This patch changes this so that:

- Only add `EF_RISCV_RVC` if the "C" extension is enabled
- Add `EF_RISCV_FLOAT_ABI_SINGLE` if the "F" extension is enabled and the "D" extension is not
- Add these ELF flags for riscv32 as well

Fixes #104284

r? rust-lang/risc-v
2023-01-13 19:16:45 +01:00
Matthias Krüger e0f6840bb6
Rollup merge of #106793 - Mark-Simulacrum:normalize-test, r=compiler-errors
Normalize test output more thoroughly

This prevents differences in local environments, which may (for example) end up with a longer backtrace with more digits in the backtrace prefix, as happened to me. While we're at it, clean more of the output up, including the exact location of the error in the compiler.

cc https://github.com/rust-lang/rust/pull/106521 which introduced this test
2023-01-13 19:16:44 +01:00
Matthias Krüger 720137b5da
Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu
Fix `mpsc::SyncSender` spinning behavior

Resolves https://github.com/rust-lang/rust/issues/106668.
2023-01-13 19:16:44 +01:00
Matthias Krüger e4d0104754
Rollup merge of #106678 - Veykril:proc-macro-panic-abort, r=eholk
Warn when using panic-strategy abort for proc-macro crates

See https://github.com/rust-lang/rust/issues/82320, this simply warns for now as that seems like the best step that can be immediately taken (opposed to straight up rejecting or ignoring)
2023-01-13 19:16:43 +01:00
Matthias Krüger 57b371ab14
Rollup merge of #106641 - chenyukang:yukang/fix-105761-segguest-this, r=estebank
Provide help on closures capturing self causing borrow checker errors

Fixes #105761

r? ````@estebank````
2023-01-13 19:16:43 +01:00
Matthias Krüger c6e3a47843
Rollup merge of #106585 - estebank:issue-46585, r=compiler-errors
When suggesting writing a fully qualified path probe for appropriate types

Address the more common part of #46585.
2023-01-13 19:16:42 +01:00
Matthias Krüger f9dde54a11
Rollup merge of #106489 - jschwe:fix_linker_detection, r=petrochenkov
Fix linker detection for linker (drivers) with a version postfix (e.g. clang-12 instead of clang)

Linker (drivers) such as clang / gcc or lld often have a version postfix matching the regex "-\d+$".
Previously, linker detection did not account for the possible version postfix and the fallback value was used, which can cause linker errors due to wrong arguments.
Also remove the check for `-clang`, since there are no architecture specific variants of clang (to my knowledge).

Fixes #106454
2023-01-13 19:16:42 +01:00
Matthias Krüger 1dc43b2e8b
Rollup merge of #106465 - compiler-errors:bump-IMPLIED_BOUNDS_ENTAILMENT, r=lcnr
Bump `IMPLIED_BOUNDS_ENTAILMENT` to Deny + ReportNow

https://github.com/rust-lang/rust/pull/105575#issuecomment-1357201969

> and then later in the same cycle increase the lint to `deny` and change it to `FutureCompatReportNow` in this nightly cycle.

r? ```@lcnr``` when they're back from holiday 😄
2023-01-13 19:16:41 +01:00
Matthias Krüger 96bb02f35c
Rollup merge of #104645 - yukiomoto:log-backtrace-option, r=oli-obk
Add log-backtrace option to show backtraces along with logging

according to #90698, I added a compiler option, `-Zlog-backtrace=filter`, where `filter` is a module name, to show backtraces for logging without rebuilding.

resolve #90698
2023-01-13 19:16:41 +01:00
Jonathan Schwender 3bc2970a2e Improve linker-flavor detection
Linker drivers such as gcc, clang or lld often have a version postfix,
e.g clang-12. The previous logic would not account for this and would
fall back to guessing the linker flavor to be the default linker flavor
for the target, which causes linker errors when this is not the case.
By accounting for the possible version postfix and also considering
g++ and clang++, we considerably reduce the amount of times the
fallback guess has to be used.

To simplify matching check for a version postfix and match against the
linker stem without any version postfix.
In contrast to gcc, clang supports all architectures in one binary.
This means there are no variants like `aarch64-linux-gnu-clang` and
there is no need to check for `-clang` variants.
2023-01-13 17:20:37 +01:00
Oli Scherer 4aca7beab0 Remove redundant session field 2023-01-13 16:01:27 +00:00
bors 0b90256ada Auto merge of #106776 - oli-obk:om_nom_nom_nom_nom, r=cjgillot
Feed a bunch of queries instead of tracking fields on TyCtxt

r? `@cjgillot`

pulled out of https://github.com/rust-lang/rust/pull/105462
2023-01-13 13:57:21 +00:00
bors 5ca6f7d2c3 Auto merge of #106801 - JohnTitor:rollup-xqkraw0, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #106608 (Render missing generics suggestion verbosely)
 - #106716 ([RFC 2397] Deny incorrect locations)
 - #106754 (Rename `Ty::is_ty_infer` -> `Ty::is_ty_or_numeric_infer`)
 - #106782 (Ignore tests move in git blame)
 - #106785 (Make blame spans better for impl wfcheck)
 - #106791 (Fix ICE formatting)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-13 10:56:53 +00:00
Lukas Wirth 549ece7033 Warn when using panic-strategy abort for proc-macro crates 2023-01-13 10:13:49 +01:00
Yuki Okushi c06d57eb19
Rollup merge of #106791 - estebank:fix-ice, r=compiler-errors
Fix ICE formatting
2023-01-13 16:54:25 +09:00
Yuki Okushi 5adc7a5e37
Rollup merge of #106785 - compiler-errors:better-impl-wf-spans, r=estebank
Make blame spans better for impl wfcheck

r? types
2023-01-13 16:54:24 +09:00
Yuki Okushi 796847a3da
Rollup merge of #106782 - albertlarsan68:ignore-test-move-in-blame, r=Nilstrieb
Ignore tests move in git blame

This commit is not relevant in the history, but may clobber the git blame output.
2023-01-13 16:54:24 +09:00
Yuki Okushi d4ad96cf6e
Rollup merge of #106754 - compiler-errors:ty-infer-method-is-confusing, r=lcnr
Rename `Ty::is_ty_infer` -> `Ty::is_ty_or_numeric_infer`

Makes sure people are aware that they may have a type variable *or* an int/float variable.

r? `@oli-obk` https://github.com/rust-lang/rust/pull/106322#issuecomment-1376913539 but I could instead implement your solution, let me know.

(This will conflict with #106322 for now, ignore that 😄)
2023-01-13 16:54:23 +09:00
Yuki Okushi f6f362c332
Rollup merge of #106716 - c410-f3r:rfc-2397-1, r=davidtwco
[RFC 2397] Deny incorrect locations

cc #51992

As declared in the RFC, `#[do_not_recommend]` should only be applicable on trait implementations.
2023-01-13 16:54:23 +09:00
Yuki Okushi 9a2f3937fc
Rollup merge of #106608 - compiler-errors:missing-generics-verbose, r=estebank
Render missing generics suggestion verbosely

It's a bit easier to read like this, especially ones that are appending new generics onto an existing list, like ": `, T`" which render somewhat poorly inline.

Also don't suggest `dyn` as a type parameter to add, even if technically that's valid in edition 2015.
2023-01-13 16:54:22 +09:00
bors 4a04f252f9 Auto merge of #106092 - asquared31415:start_lang_item_checks, r=davidtwco
Add checks for the signature of the `start` lang item

Closes #105963
2023-01-13 07:45:34 +00:00
Albert Larsan 4a3c072d10
Ignore tests move in git blame 2023-01-13 06:54:30 +00:00
Fawaz 138a1d26b5 riscv: Fix ELF header flags
The previous version added both `EF_RISCV_FLOAT_ABI_DOUBLE` and
`EF_RISCV_RVC` if the "D" extension was enabled on riscv64 targets.
riscv32 targets were not accounted for. This patch changes this
so that:

- Only add `EF_RISCV_RVC` if the "C" extension is enabled
- Add `EF_RISCV_FLOAT_ABI_SINGLE` if the "F" extension is enabled
  and the "D" extension is not
- Add these ELF flags for riscv32 as well
2023-01-12 22:35:38 -08:00
bors 279f1c9d8c Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obk
Const closures

cc https://github.com/rust-lang/rust/issues/106003
2023-01-13 05:04:48 +00:00
Mark Rousskov 95ef76b8aa Normalize test output more thoroughly
This prevents differences in local environments, which may (for example)
end up with a longer backtrace with more digits in the backtrace prefix,
as happened to me. While we're at it, clean more of the output up,
including the exact location of the error in the compiler.
2023-01-12 21:28:20 -05:00
bors bfffe406fb Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
Migrate `rustc_lint` lint diagnostics

Part 2 of [Migrate `rustc_lint` errors to `SessionDiagnostic`](https://github.com/rust-lang/rust/pull/100776)

r? `@davidtwco`

# TODO
- [x] Refactor some lints manually implementing `DecorateLint` to use `Option<Subdiagnostic>`.
- [x] Add `#[rustc_lint_diagnostics]` to lint functions in `context.rs`.
- [x] Migrate `hidden_unicode_codepoints.rs`.
- [x] Migrate `UnsafeCode` in `builtin.rs`.
- [x] Migrate the rest of `builtin.rs`.
2023-01-13 02:13:00 +00:00
Michael Goulet eaa7cc84d3 Add logic to make IMPLIED_BOUNDS_ENTAILMENT easier to understand 2023-01-13 00:39:54 +00:00
Michael Goulet 8e27211dbc is_ty_infer -> is_ty_or_numeric_infer 2023-01-12 23:57:41 +00:00
Esteban Küber 06a2d2d001 Fix ICE formatting 2023-01-12 23:46:58 +00:00
bors 86ad69d4c6 Auto merge of #106786 - JohnTitor:rollup-8f4vk8m, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #105795 (Stabilize `abi_efiapi` feature)
 - #106446 ([LSDA] Take ttype_index into account when taking unwind action)
 - #106675 (Mark ZST as FFI-safe if all its fields are PhantomData)
 - #106740 (Adding a hint on iterator type errors)
 - #106741 (Fix reexport of `doc(hidden)` item)
 - #106759 (Revert "Make nested RPITIT inherit the parent opaque's generics.")
 - #106772 (Re-add mw to review rotation)
 - #106778 (Exclude formatting commit from blame)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-12 22:58:14 +00:00
Michael Goulet 5924c2511e Only point at impl self ty in WF if trait predicate shares self ty 2023-01-12 22:25:30 +00:00
Michael Goulet bf0623e363 Don't suggest dyn as parameter to add 2023-01-12 22:04:30 +00:00
Michael Goulet 950b47fb96 Render missing generics suggestion verbosely 2023-01-12 22:04:30 +00:00
Yuki Okushi 8dc8e3ce36
Rollup merge of #106778 - RReverser:patch-1, r=dtolnay
Exclude formatting commit from blame

Excludes c34fbfaad3 (cc `@dtolnay)` to make Git blame a bit more useful.
2023-01-13 05:47:25 +09:00
Yuki Okushi 174c6c7098
Rollup merge of #106772 - michaelwoerister:triagebot-rotation, r=wesleywiser
Re-add mw to review rotation

r? `@wesleywiser`
2023-01-13 05:47:24 +09:00
Yuki Okushi bbb2a22ced
Rollup merge of #106759 - compiler-errors:revert-105255, r=cjgillot
Revert "Make nested RPITIT inherit the parent opaque's generics."

This reverts commit e2d41f4c97, and adjusts the `tests/ui/async-await/in-trait/nested-rpit.rs` test.

r? `@cjgillot`

fixes #106332, manually verified because it had no minimization :/

reopens #105197
cc #106729
2023-01-13 05:47:24 +09:00
Yuki Okushi ea45b3ef1d
Rollup merge of #106741 - GuillaumeGomez:reexport-doc-hidden, r=notriddle
Fix reexport of `doc(hidden)` item

Part of #59368.

It doesn't fix the `doc(inline)` nor the `doc(hidden)` on macro. I'll do it in a follow-up PR.

r? `@notriddle`
2023-01-13 05:47:23 +09:00
Yuki Okushi 7e5d477ac5
Rollup merge of #106740 - petar-dambovaliev:float-iterator-hint, r=Nilstrieb
Adding a hint on iterator type errors

Issue reference https://github.com/rust-lang/rust/issues/106728

- [x] add a case in the attribute
- [x] add a test

closes #106728
2023-01-13 05:47:23 +09:00