Commit Graph

215620 Commits

Author SHA1 Message Date
Dylan DPC 9e6873f788
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.
2023-01-25 17:01:41 +05:30
Dylan DPC b36a8dcea3
Rollup merge of #106583 - estebank:suggest-result-coercion, r=compiler-errors
Suggest coercion of `Result` using `?`

Fix #47560.
2023-01-25 17:01:40 +05:30
Dylan DPC c0930c497c
Rollup merge of #105552 - mattjperez:add-incompatible-types-note, r=compiler-errors
Add help message about function pointers

#102608
2023-01-25 17:01:40 +05:30
bors c04832643d Auto merge of #107275 - calebcartwright:sync-from-rustfmt, r=calebcartwright
Sync rustfmt subtree
2023-01-25 04:49:08 +00:00
Caleb Cartwright 6bf1a87fcd update rustfmt subtree version in lockfile 2023-01-24 14:21:14 -06:00
Caleb Cartwright 8e1e67dbaa Merge commit '1d8491b120223272b13451fc81265aa64f7f4d5b' into sync-from-rustfmt 2023-01-24 14:16:03 -06:00
Caleb Cartwright 1d8491b120 chore: prep v1.5.2 release 2023-01-24 14:04:12 -06:00
Matthew J Perez 1e22280f23
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`
2023-01-24 14:02:56 -05:00
Caleb Cartwright 5139b14620 fix: version gate changes for multiline single generic bound 2023-01-24 11:38:44 -06:00
Caleb Cartwright 6eeb4fd230
Merge pull request #5670 from calebcartwright/subtree-sync-2023-01-24
Subtree sync 2023-01-24
2023-01-23 22:13:01 -06:00
Caleb Cartwright 18dd0757db chore: bump toolchain 2023-01-23 21:44:03 -06:00
Caleb Cartwright e7d87ad61d Merge remote-tracking branch 'upstream/master' into subtree-sync-2023-01-24 2023-01-23 21:19:31 -06:00
Caleb Cartwright aae222c974 fix: correct span for structs with const generics 2023-01-23 12:55:02 -05:00
Esteban Küber 62aff3bbc7 tweak wording 2023-01-23 14:47:00 +00:00
Esteban Küber df81147b51 Ensure suggestion correctness 2023-01-23 14:47:00 +00:00
Esteban Küber fcf0ed9018 Do not erase regions 2023-01-23 14:47:00 +00:00
Esteban Küber ddd9a9fb46 Add call in `emit_type_mismatch_suggestions` 2023-01-23 14:46:59 +00:00
Esteban Küber d5a1609ec4 review comment: use `fcx.infcx` 2023-01-23 14:46:59 +00:00
Esteban Küber e477cf9475 Suggest coercion of `Result` using `?`
Fix #47560.
2023-01-23 14:46:59 +00:00
bors c8e6a9e8b6 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
2023-01-23 13:07:16 +00:00
Yuki Okushi eae7f947b5
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.
2023-01-23 19:30:02 +09:00
Yuki Okushi c0f80e7166
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.
2023-01-23 19:30:01 +09:00
Yuki Okushi 809d4aa478
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)
2023-01-23 19:30:00 +09:00
Yuki Okushi 8709c395a6
Rollup merge of #107109 - est31:thin_box_link, r=Mark-Simulacrum
ThinBox: Add intra-doc-links for Metadata
2023-01-23 19:30:00 +09:00
Yuki Okushi 17023496a2
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`
2023-01-23 19:29:59 +09:00
Yuki Okushi ae15d1094a
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.
2023-01-23 19:29:59 +09:00
Yuki Okushi 9e79642a7b
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>
2023-01-23 19:29:58 +09:00
bors 5bef91c6e9 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.
2023-01-23 10:12:57 +00:00
Ezra Shaw 00ff718da8
add UI test + docs for `E0789` 2023-01-23 20:38:14 +13:00
bors 6b3cd03fdb 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
2023-01-23 07:32:07 +00:00
Dylan DPC 66d6a0b5da
Rollup merge of #107203 - chenyukang:yukang/fix-106496-remove-deref, r=compiler-errors
Suggest remove deref for type mismatch

Fixes #106496
2023-01-23 11:52:07 +05:30
Dylan DPC e4ed082579
Rollup merge of #107195 - smoelius:patch-2, r=Nilstrieb
Fix typo in universal_regions.rs comment
2023-01-23 11:52:06 +05:30
Dylan DPC 4f6fc4d582
Rollup merge of #107192 - fmease:mailmap-me-at-fmease-dev, r=albertlarsan68
Add myself to the mailmap
2023-01-23 11:52:06 +05:30
Dylan DPC d9593768d4
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`
2023-01-23 11:52:05 +05:30
Dylan DPC f4f3335114
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.
2023-01-23 11:52:05 +05:30
Dylan DPC 28081a6aa6
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 :-)
2023-01-23 11:52:04 +05:30
Dylan DPC 3d4c3125be
Rollup merge of #104926 - spastorino:calculate_diverging_fallback-cleanups, r=lcnr
Move relationships from FulfillmentContext to Inherited

r? `@lcnr`
2023-01-23 11:52:04 +05:30
bors ad48c10981 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
2023-01-23 04:36:34 +00:00
Robin Schroer f908f0be5a
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.
2023-01-23 10:07:10 +09:00
bors d3322e2773 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
2023-01-23 01:05:56 +00:00
bors a5fa99eed2 Auto merge of #106975 - tmiasko:basic-blocks-cache, r=cjgillot
Refactor basic blocks control flow caches

No functional changes.
2023-01-22 21:35:21 +00:00
bors 5e37043d63 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.
2023-01-22 18:39:13 +00:00
yukang 2aa5555ad3 Fix #106496, suggest remove deref for type mismatch 2023-01-23 00:42:20 +08:00
Santiago Pastorino b905f80036
fn-trait-closure test now pass on new solver 2023-01-22 12:36:58 -03:00
Santiago Pastorino 6155a80380
Rename relationships to infer_var_info 2023-01-22 11:02:28 -03:00
Santiago Pastorino fb0a4e9589
Move relationships::update to Inherited::update_infer_var_info 2023-01-22 11:02:28 -03:00
Santiago Pastorino 7fe472223e
Store relationships on Inherent 2023-01-22 11:02:28 -03:00
Santiago Pastorino 81ee6aebaa
Remove duplicated debug call 2023-01-22 11:02:28 -03:00
bors cef633de58 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
2023-01-22 13:22:34 +00:00
Samuel Moelius 12a72f0329
Update universal_regions.rs 2023-01-22 07:38:02 -05:00