]> git.lizzy.rs Git - rust.git/log
rust.git
17 months agoRollup merge of #106762 - WaffleLapkin:atomicptr+as_mut_ptr, r=m-ou-se
Yuki Okushi [Sat, 14 Jan 2023 03:04:35 +0000 (12:04 +0900)]
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

17 months agoRollup merge of #106707 - ehuss:remove-dupe-sha-1, r=Mark-Simulacrum
Yuki Okushi [Sat, 14 Jan 2023 03:04:34 +0000 (12:04 +0900)]
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.

17 months agoRollup merge of #106693 - notriddle:notriddle/toggle-trunc, r=GuillaumeGomez
Yuki Okushi [Sat, 14 Jan 2023 03:04:34 +0000 (12:04 +0900)]
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.

17 months agoRollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
Yuki Okushi [Sat, 14 Jan 2023 03:04:33 +0000 (12:04 +0900)]
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?

17 months agoRollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
Yuki Okushi [Sat, 14 Jan 2023 03:04:33 +0000 (12:04 +0900)]
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum

Check compiler docs in PR CI

Fixes #106624

17 months agoRollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
Yuki Okushi [Sat, 14 Jan 2023 03:04:32 +0000 (12:04 +0900)]
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez

rustdoc: fix outdated lint section of the book

17 months agoRollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
Yuki Okushi [Sat, 14 Jan 2023 03:04:32 +0000 (12:04 +0900)]
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

17 months agoRollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
Yuki Okushi [Sat, 14 Jan 2023 03:04:31 +0000 (12:04 +0900)]
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

17 months agoAuto merge of #106822 - matthiaskrgr:rollup-46bi4pi, r=matthiaskrgr
bors [Fri, 13 Jan 2023 21:25:50 +0000 (21:25 +0000)]
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

17 months agorustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle
Michael Howell [Tue, 10 Jan 2023 18:35:37 +0000 (11:35 -0700)]
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.

17 months agoRollup merge of #106813 - oli-obk:sess_cleanup, r=GuillaumeGomez,petrochenkov
Matthias Krüger [Fri, 13 Jan 2023 18:16:45 +0000 (19:16 +0100)]
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.

17 months agoRollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
Matthias Krüger [Fri, 13 Jan 2023 18:16:45 +0000 (19:16 +0100)]
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

17 months agoRollup merge of #106793 - Mark-Simulacrum:normalize-test, r=compiler-errors
Matthias Krüger [Fri, 13 Jan 2023 18:16:44 +0000 (19:16 +0100)]
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

17 months agoRollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu
Matthias Krüger [Fri, 13 Jan 2023 18:16:44 +0000 (19:16 +0100)]
Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu

Fix `mpsc::SyncSender` spinning behavior

Resolves https://github.com/rust-lang/rust/issues/106668.

17 months agoRollup merge of #106678 - Veykril:proc-macro-panic-abort, r=eholk
Matthias Krüger [Fri, 13 Jan 2023 18:16:43 +0000 (19:16 +0100)]
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)

17 months agoRollup merge of #106641 - chenyukang:yukang/fix-105761-segguest-this, r=estebank
Matthias Krüger [Fri, 13 Jan 2023 18:16:43 +0000 (19:16 +0100)]
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````

17 months agoRollup merge of #106585 - estebank:issue-46585, r=compiler-errors
Matthias Krüger [Fri, 13 Jan 2023 18:16:42 +0000 (19:16 +0100)]
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.

17 months agoRollup merge of #106489 - jschwe:fix_linker_detection, r=petrochenkov
Matthias Krüger [Fri, 13 Jan 2023 18:16:42 +0000 (19:16 +0100)]
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

17 months agoRollup merge of #106465 - compiler-errors:bump-IMPLIED_BOUNDS_ENTAILMENT, r=lcnr
Matthias Krüger [Fri, 13 Jan 2023 18:16:41 +0000 (19:16 +0100)]
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 :smile:

17 months agoRollup merge of #104645 - yukiomoto:log-backtrace-option, r=oli-obk
Matthias Krüger [Fri, 13 Jan 2023 18:16:41 +0000 (19:16 +0100)]
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

17 months agoImprove linker-flavor detection
Jonathan Schwender [Thu, 5 Jan 2023 13:14:23 +0000 (14:14 +0100)]
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.

