]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoUpdate tests for UEFI and AVR
Vadim Petrochenkov [Sat, 27 Aug 2022 13:19:56 +0000 (16:19 +0300)]
Update tests for UEFI and AVR

22 months agorustc_target: Use `Cow` and link args helpers in `apple_base`
Vadim Petrochenkov [Sun, 14 Aug 2022 16:13:15 +0000 (19:13 +0300)]
rustc_target: Use `Cow` and link args helpers in `apple_base`

22 months agorustc_target: Do not specify some target options redundantly
Vadim Petrochenkov [Sun, 14 Aug 2022 16:11:31 +0000 (19:11 +0300)]
rustc_target: Do not specify some target options redundantly

These values are already inherited

22 months agorustc_target: Add some more target spec sanity checking
Vadim Petrochenkov [Tue, 28 Jun 2022 09:40:39 +0000 (12:40 +0300)]
rustc_target: Add some more target spec sanity checking

22 months agoAuto merge of #100946 - jyn514:query-system-3, r=cjgillot
bors [Sat, 27 Aug 2022 08:53:24 +0000 (08:53 +0000)]
Auto merge of #100946 - jyn514:query-system-3, r=cjgillot

Simplify the arguments to macros generated by the `rustc_queries` proc macro

Very small cleanup. Based on https://github.com/rust-lang/rust/pull/100436 which modifies some of the same code.

r? `@cjgillot`

22 months agoAuto merge of #101074 - JohnTitor:rollup-zwznihq, r=JohnTitor
bors [Sat, 27 Aug 2022 06:12:17 +0000 (06:12 +0000)]
Auto merge of #101074 - JohnTitor:rollup-zwznihq, r=JohnTitor

Rollup of 11 pull requests

Successful merges:

 - #96240 (Stabilize `const_ptr_offset_from`.)
 - #99784 (Make forward compatibility lint deprecated_cfg_attr_crate_type_name deny by default)
 - #100811 (Fix wrong compiletest filters on Windows)
 - #100924 (Smaller improvements of tidy and the unicode generator)
 - #100953 (Update documentation for `write!` and `writeln!`)
 - #101018 (rustdoc: omit start/end tags for empty item description blocks)
 - #101044 (rustdoc: remove unused CSS for `hidden-by-*-hider`)
 - #101046 (rustdoc: remove incorrect CSS selector `.impl-items table td`)
 - #101057 (Merge implementations of HIR fn_decl and fn_sig.)
 - #101062 (rustdoc: remove empty extern_crates and type="text/javascript" on script)
 - #101063 (Merge duplicated CSS rules)

Failed merges:

 - #101055 (Use smaller span for suggestions)

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

22 months agoRollup merge of #101063 - GuillaumeGomez:merge-duplicated-css, r=notriddle
Yuki Okushi [Sat, 27 Aug 2022 04:14:26 +0000 (13:14 +0900)]
Rollup merge of #101063 - GuillaumeGomez:merge-duplicated-css, r=notriddle

Merge duplicated CSS rules

