]> git.lizzy.rs Git - rust.git/log
rust.git
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 agocreate and use GlobalAlloc::address_space
Erik Desjardins [Wed, 25 Jan 2023 06:46:19 +0000 (01:46 -0500)]
create and use GlobalAlloc::address_space

17 months agorustc_metadata: Fix `encode_attrs`
Vadim Petrochenkov [Sat, 21 Jan 2023 19:49:23 +0000 (23:49 +0400)]
rustc_metadata: Fix `encode_attrs`

This function didn't do what the authors intended it to do.

- Due to `move` in the closure `is_public` wasn't captured by mutalbe reference and wasn't used as a cache.
- Due to iterator cloning all the `should_encode_attr` logic run for the second time to calculate `may_have_doc_links`

This PR fixes these issues, and calculates all the needed attribute flags in one go.

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 agocore: Support variety of atomic widths in width-agnostic functions
Michal Rostecki [Mon, 16 Jan 2023 11:40:38 +0000 (19:40 +0800)]
core: Support variety of atomic widths in width-agnostic functions

Before this change, the following functions and macros were annotated
with `#[cfg(target_has_atomic = "8")]` or
`#[cfg(target_has_atomic_load_store = "8")]`:

* `atomic_int`
* `strongest_failure_ordering`
* `atomic_swap`
* `atomic_add`
* `atomic_sub`
* `atomic_compare_exchange`
* `atomic_compare_exchange_weak`
* `atomic_and`
* `atomic_nand`
* `atomic_or`
* `atomic_xor`
* `atomic_max`
* `atomic_min`
* `atomic_umax`
* `atomic_umin`

However, none of those functions and macros actually depend on 8-bit
width and they are needed for all atomic widths (16-bit, 32-bit, 64-bit
etc.). Some targets might not support 8-bit atomics (i.e. BPF, if we
would enable atomic CAS for it).

This change fixes that by removing the `"8"` argument from annotations,
which results in accepting the whole variety of widths.

Fixes #106845
Fixes #106795

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
17 months agoAdd `target_has_atomic*` symbols if any atomic width is supported
Michal Rostecki [Mon, 16 Jan 2023 11:13:52 +0000 (19:13 +0800)]
Add `target_has_atomic*` symbols if any atomic width is supported

Atomic operations for different widths (8-bit, 16-bit, 32-bit etc.) are
guarded by `target_has_atomic = "value"` symbol (i.e. `target_has_atomic
= "8"`) (and the other derivatives), but before this change, there was
no width-agnostic symbol indicating a general availability of atomic
operations.

This change introduces:

* `target_has_atomic_load_store` symbol when atomics for any integer
  width are supported by the target.
* `target_has_atomic` symbol when also CAS is supported.

Fixes #106845

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
17 months agono without_constness
Boxy [Tue, 24 Jan 2023 23:32:47 +0000 (23:32 +0000)]
no without_constness

17 months agosorry erica
Boxy [Tue, 24 Jan 2023 23:29:02 +0000 (23:29 +0000)]
sorry erica

17 months agoimplement builtin candidate
Boxy [Tue, 24 Jan 2023 23:24:25 +0000 (23:24 +0000)]
implement builtin candidate

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 agoUpdate tidy for cranelift-egraph removal and new windows-sys targets
bjorn3 [Tue, 24 Jan 2023 18:03:13 +0000 (19:03 +0100)]
Update tidy for cranelift-egraph removal and new windows-sys targets

17 months agoMerge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24
bjorn3 [Tue, 24 Jan 2023 17:56:42 +0000 (18:56 +0100)]
Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24

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 agorustdoc: prevent scroll bar on source viewer
KaDiWa [Tue, 24 Jan 2023 15:46:45 +0000 (16:46 +0100)]
rustdoc: prevent scroll bar on source viewer

17 months agoWork around issue 106930.
Mara Bos [Tue, 24 Jan 2023 15:44:00 +0000 (16:44 +0100)]
Work around issue 106930.

17 months agoadd feature gate tests for DispatchFromDyn
dimi [Wed, 26 Oct 2022 12:40:03 +0000 (14:40 +0200)]
add feature gate tests for DispatchFromDyn

17 months agoDelete `SimplifyArmIdentity` and `SimplifyBranchSame` mir opts
Jakob Degen [Tue, 24 Jan 2023 12:13:52 +0000 (04:13 -0800)]
Delete `SimplifyArmIdentity` and `SimplifyBranchSame` mir opts

17 months agoadd test where we ignore hr implied bounds
lcnr [Tue, 24 Jan 2023 11:41:18 +0000 (12:41 +0100)]
add test where we ignore hr implied bounds

