]> git.lizzy.rs Git - rust.git/log
rust.git
17 months agoEmit only one nbsp error per file
David Tolnay [Sat, 14 Jan 2023 18:34:06 +0000 (10:34 -0800)]
Emit only one nbsp error per file

17 months agoAdd more nbsp to unicode-chars test
David Tolnay [Sat, 14 Jan 2023 19:02:14 +0000 (11:02 -0800)]
Add more nbsp to unicode-chars test

17 months agoAuto merge of #106851 - matthiaskrgr:rollup-d9dz3yp, r=matthiaskrgr
bors [Sat, 14 Jan 2023 14:50:53 +0000 (14:50 +0000)]
Auto merge of #106851 - matthiaskrgr:rollup-d9dz3yp, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #106046 (Fix mir-opt tests for big-endian platforms)
 - #106470 (tidy: Don't include wasm32 in compiler dependency check)
 - #106566 (Emit a single error for contiguous sequences of unknown tokens)
 - #106644 (Update the wasi-libc used for the wasm32-wasi target)
 - #106665 (Add note when `FnPtr` vs. `FnDef` impl trait)
 - #106752 (Emit a hint for bad call return types due to generic arguments)
 - #106788 (Tweak E0599 and elaborate_predicates)
 - #106831 (Use GitHub yaml templates for ICE, Docs and Diagnostics tickets)
 - #106846 (Improve some comments and names in parser)
 - #106848 (Fix wrong path in triage bot autolabel for wg-trait-solver-refactor)

Failed merges:

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

17 months agoRollup merge of #106848 - BoxyUwU:correct_triagebot_path, r=WaffleLapkin
Matthias Krüger [Sat, 14 Jan 2023 12:04:28 +0000 (13:04 +0100)]
Rollup merge of #106848 - BoxyUwU:correct_triagebot_path, r=WaffleLapkin

Fix wrong path in triage bot autolabel for wg-trait-solver-refactor

17 months agoRollup merge of #106846 - WaffleLapkin:pico_parse_ref, r=TaKO8Ki
Matthias Krüger [Sat, 14 Jan 2023 12:04:27 +0000 (13:04 +0100)]
Rollup merge of #106846 - WaffleLapkin:pico_parse_ref, r=TaKO8Ki

Improve some comments and names in parser

Just a tiny drive-by cleanup.

17 months agoRollup merge of #106831 - estebank:tickets_yaml, r=Mark-Simulacrum
Matthias Krüger [Sat, 14 Jan 2023 12:04:27 +0000 (13:04 +0100)]
Rollup merge of #106831 - estebank:tickets_yaml, r=Mark-Simulacrum

Use GitHub yaml templates for ICE, Docs and Diagnostics tickets

The GitHub yaml templates allow us to define HTML forms with validation for issue templates, instead of the current markdown based templates which only let us introduce text into the user editable text area. The form lets us make some fields mandatory, as well as add text that won't pollute the user's text and titles that won't be interfered with by enterprising users.

17 months agoRollup merge of #106788 - estebank:elaborate_pred_E0599, r=compiler-errors
Matthias Krüger [Sat, 14 Jan 2023 12:04:26 +0000 (13:04 +0100)]
Rollup merge of #106788 - estebank:elaborate_pred_E0599, r=compiler-errors

Tweak E0599 and elaborate_predicates

CC https://github.com/rust-lang/rust/issues/86377.

17 months agoRollup merge of #106752 - sulami:master, r=estebank
Matthias Krüger [Sat, 14 Jan 2023 12:04:26 +0000 (13:04 +0100)]
Rollup merge of #106752 - sulami:master, r=estebank

Emit a hint for bad call return types due to generic arguments

When the return type of a function call depends on the type of an argument, e.g.

```
fn foo<T>(x: T) -> T {
    x
}
```

and the expected type is set due to either an explicitly typed binding, or because the call to the function is in a tail position without semicolon, the current error implies that the argument in the call has the wrong type.