I used the [stylelint](https://stylelint.io/user-guide/configure) tool to check for duplicated CSS rules in order to merge them.

r? `@notriddle`

22 months agoRollup merge of #101062 - notriddle:notriddle/text-javascript, r=GuillaumeGomez
Yuki Okushi [Sat, 27 Aug 2022 04:14:25 +0000 (13:14 +0900)]
Rollup merge of #101062 - notriddle:notriddle/text-javascript, r=GuillaumeGomez

rustdoc: remove empty extern_crates and type="text/javascript" on script

Like #101023, this removes an attribute with a default value.

22 months agoRollup merge of #101057 - cjgillot:one-fn-sig, r=compiler-errors
Yuki Okushi [Sat, 27 Aug 2022 04:14:24 +0000 (13:14 +0900)]
Rollup merge of #101057 - cjgillot:one-fn-sig, r=compiler-errors

Merge implementations of HIR fn_decl and fn_sig.

22 months agoRollup merge of #101046 - notriddle:notriddle/table-css, r=jsha
Yuki Okushi [Sat, 27 Aug 2022 04:14:23 +0000 (13:14 +0900)]
Rollup merge of #101046 - notriddle:notriddle/table-css, r=jsha

rustdoc: remove incorrect CSS selector `.impl-items table td`

Fixes #100994

This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480. The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>.

This rule was added to help with a `<table>` that was used for displaying the function signature [src] lockup. That lockup was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox instead, leaving this selector unused (at least, for its original purpose).

22 months agoRollup merge of #101044 - notriddle:notriddle/css-hidden-by, r=jsha
Yuki Okushi [Sat, 27 Aug 2022 04:14:22 +0000 (13:14 +0900)]
Rollup merge of #101044 - notriddle:notriddle/css-hidden-by, r=jsha

rustdoc: remove unused CSS for `hidden-by-*-hider`

This CSS seems to have become obsolete with the move to `<details>` tags,
and its corresponding JavaScript was removed in aee054d05d8b795d35c0b448a4b731b6507aa459

22 months agoRollup merge of #101018 - notriddle:notriddle/item-right-docblock-short, r=GuillaumeGomez
Yuki Okushi [Sat, 27 Aug 2022 04:14:21 +0000 (13:14 +0900)]
Rollup merge of #101018 - notriddle:notriddle/item-right-docblock-short, r=GuillaumeGomez

rustdoc: omit start/end tags for empty item description blocks

Related to #100952

This is definitely not a complete solution, but it does shrink keysyms/index.html on smithay from 620K to 516K.

22 months agoRollup merge of #100953 - joshtriplett:write-docs, r=Mark-Simulacrum
Yuki Okushi [Sat, 27 Aug 2022 04:14:20 +0000 (13:14 +0900)]
Rollup merge of #100953 - joshtriplett:write-docs, r=Mark-Simulacrum

Update documentation for `write!` and `writeln!`

https://github.com/rust-lang/rust/pull/37472 added this documentation, but it
needs updating:

- Remove some documentation duplicated between `writeln!` and `write!`
- Update `write!` docs: can now import traits as `_` to avoid conflicts
- Expand example to show how to implement qualified trait names

22 months agoRollup merge of #100924 - est31:closure_to_fn_ptr, r=Mark-Simulacrum
Yuki Okushi [Sat, 27 Aug 2022 04:14:19 +0000 (13:14 +0900)]
Rollup merge of #100924 - est31:closure_to_fn_ptr, r=Mark-Simulacrum

Smaller improvements of tidy and the unicode generator

22 months agoRollup merge of #100811 - czzrr:master, r=Mark-Simulacrum
Yuki Okushi [Sat, 27 Aug 2022 04:14:18 +0000 (13:14 +0900)]
Rollup merge of #100811 - czzrr:master, r=Mark-Simulacrum

Fix wrong compiletest filters on Windows

As discussed in [#79334](https://github.com/rust-lang/rust/issues/79334), when calling e.g.
```
python x.py test src/test/ui/expr/compound-assignment/eval-order.rs
```
on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed.

I'm not sure how to organize a test for this. Any suggestions?

22 months agoRollup merge of #99784 - est31:deny_cfg_attr_crate_type_name, r=Mark-Simulacrum
Yuki Okushi [Sat, 27 Aug 2022 04:14:16 +0000 (13:14 +0900)]
Rollup merge of #99784 - est31:deny_cfg_attr_crate_type_name, r=Mark-Simulacrum

Make forward compatibility lint deprecated_cfg_attr_crate_type_name deny by default

Turns the forward compatibility lint added by #83744 to deprecate `cfg_attr` usage with `#![crate_type]` and `#![crate_name]` attributes into deny by default. Copying the example from #83744:

```Rust
#![crate_type = "lib"] // remains working
#![cfg_attr(foo, crate_type = "bin")] // will stop working
```

Over 8 months have passed since #83744 was merged so I'd say this gives ample time for people to have been warned, so we can make the warning stronger. No usage was found via grep.app except for one, which was in an unmaintained code base that didn't seem to be used in the open source eco system. The crater run conducted in #83744 also didn't show up anything.

cc #91632 - tracking issue for the lint

22 months agoRollup merge of #96240 - fee1-dead-contrib:stabilize_const_offset_from, r=Mark-Simulacrum
Yuki Okushi [Sat, 27 Aug 2022 04:14:15 +0000 (13:14 +0900)]
Rollup merge of #96240 - fee1-dead-contrib:stabilize_const_offset_from, r=Mark-Simulacrum

Stabilize `const_ptr_offset_from`.

Stabilization has been completed [here](https://github.com/rust-lang/rust/issues/92980#issuecomment-1065644848) with a FCP.

Closes #92980.

22 months agoAuto merge of #100732 - dpaoliello:import_name_type, r=wesleywiser
bors [Sat, 27 Aug 2022 03:19:12 +0000 (03:19 +0000)]
Auto merge of #100732 - dpaoliello:import_name_type, r=wesleywiser

Implementation of import_name_type

Fixes #96534 by implementing https://github.com/rust-lang/compiler-team/issues/525

Symbols that are exported or imported from a binary on 32bit x86 Windows can be named in four separate ways, corresponding to the [import name types](https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#import-name-type) from the PE-COFF spec. The exporting and importing binaries must use the same name encoding, otherwise mismatches can lead to link failures due to "missing symbols" or to 0xc0000139 (`STATUS_ENTRYPOINT_NOT_FOUND`) errors when the executable/library is loaded. For details, see the comments on the raw-dylib feature's https://github.com/rust-lang/rust/issues/58713. To generate the correct import libraries for these DLLs, therefore, rustc must know the import name type for each `extern` function, and there is currently no way for users to provide this information.

This change adds a new `MetaNameValueStr` key to the `#[link]` attribute called `import_name_type`, and which accepts one of three values: `decorated`, `noprefix`, and `undecorated`.

A single DLL is likely to export all its functions using the same import type name, hence `import_name_type` is a parameter of `#[link]` rather than being its own attribute that is applied per-function. It is possible to have a single DLL that exports different functions using different import name types, but users could express such cases by providing multiple export blocks for the same DLL, each with a different import name type.

Note: there is a fourth import name type defined in the PE-COFF spec, `IMPORT_ORDINAL`. This case is already handled by the `#[link_ordinal]` attribute. While it could be merged into `import_type_name`, that would not make sense as `#[link_ordinal]` provides per-function information (namely the ordinal itself).

Design decisions (these match the MCP linked above):
* For GNU, `decorated` matches the PE Spec and MSVC rather than the default behavior of `dlltool` (i.e., there will be a leading `_` for `stdcall`).
* If `import_name_type` is not present, we will keep our current behavior of matching the environment (MSVC vs GNU) default for decorating.
* Using `import_name_type` on architectures other than 32bit x86 will result in an error.
* Using `import_name_type` with link kinds other than `"raw-dylib"` will result in an error.

22 months agoAuto merge of #101064 - compiler-errors:rollup-fwm5m5f, r=compiler-errors
bors [Sat, 27 Aug 2022 00:38:06 +0000 (00:38 +0000)]
Auto merge of #101064 - compiler-errors:rollup-fwm5m5f, r=compiler-errors

Rollup of 9 pull requests

Successful merges:

 - #100724 (Migrate ast lowering to session diagnostic)
 - #100735 (Migrate `rustc_ty_utils` to `SessionDiagnostic`)
 - #100738 (Diagnostics migr const eval)
 - #100744 (Migrate rustc_mir_dataflow to diagnostic structs)
 - #100776 (Migrate `rustc_lint` errors to `SessionDiagnostic`)
 - #100817 (sugg: suggest the usage of boolean value when there is a typo in the keyword)
 - #100836 (Migrate `rustc_attr` crate diagnostics)
 - #100890 (Migrate rustc_driver to SessionDiagnostic)
 - #100900 (on `region_errors.rs`)

Failed merges:

 - #100831 (Migrate `symbol_mangling` module to new diagnostics structs)

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

22 months agoRollup merge of #100900 - AndyJado:diag-migrate, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:30 +0000 (15:56 -0700)]
Rollup merge of #100900 - AndyJado:diag-migrate, r=davidtwco

on `region_errors.rs`

`@rustbot` label +A-translation

22 months agoRollup merge of #100890 - adriantombu:migrate_diagnostic_rustc_driver, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:29 +0000 (15:56 -0700)]
Rollup merge of #100890 - adriantombu:migrate_diagnostic_rustc_driver, r=davidtwco

Migrate rustc_driver to SessionDiagnostic

First timer noob here 👋🏽 I'm having a problem understanding how I can retrieve the span, and how to properly construct the error structs to avoid the current compilation errors.

Any help pointing me in the right direction would be much appreciated 🙌🏽

22 months agoRollup merge of #100836 - hampuslidin:migrate-attr-crate-diagnostics, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:28 +0000 (15:56 -0700)]
Rollup merge of #100836 - hampuslidin:migrate-attr-crate-diagnostics, r=davidtwco

Migrate `rustc_attr` crate diagnostics

Hi!

This is my first PR to the rustc project, excited to be part of the development! This PR is part of the diagnostics effort, to make diagnostics translatable.

`@rustbot` label +A-translation

22 months agoRollup merge of #100817 - vincenzopalazzo:macros/bool_spelling_sugg, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:26 +0000 (15:56 -0700)]
Rollup merge of #100817 - vincenzopalazzo:macros/bool_spelling_sugg, r=davidtwco

sugg: suggest the usage of boolean value when there is a typo in the keyword

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

This adds a new suggestion when there is a well-known typo

With the following program

```rust
fn main() {
    let x = True;
}
```

Now we have the following suggestion

```
error[E0425]: cannot find value `True` in this scope
 --> test.rs:2:13
  |
2 |     let x = True;
  |             ^^^^ not found in this scope
  |
help: you may want to use a bool value instead
  |
2 |     let x = true;
  |             ~~~~

error: aborting due to previous error
```

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
22 months agoRollup merge of #100776 - Rejyr:diagnostic-migration-rustc-lint, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:25 +0000 (15:56 -0700)]
Rollup merge of #100776 - Rejyr:diagnostic-migration-rustc-lint, r=davidtwco

Migrate `rustc_lint` errors to `SessionDiagnostic`

Draft PR for migrating `rustc_lint` to `SessionDiagnostic`, as part of the [recent blog post](https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html)

22 months agoRollup merge of #100744 - 5225225:migrate-rustc-mir-dataflow, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:24 +0000 (15:56 -0700)]
Rollup merge of #100744 - 5225225:migrate-rustc-mir-dataflow, r=davidtwco

Migrate rustc_mir_dataflow to diagnostic structs

22 months agoRollup merge of #100738 - nidnogg:diagnostics_migr_const_eval, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:23 +0000 (15:56 -0700)]
Rollup merge of #100738 - nidnogg:diagnostics_migr_const_eval, r=davidtwco

Diagnostics migr const eval

This PR should eventually contain all diagnostic migrations for the `rustc_const_eval` crate.

r? `@davidtwco`
`@rustbot` label +A-translation

22 months agoRollup merge of #100735 - Facel3ss1:ty-utils-translation, r=davidtwco
Michael Goulet [Fri, 26 Aug 2022 22:56:22 +0000 (15:56 -0700)]
Rollup merge of #100735 - Facel3ss1:ty-utils-translation, r=davidtwco

Migrate `rustc_ty_utils` to `SessionDiagnostic`

I have migrated the `rustc_ty_utils` crate to use `SessionDiagnostic`, motivated by the [recent blog post about the diagnostic translation effort](https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html).

This is my first PR to the Rust repository, so if I have missed anything, or anything needs to be changed, please let me know! 😄

`@rustbot` label +A-translation

22 months agoRollup merge of #100724 - JeanCASPAR:migrate-ast_lowering-to-session-diagnostic,...
Michael Goulet [Fri, 26 Aug 2022 22:56:21 +0000 (15:56 -0700)]
Rollup merge of #100724 - JeanCASPAR:migrate-ast_lowering-to-session-diagnostic, r=davidtwco

Migrate ast lowering to session diagnostic

I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see https://github.com/rust-lang/rust/pull/100694).

22 months agoMerge duplicated CSS rules
Guillaume Gomez [Fri, 26 Aug 2022 22:37:04 +0000 (00:37 +0200)]
Merge duplicated CSS rules

22 months agorustdoc: remove empty extern_crates and type="text/javascript" on script
Michael Howell [Fri, 26 Aug 2022 21:49:06 +0000 (14:49 -0700)]
rustdoc: remove empty extern_crates and type="text/javascript" on script

Like #101023, this removes an attribute with a default value.

22 months agoAuto merge of #100043 - RalfJung:scalar-always-init, r=RalfJung
bors [Fri, 26 Aug 2022 21:50:09 +0000 (21:50 +0000)]
Auto merge of #100043 - RalfJung:scalar-always-init, r=RalfJung

interpret: remove support for uninitialized scalars

With Miri no longer supporting `-Zmiri-allow-uninit-numbers`, we no longer need to support storing uninit data in a `Scalar`. We anyway already only use this representation for types with *initialized* `Scalar` layout (and we have to, due to partial initialization), so let's get rid of the `ScalarMaybeUninit` type entirely.

I tried to stage this into meaningful commits, but the one that changes `read_immediate` to always trigger UB on uninit is the largest chunk of the PR and I don't see how it could be subdivided.

Fixes https://github.com/rust-lang/miri/issues/2187
r? `@oli-obk`

22 months agoMerge implementations of HIR fn_decl and fn_sig.
Camille GILLOT [Mon, 22 Aug 2022 19:23:09 +0000 (21:23 +0200)]
Merge implementations of HIR fn_decl and fn_sig.

22 months agoAuto merge of #101039 - ouz-a:issue-100991, r=compiler-errors
bors [Fri, 26 Aug 2022 18:53:16 +0000 (18:53 +0000)]
Auto merge of #101039 - ouz-a:issue-100991, r=compiler-errors

Don't catch overflow when running with cargo doc

Fixes #100991

r? `@compiler-errors`

22 months agoDon't catch overflow when running with cargo doc
ouz-a [Fri, 26 Aug 2022 12:41:14 +0000 (15:41 +0300)]
Don't catch overflow when running with cargo doc

22 months agoremove now-unused ScalarMaybeUninit
Ralf Jung [Tue, 2 Aug 2022 01:40:29 +0000 (21:40 -0400)]
remove now-unused ScalarMaybeUninit

22 months agomake read_immediate error immediately on uninit, so ImmTy can carry initialized Scalar
Ralf Jung [Mon, 1 Aug 2022 23:05:20 +0000 (19:05 -0400)]
make read_immediate error immediately on uninit, so ImmTy can carry initialized Scalar

22 months agoremove some now-unnecessary parameters from check_bytes
Ralf Jung [Wed, 27 Jul 2022 01:49:34 +0000 (21:49 -0400)]
remove some now-unnecessary parameters from check_bytes

22 months agoremove enforce_number_init machine hook that Miri no longer needs
Ralf Jung [Wed, 27 Jul 2022 01:45:47 +0000 (21:45 -0400)]
remove enforce_number_init machine hook that Miri no longer needs

22 months agofix an outdated machine hook name
Ralf Jung [Wed, 27 Jul 2022 01:43:17 +0000 (21:43 -0400)]
fix an outdated machine hook name

22 months agoImplementation of import_name_type
Daniel Paoliello [Tue, 12 Jul 2022 20:52:35 +0000 (13:52 -0700)]
Implementation of import_name_type

22 months agorustdoc: remove incorrect CSS selector `.impl-items table td`
Michael Howell [Fri, 26 Aug 2022 15:27:31 +0000 (08:27 -0700)]
rustdoc: remove incorrect CSS selector `.impl-items table td`

Fixes #100994

This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480.
The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>.

This rule was added to help with a `<table>` that was used for displaying the
function signature [src] lockup. That lockup was changed in
34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox instead, leaving this
selector unused (at least, for its original purpose).

22 months agoAuto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
bors [Fri, 26 Aug 2022 15:47:26 +0000 (15:47 +0000)]
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser

session: stabilize split debuginfo on linux

Stabilize the `-Csplit-debuginfo` flag...

- ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance.
- ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable.

22 months agorustdoc: remove unused CSS for `hidden-by-*-hider`
Michael Howell [Fri, 26 Aug 2022 14:34:55 +0000 (07:34 -0700)]
rustdoc: remove unused CSS for `hidden-by-*-hider`

This CSS seems to have become obsolete with the move to `<details>` tags,
and its corresponding JavaScript was removed in aee054d05d8b795d35c0b448a4b731b6507aa459

22 months agoMigrate rustc_ty_utils to use SessionDiagnostic
Peter Medus [Thu, 18 Aug 2022 23:04:31 +0000 (00:04 +0100)]
Migrate rustc_ty_utils to use SessionDiagnostic

22 months agoAuto merge of #101037 - GuillaumeGomez:rollup-opn6kj1, r=GuillaumeGomez
bors [Fri, 26 Aug 2022 13:05:57 +0000 (13:05 +0000)]
Auto merge of #101037 - GuillaumeGomez:rollup-opn6kj1, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #95005 (BTree: evaluate static type-related check at compile time)
 - #99742 (Add comments about stdout locking)
 - #100128 (Document that `RawWakerVTable` functions must be thread-safe.)
 - #100956 (Reduce right-side DOM size)
 - #101006 (Fix doc cfg on reexports)
 - #101012 (rustdoc: remove unused CSS for `.variants_table`)
 - #101023 (rustdoc: remove `type="text/css"` from stylesheet links)
 - #101031 (Remove unused build dependency)

Failed merges:

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

22 months agoRollup merge of #101031 - rust-lang:remove-unused-build-dep, r=bjorn3
Guillaume Gomez [Fri, 26 Aug 2022 12:08:51 +0000 (14:08 +0200)]
Rollup merge of #101031 - rust-lang:remove-unused-build-dep, r=bjorn3

Remove unused build dependency

There is no more `build.rs` so this dependency is unused.

r? `@Dylan-DPC`

22 months agoRollup merge of #101023 - notriddle:notriddle/head-shrink, r=Dylan-DPC
Guillaume Gomez [Fri, 26 Aug 2022 12:08:50 +0000 (14:08 +0200)]
Rollup merge of #101023 - notriddle:notriddle/head-shrink, r=Dylan-DPC

rustdoc: remove `type="text/css"` from stylesheet links

MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>, since "CSS is the only stylesheet language used on the web."

22 months agoRollup merge of #101012 - notriddle:notriddle/variants_table, r=jsha
Guillaume Gomez [Fri, 26 Aug 2022 12:08:49 +0000 (14:08 +0200)]
Rollup merge of #101012 - notriddle:notriddle/variants_table, r=jsha

rustdoc: remove unused CSS for `.variants_table`

Continuation of #100938 and #101010. This rule was added to support the old, table-based style for displaying enum variants, which are now displayed using headers and paragraphs.

22 months agoRollup merge of #101006 - GuillaumeGomez:doc-cfg-reexport, r=notriddle
Guillaume Gomez [Fri, 26 Aug 2022 12:08:48 +0000 (14:08 +0200)]
Rollup merge of #101006 - GuillaumeGomez:doc-cfg-reexport, r=notriddle

Fix doc cfg on reexports

Fixes #83428.

The problem was that the newly inlined item cfg propagation was not working since its real parent is different than its current one.

For the implementation, I decided to put it directly into `CfgPropagation` instead of inside `inline.rs` because I thought it would be simpler to maintain and to not forget if new kind of items are added if it's all done in one place.

r? `@notriddle`

22 months agoRollup merge of #100956 - GuillaumeGomez:reduce-rightside-dom-size, r=notriddle
Guillaume Gomez [Fri, 26 Aug 2022 12:08:47 +0000 (14:08 +0200)]
Rollup merge of #100956 - GuillaumeGomez:reduce-rightside-dom-size, r=notriddle

Reduce right-side DOM size

This is another follow-up of https://github.com/rust-lang/rust/pull/100429 but not in code blocks this time.

So the idea is: if there is only one element in the `.rightside` element, there is no need to wrap it, we can just create one node.

On each page, I run this JS: `document.getElementsByTagName('*').length`. Important to note: the bigger the number of elements inside the page, the greater the gain. It also doesn't work very nicely on std docs because there are a lot of version annotations. So with this PR, It allows to get the following results:

| file name | before this PR | with this PR | diff |
|-|-|-|-|
| std/default/trait.Default.html | 2189 | 1331 | 39.2% |
| std/vec/struct.Vec.html | 14073 | 13842 | 1.7% |
| std/fmt/trait.Debug.html | 5313 | 4907 | 7.7% |
| std/ops/trait.Index.html | 642 | 630 | 1.9% |
| gtk4/WidgetExt | 3269 | 3061 | 6.4% |

You can test it [here](https://rustdoc.crud.net/imperio/reduce-rightsize-dom-size/gtk4/prelude/trait.WidgetExt.html).

r? `@notriddle`

22 months agoRollup merge of #100128 - kpreid:waker-doc, r=thomcc
Guillaume Gomez [Fri, 26 Aug 2022 12:08:45 +0000 (14:08 +0200)]
Rollup merge of #100128 - kpreid:waker-doc, r=thomcc

Document that `RawWakerVTable` functions must be thread-safe.

Also add some intra-doc links and more high-level explanation of how `Waker` is used, while I'm here.

Context: https://internals.rust-lang.org/t/thread-safety-of-rawwakervtables/17126

22 months agoRollup merge of #99742 - sigaloid:master, r=thomcc
Guillaume Gomez [Fri, 26 Aug 2022 12:08:44 +0000 (14:08 +0200)]
Rollup merge of #99742 - sigaloid:master, r=thomcc

Add comments about stdout locking

This is the source of some confusion regarding the `println!` macro:
* https://llogiq.github.io/2017/06/01/perf-pitfalls.html#unbuffered-io
* https://news.ycombinator.com/item?id=18794930
* https://reddit.com/r/rust/comments/5puyx2/why_is_println_so_slow/dcua5g5/
* https://reddit.com/r/rust/comments/ab7hsi/comparing_pythagorean_triples_in_c_d_and_rust/ecy7ql8/

In some of these cases it's not the locking behavior where the bottleneck lies, but it's still mentioned as a surprise when, eg, benchmarking a million `println!`'s in a very tight loop.

If there's any stylistic problems please feel free to correct me! This is my first contribution and I want to get it right :crab:

22 months agoRollup merge of #95005 - ssomers:btree_static_assert, r=thomcc
Guillaume Gomez [Fri, 26 Aug 2022 12:08:43 +0000 (14:08 +0200)]
Rollup merge of #95005 - ssomers:btree_static_assert, r=thomcc

BTree: evaluate static type-related check at compile time

`assert`s like the ones replaced here would only go off when you run the right test cases, if the code were ever incorrectly changed such that rhey would trigger. But [inspired on a nice forum question](https://users.rust-lang.org/t/compile-time-const-generic-parameter-check/69202), they can be checked at compile time.

22 months agoAuto merge of #100944 - nnethercote:shrink-thir-Expr, r=cjgillot
bors [Fri, 26 Aug 2022 10:00:27 +0000 (10:00 +0000)]
Auto merge of #100944 - nnethercote:shrink-thir-Expr, r=cjgillot

Shrink `thir::Expr`

r? `@cjgillot`

22 months agoRemove unused build dependency
Guillaume Gomez [Fri, 26 Aug 2022 09:18:48 +0000 (11:18 +0200)]
Remove unused build dependency

22 months agoAuto merge of #100705 - compiler-errors:issue-100620, r=oli-obk
bors [Fri, 26 Aug 2022 06:05:06 +0000 (06:05 +0000)]
Auto merge of #100705 - compiler-errors:issue-100620, r=oli-obk

Avoid reporting overflow in `is_impossible_method`

Fixes #100620

We're evaluating a new predicate in a different param-env than it was checked during typeck, so be more careful about handling overflow errors. Instead of using `FulfillmentCtxt`, using `InferCtxt::evaluate_obligation` by itself will give us back the overflow error, so we can throw it away properly.

This may give us more false-positives, but it doesn't regress the `<HashMap as Iterator>::rev` example that originally motivated adding `is_impossible_method` in the first place.

22 months agorustdoc: remove `type="text/css" from stylesheet links
Michael Howell [Fri, 26 Aug 2022 04:28:20 +0000 (21:28 -0700)]
rustdoc: remove `type="text/css" from stylesheet links

MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>,
since "CSS is the only stylesheet language used on the web."

22 months agorustdoc: omit start/end tags for empty item description blocks
Michael Howell [Fri, 26 Aug 2022 00:41:25 +0000 (17:41 -0700)]
rustdoc: omit start/end tags for empty item description blocks

Related to #100952

This is definitely not a complete solution, but it does shrink
keysyms/index.html on smithay from 620K to 516K.

22 months agoAuto merge of #101017 - JohnTitor:rollup-73f2fhb, r=JohnTitor
bors [Fri, 26 Aug 2022 03:23:54 +0000 (03:23 +0000)]
Auto merge of #101017 - JohnTitor:rollup-73f2fhb, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #99064 (distinguish the method and associated function diagnostic information)
 - #99920 (Custom allocator support in `rustc_serialize`)
 - #100034 ( Elaborate all box dereferences in `ElaborateBoxDerefs`)
 - #100076 (make slice::{split_at,split_at_unchecked} const functions)
 - #100604 (Remove unstable Result::into_ok_or_err)
 - #100933 (Reduce code size of `assert_matches_failed`)
 - #100978 (Handle `Err` in `ast::LitKind::to_token_lit`.)
 - #101010 (rustdoc: remove unused CSS for `.multi-column`)

Failed merges:

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

22 months agodiag-mig
AndyJado [Fri, 26 Aug 2022 02:32:59 +0000 (10:32 +0800)]
diag-mig

22 months agoRollup merge of #101010 - notriddle:notriddle/multi-column, r=jsha
Yuki Okushi [Fri, 26 Aug 2022 00:51:47 +0000 (09:51 +0900)]
Rollup merge of #101010 - notriddle:notriddle/multi-column, r=jsha

rustdoc: remove unused CSS for `.multi-column`

As a sanity check, [this tool] can be used to run a CSS query across an HTML tree to detect if a selector ever matches (I use compiler-docs and std docs). This isn't good enough, because I also need to account for JavaScript, but this class is never mentioned in any of the JS files, either.

According to [blame], this class was added when rustdoc was first written, and, as far as I can tell, was never actually used.

[this tool]: https://gitlab.com/notriddle/html-scanner
[blame]: https://github.com/rust-lang/rust/blame/4d45b0745ab227feb9000bc15713ade4b99241ea/src/librustdoc/html/static/css/rustdoc.css#L753-L761

22 months agoRollup merge of #100978 - nnethercote:fix-100948, r=petrochenkov
Yuki Okushi [Fri, 26 Aug 2022 00:51:46 +0000 (09:51 +0900)]
Rollup merge of #100978 - nnethercote:fix-100948, r=petrochenkov

Handle `Err` in `ast::LitKind::to_token_lit`.

Fixes #100948.

r? ``@petrochenkov``

22 months agoRollup merge of #100933 - a1phyr:cheap_assert_match_failed, r=JoshTriplett
Yuki Okushi [Fri, 26 Aug 2022 00:51:45 +0000 (09:51 +0900)]
Rollup merge of #100933 - a1phyr:cheap_assert_match_failed, r=JoshTriplett

Reduce code size of `assert_matches_failed`

Using `write_str` instead of `<str as Display>::fmt` avoids the `pad` function which is very expensive to have in size-constrained code.

22 months agoRollup merge of #100604 - dtolnay:okorerr, r=m-ou-se
Yuki Okushi [Fri, 26 Aug 2022 00:51:44 +0000 (09:51 +0900)]
Rollup merge of #100604 - dtolnay:okorerr, r=m-ou-se

Remove unstable Result::into_ok_or_err

Pending FCP: https://github.com/rust-lang/rust/issues/82223#issuecomment-1214920203

```@rustbot``` label +waiting-on-fcp

22 months agoRollup merge of #100076 - tspiteri:const_slice_split_at, r=oli-obk
Yuki Okushi [Fri, 26 Aug 2022 00:51:43 +0000 (09:51 +0900)]
Rollup merge of #100076 - tspiteri:const_slice_split_at, r=oli-obk

make slice::{split_at,split_at_unchecked} const functions

Now that `slice::from_raw_parts` is const in stable 1.64, it makes sense to have `split_at` const as well, otherwise unsafe code is required to achieve a const equivalent.

22 months agoRollup merge of #100034 - tmiasko:elaborate-box-derefs, r=oli-obk
Yuki Okushi [Fri, 26 Aug 2022 00:51:42 +0000 (09:51 +0900)]
Rollup merge of #100034 - tmiasko:elaborate-box-derefs, r=oli-obk

 Elaborate all box dereferences in `ElaborateBoxDerefs`

so that it is the only pass responsible for elaboration, instead of
splitting this responsibility between the `StateTransform` and
`ElaborateBoxDerefs`.

22 months agoRollup merge of #99920 - emarteca:custom-allocator-support, r=oli-obk
Yuki Okushi [Fri, 26 Aug 2022 00:51:41 +0000 (09:51 +0900)]
Rollup merge of #99920 - emarteca:custom-allocator-support, r=oli-obk

Custom allocator support in `rustc_serialize`

Adding support for `rustc_serialize` encode/decode for `Box` and `Vec` that use a custom allocator.

22 months agoRollup merge of #99064 - lyming2007:issue-97687-fix, r=estebank
Yuki Okushi [Fri, 26 Aug 2022 00:51:40 +0000 (09:51 +0900)]
Rollup merge of #99064 - lyming2007:issue-97687-fix, r=estebank

distinguish the method and associated function diagnostic information

Methods are defined within the context of a struct and their first parameter is always self
Associated functions don’t take self as a parameter
```
modified:   compiler/rustc_typeck/src/check/method/suggest.rs
modified:   src/test/ui/auto-ref-slice-plus-ref.stderr
modified:   src/test/ui/block-result/issue-3563.stderr
modified:   src/test/ui/issues/issue-28344.stderr
modified:   src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr
modified:   src/test/ui/suggestions/suggest-methods.stderr
modified:   src/test/ui/traits/trait-upcasting/subtrait-method.stderr
```

22 months agoAuto merge of #99487 - bmacnaughton:is_whitespace_updates, r=thomcc
bors [Fri, 26 Aug 2022 00:42:40 +0000 (00:42 +0000)]
Auto merge of #99487 - bmacnaughton:is_whitespace_updates, r=thomcc

is_whitespace() performance improvements

This is my first rust PR, so if I miss anything obvious please let me know and I'll do my best to fix it.

This was a bit more of a challenge than I realized because, while I made working code locally and tested it against the native `is_whitespace()`, this PR required changing `src/tools/unicode-table-generator`, the code that generated the code.

I have benchmarked this locally, using criterion, and have seen meaningful performance improvements. I can add those outputs to this if you'd like, but am guessing that the perf run that `@fmease` recommended is what's needed.

I have run ` ./x.py test --stage 0 library/std` after building it locally after executing `./x.py build library`. I didn't try to build the whole compiler, but maybe I should have - any guidance would be appreciated.

If this general approach makes sense, I'll take a look at some other candidate categories, e.g., `Cc`, in the future.

Oh, and I wasn't sure whether the generated code should be included in this PR or not. I did include it.

22 months agorustdoc: remove unused CSS for `.variants_table`
Michael Howell [Thu, 25 Aug 2022 21:27:40 +0000 (14:27 -0700)]
rustdoc: remove unused CSS for `.variants_table`

Continuation of #100938 and #101010. This rule was added to support the old,
table-based style for displaying enum variants, which are now displayed using
headers and paragraphs.

22 months agoAuto merge of #100748 - SparrowLii:query_depth, r=cjgillot
bors [Thu, 25 Aug 2022 21:27:38 +0000 (21:27 +0000)]
Auto merge of #100748 - SparrowLii:query_depth, r=cjgillot

add `depth_limit` in `QueryVTable` to avoid entering a new tcx in `layout_of`

Fixes #49735
Updates #48685

The `layout_of` query needs to check whether it overflows the depth limit, and the current implementation needs to create a new `ImplicitCtxt` inside `layout_of`. However, `start_query` will already create a new `ImplicitCtxt`, so we can check the depth limit in `start_query`.

We can tell whether we need to check the depth limit simply by whether the return value of `to_debug_str` of the query is `layout_of`. But I think adding the `depth_limit` field in `QueryVTable` may be more elegant and more scalable.

22 months agoAdding support for rustc_serialize encode and decode for Box and Vec that use a custo...
Ellen Arteca [Thu, 25 Aug 2022 20:19:18 +0000 (20:19 +0000)]
Adding support for rustc_serialize encode and decode for Box and Vec that use a custom allocator

22 months agorustdoc: remove unused CSS for `.multi-column`
Michael Howell [Thu, 25 Aug 2022 18:43:36 +0000 (11:43 -0700)]
rustdoc: remove unused CSS for `.multi-column`

As a sanity check, [this tool] can be used to run a CSS query across an HTML
tree to detect if a selector ever matches (I use compiler-docs and std
docs). This isn't good enough, because I also need to account for JavaScript,
but this class is never mentioned in any of the JS files, either.

According to [blame], this class was added when rustdoc was first written,
and, as far as I can tell, was never actually used.

[this tool]: https://gitlab.com/notriddle/html-scanner
[blame]: https://github.com/rust-lang/rust/blame/4d45b0745ab227feb9000bc15713ade4b99241ea/src/librustdoc/html/static/css/rustdoc.css#L753-L761

22 months agoAuto merge of #100911 - tmiasko:update-stdarch, r=Amanieu
bors [Thu, 25 Aug 2022 18:17:42 +0000 (18:17 +0000)]
Auto merge of #100911 - tmiasko:update-stdarch, r=Amanieu

Update stdarch submodule

Changes from stdarch:

* Fix links in documentation of cmpxchg16b
* Use load intrinsic and loop for intrinsic-test programs. Add --release flag back to intrinsic-test programs.
* Properly fix vext intrinsic tests
* Replace some calls to `pointer::offset` with `add` and `sub`
* Allow internal use of stdsimd from detect_feature
* fix target name in contributing.md
* Tweak constant for ARM vext instruction tests
* Use `llvm.ppc.altivec.lvx` intrinsic for `vec_ld`
*  Adding doc links for arm neon intrinsics
* Adding doc links for arm crypto and aes intrinsics
* Remove instruction tests for `__mmask*` intrinsics
* Update ubuntu 21.10 docker containers to 22.04
* Adding documentation links for arm crc32 intrinsics
* Remove restrictions on compare-exchange memory ordering.
* Fix a typo in the document.
* Allow mapping a runtime feature to a set of target_features
* Update atomic intrinsics
* Fully qualify recursive macro calls
* Ensure the neon vector aggregates like `float32x4x4_t` are `#[repr(C)]`
* Remove useless conditional compilation
* Fix ARM vbsl* NEON intrinsics

r? `@Amanieu`

22 months agoAdd test for missing cfg propagation for reexport
Guillaume Gomez [Thu, 25 Aug 2022 14:42:51 +0000 (16:42 +0200)]
Add test for missing cfg propagation for reexport

22 months agoFix missing cfg propagation for reexports
Guillaume Gomez [Thu, 25 Aug 2022 14:42:17 +0000 (16:42 +0200)]
Fix missing cfg propagation for reexports

22 months agoCode cleaning
Adrian Tombu [Thu, 25 Aug 2022 17:04:00 +0000 (19:04 +0200)]
Code cleaning

22 months agoReplace spaghetti with a simple errors enum
Adrian Tombu [Thu, 25 Aug 2022 16:05:23 +0000 (18:05 +0200)]
Replace spaghetti with a simple errors enum

22 months agoStart adding enum errors for deserialize_rlink
Adrian Tombu [Wed, 24 Aug 2022 17:15:44 +0000 (19:15 +0200)]
Start adding enum errors for deserialize_rlink

22 months agoUse std::io::Error and remove useless to_string
Adrian Tombu [Wed, 24 Aug 2022 12:12:39 +0000 (14:12 +0200)]
Use std::io::Error and remove useless to_string

22 months agoFixes fmt & SessionDiagnostic structs
Adrian Tombu [Tue, 23 Aug 2022 16:48:46 +0000 (18:48 +0200)]
Fixes fmt & SessionDiagnostic structs

22 months agoStart moving rustc_driver to SessionDiagnostic
Adrian Tombu [Mon, 22 Aug 2022 21:43:09 +0000 (23:43 +0200)]
Start moving rustc_driver to SessionDiagnostic

22 months agoreview
Trevor Spiteri [Thu, 25 Aug 2022 10:54:30 +0000 (12:54 +0200)]
review

22 months agoInline trivial `From<Local> for Place<'_>` impl
Tomasz Miąsko [Thu, 25 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Inline trivial `From<Local> for Place<'_>` impl

22 months agoAdd method that applies DefUse effect
Tomasz Miąsko [Thu, 25 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Add method that applies DefUse effect

22 months agoElaborate all box dereferences in `ElaborateBoxDerefs`
Tomasz Miąsko [Mon, 1 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Elaborate all box dereferences in `ElaborateBoxDerefs`

so that it is the only pass responsible for elaboration, instead of
splitting this responsibility between the `StateTransform` and
`ElaborateBoxDerefs`.

22 months agoAuto merge of #100571 - cjgillot:mir-cost-visit, r=compiler-errors
bors [Thu, 25 Aug 2022 08:16:43 +0000 (08:16 +0000)]
Auto merge of #100571 - cjgillot:mir-cost-visit, r=compiler-errors

Check projection types before inlining MIR

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

I'm very unhappy with this solution, having to duplicate MIR validation code, but at least it removes the ICE.

r? `@compiler-errors`

22 months agoDo not include `const_ptr_sub_ptr` in this stabilization
Deadbeef [Thu, 12 May 2022 06:48:46 +0000 (16:48 +1000)]
Do not include `const_ptr_sub_ptr` in this stabilization

22 months agoStabilize `const_ptr_offset_from`.
Deadbeef [Wed, 20 Apr 2022 04:42:18 +0000 (14:42 +1000)]
Stabilize `const_ptr_offset_from`.

Stabilization has been completed [here](https://github.com/rust-lang/rust/issues/92980#issuecomment-1065644848)
with a FCP.

22 months agoAuto merge of #100436 - jyn514:macro-query-system, r=cjgillot
bors [Thu, 25 Aug 2022 05:35:27 +0000 (05:35 +0000)]
Auto merge of #100436 - jyn514:macro-query-system, r=cjgillot

try and simplify some things in the query system

22 months agoFix liveness analysis for yield terminators
Tomasz Miąsko [Mon, 1 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Fix liveness analysis for yield terminators

A resume place is evaluated and assigned to only after a yield
terminator resumes. Ensure that locals used when evaluating the
resume place are live across the yield.

22 months agoAuto merge of #100977 - JohnTitor:rollup-8hc7rxh, r=JohnTitor
bors [Thu, 25 Aug 2022 02:32:11 +0000 (02:32 +0000)]
Auto merge of #100977 - JohnTitor:rollup-8hc7rxh, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #99332 (Stabilize `#![feature(label_break_value)]`)
 - #99954 (let-else: break out to one scope higher for let-else)
 - #100188 (Parser will not suggest invalid expression when use public)
 - #100780 (save_analysis: Migrate diagnostic)
 - #100808 (Migrate `rustc_interface` diagnostics )
 - #100921 (Add a warning about `Option/Result::and()` being eagerly evaluated)
 - #100960 (rustdoc: ayu code color selector more specific)
 - #100964 (Sync rustc_codegen_cranelift)

Failed merges:

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

22 months agoHandle `Err` in `ast::LitKind::to_token_lit`.
Nicholas Nethercote [Wed, 24 Aug 2022 23:41:48 +0000 (09:41 +1000)]
Handle `Err` in `ast::LitKind::to_token_lit`.

Fixes #100948.

22 months agoAuto merge of #99946 - tmiasko:elide-storage-makers, r=oli-obk
bors [Wed, 24 Aug 2022 23:51:06 +0000 (23:51 +0000)]
Auto merge of #99946 - tmiasko:elide-storage-makers, r=oli-obk

Elide superfluous storage markers

Follow the existing strategy of omitting the storage markers for temporaries
introduced for internal usage when elaborating derefs and deref projections.

Those temporaries are simple scalars which are used immediately after being
defined and never have their address taken. There is no benefit from storage
markers from either liveness analysis or code generation perspective.

22 months agoRollup merge of #100964 - bjorn3:sync_cg_clif-2022-08-24, r=bjorn3
Yuki Okushi [Wed, 24 Aug 2022 23:51:01 +0000 (08:51 +0900)]
Rollup merge of #100964 - bjorn3:sync_cg_clif-2022-08-24, r=bjorn3

Sync rustc_codegen_cranelift

The main highlights this time are support for parallel compilation of codegen units (by me) and improved windows support (by ``@afonso360)`` In addition ``@afonso360`` added abi-checker to cg_clif's CI. This has already catched an abi compatibility issue with AArch64. The fix has landed on Cranelift's main branch, but doesn't yet have a release. ``@uweigand`` also submitted a couple of PR's that will are prerequisites for supporting IBM's s390x architecture.

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler

22 months agoRollup merge of #100960 - rust-lang:notriddle/ayu-span-code, r=GuillaumeGomez
Yuki Okushi [Wed, 24 Aug 2022 23:51:00 +0000 (08:51 +0900)]
Rollup merge of #100960 - rust-lang:notriddle/ayu-span-code, r=GuillaumeGomez

rustdoc: ayu code color selector more specific

According to https://github.com/rust-lang/rust/pull/100960#issuecomment-1225970579, this selector is only really intended to apply to item info. However, it's so broad that it's hard to tell when it deliberately applies vs where it accidentally applies.

22 months agoRollup merge of #100921 - ChayimFriedman2:and-eager-eval, r=JohnTitor
Yuki Okushi [Wed, 24 Aug 2022 23:50:59 +0000 (08:50 +0900)]
Rollup merge of #100921 - ChayimFriedman2:and-eager-eval, r=JohnTitor

Add a warning about `Option/Result::and()` being eagerly evaluated

Copied from `or()`.

Inspired by [this StackOverflow question](https://stackoverflow.com/questions/73461846/why-is-in-rust-the-expression-in-option-and-evaluated-if-option-is-none).

[The PR for `or()`](https://github.com/rust-lang/rust/pull/46548) mentions the Clippy lint `or_fun_call` which doesn't exist for `and()` (although there is `unnecessary_lazy_evaluations`). I still think this warning is also good for `and()`. Feel free to close if you disagree.

22 months agoRollup merge of #100808 - SkiFire13:migrate_diagnostics_rustc_interface, r=davidtwco
Yuki Okushi [Wed, 24 Aug 2022 23:50:58 +0000 (08:50 +0900)]
Rollup merge of #100808 - SkiFire13:migrate_diagnostics_rustc_interface, r=davidtwco

Migrate `rustc_interface` diagnostics

``@rustbot`` label +A-translation

r? rust-lang/diagnostics
cc #100717

22 months agoRollup merge of #100780 - wonchulee:translation_save_analysis, r=davidtwco
Yuki Okushi [Wed, 24 Aug 2022 23:50:57 +0000 (08:50 +0900)]
Rollup merge of #100780 - wonchulee:translation_save_analysis, r=davidtwco

save_analysis: Migrate diagnostic

* Migrate the `rustc_save_analysis` crate's diagnostic to translatable diagnostic structs.

Depends on https://github.com/rust-lang/rust/pull/100694 and https://github.com/rust-lang/rust/pull/100754 for #[fatal(..)] support, then https://github.com/rust-lang/rust/commit/aa68eb4179881ed25106e675a6a224746f8fad5f, https://github.com/rust-lang/rust/commit/f5219a396083b764f3741e9e105685323a745ce8, https://github.com/rust-lang/rust/commit/7da52f694a4ff7c4b9870415584f2c86cec5ce62 can be removed. (I copied commits from https://github.com/rust-lang/rust/pull/100754)

22 months agoRollup merge of #100188 - chenyukang:fix-issue-100165, r=estebank
Yuki Okushi [Wed, 24 Aug 2022 23:50:56 +0000 (08:50 +0900)]
Rollup merge of #100188 - chenyukang:fix-issue-100165, r=estebank

Parser will not suggest invalid expression when use public

Fixes #100165