17 months agoRemove redundant session field
Oli Scherer [Thu, 8 Dec 2022 09:39:48 +0000 (09:39 +0000)]
Remove redundant session field

17 months agoAuto merge of #106776 - oli-obk:om_nom_nom_nom_nom, r=cjgillot
bors [Fri, 13 Jan 2023 13:57:21 +0000 (13:57 +0000)]
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

17 months agoAuto merge of #106801 - JohnTitor:rollup-xqkraw0, r=JohnTitor
bors [Fri, 13 Jan 2023 10:56:53 +0000 (10:56 +0000)]
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

17 months agoWarn when using panic-strategy abort for proc-macro crates
Lukas Wirth [Tue, 10 Jan 2023 12:57:42 +0000 (13:57 +0100)]
Warn when using panic-strategy abort for proc-macro crates

17 months agoRollup merge of #106791 - estebank:fix-ice, r=compiler-errors
Yuki Okushi [Fri, 13 Jan 2023 07:54:25 +0000 (16:54 +0900)]
Rollup merge of #106791 - estebank:fix-ice, r=compiler-errors

Fix ICE formatting

17 months agoRollup merge of #106785 - compiler-errors:better-impl-wf-spans, r=estebank
Yuki Okushi [Fri, 13 Jan 2023 07:54:24 +0000 (16:54 +0900)]
Rollup merge of #106785 - compiler-errors:better-impl-wf-spans, r=estebank

Make blame spans better for impl wfcheck

r? types

17 months agoRollup merge of #106782 - albertlarsan68:ignore-test-move-in-blame, r=Nilstrieb
Yuki Okushi [Fri, 13 Jan 2023 07:54:24 +0000 (16:54 +0900)]
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.

17 months agoRollup merge of #106754 - compiler-errors:ty-infer-method-is-confusing, r=lcnr
Yuki Okushi [Fri, 13 Jan 2023 07:54:23 +0000 (16:54 +0900)]
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 :smile:)

17 months agoRollup merge of #106716 - c410-f3r:rfc-2397-1, r=davidtwco
Yuki Okushi [Fri, 13 Jan 2023 07:54:23 +0000 (16:54 +0900)]
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.

17 months agoRollup merge of #106608 - compiler-errors:missing-generics-verbose, r=estebank
Yuki Okushi [Fri, 13 Jan 2023 07:54:22 +0000 (16:54 +0900)]
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.

17 months agoAuto merge of #106092 - asquared31415:start_lang_item_checks, r=davidtwco
bors [Fri, 13 Jan 2023 07:45:34 +0000 (07:45 +0000)]
Auto merge of #106092 - asquared31415:start_lang_item_checks, r=davidtwco

Add checks for the signature of the `start` lang item

Closes #105963

17 months agoIgnore tests move in git blame
Albert Larsan [Thu, 12 Jan 2023 18:20:51 +0000 (18:20 +0000)]
Ignore tests move in git blame

17 months agoriscv: Fix ELF header flags
Fawaz [Mon, 9 Jan 2023 08:17:58 +0000 (00:17 -0800)]
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

17 months agoAuto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obk
bors [Fri, 13 Jan 2023 05:04:48 +0000 (05:04 +0000)]
Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obk

Const closures

cc https://github.com/rust-lang/rust/issues/106003

17 months agoNormalize test output more thoroughly
Mark Rousskov [Fri, 13 Jan 2023 02:28:20 +0000 (21:28 -0500)]
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.

