]> git.lizzy.rs Git - rust.git/log
rust.git
17 months agoRollup merge of #107239 - tmiasko:tests, r=Mark-Simulacrum
Matthias Krüger [Wed, 25 Jan 2023 21:19:53 +0000 (22:19 +0100)]
Rollup merge of #107239 - tmiasko:tests, r=Mark-Simulacrum

Bring tests back into rustc source tarball

They were missing after recent move from src/test to tests.

cc ```@albertlarsan68```

Fixes #107081

17 months agoRollup merge of #106944 - Nilstrieb:there-once-was-a-diagnostic, r=WaffleLapkin
Matthias Krüger [Wed, 25 Jan 2023 21:19:52 +0000 (22:19 +0100)]
Rollup merge of #106944 - Nilstrieb:there-once-was-a-diagnostic, r=WaffleLapkin

Suggest using a lock for `*Cell: Sync` bounds

I mostly did this for `OnceCell<T>` at first because users will be confused to see that the `OnceCell<T>` in `std` isn't `Sync` but then extended it to `Cell<T>` and `RefCell<T>` as well.

17 months agoRollup merge of #106897 - estebank:issue-99430, r=davidtwco
Matthias Krüger [Wed, 25 Jan 2023 21:19:52 +0000 (22:19 +0100)]
Rollup merge of #106897 - estebank:issue-99430, r=davidtwco

Tweak E0597

CC #99430

17 months agoRollup merge of #105345 - yanchen4791:issue-103582-fix, r=jackh726
Matthias Krüger [Wed, 25 Jan 2023 21:19:51 +0000 (22:19 +0100)]
Rollup merge of #105345 - yanchen4791:issue-103582-fix, r=jackh726

Add hint for missing lifetime bound on trait object when type alias is used

Fix issue #103582.

The problem: When a type alias is used to specify the return type of the method in a trait impl, the suggestion for fixing the problem of "missing lifetime bound on trait object" of the trait impl will not be created. The issue caused by the code which searches for the return trait objects when constructing the hint suggestion is not able to find the trait objects since they are specified in the type alias path instead of the return path of the trait impl.

The solution: Trace the trait objects in the type alias path and provide them along with the alias span to generate the suggestion in case the type alias is used in return type of the method in the trait impl.

17 months agoAuto merge of #103902 - vincenzopalazzo:macros/obligation_rulesv2, r=oli-obk
bors [Wed, 25 Jan 2023 16:39:29 +0000 (16:39 +0000)]
Auto merge of #103902 - vincenzopalazzo:macros/obligation_rulesv2, r=oli-obk

use `LocalDefId` instead of `HirId` in trait resolution to simplify the obligation clause resolution

This commit introduces a refactoring suggested by `@lcnr` to simplify the obligation clause resolution.

This is just the first PR that introduces a type of refactoring, but others PRs will follow this to introduce name changing to change from the variable name from `body_id` to something else.

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

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
`@rustbot` r? `@lcnr`

17 months agoAuto merge of #107290 - Dylan-DPC:rollup-tovojhr, r=Dylan-DPC
bors [Wed, 25 Jan 2023 13:58:41 +0000 (13:58 +0000)]
Auto merge of #107290 - Dylan-DPC:rollup-tovojhr, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #105552 (Add help message about function pointers)
 - #106583 (Suggest coercion of `Result` using `?`)
 - #106767 (Allow setting CFG_DISABLE_UNSTABLE_FEATURES to 0)
 - #106823 (Allow fmt::Arguments::as_str() to return more Some(_).)
 - #107166 (rustc_metadata: Support non-`Option` nullable values in metadata tables)
 - #107213 (Add suggestion to remove if in let..else block)
 - #107223 (`sub_ptr()` is equivalent to `usize::try_from().unwrap_unchecked()`, not `usize::from().unwrap_unchecked()`)
 - #107227 (`new_outside_solver` ->  `evaluate_root_goal`)
 - #107232 (rustdoc: simplify settings popover DOM, CSS, JS)

Failed merges:

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

17 months agoRollup merge of #107232 - notriddle:notriddle/settings-choice, r=GuillaumeGomez
Dylan DPC [Wed, 25 Jan 2023 11:31:44 +0000 (17:01 +0530)]
Rollup merge of #107232 - notriddle:notriddle/settings-choice, r=GuillaumeGomez

rustdoc: simplify settings popover DOM, CSS, JS

* Change the class names so that they all start with `setting-`. That should make it harder to accidentally use a setting class outside the settings popover, where loading the CSS might accidentally change the styles of something unrelated.
* Get rid of an unnecessary wrapper DIV around the radio button line.
* Simplify CSS selectors by making the DOM easier and more intuitive to target.
* Remove dead settings JS for obsolete select-wrapper

17 months agoRollup merge of #107227 - lcnr:solver-new-external-api, r=compiler-errors
Dylan DPC [Wed, 25 Jan 2023 11:31:44 +0000 (17:01 +0530)]
Rollup merge of #107227 - lcnr:solver-new-external-api, r=compiler-errors

`new_outside_solver` ->  `evaluate_root_goal`

r? ```@rust-lang/initiative-trait-system-refactor```

17 months agoRollup merge of #107223 - ChayimFriedman2:patch-5, r=WaffleLapkin
Dylan DPC [Wed, 25 Jan 2023 11:31:43 +0000 (17:01 +0530)]
Rollup merge of #107223 - ChayimFriedman2:patch-5, r=WaffleLapkin

`sub_ptr()` is equivalent to `usize::try_from().unwrap_unchecked()`, not `usize::from().unwrap_unchecked()`