This new hint highlights that the expected type doesn't match the returned type, which matches the argument type, and that that's why we're flagging the argument type.

Fixes #43608.

17 months agoRollup merge of #106665 - JulianKnodt:better_fn_trait_note, r=cjgillot
Matthias Krüger [Sat, 14 Jan 2023 12:04:25 +0000 (13:04 +0100)]
Rollup merge of #106665 - JulianKnodt:better_fn_trait_note, r=cjgillot

Add note when `FnPtr` vs. `FnDef` impl trait

I encountered an instance where an `FnPtr` implemented a trait, but I was passing an `FnDef`. I was confused for an hour and to examine the source code of the trait's crate's tests in order to understand how to cast it properly (it didn't help that it was behind a reference). To the end user, it might not be immediately obvious that they are different and how to convert from an `FnDef` to an `FnPtr`, but it is necessary to cast to the generic function in order to compile. It is thus useful to suggest `as` in the help note, (even if the `Fn` output implements the trait).

17 months agoRollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
Matthias Krüger [Sat, 14 Jan 2023 12:04:25 +0000 (13:04 +0100)]
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper

Update the wasi-libc used for the wasm32-wasi target

This commit updates the wasi-libc revision used to build with the wasm32-wasi target. This notably pulls in WebAssembly/wasi-libc#377 which is needed to fix a use case I've been working on recently. This should be a relatively small update hopefully and is not expected to have any user impact.

17 months agoRollup merge of #106566 - clubby789:contiguous-weird-unicode, r=cjgillot
Matthias Krüger [Sat, 14 Jan 2023 12:04:24 +0000 (13:04 +0100)]
Rollup merge of #106566 - clubby789:contiguous-weird-unicode, r=cjgillot

Emit a single error for contiguous sequences of unknown tokens

Closes #106101

On encountering a sequence of identical source characters which are unknown tokens, note the amount of subsequent characters and advance past them silently. The old behavior was to emit an error and 'help' note for every single one.

`@rustbot` label +A-diagnostics +A-parser

17 months agoRollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
Matthias Krüger [Sat, 14 Jan 2023 12:04:24 +0000 (13:04 +0100)]
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum

tidy: Don't include wasm32 in compiler dependency check

This changes the tidy compiler dependency check so that it does not include wasm32-unknown-unknown dependencies in the PERMITTED_RUSTC_DEPENDENCIES. This just helps keep the list cleaner under the assumption that the compiler will never work on wasm32-unknown-unknown.

This also fixes a bug in the check to verify there are no unused dependencies in the PERMITTED_RUSTC_DEPENDENCIES. Previously the check was verifying that the dependency was used *anywhere* in the workspace, when it should have been checking if it was used for the compiler.

There's also just a little general cleanup here. For example, the old `normal_deps_of_r` function was changed a while ago to return *all* dependencies, but the function name and description wasn't updated to remove `normal_`.

17 months agoRollup merge of #106046 - uweigand:s390x-test-bigendian-mir, r=Mark-Simulacrum
Matthias Krüger [Sat, 14 Jan 2023 12:04:23 +0000 (13:04 +0100)]
Rollup merge of #106046 - uweigand:s390x-test-bigendian-mir, r=Mark-Simulacrum

Fix mir-opt tests for big-endian platforms

The test cases src/test/mir-opt/building/custom/consts.rs and src/test/mir-opt/const_prop/mutable_variable_no_prop.rs are currently failing on big-endian platforms as the binary encoding of some constants is hard-coded in the MIR test files.  Fix this by choosing constant values that have the same encoding on big- and little-endian platforms.

The test case src/test/mir-opt/issues/issue_75439.rs is failing as well, but since the purpose of the test is to validate handling of big-endian integer encodings on a little-endian platform, it does not make much sense to run it on big-endian platforms in the first place - we can just ignore it there.

Fixed part of https://github.com/rust-lang/rust/issues/105383.

17 months agoa
Boxy [Sat, 14 Jan 2023 11:44:37 +0000 (11:44 +0000)]
a

17 months agoImprove comments in `parser/expr.rs`
Maybe Waffle [Sat, 14 Jan 2023 11:29:22 +0000 (11:29 +0000)]
Improve comments in `parser/expr.rs`

17 months agoMake `LhsExpr::AlreadyParsed` a named struct
Maybe Waffle [Sat, 14 Jan 2023 11:28:14 +0000 (11:28 +0000)]
Make `LhsExpr::AlreadyParsed` a named struct

17 months agoAdd note when `FnPtr` vs. `FnDef` impl trait
kadmin [Tue, 10 Jan 2023 06:08:18 +0000 (06:08 +0000)]
Add note when `FnPtr` vs. `FnDef` impl trait

I encountered an instance where an `FnPtr` implemented a trait, but I was passing an `FnDef`. To
the end user, there is really no way to differentiate each of them, but it is necessary to cast
to the generic function in order to compile. It is thus useful to suggest `as` in the help note,
(even if the Fn output implements the trait).

17 months agoAuto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
bors [Sat, 14 Jan 2023 08:33:09 +0000 (08:33 +0000)]
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum

Fix aarch64-unknown-linux-gnu_ilp32 target

This was broken because the synthetic object files produced by rustc were for 64-bit AArch64, which caused link failures when combined with 32-bit ILP32 object files.

This PR updates the object crate to 0.30.1 which adds support for generating ILP32 AArch64 object files.

17 months agoAuto merge of #106833 - JohnTitor:rollup-z8398jk, r=JohnTitor
bors [Sat, 14 Jan 2023 05:51:55 +0000 (05:51 +0000)]
Auto merge of #106833 - JohnTitor:rollup-z8398jk, r=JohnTitor

Rollup of 13 pull requests

Successful merges:

 - #104965 (reword Option::as_ref and Option::map examples)
 - #105172 (Added error documentation for write_fmt)
 - #106605 (rustdoc: fix outdated lint section of the book)
 - #106670 (Check compiler docs in PR CI)
 - #106692 (mv binary_heap.rs binary_heap/mod.rs)
 - #106693 (rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle)
 - #106707 (Remove duplicate sha-1 dependency)
 - #106762 (Add `AtomicPtr::as_mut_ptr`)
 - #106766 (Remove dead code in rustdoc stripper)
 - #106775 (Remove stale reference to the test suite location)
 - #106799 (Stop having unused lifetimes on some `impl`s)
 - #106816 (Update `rental` hack to work with remapped paths.)
 - #106819 (rustdoc: remove unnecessary DOM class `h1.fqn`)

Failed merges:

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

17 months agoAuto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
bors [Sat, 14 Jan 2023 03:04:40 +0000 (03:04 +0000)]
Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum

Update mdbook

This updates mdbook from 0.4.21 to 0.4.25. The list of changes is [here](https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0425). The only user-visible changes are some changes around the theme picker, and change to the copy-to-clipboard ignoring hidden lines.

Internally there were some dependency updates and small fixes.

This also updates `clap` from 4.0.15 to 4.0.32 whose changelog is [here](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#4032---2022-12-22). This impacts tools like cargo. I don't see anything particularly noteworthy there, though there are some small user-visible changes.

Unfortunately this required adding a hack for building `rustix` with a bootstrap tool. The comment explains why. I am unable to think of some other workaround (or even a cleaner way to set the rustflag). Ideas are welcome if you can think of alternatives. I'm struggling to even think of a long-term solution, other than asking projects not to do auto-nightly feature detection.

One medium-term solution is to avoid the clap dependency for the mdbook library (which is how rustix gets pulled in). That is one of my goals for the 0.5 release of mdbook, but that probably won't happen until later this year. It would also require dropping clap from `rustbook` and using some other means to parse arguments (there's only two options, so it can probably be done manually).

17 months agoRollup merge of #106819 - notriddle:notriddle/rm-h1-fqn, r=GuillaumeGomez
Yuki Okushi [Sat, 14 Jan 2023 03:04:37 +0000 (12:04 +0900)]
Rollup merge of #106819 - notriddle:notriddle/rm-h1-fqn, r=GuillaumeGomez

rustdoc: remove unnecessary DOM class `h1.fqn`

It's misleading. The main heading sometimes isn't an fully qualified name at all.

It's also redundant. It's always a child of `div.main-heading`, so just use that.

17 months agoRollup merge of #106816 - TimNN:rental-remap, r=oli-obj
Yuki Okushi [Sat, 14 Jan 2023 03:04:37 +0000 (12:04 +0900)]
Rollup merge of #106816 - TimNN:rental-remap, r=oli-obj

Update `rental` hack to work with remapped paths.

This PR simply switches to an already-existing helper instead of hard-coding a specific enum variant. The new revision of the test fails without the other changes in this PR.

Context: I'm exploring running UI tests with remapped paths by default in #105924 and the rental test was one of the ones that failed.

This may also be useful in the context of https://github.com/rust-lang/rfcs/pull/3127 ("New rustc and Cargo options to allow path sanitisation by default").

17 months agoRollup merge of #106799 - scottmcm:remove-unused-generics, r=cuviper
Yuki Okushi [Sat, 14 Jan 2023 03:04:36 +0000 (12:04 +0900)]
Rollup merge of #106799 - scottmcm:remove-unused-generics, r=cuviper

Stop having unused lifetimes on some `impl`s

See <https://doc.rust-lang.org/nightly/std/cmp/trait.PartialOrd.html#impl-PartialOrd%3COsStr%3E-for-PathBuf>, where these lifetimes show up even though they're not needed:
![image](https://user-images.githubusercontent.com/18526288/212257802-da275167-38f9-4e2c-aafc-d44f0fc6a7c6.png)

With this PR, the unneeded lifetimes are no longer there:
![image](https://user-images.githubusercontent.com/18526288/212257938-0097c4bf-1247-4c91-8445-5bf0dde1b501.png)

17 months agoRollup merge of #106775 - albertlarsan68:patch-1, r=Mark-Simulacrum
Yuki Okushi [Sat, 14 Jan 2023 03:04:36 +0000 (12:04 +0900)]
Rollup merge of #106775 - albertlarsan68:patch-1, r=Mark-Simulacrum

Remove stale reference to the test suite location

17 months agoRollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddle
Yuki Okushi [Sat, 14 Jan 2023 03:04:35 +0000 (12:04 +0900)]
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`

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 agoUse GitHub yaml templates for ICE, Docs and Diagnostics tickets
Esteban Küber [Sat, 14 Jan 2023 01:17:18 +0000 (01:17 +0000)]
Use GitHub yaml templates for ICE, Docs and Diagnostics tickets

17 months agoAuto merge of #106825 - weihanglo:update-cargo, r=weihanglo
bors [Sat, 14 Jan 2023 00:20:36 +0000 (00:20 +0000)]
Auto merge of #106825 - weihanglo:update-cargo, r=weihanglo

Update cargo

8 commits in d992ab4e9034930e7809749f04077045af8f4d79..1cd6d3803dfb0b342272862a8590f5dfc9f72573 2023-01-10 14:36:41 +0100 to 2023-01-12 18:40:36 +0000

- Fix for rust-lang/cargo#11555 (rust-lang/cargo#11568)
- chore: Fix typos (rust-lang/cargo#11561)
- fix(docs): fix typo learm =&gt; learn in cargo tree docs (rust-lang/cargo#11560)
- Add fix for CVE-2022-46176 (rust-lang/cargo#11556)
- Fix panic on target dependency errors. (rust-lang/cargo#11541)
- Fix some doc links (rust-lang/cargo#11538)
- Cargo by default saves credentials to `.cargo/credentials.toml` (rust-lang/cargo#11533)
- Fix a typo in the registries documentation. (rust-lang/cargo#11535)

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 agoUpdate the wasi-libc used for the wasm32-wasi target
Alex Crichton [Mon, 9 Jan 2023 17:00:09 +0000 (09:00 -0800)]
Update the wasi-libc used for the wasm32-wasi target

This commit updates the wasi-libc revision used to build with the
wasm32-wasi target. This notably pulls in WebAssembly/wasi-libc#377
which is needed to fix a use case I've been working on recently. This
should be a relatively small update hopefully and is not expected to
have any user impact.

17 months agoDo not incorrectly suggest restricting implied bounds
Esteban Küber [Fri, 13 Jan 2023 20:50:34 +0000 (20:50 +0000)]
Do not incorrectly suggest restricting implied bounds

When we have already suggested bounds that imply the about to be
suggested bound, skip them.

17 months agoUpdate `rental` hack to work with remapped paths.
Tim Neumann [Fri, 6 Jan 2023 10:37:53 +0000 (10:37 +0000)]
Update `rental` hack to work with remapped paths.

17 months agoUpdate cargo
Weihang Lo [Fri, 13 Jan 2023 19:59:28 +0000 (19:59 +0000)]
Update cargo

8 commits in d992ab4e9034930e7809749f04077045af8f4d79..1cd6d3803dfb0b342272862a8590f5dfc9f72573
2023-01-10 14:36:41 +0100 to 2023-01-12 18:40:36 +0000

- Fix for rust-lang/cargo#11555 (rust-lang/cargo#11568)
- chore: Fix typos (rust-lang/cargo#11561)
- fix(docs): fix typo learm =&gt; learn in cargo tree docs (rust-lang/cargo#11560)
- Add fix for CVE-2022-46176 (rust-lang/cargo#11556)
- Fix panic on target dependency errors. (rust-lang/cargo#11541)
- Fix some doc links (rust-lang/cargo#11538)
- Cargo by default saves credentials to `.cargo/credentials.toml` (rust-lang/cargo#11533)
- Fix a typo in the registries documentation. (rust-lang/cargo#11535)

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 agoAdd tests
Esteban Küber [Thu, 12 Jan 2023 21:48:07 +0000 (21:48 +0000)]
Add tests

17 months agoKeep obligation chain when elaborating obligations
Esteban Küber [Thu, 12 Jan 2023 21:32:06 +0000 (21:32 +0000)]
Keep obligation chain when elaborating obligations

17 months agoElaborate unmet obligations in E0599 for more context
Esteban Küber [Thu, 12 Jan 2023 19:53:01 +0000 (19:53 +0000)]
Elaborate unmet obligations in E0599 for more context

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 agorustdoc: remove unnecessary DOM class `h1.fqn`
Michael Howell [Fri, 13 Jan 2023 17:09:25 +0000 (10:09 -0700)]
rustdoc: remove unnecessary DOM class `h1.fqn`

It's misleading. The main heading sometimes isn't an fully qualified name at all.

It's also redundant. It's always a child of `div.main-heading`, so just use that.

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 agoRemove stale reference to the test suite location
Albert Larsan [Thu, 12 Jan 2023 16:17:20 +0000 (17:17 +0100)]
Remove stale reference to the test suite location

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 agoStop having unused lifetimes on some `impl`s
Scott McMurray [Fri, 13 Jan 2023 06:55:58 +0000 (22:55 -0800)]
Stop having unused lifetimes on some `impl`s

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 agoEmit a hint for bad call return types due to generic arguments
Robin Schroer [Sun, 8 Jan 2023 12:10:48 +0000 (21:10 +0900)]
Emit a hint for bad call return types due to generic arguments

When the return type of a function call depends on the type of an
argument, e.g.

```
fn foo<T>(x: T) -> T {
    x
}
```

and the expected type is set due to either an explicitly typed
binding, or because the call to the function is in a tail position
without semicolon, the current error implies that the argument in the
call has the wrong type.

This new hint highlights that the expected type doesn't match the
returned type, which matches the argument type, and that that's why
we're flagging the argument type.

Fixes #43608.

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