17 months agoAuto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
bors [Fri, 13 Jan 2023 02:13:00 +0000 (02:13 +0000)]
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`.

17 months agoAdd logic to make IMPLIED_BOUNDS_ENTAILMENT easier to understand
Michael Goulet [Thu, 12 Jan 2023 20:43:44 +0000 (20:43 +0000)]
Add logic to make IMPLIED_BOUNDS_ENTAILMENT easier to understand

17 months agois_ty_infer -> is_ty_or_numeric_infer
Michael Goulet [Wed, 11 Jan 2023 22:20:56 +0000 (22:20 +0000)]
is_ty_infer -> is_ty_or_numeric_infer

17 months agoFix ICE formatting
Esteban Küber [Thu, 12 Jan 2023 23:46:58 +0000 (23:46 +0000)]
Fix ICE formatting

17 months agoAuto merge of #106786 - JohnTitor:rollup-8f4vk8m, r=JohnTitor
bors [Thu, 12 Jan 2023 22:58:14 +0000 (22:58 +0000)]
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

17 months agoOnly point at impl self ty in WF if trait predicate shares self ty
Michael Goulet [Thu, 12 Jan 2023 20:28:57 +0000 (20:28 +0000)]
Only point at impl self ty in WF if trait predicate shares self ty

17 months agoDon't suggest dyn as parameter to add
Michael Goulet [Sun, 8 Jan 2023 23:27:22 +0000 (23:27 +0000)]
Don't suggest dyn as parameter to add

17 months agoRender missing generics suggestion verbosely
Michael Goulet [Sun, 8 Jan 2023 23:21:46 +0000 (23:21 +0000)]
Render missing generics suggestion verbosely

17 months agoRollup merge of #106778 - RReverser:patch-1, r=dtolnay
Yuki Okushi [Thu, 12 Jan 2023 20:47:25 +0000 (05:47 +0900)]
Rollup merge of #106778 - RReverser:patch-1, r=dtolnay

Exclude formatting commit from blame

Excludes https://github.com/rust-lang/rust/commit/c34fbfaad38cf5829ef5cfe780dc9d58480adeaa (cc `@dtolnay)` to make Git blame a bit more useful.

17 months agoRollup merge of #106772 - michaelwoerister:triagebot-rotation, r=wesleywiser
Yuki Okushi [Thu, 12 Jan 2023 20:47:24 +0000 (05:47 +0900)]
Rollup merge of #106772 - michaelwoerister:triagebot-rotation, r=wesleywiser

Re-add mw to review rotation

r? `@wesleywiser`

17 months agoRollup merge of #106759 - compiler-errors:revert-105255, r=cjgillot
Yuki Okushi [Thu, 12 Jan 2023 20:47:24 +0000 (05:47 +0900)]
Rollup merge of #106759 - compiler-errors:revert-105255, r=cjgillot

Revert "Make nested RPITIT inherit the parent opaque's generics."

This reverts commit e2d41f4c974f0cc09e5aafb02883f222487610f9, 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

17 months agoRollup merge of #106741 - GuillaumeGomez:reexport-doc-hidden, r=notriddle
Yuki Okushi [Thu, 12 Jan 2023 20:47:23 +0000 (05:47 +0900)]
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`

17 months agoRollup merge of #106740 - petar-dambovaliev:float-iterator-hint, r=Nilstrieb
Yuki Okushi [Thu, 12 Jan 2023 20:47:23 +0000 (05:47 +0900)]
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

17 months agoRollup merge of #106675 - krtab:fix_improper_ctypes, r=davidtwco
Yuki Okushi [Thu, 12 Jan 2023 20:47:22 +0000 (05:47 +0900)]
Rollup merge of #106675 - krtab:fix_improper_ctypes, r=davidtwco

Mark ZST as FFI-safe if all its fields are PhantomData

This presents one possible solution to issue: #106629.

This is my first (tentative) contribution to the compiler itself.

I'm looking forward for comments and feedback

Closes: #106629
17 months agoRollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
Yuki Okushi [Thu, 12 Jan 2023 20:47:21 +0000 (05:47 +0900)]
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu

[LSDA] Take ttype_index into account when taking unwind action

If `cs_action != 0`, we should check the `ttype_index` field in action record. If `ttype_index == 0`, a clean up action is taken; otherwise catch action is taken.

This can fix unwind failure on AIX which uses LLVM's libunwind by default. IIUC, rust's LSDA is borrowed from c++ and I'm assuming itanium-cxx-abi https://itanium-cxx-abi.github.io/cxx-abi/exceptions.pdf should be followed, so the fix follows what libcxxabi does. See https://github.com/llvm/llvm-project/blob/ec48682ce9f61d056361c5095f21e930b8365661/libcxxabi/src/cxa_personality.cpp#L152 for use of `ttype_index`.

17 months agoRollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
Yuki Okushi [Thu, 12 Jan 2023 20:47:21 +0000 (05:47 +0900)]
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett

Stabilize `abi_efiapi` feature

Tracking issue: https://github.com/rust-lang/rust/issues/65815
Closes #65815

17 months agoBump IMPLIED_BOUNDS_ENTAILMENT to Deny + ReportNow
Michael Goulet [Wed, 4 Jan 2023 20:55:37 +0000 (20:55 +0000)]
Bump IMPLIED_BOUNDS_ENTAILMENT to Deny + ReportNow