`usize::from()` gives a `usize`, not `Result<usize>`, and `usize: From<isize>` is not implemented.

17 months agoRollup merge of #107213 - edward-shen:edward-shen/fix-accidental-let-else, r=compiler...
Dylan DPC [Wed, 25 Jan 2023 11:31:43 +0000 (17:01 +0530)]
Rollup merge of #107213 - edward-shen:edward-shen/fix-accidental-let-else, r=compiler-errors

Add suggestion to remove if in let..else block

Adds an additional hint to failures where we encounter an else keyword while we're parsing an if-let expression.

This is likely that the user has accidentally mixed if-let and let..else together.

Fixes #103791.

17 months agoRollup merge of #107166 - petrochenkov:nooptable, r=oli-obk
Dylan DPC [Wed, 25 Jan 2023 11:31:42 +0000 (17:01 +0530)]
Rollup merge of #107166 - petrochenkov:nooptable, r=oli-obk

rustc_metadata: Support non-`Option` nullable values in metadata tables

This is a convenience feature for cases in which "no value in the table" and "default value in the table" are equivalent.
Tables using `Table<DefIndex, ()>` are migrated in this PR, some other cases can be migrated later.
This helps `DocFlags` in https://github.com/rust-lang/rust/pull/107136 in particular.

17 months agoRollup merge of #106823 - m-ou-se:format-args-as-str-guarantees, r=dtolnay
Dylan DPC [Wed, 25 Jan 2023 11:31:42 +0000 (17:01 +0530)]
Rollup merge of #106823 - m-ou-se:format-args-as-str-guarantees, r=dtolnay

Allow fmt::Arguments::as_str() to return more Some(_).

This adjusts the documentation to allow optimization of format_args!() to be visible through fmt::Arguments::as_str().

This allows for future changes like https://github.com/rust-lang/rust/pull/106824.

17 months agoRollup merge of #106767 - chbaker0:disable-unstable-features, r=Mark-Simulacrum
Dylan DPC [Wed, 25 Jan 2023 11:31:41 +0000 (17:01 +0530)]
Rollup merge of #106767 - chbaker0:disable-unstable-features, r=Mark-Simulacrum

Allow setting CFG_DISABLE_UNSTABLE_FEATURES to 0

Two locations check whether this build-time environment variable is defined. Allowing it to be explicitly disabled with a "0" value is useful, especially for integrating with external build systems.

17 months agoRollup merge of #106583 - estebank:suggest-result-coercion, r=compiler-errors
Dylan DPC [Wed, 25 Jan 2023 11:31:40 +0000 (17:01 +0530)]
Rollup merge of #106583 - estebank:suggest-result-coercion, r=compiler-errors

Suggest coercion of `Result` using `?`

Fix #47560.

17 months agoRollup merge of #105552 - mattjperez:add-incompatible-types-note, r=compiler-errors
Dylan DPC [Wed, 25 Jan 2023 11:31:40 +0000 (17:01 +0530)]
Rollup merge of #105552 - mattjperez:add-incompatible-types-note, r=compiler-errors

Add help message about function pointers

#102608

17 months agoAuto merge of #107277 - weihanglo:update-cargo, r=weihanglo
bors [Wed, 25 Jan 2023 10:27:52 +0000 (10:27 +0000)]
Auto merge of #107277 - weihanglo:update-cargo, r=weihanglo

Update cargo

11 commits in 985d561f0bb9b76ec043a2b12511790ec7a2b954..3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c 2023-01-20 14:39:28 +0000 to 2023-01-24 15:48:15 +0000