17 months agoimpl DispatchFromDyn for Cell and UnsafeCell
dimi [Tue, 24 May 2022 21:56:19 +0000 (23:56 +0200)]
impl DispatchFromDyn for Cell and UnsafeCell

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: rearrange HTML in primitive reference links
Michael Howell [Tue, 24 Jan 2023 00:10:54 +0000 (17:10 -0700)]
rustdoc: rearrange HTML in primitive reference links

This patch avoids hard-to-click single character links by making
the generic part of the link:

Before: <a href="#">&</a>T

After: <a href="#">&T</a>

17 months agoThread a ParamEnv down to might_permit_raw_init
Ben Kimock [Sun, 22 Jan 2023 22:06:28 +0000 (17:06 -0500)]
Thread a ParamEnv down to might_permit_raw_init

17 months agoPrint PID holding bootstrap build lock on Linux
clubby789 [Thu, 19 Jan 2023 21:11:17 +0000 (21:11 +0000)]
Print PID holding bootstrap build lock on Linux

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 agorustdoc: make item links consistently use `title="{shortty} {path}"`
Michael Howell [Mon, 23 Jan 2023 21:31:35 +0000 (14:31 -0700)]
rustdoc: make item links consistently use `title="{shortty} {path}"`

The ordering in item tables was flipped in 3030cbea957adbd560bf2eaa34c1b8a56daee16a, making it
inconsistent with the ordering in method signatures.

Compare these:

https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/render/print_item.rs#L455-L459

https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/format.rs#L903-L908

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 agoreview comment: Remove AST AnonTy
Esteban Küber [Mon, 23 Jan 2023 14:29:53 +0000 (14:29 +0000)]
review comment: Remove AST AnonTy

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 agoHack to suppress bad labels in type mismatch inference deduction code
Michael Goulet [Sat, 21 Jan 2023 22:18:51 +0000 (22:18 +0000)]
Hack to suppress bad labels in type mismatch inference deduction code

17 months agoDon't resolve type var roots in point_at_expr_source_of_inferred_type
Michael Goulet [Sat, 21 Jan 2023 21:54:49 +0000 (21:54 +0000)]
Don't resolve type var roots in point_at_expr_source_of_inferred_type

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 agoEvaluate `output_filenames` before one of its dependencies gets stolen
Oli Scherer [Mon, 23 Jan 2023 12:00:03 +0000 (12:00 +0000)]
Evaluate `output_filenames` before one of its dependencies gets stolen

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 agoStore the gctxt instead of fetching it twice.
Oli Scherer [Thu, 19 Jan 2023 14:12:29 +0000 (14:12 +0000)]
Store the gctxt instead of fetching it twice.

17 months agoPrefer queries over Compiler methods
Oli Scherer [Wed, 7 Dec 2022 11:55:29 +0000 (11:55 +0000)]
Prefer queries over Compiler methods

17 months agoMake `output_filenames` a real query
Oli Scherer [Mon, 23 Jan 2023 10:25:51 +0000 (10:25 +0000)]
Make `output_filenames` a real query

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 agoRemove another unneeded use of the resolver
Oli Scherer [Wed, 7 Dec 2022 09:33:25 +0000 (09:33 +0000)]
Remove another unneeded use of the resolver

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 agoabi: add `AddressSpace` field to `Primitive::Pointer`
Erik Desjardins [Mon, 23 Jan 2023 04:03:58 +0000 (23:03 -0500)]
abi: add `AddressSpace` field to `Primitive::Pointer`

...and remove it from `PointeeInfo`, which isn't meant for this.

There are still various places (marked with FIXMEs) that assume all pointers
have the same size and alignment. Fixing this requires parsing non-default
address spaces in the data layout string, which will be done in a followup.

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 agorustc_abi: remove Primitive::{is_float,is_int}
Erik Desjardins [Mon, 23 Jan 2023 02:02:07 +0000 (21:02 -0500)]
rustc_abi: remove Primitive::{is_float,is_int}

there were fixmes for this already

i am about to remove is_ptr (since callers need to properly distinguish
between pointers in different address spaces), so might as well do this
at the same time

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 agoTweak comments.
Camille GILLOT [Sun, 22 Jan 2023 11:08:33 +0000 (11:08 +0000)]
Tweak comments.

17 months agoInline encode_enum_variant_info.
Camille GILLOT [Sun, 3 Jul 2022 20:53:57 +0000 (22:53 +0200)]
Inline encode_enum_variant_info.

17 months agoEncode AdtDef in the def-id loop.
Camille GILLOT [Sun, 3 Jul 2022 20:08:01 +0000 (22:08 +0200)]
Encode AdtDef in the def-id loop.

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`.