17 months agoPoint at impl self type for impl wf obligations
Michael Goulet [Thu, 12 Jan 2023 20:15:00 +0000 (20:15 +0000)]
Point at impl self type for impl wf obligations

17 months agoPoint at HIR types when impl trait ref doesn't normalize
Michael Goulet [Thu, 12 Jan 2023 18:51:09 +0000 (18:51 +0000)]
Point at HIR types when impl trait ref doesn't normalize

17 months agoAuto merge of #106780 - flip1995:clippyup, r=Manishearth
bors [Thu, 12 Jan 2023 20:05:18 +0000 (20:05 +0000)]
Auto merge of #106780 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

17 months agoMerge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
Philipp Krones [Thu, 12 Jan 2023 18:48:13 +0000 (19:48 +0100)]
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup

17 months agoAuto merge of #10192 - Jarcho:revert_9701, r=flip1995
bors [Thu, 12 Jan 2023 18:47:17 +0000 (18:47 +0000)]
Auto merge of #10192 - Jarcho:revert_9701, r=flip1995

Partially revert #9701

This partially reverts #9701 due to #10134

r? `@flip1995`

changelog: None

17 months agoAdjust old code for newer rustc version.
Jason Newcomb [Thu, 12 Jan 2023 18:29:23 +0000 (13:29 -0500)]
Adjust old code for newer rustc version.

17 months agoRevert 4dbd8ad34e7f6820f6e9e99531353e7ffe37b76a, c7dc96155853a3919b973347277d0e9bcaaa...
Jason Newcomb [Thu, 12 Jan 2023 18:28:22 +0000 (13:28 -0500)]
Revert 4dbd8ad34e7f6820f6e9e99531353e7ffe37b76ac7dc96155853a3919b973347277d0e9bcaaa22f0ed519ad746e31f64c4e9255be561785612532d37 and c6477eb71188311f01f409da628fab7062697bd7

17 months agoAuto merge of #10191 - flip1995:rustup, r=flip1995
bors [Thu, 12 Jan 2023 18:13:13 +0000 (18:13 +0000)]
Auto merge of #10191 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

17 months agoAlso add rustc_driver to clippy_utils
Philipp Krones [Thu, 12 Jan 2023 18:12:06 +0000 (19:12 +0100)]
Also add rustc_driver to clippy_utils

I'm not sure why this is necessary. It worked without this for me
locally, but this fails in CI. The same was done in clippy_dev

17 months agoBump nightly version -> 2023-01-12
Philipp Krones [Thu, 12 Jan 2023 18:00:16 +0000 (19:00 +0100)]
Bump nightly version -> 2023-01-12

17 months agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Thu, 12 Jan 2023 17:59:59 +0000 (18:59 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

17 months agoExclude formatting commit from blame
Ingvar Stepanyan [Thu, 12 Jan 2023 17:40:48 +0000 (17:40 +0000)]
Exclude formatting commit from blame

Excludes https://github.com/rust-lang/rust/commit/c34fbfaad38cf5829ef5cfe780dc9d58480adeaa to make Git blame a bit more useful.

17 months agoAuto merge of #10149 - jyn514:duplicate-sysroot, r=flip1995
bors [Thu, 12 Jan 2023 17:36:00 +0000 (17:36 +0000)]
Auto merge of #10149 - jyn514:duplicate-sysroot, r=flip1995

Don't pass `--sysroot` twice if SYSROOT is set

This is useful for rust-lang/rust to allow setting a sysroot that's *only* for build scripts, different from the regular sysroot passed in RUSTFLAGS (since cargo doesn't apply RUSTFLAGS to build scripts or proc-macros).

That said, the exact motivation is not particularly important: this fixes a regression from
https://github.com/rust-lang/rust-clippy/pull/9881/commits/5907e9155ed7f1312d108aa2110853472da3b029#r1060215684.

Note that only RUSTFLAGS is tested in the new integration test; passing --sysroot through `clippy-driver` never worked as far as I can tell, and no one is using it, so I didn't fix it here.

Helps with https://github.com/rust-lang/rust/pull/106394.

---