- Add a note about verifying your email address on crates.io (rust-lang/cargo#11620)
- Improve CI caching by skipping mtime checks for paths in $CARGO_HOME (rust-lang/cargo#11613)
- test: Update for clap 4.1.3 (rust-lang/cargo#11619)
- Fix unused attribute on Windows. (rust-lang/cargo#11614)
- [Doc]: Added links to the `Target` section of the glossary for occurences of `target triple` (rust-lang/cargo#11603)
- feat: stabilize auto fix note (rust-lang/cargo#11558)
- Clarify the difference between CARGO_CRATE_NAME and CARGO_PKG_NAME (rust-lang/cargo#11576)
- Temporarily pin libgit2-sys. (rust-lang/cargo#11609)
- Disable network SSH tests on windows. (rust-lang/cargo#11610)
- fix(toml): Add `default-features` to `TomlWorkspaceDependency` (rust-lang/cargo#11409)
- doc(contrib): remove rls in release process (rust-lang/cargo#11601)

r? `@ghost`

17 months agoAuto merge of #107275 - calebcartwright:sync-from-rustfmt, r=calebcartwright
bors [Wed, 25 Jan 2023 04:49:08 +0000 (04:49 +0000)]
Auto merge of #107275 - calebcartwright:sync-from-rustfmt, r=calebcartwright

Sync rustfmt subtree

17 months agoUpdate cargo
Weihang Lo [Tue, 24 Jan 2023 20:34:33 +0000 (20:34 +0000)]
Update cargo

11 commits in 985d561f0bb9b76ec043a2b12511790ec7a2b954..3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c
2023-01-20 14:39:28 +0000 to 2023-01-24 15:48:15 +0000

- Add a note about verifying your email address on crates.io (rust-lang/cargo#11620)
- Improve CI caching by skipping mtime checks for paths in $CARGO_HOME (rust-lang/cargo#11613)
- test: Update for clap 4.1.3 (rust-lang/cargo#11619)
- Fix unused attribute on Windows. (rust-lang/cargo#11614)
- [Doc]: Added links to the `Target` section of the glossary for occurences of `target triple` (rust-lang/cargo#11603)
- feat: stabilize auto fix note (rust-lang/cargo#11558)
- Clarify the difference between CARGO_CRATE_NAME and CARGO_PKG_NAME (rust-lang/cargo#11576)
- Temporarily pin libgit2-sys. (rust-lang/cargo#11609)
- Disable network SSH tests on windows. (rust-lang/cargo#11610)
- fix(toml): Add `default-features` to `TomlWorkspaceDependency` (rust-lang/cargo#11409)
- doc(contrib): remove rls in release process (rust-lang/cargo#11601)

17 months agoupdate rustfmt subtree version in lockfile
Caleb Cartwright [Tue, 24 Jan 2023 20:21:14 +0000 (14:21 -0600)]
update rustfmt subtree version in lockfile

17 months agoMerge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt
Caleb Cartwright [Tue, 24 Jan 2023 20:16:03 +0000 (14:16 -0600)]
Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt

17 months agochore: prep v1.5.2 release
Caleb Cartwright [Tue, 24 Jan 2023 19:08:52 +0000 (13:08 -0600)]
chore: prep v1.5.2 release

17 months agoAdd suggestions for function pointers
Matthew J Perez [Sun, 11 Dec 2022 07:49:07 +0000 (02:49 -0500)]
Add suggestions for function pointers

- On compiler-error's suggestion of moving this lower down the stack,
along the path of `report_mismatched_types()`, which is used
by `rustc_hir_analysis` and `rustc_hir_typeck`.
- update ui tests, add test
- add suggestions for references to fn pointers
- modify `TypeErrCtxt::same_type_modulo_infer` to take `T: relate::Relate` instead of `Ty`

17 months agofix: version gate changes for multiline single generic bound
Caleb Cartwright [Tue, 24 Jan 2023 17:13:54 +0000 (11:13 -0600)]
fix: version gate changes for multiline single generic bound

17 months agoAdd suggestion to remove if in let...else block
Edward Shen [Tue, 24 Jan 2023 04:31:45 +0000 (20:31 -0800)]
Add suggestion to remove if in let...else block

Adds an additional hint to failures where we encounter an else keyword
while we're parsing an if-let block.

This is likely that the user has accidentally mixed if-let and let...else
together.

17 months agoMerge pull request #5670 from calebcartwright/subtree-sync-2023-01-24
Caleb Cartwright [Tue, 24 Jan 2023 04:13:01 +0000 (22:13 -0600)]
Merge pull request #5670 from calebcartwright/subtree-sync-2023-01-24

Subtree sync 2023-01-24

17 months agochore: bump toolchain
Caleb Cartwright [Tue, 24 Jan 2023 03:44:03 +0000 (21:44 -0600)]
chore: bump toolchain

17 months agoMerge remote-tracking branch 'upstream/master' into subtree-sync-2023-01-24
Caleb Cartwright [Tue, 24 Jan 2023 03:19:31 +0000 (21:19 -0600)]
Merge remote-tracking branch 'upstream/master' into subtree-sync-2023-01-24

17 months agorustdoc: remove dead settings JS for obsolete select-wrapper
Michael Howell [Mon, 23 Jan 2023 17:46:40 +0000 (10:46 -0700)]
rustdoc: remove dead settings JS for obsolete select-wrapper

17 months agorustdoc: simplify settings popover DOM
Michael Howell [Mon, 23 Jan 2023 17:44:01 +0000 (10:44 -0700)]
rustdoc: simplify settings popover DOM

* Changes the class names so that they all start with `setting-`.
  That should make it harder to accidentally use a setting class outside
  the settings popover, where loading the CSS might accidentally change
  the styles of something unrelated.
* Get rid of an unnecessary wrapper DIV around the radio button line.
* Simplify CSS selectors by making the DOM easier and more intuitive
  to target.

17 months agoBring tests back into rustc source tarball
Tomasz Miąsko [Mon, 23 Jan 2023 00:00:00 +0000 (00:00 +0000)]
Bring tests back into rustc source tarball

They were missing after recent move from src/test to tests.

17 months agofix: correct span for structs with const generics
Caleb Cartwright [Mon, 23 Jan 2023 16:54:05 +0000 (10:54 -0600)]
fix: correct span for structs with const generics

17 months agoAdd hint for missing lifetime bound on trait object when type alias is used
yanchen4791 [Tue, 6 Dec 2022 00:51:49 +0000 (16:51 -0800)]
Add hint for missing lifetime bound on trait object when type alias is used

17 months agorustc_metadata: Support non-`Option` nullable values in metadata tables
Vadim Petrochenkov [Sat, 21 Jan 2023 14:38:14 +0000 (18:38 +0400)]
rustc_metadata: Support non-`Option` nullable values in metadata tables

This is a convenience feature for cases in which "no value in the table" and "default value in the table" are equivalent.
Tables using `Table<DefIndex, ()>` are migrated in this PR, some other cases can be migrated later.

This helps `DocFlags` in https://github.com/rust-lang/rust/pull/107136 in particular.

17 months ago`new_outside_solver` -> `evaluate_root_goal`
lcnr [Mon, 23 Jan 2023 14:34:11 +0000 (15:34 +0100)]
`new_outside_solver` ->  `evaluate_root_goal`

17 months agotweak wording
Esteban Küber [Mon, 23 Jan 2023 14:46:30 +0000 (14:46 +0000)]
tweak wording

17 months agoEnsure suggestion correctness
Esteban Küber [Sun, 8 Jan 2023 19:12:15 +0000 (19:12 +0000)]
Ensure suggestion correctness

17 months agoDo not erase regions
Esteban Küber [Sun, 8 Jan 2023 07:43:24 +0000 (07:43 +0000)]
Do not erase regions

17 months agoAdd call in `emit_type_mismatch_suggestions`
Esteban Küber [Sun, 8 Jan 2023 07:14:17 +0000 (07:14 +0000)]
Add call in `emit_type_mismatch_suggestions`

17 months agoreview comment: use `fcx.infcx`
Esteban Küber [Sun, 8 Jan 2023 07:05:23 +0000 (07:05 +0000)]
review comment: use `fcx.infcx`

17 months agoSuggest coercion of `Result` using `?`
Esteban Küber [Sun, 8 Jan 2023 02:54:59 +0000 (02:54 +0000)]
Suggest coercion of `Result` using `?`

Fix #47560.

17 months agoAuto merge of #107220 - JohnTitor:rollup-5pvuz0z, r=JohnTitor
bors [Mon, 23 Jan 2023 13:07:16 +0000 (13:07 +0000)]
Auto merge of #107220 - JohnTitor:rollup-5pvuz0z, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #106796 (BPF: Disable atomic CAS)
 - #106886 (Make stage2 rustdoc and proc-macro-srv disableable in x.py install)
 - #107101 (Filter param-env predicates for errors before calling `to_opt_poly_trait_pred`)
 - #107109 (ThinBox: Add intra-doc-links for Metadata)
 - #107148 (remove error code from `E0789`, add UI test/docs)
 - #107151 (Instantiate dominators algorithm only once)
 - #107153 (Consistently use dominates instead of is_dominated_by)

Failed merges:

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

17 months ago`sub_ptr()` is equivalent to `usize::try_from().unwrap_unchecked()`, not `usize:...
Chayim Refael Friedman [Mon, 23 Jan 2023 12:42:32 +0000 (14:42 +0200)]
`sub_ptr()` is equivalent to `usize::try_from().unwrap_unchecked()`, not `usize::from().unwrap_unchecked()`.

`usize::from()` gives a `usize`, not `Result<usize>`, and `usize: From<isize>` is not implemented.

17 months agofix: use LocalDefId instead of HirId in trait res
Vincenzo Palazzo [Sun, 15 Jan 2023 11:58:46 +0000 (12:58 +0100)]
fix: use LocalDefId instead of HirId in trait res

use LocalDefId instead of HirId in trait resolution to simplify
the obligation clause resolution

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
17 months agoRollup merge of #107153 - tmiasko:dominates, r=oli-obk
Yuki Okushi [Mon, 23 Jan 2023 10:30:02 +0000 (19:30 +0900)]
Rollup merge of #107153 - tmiasko:dominates, r=oli-obk

Consistently use dominates instead of is_dominated_by

There is a number of APIs that answer dominance queries. Previously they were named either "dominates" or "is_dominated_by". Consistently use the "dominates" form.

No functional changes.

17 months agoRollup merge of #107151 - tmiasko:dominators-no-inline, r=compiler-errors
Yuki Okushi [Mon, 23 Jan 2023 10:30:01 +0000 (19:30 +0900)]
Rollup merge of #107151 - tmiasko:dominators-no-inline, r=compiler-errors

Instantiate dominators algorithm only once

Remove inline from BasicBlocks::dominators to instantiate the dominator algorithm only once - in the rustc_middle crate.

17 months agoRollup merge of #107148 - Ezrashaw:uncode-e0789, r=compiler-errors,GuillaumeGomez
Yuki Okushi [Mon, 23 Jan 2023 10:30:00 +0000 (19:30 +0900)]
Rollup merge of #107148 - Ezrashaw:uncode-e0789, r=compiler-errors,GuillaumeGomez

remove error code from `E0789`, add UI test/docs

`E0789` shouldn't have an error code, it's explicitly internal-only and is tiny in scope. (I wonder if we can tighten the standard for this in the RFC?) I also added a UI test and error docs (done like `E0208`, they are "no longer emitted").

r? `@GuillaumeGomez` (shouldn't need a compiler review, it's pretty minor)

17 months agoRollup merge of #107109 - est31:thin_box_link, r=Mark-Simulacrum
Yuki Okushi [Mon, 23 Jan 2023 10:30:00 +0000 (19:30 +0900)]
Rollup merge of #107109 - est31:thin_box_link, r=Mark-Simulacrum

ThinBox: Add intra-doc-links for Metadata

17 months agoRollup merge of #107101 - compiler-errors:perf-106309-1, r=petrochenkov
Yuki Okushi [Mon, 23 Jan 2023 10:29:59 +0000 (19:29 +0900)]
Rollup merge of #107101 - compiler-errors:perf-106309-1, r=petrochenkov

Filter param-env predicates for errors before calling `to_opt_poly_trait_pred`

cc #106309 https://github.com/rust-lang/rust/pull/106757#issuecomment-1396616318

r? `@ghost`

17 months agoRollup merge of #106886 - dtolnay:fastinstall, r=Mark-Simulacrum
Yuki Okushi [Mon, 23 Jan 2023 10:29:59 +0000 (19:29 +0900)]
Rollup merge of #106886 - dtolnay:fastinstall, r=Mark-Simulacrum

Make stage2 rustdoc and proc-macro-srv disableable in x.py install

Rustdoc will build if `[build] tools = ["rustdoc"]` is set, and rust-analyzer-proc-macro-srv will build if `[build] tools = ["rust-analyzer"]` is set.

On my machine skipping these tools speeds up `x.py install` from 7m15s to 6m08s (0m43s for rustdoc and 0m24s for rust-analyzer-proc-macro-srv). This is a significant speedup, since I never use rust-analyzer-proc-macro-srv, and I practically never need to use a custom build of rustdoc.

17 months agoRollup merge of #106796 - vadorovsky:revert-105708-enable-atomic-cas-bpf, r=bjorn3
Yuki Okushi [Mon, 23 Jan 2023 10:29:58 +0000 (19:29 +0900)]
Rollup merge of #106796 - vadorovsky:revert-105708-enable-atomic-cas-bpf, r=bjorn3

BPF: Disable atomic CAS

Enabling CAS for BPF targets (https://github.com/rust-lang/rust/pull/105708) breaks the build of core library.
The failure occurs both when building rustc for BPF targets and when
building crates for BPF targets with the current nightly.

The LLVM BPF backend does not correctly lower all `atomicrmw` operations
and crashes for unsupported ones.

Before we can enable CAS for BPF in Rust, we need to fix the LLVM BPF
backend first.

Fixes #106795

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
17 months agoAuto merge of #107136 - petrochenkov:dochidden, r=cjgillot
bors [Mon, 23 Jan 2023 10:12:57 +0000 (10:12 +0000)]
Auto merge of #107136 - petrochenkov:dochidden, r=cjgillot

rustc_metadata: Encode `doc(hidden)` flag to metadata

To retrieve these flags rustdoc currently has to mass decode full attributes for items in the whole crate tree, so it's better to pre-compute it in advance.

This is especially important for short-term performance of https://github.com/rust-lang/rust/pull/107054 because resolver cannot use memoization of query results yet.

17 months agoadd UI test + docs for `E0789`
Ezra Shaw [Sat, 21 Jan 2023 08:32:05 +0000 (21:32 +1300)]
add UI test + docs for `E0789`

17 months agoAuto merge of #107215 - Dylan-DPC:rollup-zqtiufk, r=Dylan-DPC
bors [Mon, 23 Jan 2023 07:32:07 +0000 (07:32 +0000)]
Auto merge of #107215 - Dylan-DPC:rollup-zqtiufk, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #104926 (Move relationships from FulfillmentContext to Inherited)
 - #106854 (Add `Arc::into_inner` for safely discarding `Arc`s without calling the destructor on the inner type.)
 - #107108 (Consider doc(alias) when providing typo suggestions)
 - #107186 (rustdoc: Use correct pseudo-element selector)
 - #107192 (Add myself to the mailmap)
 - #107195 (Fix typo in universal_regions.rs comment)
 - #107203 (Suggest remove deref for type mismatch)

Failed merges:

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

17 months agoRollup merge of #107203 - chenyukang:yukang/fix-106496-remove-deref, r=compiler-errors
Dylan DPC [Mon, 23 Jan 2023 06:22:07 +0000 (11:52 +0530)]
Rollup merge of #107203 - chenyukang:yukang/fix-106496-remove-deref, r=compiler-errors

Suggest remove deref for type mismatch

Fixes #106496

17 months agoRollup merge of #107195 - smoelius:patch-2, r=Nilstrieb
Dylan DPC [Mon, 23 Jan 2023 06:22:06 +0000 (11:52 +0530)]
Rollup merge of #107195 - smoelius:patch-2, r=Nilstrieb

Fix typo in universal_regions.rs comment

17 months agoRollup merge of #107192 - fmease:mailmap-me-at-fmease-dev, r=albertlarsan68
Dylan DPC [Mon, 23 Jan 2023 06:22:06 +0000 (11:52 +0530)]
Rollup merge of #107192 - fmease:mailmap-me-at-fmease-dev, r=albertlarsan68

Add myself to the mailmap

17 months agoRollup merge of #107186 - GuillaumeGomez:correct-pseudo-element-selector, r=notriddle
Dylan DPC [Mon, 23 Jan 2023 06:22:05 +0000 (11:52 +0530)]
Rollup merge of #107186 - GuillaumeGomez:correct-pseudo-element-selector, r=notriddle

rustdoc: Use correct pseudo-element selector

As explained [here](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements#syntax).

I wrote it on top of #107152 so we'll need to wait for this one to be merged first.

r? `@notriddle`

17 months agoRollup merge of #107108 - sulami:issue-83968-doc-alias-typo-suggestions, r=compiler...
Dylan DPC [Mon, 23 Jan 2023 06:22:05 +0000 (11:52 +0530)]
Rollup merge of #107108 - sulami:issue-83968-doc-alias-typo-suggestions, r=compiler-errors

Consider doc(alias) when providing typo suggestions

This means that

```rust
impl Foo {
    #[doc(alias = "quux")]
    fn bar(&self) {}
}

fn main() {
    (Foo {}).quux();
}
```

will suggest `bar`. This currently uses the "there is a method with a similar name" help text, because the point where we choose and emit a suggestion is different from where we gather the suggestions. Changes have mainly been made to the latter.

The selection code will now fall back to aliased candidates, but generally only if there is no candidate that matches based on the existing Levenshtein methodology.

Fixes #83968.

17 months agoRollup merge of #106854 - steffahn:drop_linear_arc_rebased, r=Mark-Simulacrum
Dylan DPC [Mon, 23 Jan 2023 06:22:04 +0000 (11:52 +0530)]
Rollup merge of #106854 - steffahn:drop_linear_arc_rebased, r=Mark-Simulacrum

Add `Arc::into_inner` for safely discarding `Arc`s without calling the destructor on the inner type.

ACP: rust-lang/libs-team#162

Reviving #79665.

I want to get this merged this time; this does not contain changes (apart from very minor changes in comments/docs).

See #79665 for further description of the PR. The only “unresolved” points that led to that PR being closed, AFAICT, were

* The desire to also implement a `Rc::into_inner` function
  * however, this can very well also happen as a subsequent PR
* Possible need for further discussion on the naming “`into_inner`” (?)
  * `into_inner` seems fine to me; also, this PR introduces unstable API, and names can be changed later, too
* ~~I don't know if a tracking issue for the feature flag is supposed to be opened before or after this PR gets merged (if *before*, then I can add the issue number to the `#[unstable…]` attribute)~~ There is a [tracking issue](https://github.com/rust-lang/rust/issues/106894) now.

I say “unresolved” in quotation marks because from my point of view, if reviewers agree, the PR can be merged immediately and as-is :-)

17 months agoRollup merge of #104926 - spastorino:calculate_diverging_fallback-cleanups, r=lcnr
Dylan DPC [Mon, 23 Jan 2023 06:22:04 +0000 (11:52 +0530)]
Rollup merge of #104926 - spastorino:calculate_diverging_fallback-cleanups, r=lcnr

Move relationships from FulfillmentContext to Inherited

r? `@lcnr`

17 months agoAuto merge of #107044 - cuviper:more-llvm-ci, r=Mark-Simulacrum
bors [Mon, 23 Jan 2023 04:36:34 +0000 (04:36 +0000)]
Auto merge of #107044 - cuviper:more-llvm-ci, r=Mark-Simulacrum

ci: add runners for vanilla LLVM 14 and 15

As discussed in [zulip #t-infra][1] -- r? Mark-Simulacrum

[1]: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/testing.20multiple.20llvm.20versions

17 months agoConsider doc(alias) when providing typo suggestions
Robin Schroer [Wed, 18 Jan 2023 10:58:50 +0000 (19:58 +0900)]
Consider doc(alias) when providing typo suggestions

This means that

```rust
impl Foo {
    #[doc(alias = "quux")]
    fn bar(&self) {}
}

fn main() {
    (Foo {}).quux();
}
```

will suggest `bar`. This currently uses the "there is a method with a
similar name" help text, because the point where we choose and emit a
suggestion is different from where we gather the suggestions. Changes
have mainly been made to the latter.

The selection code will now fall back to aliased candidates, but
generally only if there is no candidate that matches based on the
existing Levenshtein methodology.

Fixes #83968.

17 months agoAuto merge of #106981 - joboet:std_remove_box_syntax, r=thomcc
bors [Mon, 23 Jan 2023 01:05:56 +0000 (01:05 +0000)]
Auto merge of #106981 - joboet:std_remove_box_syntax, r=thomcc

Do not use box syntax in `std`

See #94970 and #49733. About half of the `box` instances in `std` do not even need to allocate, the other half can simply be replaced with `Box::new`.

`@rustbot` label +T-libs
r? rust-lang/libs

17 months agoAuto merge of #106975 - tmiasko:basic-blocks-cache, r=cjgillot
bors [Sun, 22 Jan 2023 21:35:21 +0000 (21:35 +0000)]
Auto merge of #106975 - tmiasko:basic-blocks-cache, r=cjgillot

Refactor basic blocks control flow caches

No functional changes.

17 months agoAuto merge of #106827 - alexcrichton:update-llvm-to-15.0.7, r=cuviper
bors [Sun, 22 Jan 2023 18:39:13 +0000 (18:39 +0000)]
Auto merge of #106827 - alexcrichton:update-llvm-to-15.0.7, r=cuviper

Update LLVM to 15.0.7

This commit pulls in rust-lang/llvm-project#143 which updates the LLVM version used by rustc to 15.0.7, namely pulling in https://reviews.llvm.org/D136110 which is needed for some work I'm working on with wasm.

17 months agoFix #106496, suggest remove deref for type mismatch
yukang [Sun, 22 Jan 2023 16:42:20 +0000 (00:42 +0800)]
Fix #106496, suggest remove deref for type mismatch

17 months agofn-trait-closure test now pass on new solver
Santiago Pastorino [Sun, 22 Jan 2023 15:36:58 +0000 (12:36 -0300)]
fn-trait-closure test now pass on new solver

17 months agoRename relationships to infer_var_info
Santiago Pastorino [Fri, 20 Jan 2023 19:45:01 +0000 (16:45 -0300)]
Rename relationships to infer_var_info

17 months agoMove relationships::update to Inherited::update_infer_var_info
Santiago Pastorino [Fri, 20 Jan 2023 19:42:22 +0000 (16:42 -0300)]
Move relationships::update to Inherited::update_infer_var_info

17 months agoStore relationships on Inherent
Santiago Pastorino [Fri, 25 Nov 2022 21:18:03 +0000 (18:18 -0300)]
Store relationships on Inherent

17 months agoRemove duplicated debug call
Santiago Pastorino [Thu, 24 Nov 2022 17:26:57 +0000 (14:26 -0300)]
Remove duplicated debug call

17 months agoAuto merge of #107187 - matthiaskrgr:rollup-lvwzlg2, r=matthiaskrgr
bors [Sun, 22 Jan 2023 13:22:34 +0000 (13:22 +0000)]
Auto merge of #107187 - matthiaskrgr:rollup-lvwzlg2, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #107102 (Implement some more predicates in the new solver)
 - #107111 (Fix missing arguments issues and copy-paste bug for fluent)
 - #107114 (Add note about absolute paths to Path::join)
 - #107127 (Enable sanitizers for s390x-linux)
 - #107152 (Migrate scraped-examples top and bottom "borders" to CSS variables)
 - #107170 (Add myself to .mailmap)
 - #107174 (rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`)
 - #107180 (Remove unnecessary `&format!`)

Failed merges:

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

17 months agoUpdate universal_regions.rs
Samuel Moelius [Sun, 22 Jan 2023 12:38:02 +0000 (07:38 -0500)]
Update universal_regions.rs

17 months agoadd fmease to mailmap
León Orell Valerian Liehr [Sun, 22 Jan 2023 11:36:04 +0000 (12:36 +0100)]
add fmease to mailmap

17 months agoRollup merge of #107180 - nvzqz:rm-fmt-ref, r=joshtriplett
Matthias Krüger [Sun, 22 Jan 2023 10:43:09 +0000 (11:43 +0100)]
Rollup merge of #107180 - nvzqz:rm-fmt-ref, r=joshtriplett

Remove unnecessary `&format!`

These were likely from before the `PartialEq<str>` impl for `&String`.

17 months agoRollup merge of #107174 - petrochenkov:defidoc, r=notriddle
Matthias Krüger [Sun, 22 Jan 2023 10:43:08 +0000 (11:43 +0100)]
Rollup merge of #107174 - petrochenkov:defidoc, r=notriddle

rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`

Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.
cc https://github.com/rust-lang/rust/pull/106977

17 months agoRollup merge of #107170 - albertlarsan68:update-mailmap, r=compiler-errors
Matthias Krüger [Sun, 22 Jan 2023 10:43:08 +0000 (11:43 +0100)]
Rollup merge of #107170 - albertlarsan68:update-mailmap, r=compiler-errors

Add myself to .mailmap

17 months agoRollup merge of #107152 - GuillaumeGomez:migrate-to-css-var, r=notriddle
Matthias Krüger [Sun, 22 Jan 2023 10:43:07 +0000 (11:43 +0100)]
Rollup merge of #107152 - GuillaumeGomez:migrate-to-css-var, r=notriddle

Migrate scraped-examples top and bottom "borders" to CSS variables

r? `@notriddle`

17 months agoRollup merge of #107127 - uweigand:s390x-sanitizer, r=Mark-Simulacrum
Matthias Krüger [Sun, 22 Jan 2023 10:43:07 +0000 (11:43 +0100)]
Rollup merge of #107127 - uweigand:s390x-sanitizer, r=Mark-Simulacrum

Enable sanitizers for s390x-linux

Include sanitizers supported by LLVM on s390x (asan, lsan, msan, tsan) in the target definition, as well as in the compiletest supported list.

Build sanitizer runtime for the target.  Enable sanitizers in the CI.

17 months agoRollup merge of #107114 - Erk-:add-absolute-note-to-path-join, r=m-ou-se
Matthias Krüger [Sun, 22 Jan 2023 10:43:06 +0000 (11:43 +0100)]
Rollup merge of #107114 - Erk-:add-absolute-note-to-path-join, r=m-ou-se

Add note about absolute paths to Path::join

The note already exists on `PathBuf::push`, but I think it is good to have it on `Path::join` as well since it can cause issues if you are not careful with your input.

17 months agoRollup merge of #107111 - chenyukang:yukang/fix-107090-fluent-parameters, r=petrochenkov
Matthias Krüger [Sun, 22 Jan 2023 10:43:06 +0000 (11:43 +0100)]
Rollup merge of #107111 - chenyukang:yukang/fix-107090-fluent-parameters, r=petrochenkov

Fix missing arguments issues and copy-paste bug for fluent

Fixes #107090

17 months agoRollup merge of #107102 - compiler-errors:new-solver-new-candidats-4, r=lcnr
Matthias Krüger [Sun, 22 Jan 2023 10:43:05 +0000 (11:43 +0100)]
Rollup merge of #107102 - compiler-errors:new-solver-new-candidats-4, r=lcnr

Implement some more predicates in the new solver

Implement a few more goals. The subtype goal specifically is important, since it's required for this code to compile:

```
fn main() {
  let mut x = vec![];
  x.push(1i32);
}
```

(I think we emit a subtype goal here because of coercion).

Drive-by: Also implements `--compare-mode=next-solver` -- I've been using this locally a lot to find out what works and what doesn't. I'm also happy to split this out into another PR.
r? `@lcnr`

17 months agoAuto merge of #107137 - Mark-Simulacrum:169, r=Mark-Simulacrum
bors [Sun, 22 Jan 2023 10:30:59 +0000 (10:30 +0000)]
Auto merge of #107137 - Mark-Simulacrum:169, r=Mark-Simulacrum

Bump to 1.69.0

r? `@Mark-Simulacrum`

17 months agoUse correct pseudo-element selector
Guillaume Gomez [Sun, 22 Jan 2023 10:11:29 +0000 (11:11 +0100)]
Use correct pseudo-element selector

17 months agoAuto merge of #107185 - compiler-errors:rollup-wkomjma, r=compiler-errors
bors [Sun, 22 Jan 2023 06:53:36 +0000 (06:53 +0000)]
Auto merge of #107185 - compiler-errors:rollup-wkomjma, r=compiler-errors

Rollup of 8 pull requests

Successful merges:

 - #103418 (Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report)
 - #106113 (llvm-wrapper: adapt for LLVM API change)
 - #106144 (Improve the documentation of `black_box`)
 - #106578 (Label closure captures/generator locals that make opaque types recursive)
 - #106749 (Update cc to 1.0.77)
 - #106935 (Fix `SingleUseLifetime` ICE)
 - #107015 (Re-enable building rust-analyzer on riscv64)
 - #107029 (Add new bootstrap members to triagebot.toml)

Failed merges:

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

17 months agoRollup merge of #107029 - albertlarsan68:patch-2, r=Mark-Simulacrum
Michael Goulet [Sun, 22 Jan 2023 04:21:02 +0000 (23:21 -0500)]
Rollup merge of #107029 - albertlarsan68:patch-2, r=Mark-Simulacrum

Add new bootstrap members to triagebot.toml

```@ozkanonur``` if you want to be assigned to review PRs too, just post a message to this thread.

Should a `T-bootstrap` label be created, since `src/tools/tidy` is assigned to the `bootstrap` members, but labeled `A-testsuite` (and not `A-bootstrap`) ?

cc ```@jyn514```

17 months agoRollup merge of #107015 - cuviper:ra-riscv64, r=Mark-Simulacrum
Michael Goulet [Sun, 22 Jan 2023 04:21:01 +0000 (23:21 -0500)]
Rollup merge of #107015 - cuviper:ra-riscv64, r=Mark-Simulacrum

Re-enable building rust-analyzer on riscv64

It was disabled in #75103 due to an LLVM bug, but followup comments have
confirmed that it builds fine on Fedora with LLVM 15.

r? ```@Mark-Simulacrum```
cc ```@matklad``` ```@davidlt```

17 months agoRollup merge of #106935 - TaKO8Ki:fix-104440, r=cjgillot
Michael Goulet [Sun, 22 Jan 2023 04:21:00 +0000 (23:21 -0500)]
Rollup merge of #106935 - TaKO8Ki:fix-104440, r=cjgillot

Fix `SingleUseLifetime` ICE

Fixes #104440
cc: ``@matthiaskrgr``

17 months agoRollup merge of #106749 - glandium:dwarf, r=Mark-Simulacrum
Michael Goulet [Sun, 22 Jan 2023 04:21:00 +0000 (23:21 -0500)]
Rollup merge of #106749 - glandium:dwarf, r=Mark-Simulacrum

Update cc to 1.0.77

Fixes (without a test) #98746.

17 months agoRollup merge of #106578 - compiler-errors:recursive-opaque-closure, r=TaKO8Ki
Michael Goulet [Sun, 22 Jan 2023 04:20:59 +0000 (23:20 -0500)]
Rollup merge of #106578 - compiler-errors:recursive-opaque-closure, r=TaKO8Ki

Label closure captures/generator locals that make opaque types recursive

cc https://github.com/rust-lang/rust/issues/46415#issuecomment-1374665828

17 months agoRollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
Michael Goulet [Sun, 22 Jan 2023 04:20:59 +0000 (23:20 -0500)]
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum

Improve the documentation of `black_box`

There don't seem to be many great resources on how `black_box` should be used, so I added some information here

17 months agoRollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
Michael Goulet [Sun, 22 Jan 2023 04:20:58 +0000 (23:20 -0500)]
Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic

llvm-wrapper: adapt for LLVM API change

No functional changes intended.

The LLVM commit https://github.com/llvm/llvm-project/commit/e6b02214c68df2c9f826e02310c9352ac652e456 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.

17 months agoRollup merge of #103418 - Aaron1011:macro-semicolon-future-incompat, r=davidtwco
Michael Goulet [Sun, 22 Jan 2023 04:20:58 +0000 (23:20 -0500)]
Rollup merge of #103418 - Aaron1011:macro-semicolon-future-incompat, r=davidtwco

Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report

See https://github.com/rust-lang/rust/issues/79813 for a discussion of this lint. This has been warn-by-default for over a year, so adding it to the future-incompat report should help to find libraries that haven't yet updated.

17 months agoAuto merge of #107133 - pnkfelix:revert-pr-84022-for-issue-106337, r=Mark-Simulacrum
bors [Sun, 22 Jan 2023 03:58:52 +0000 (03:58 +0000)]
Auto merge of #107133 - pnkfelix:revert-pr-84022-for-issue-106337, r=Mark-Simulacrum

Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"

This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36 aka PR #84022

I am doing this to buy us some time with respect to issue #106337 w.r.t. the 1.67 release.

17 months agoRemove unnecessary `&format!`
Nikolai Vazquez [Sun, 22 Jan 2023 03:00:25 +0000 (22:00 -0500)]
Remove unnecessary `&format!`

These were likely from before the `PartialEq<str>` impl for `&String`.

17 months agorustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`
Vadim Petrochenkov [Sat, 21 Jan 2023 21:33:53 +0000 (01:33 +0400)]
rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`

Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.

17 months agoAuto merge of #106948 - cuviper:ci-mingw-check, r=nikic
bors [Sat, 21 Jan 2023 21:42:21 +0000 (21:42 +0000)]
Auto merge of #106948 - cuviper:ci-mingw-check, r=nikic

ci: upgrade mingw-check to ubuntu:22.04

17 months agoAdd myself to .mailmap
Albert Larsan [Sat, 21 Jan 2023 20:52:20 +0000 (20:52 +0000)]
Add myself to .mailmap

17 months agoAdd `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report
Aaron Hill [Sat, 22 Oct 2022 22:28:08 +0000 (17:28 -0500)]
Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report

17 months agorustc_metadata: Encode `doc(hidden)` flag to metadata
Vadim Petrochenkov [Fri, 20 Jan 2023 20:59:19 +0000 (00:59 +0400)]
rustc_metadata: Encode `doc(hidden)` flag to metadata

To retrieve these flags rustdoc currently has to mass decode full attributes for items in the whole crate tree, so it's better to pre-compute it in advance.

This is especially for short-term performance of https://github.com/rust-lang/rust/pull/107054 because resolver cannot use memoization of query results yet.