changelog: other: `SYSROOT` and `--sysroot` can now be set at the same time
[#10149](https://github.com/rust-lang/rust-clippy/pull/10149)
<!-- changelog_checked -->

17 months agoAdd cargo-clippy sysroot test
Philipp Krones [Thu, 12 Jan 2023 17:30:51 +0000 (18:30 +0100)]
Add cargo-clippy sysroot test

Whne SYSROOT is defined, clippy-driver will insert a --sysroot argument
when calling rustc. However, when a sysroot argument is already defined,
e.g. through RUSTFLAGS=--sysroot=... the `cargo clippy` call would
error. This tests that the sysroot argument is only passed once and that
SYSROOT is ignored in this case.

17 months agoDon't pass `--sysroot` twice if SYSROOT is set
Joshua Nelson [Tue, 3 Jan 2023 18:04:28 +0000 (18:04 +0000)]
Don't pass `--sysroot` twice if SYSROOT is set

This is useful for rust-lang/rust to allow setting a sysroot that's
*only* for build scripts, different from the regular sysroot passed in
RUSTFLAGS (since cargo doesn't apply RUSTFLAGS to build scripts or
proc-macros).

That said, the exact motivation is not particularly important: this
fixes a regression from
https://github.com/rust-lang/rust-clippy/pull/9881/commits/5907e9155ed7f1312d108aa2110853472da3b029#r1060215684.

Note that only RUSTFLAGS is tested in the new integration test; passing
--sysroot through `clippy-driver` never worked as far as I can tell, and
no one is using it, so I didn't fix it here.

17 months agoFeed the `features_query` instead of grabbing it from the session lazily
Oli Scherer [Mon, 5 Dec 2022 17:52:17 +0000 (17:52 +0000)]
Feed the `features_query` instead of grabbing it from the session lazily

17 months agoRemove `output_filenames` field from TyCtxt and feed the query instead
Oli Scherer [Mon, 5 Dec 2022 17:00:26 +0000 (17:00 +0000)]
Remove `output_filenames` field from TyCtxt and feed the query instead

17 months agoRemove `untracked_crate` field and instead pass it along with the resolver.
Oli Scherer [Mon, 5 Dec 2022 16:43:06 +0000 (16:43 +0000)]
Remove `untracked_crate` field and instead pass it along with the resolver.

17 months agoFeed `crate_name` query
Oli Scherer [Mon, 5 Dec 2022 16:37:44 +0000 (16:37 +0000)]
Feed `crate_name` query

17 months agoFeed `resolutions` query instead of it being a thin wrapper around an untracked field
Oli Scherer [Mon, 5 Dec 2022 16:19:14 +0000 (16:19 +0000)]
Feed `resolutions` query instead of it being a thin wrapper around an untracked field

17 months agoAuto merge of #106773 - Nilstrieb:rollup-sq73pyg, r=Nilstrieb
bors [Thu, 12 Jan 2023 17:11:03 +0000 (17:11 +0000)]
Auto merge of #106773 - Nilstrieb:rollup-sq73pyg, r=Nilstrieb

Rollup of 6 pull requests

Successful merges:

 - #105806 (Support eager subdiagnostics again)
 - #106322 (Handle inference variables in `CollectAllMismatches` correctly)
 - #106579 (Suggest making private tuple struct field public)
 - #106714 (remove unreachable error code `E0490`)
 - #106751 (Fix rendering 'const' in header for intrinsics)
 - #106761 (Add `WaffleLapkin` to compiler reviewers)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

17 months agoAdd test for displayed re-export of `doc(hidden)`
Guillaume Gomez [Thu, 12 Jan 2023 17:03:50 +0000 (18:03 +0100)]
Add test for displayed re-export of `doc(hidden)`

17 months agoFix not displayed re-export of `doc(hidden)` item
Guillaume Gomez [Wed, 11 Jan 2023 19:41:07 +0000 (20:41 +0100)]
Fix not displayed re-export of `doc(hidden)` item

17 months agoAuto merge of #10184 - robertbastian:master, r=xFrednet
bors [Thu, 12 Jan 2023 14:59:41 +0000 (14:59 +0000)]
Auto merge of #10184 - robertbastian:master, r=xFrednet

Allow implementing `Hash` with derived `PartialEq` (`derive_hash_xor_eq`

This is a common pattern and is totally allowed by the `Hash` trait.

Fixes #2627

changelog: Move: Renamed `derive_hash_xor_eq` to [`derived_hash_with_manual_eq`]
[#10184](https://github.com/rust-lang/rust-clippy/pull/10184)
changelog: Enhancement: [`derived_hash_with_manual_eq`]: Now allows `#[derive(PartialEq)]` with custom `Hash` implementations
[#10184](https://github.com/rust-lang/rust-clippy/pull/10184)
<!-- changelog_checked -->

17 months agoRollup merge of #106761 - WaffleLapkin:waffle-is-CompilerReviewer, r=oli-obk
nils [Thu, 12 Jan 2023 14:44:53 +0000 (15:44 +0100)]
Rollup merge of #106761 - WaffleLapkin:waffle-is-CompilerReviewer, r=oli-obk

Add `WaffleLapkin` to compiler reviewers

r? ``@wesleywiser``

17 months agoRollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez
nils [Thu, 12 Jan 2023 14:44:53 +0000 (15:44 +0100)]
Rollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez

Fix rendering 'const' in header for intrinsics

Fixes #99398

17 months agoRollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco
nils [Thu, 12 Jan 2023 14:44:52 +0000 (15:44 +0100)]
Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco

remove unreachable error code `E0490`

AFAIK, the untested and undocumented error code `E0490` is now unreachable, it was from the days of the original borrow checker.

cc ``@GuillaumeGomez`` #61137

17 months agoRollup merge of #106579 - estebank:issue-52144, r=Nilstrieb
nils [Thu, 12 Jan 2023 14:44:51 +0000 (15:44 +0100)]
Rollup merge of #106579 - estebank:issue-52144, r=Nilstrieb

Suggest making private tuple struct field public

Fix #52144.

17 months agoRollup merge of #106322 - compiler-errors:CollectAllMismatches-infer-vars, r=oli-obk
nils [Thu, 12 Jan 2023 14:44:51 +0000 (15:44 +0100)]
Rollup merge of #106322 - compiler-errors:CollectAllMismatches-infer-vars, r=oli-obk

Handle inference variables in `CollectAllMismatches` correctly

1. Fix #106240
2. Treat int/float type variables correctly (see `src/test/ui/iterators/invalid-iterator-chain-with-int-infer.rs`), so we can point out things like "`Iterator::Item` changed to `{integer}` here"

17 months agoRollup merge of #105806 - mejrs:eager2, r=davidtwco
nils [Thu, 12 Jan 2023 14:44:50 +0000 (15:44 +0100)]
Rollup merge of #105806 - mejrs:eager2, r=davidtwco

Support eager subdiagnostics again

See https://github.com/rust-lang/rust/pull/104941#discussion_r1051135746

I'm not sure how to add a test for this. But I did pick some of the diagnostic structs in the mentioned PR and it works with them.

17 months agoAdd mw to triagebot.toml
Michael Woerister [Thu, 12 Jan 2023 14:36:15 +0000 (15:36 +0100)]
Add mw to triagebot.toml

17 months agoadd note for float iterator
Petar Dambovaliev [Wed, 11 Jan 2023 19:28:56 +0000 (20:28 +0100)]
add note for float iterator

17 months agoAuto merge of #105603 - oli-obk:non_repeatable_queries, r=petrochenkov
bors [Thu, 12 Jan 2023 13:59:30 +0000 (13:59 +0000)]
Auto merge of #105603 - oli-obk:non_repeatable_queries, r=petrochenkov

Harden the pre-tyctxt query system against accidental recomputation

While the current compiler has no issues where we `take` and then compute the query again, in https://github.com/rust-lang/rust/pull/105462 I accidentally introduced such a case.

I also took the opportunity to remove `peek_mut`, which is only ever used for `global_tcx` to then invoke `enter`. I added an `enter` method directly on the query.

17 months agofix
Robert Bastian [Thu, 12 Jan 2023 13:22:18 +0000 (14:22 +0100)]
fix

17 months agotake care when there is no args in method call
yukang [Sat, 7 Jan 2023 16:32:40 +0000 (00:32 +0800)]
take care when there is no args in method call

17 months agoProvide help on closures capturing self causing borrow checker errors
yukang [Sat, 7 Jan 2023 06:02:59 +0000 (14:02 +0800)]
Provide help on closures capturing self causing borrow checker errors

17 months agoAuto merge of #10179 - llogiq:trim-suspicious-to-owned-paths, r=xFrednet
bors [Thu, 12 Jan 2023 12:10:56 +0000 (12:10 +0000)]
Auto merge of #10179 - llogiq:trim-suspicious-to-owned-paths, r=xFrednet

trim paths in `suspicious_to_owned`

This continues my path trimming spree. I'm not going to add yet another changelog entry, we should have one "trim paths in some applicable lints" entry instead.

---

changelog: none

17 months ago[RFC 2397] Deny incorrect locations
Caio [Thu, 12 Jan 2023 11:41:21 +0000 (08:41 -0300)]
[RFC 2397] Deny incorrect locations

17 months agoMark ZST as FFI-safe if all its fields are PhantomData
Arthur Carcano [Tue, 10 Jan 2023 10:38:53 +0000 (11:38 +0100)]
Mark ZST as FFI-safe if all its fields are PhantomData

Modify the linting behavior and add the corresponding
regression test

17 months agoAuto merge of #106760 - compiler-errors:rollup-0bogyco, r=compiler-errors
bors [Thu, 12 Jan 2023 10:46:19 +0000 (10:46 +0000)]
Auto merge of #106760 - compiler-errors:rollup-0bogyco, r=compiler-errors

Rollup of 8 pull requests

Successful merges:

 - #103236 (doc: rewrite doc for signed int::{carrying_add,borrowing_sub})
 - #103800 (Stabilize `::{core,std}::pin::pin!`)
 - #106097 (Migrate mir_build diagnostics 2 of 3)
 - #106170 (Move autoderef to `rustc_hir_analysis`)
 - #106323 (Stabilize f16c_target_feature)
 - #106360 (Tweak E0277 `&`-removal suggestions)
 - #106524 (Label `struct/enum constructor` instead of `fn item`, mention that it should be called on type mismatch)
 - #106739 (Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

17 months agoHarden the pre-tyctxt query system against accidental recomputation
Oli Scherer [Mon, 12 Dec 2022 10:48:02 +0000 (10:48 +0000)]
Harden the pre-tyctxt query system against accidental recomputation

17 months agoAuto merge of #106757 - matthiaskrgr:rollup-9j8830g, r=matthiaskrgr
bors [Thu, 12 Jan 2023 07:40:32 +0000 (07:40 +0000)]
Auto merge of #106757 - matthiaskrgr:rollup-9j8830g, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #106167 (Fix invalid syntax and incomplete suggestion in impl Trait parameter type suggestions for E0311)
 - #106309 (Prefer non-`[type error]` candidates during selection)
 - #106532 (Allow codegen to unsize `dyn*` to `dyn`)
 - #106596 (Hide more of long types in E0271)
 - #106638 (std tests: use __OsLocalKeyInner from realstd)
 - #106676 (Test that we cannot use trait impl methods arguments as defining uses)
 - #106702 (Conserve cause of `ImplDerivedObligation` in E0599)
 - #106732 (rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors.)
 - #106733 (Revert "warn newer available version of the x tool")
 - #106748 (Clean up `OnUnimplementedFormatString::verify`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

17 months agoMake `// SAFETY` comment part of the doctest, and not surrounding code
Maybe Waffle [Thu, 12 Jan 2023 07:28:43 +0000 (07:28 +0000)]
Make `// SAFETY` comment part of the doctest, and not surrounding code

17 months agoRemove unused `mut` from a doctest
Maybe Waffle [Thu, 12 Jan 2023 07:27:51 +0000 (07:27 +0000)]
Remove unused `mut` from a doctest

17 months agoAdd `AtomicPtr::as_mut_ptr`
Maybe Waffle [Thu, 12 Jan 2023 07:27:36 +0000 (07:27 +0000)]
Add `AtomicPtr::as_mut_ptr`

17 months agoAdd `WaffleLapkin` to compiler reviewers
Maybe Waffle [Thu, 12 Jan 2023 06:53:06 +0000 (06:53 +0000)]
Add `WaffleLapkin` to compiler reviewers

17 months agoRollup merge of #106739 - WaffleLapkin:astconv, r=estebank
Michael Goulet [Thu, 12 Jan 2023 06:25:50 +0000 (22:25 -0800)]
Rollup merge of #106739 - WaffleLapkin:astconv, r=estebank

Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`

This removes the need for <>><><><<>> dances and makes the code a bit nicer.

Not sure if `astconv` is the best name though, maybe someone has a better idea?