Commit Graph

211267 Commits

Author SHA1 Message Date
Santiago Pastorino
3c9b30e658
Define all clauses as dummy_with_span as the usages are all equivalent 2022-11-25 16:00:08 -03:00
Santiago Pastorino
aaa1db63ce
Remove AscribeUserTypeCx 2022-11-25 15:25:00 -03:00
bors
e704e95250 Auto merge of #104877 - matthiaskrgr:rollup-s7taiq8, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #103648 (Don't set `is_preview` for clippy and rustfmt)
 - #104654 (Add `#![deny(unsafe_op_in_unsafe_fn)]` in liballoc tests)
 - #104793 (unstable-book: Add page for the `abi_efiapi` feature)
 - #104841 (Assert that we don't capture escaping bound vars in `Fn` trait selection)
 - #104849 (Migrate source code elements style to CSS variables)
 - #104873 (RefCell::get_mut: fix typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-25 13:01:45 +00:00
Matthias Krüger
f360686ed6
Rollup merge of #104873 - RalfJung:therefore, r=Dylan-DPC
RefCell::get_mut: fix typo

and fix the same typo in a bunch of other places
2022-11-25 10:44:40 +01:00
Matthias Krüger
8babe1c417
Rollup merge of #104849 - GuillaumeGomez:source-code-sidebar-css-migration, r=notriddle
Migrate source code elements style to CSS variables

r? ``@notriddle``
2022-11-25 10:44:40 +01:00
Matthias Krüger
34f1de8395
Rollup merge of #104841 - compiler-errors:fishy-bound-var, r=jackh726
Assert that we don't capture escaping bound vars in `Fn` trait selection

Fixes #104825
2022-11-25 10:44:39 +01:00
Matthias Krüger
f00c3f05bc
Rollup merge of #104793 - nicholasbishop:bishop-add-efiapi, r=JohnTitor
unstable-book: Add page for the `abi_efiapi` feature

Tracking issue for `abi_efiapi`: https://github.com/rust-lang/rust/issues/65815
2022-11-25 10:44:39 +01:00
Matthias Krüger
808157bd7d
Rollup merge of #104654 - thomcc:alloc-tests-unsafe_op_in_unsafe_fn, r=Mark-Simulacrum
Add `#![deny(unsafe_op_in_unsafe_fn)]` in liballoc tests

In https://github.com/rust-lang/rust/pull/104647#discussion_r1027332930 it was mentioned that liballoc tests should probably have this enabled (we have it pretty much everywhere else in the stdlib), so I added it.

This will probably conflict with https://github.com/rust-lang/rust/pull/104647 so I'll rebase after that lands.
2022-11-25 10:44:38 +01:00
Matthias Krüger
a9313e9077
Rollup merge of #103648 - jyn514:no-preview, r=Mark-Simulacrum
Don't set `is_preview` for clippy and rustfmt

These have been shipped on stable for many years now and it would be very disruptive to ever remove them.
Remove the `-preview` suffix from their dist components.

Based on https://github.com/rust-lang/rust/pull/102565.
2022-11-25 10:44:37 +01:00
bors
8a75c5a9b5 Auto merge of #104650 - BlackHoleFox:stuck-with-xcode-13, r=Mark-Simulacrum
Build macOS distribution artifacts with XCode 13

After all of the `rust-lang/rust` Apple runners started using macOS 12, the builds created by CI began to use XCode 14.0.1. Due to this (as far as we can tell), XCode's build tools started to ignore the `MACOSX_DEPLOYMENT_TARGET` being defined by us for the distributed builds that let both `rustc` and `libstd` work on older versions. The current idea is that since XCode 14's macOS SDK doesn't support deployment targets before 10.13, it uses some default of its own. You can see the difference between stable's and the most recent nighty's supported versions [here](https://github.com/rust-lang/rust/issues/104570#issuecomment-1321225907).

I wasn't able to confirm my SDK versioning hypothesis locally since I think there's something jammed with my XCode installation, but hopefully this should still fix it for releases.

Closes https://github.com/rust-lang/rust/issues/104570

r? `@Mark-Simulacrum`
2022-11-25 09:44:16 +00:00
Ralf Jung
6ed4f15940 RefCell::get_mut: fix typo
and fix the same typo in a bunch of other places
2022-11-25 08:52:06 +01:00
bors
41e0363055 Auto merge of #104602 - petrochenkov:effvisperf5, r=oli-obk
privacy: Fix more (potential) issues with effective visibilities

Continuation of https://github.com/rust-lang/rust/pull/103965.
See individual commits for more detailed description of the changes.

The shortcuts removed in 4eb63f618e and c7c7d16727 could actually be correct (or correct after some tweaks), but they used global reasoning like "we can skip this update because if the code compiles then some other update should do the same thing eventually".
I have some expertise in this area, but I still have doubt whether such global reasoning was correct or not, especially in presence of all possible exotic cases with imports.
After this PR all table changes should be "locally correct" after every update, even if it may be overcautious.
If similar optimizations are introduced again they will need detailed comments explaining why it's legal to do what they do and providing proofs.

Fixes https://github.com/rust-lang/rust/issues/104249.
Fixes https://github.com/rust-lang/rust/issues/104539.
2022-11-25 06:14:42 +00:00
bors
af63e3b39f Auto merge of #104855 - thomcc:revert-noinline-wintls, r=ChrisDenton
Revert "Forbid inlining `thread_local!`'s `__getit` function on Windows"

Revert of #101368, fixes #104852.

I'd rather not do this since that's a soundness fix and this is hitting some compiler bug, but I don't really know an alternative.

r? `@ChrisDenton`
2022-11-25 03:17:25 +00:00
Thom Chiovoloni
24712f9982
Revert "Forbid inlining thread_local!'s __getit function on Windows"
This reverts commit 3099dfdd9f.
2022-11-24 18:12:12 -08:00
Joshua Nelson
fb3e724d76 Don't set is_preview for clippy and rustfmt
These have been shipped on stable for many years now and it would be very disruptive to ever remove them.
Remove the `-preview` suffix from their dist components.
2022-11-24 20:22:08 -05:00
bors
65a6e22668 Auto merge of #104845 - matthiaskrgr:rollup-tckj956, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #104514 (Use node_ty_opt to avoid ICE in visit_ty)
 - #104704 (Allow power10-vector feature in PowerPC)
 - #104747 (resolve: Don't use constructor def ids in the map for field names)
 - #104773 (OpaqueCast projections are always overlapping, they can't possibly be disjoint)
 - #104774 (Document split{_ascii,}_whitespace() for empty strings)
 - #104780 (make `error_reported` check for delayed bugs)
 - #104782 (Bump the const eval step limit)
 - #104792 (rustdoc: simplify `.search-results-title` CSS)
 - #104796 (lint: do not warn unused parens around higher-ranked function pointers)
 - #104820 (Remove normalize_projection_type)
 - #104822 (with_query_mode -> new)

Failed merges:

 - #104716 (move 2 candidates into builtin candidate)
 - #104841 (Assert that we don't capture escaping bound vars in `Fn` trait selection)

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-24 23:45:32 +00:00
Guillaume Gomez
e6a4008d24 Strenghten GUI test to include extra state in selector 2022-11-24 23:39:49 +01:00
Guillaume Gomez
6fc52c6b80 Extend GUI test to include more source code elements checks 2022-11-24 23:36:41 +01:00
Guillaume Gomez
786ec7ccf1 Migrate source code elements style to CSS variables 2022-11-24 23:36:26 +01:00
Michael Goulet
d945967779 Remove comment, simplify since we asserted fn ptr Self type has no bound vars 2022-11-24 21:50:04 +00:00
Michael Goulet
c7330c9fe8 Also check that fn pointer candidates don't have escaping bound vars 2022-11-24 21:50:04 +00:00
Michael Goulet
8927135274 Assert that we don't capture escaping bound vars in Fn trait selection 2022-11-24 21:50:04 +00:00
Matthias Krüger
1048a85dbe
Rollup merge of #104822 - spastorino:selctx-new-instead-of-with_query_mode, r=lcnr
with_query_mode -> new

r? ```@lcnr```
2022-11-24 21:34:57 +01:00
Matthias Krüger
73f01ffd46
Rollup merge of #104820 - spastorino:remove-normalize_projection_type, r=jackh726
Remove normalize_projection_type

r? ``@lcnr``
2022-11-24 21:34:56 +01:00
Matthias Krüger
83d1aab9ff
Rollup merge of #104796 - notriddle:notriddle/unused-issue-104397, r=oli-obk
lint: do not warn unused parens around higher-ranked function pointers

Fixes #104397
2022-11-24 21:34:56 +01:00
Matthias Krüger
ed2d9369f4
Rollup merge of #104792 - notriddle:notriddle/crate-search-title-display, r=GuillaumeGomez
rustdoc: simplify `.search-results-title` CSS

By using `display: flex`, we still get the never-wrapping layout with `#crate-search-div` maxing out and truncating its text. The title itself winds up always filling its parent, but since `#crate-search` doesn't have `flex-grow` set, it won't fill available space.
2022-11-24 21:34:55 +01:00
Matthias Krüger
679f1b7892
Rollup merge of #104782 - oli-obk:const_eval_limit_bump, r=pnkfelix
Bump the const eval step limit

fixes https://github.com/rust-lang/rust/issues/103814

https://github.com/rust-lang/rust/pull/103877 has too much of an impact to beta backport. So let's just increase the limit, avoiding the immediate breakage.

r? ``@pnkfelix``
2022-11-24 21:34:55 +01:00
Matthias Krüger
4843946a10
Rollup merge of #104780 - BoxyUwU:error_reported_not_be_bad, r=oli-obk
make `error_reported` check for delayed bugs

Fixes #104768

`error_reported()` was only checking if there were errors emitted, not for `delay_bug`s which can also be a source of `ErrorGuaranteed`. I assume the same is true of `lint_err_count` but i dont know
2022-11-24 21:34:54 +01:00
Matthias Krüger
d4e5418b0c
Rollup merge of #104774 - vojtechkral:doc-str-empty-split-whitespace, r=thomcc
Document split{_ascii,}_whitespace() for empty strings

doc change only
2022-11-24 21:34:54 +01:00
Matthias Krüger
9a558b68e1
Rollup merge of #104773 - oli-obk:overlap, r=lcnr
OpaqueCast projections are always overlapping, they can't possibly be disjoint

r? ``@lcnr``
2022-11-24 21:34:53 +01:00
Matthias Krüger
0e4eb0da33
Rollup merge of #104747 - petrochenkov:ctorfields, r=cjgillot
resolve: Don't use constructor def ids in the map for field names

Also do some minor cleanup to insertion of those field names.

Addresses a FIXME left in https://github.com/rust-lang/rust/pull/103578.
2022-11-24 21:34:53 +01:00
Matthias Krüger
7a17d61d3d
Rollup merge of #104704 - ecnelises:p10vec, r=jackh726
Allow power10-vector feature in PowerPC

Note that we don't have `power10-altivec`:

57fd7ffeff/llvm/lib/Target/PowerPC/PPC.td (L277-L280)
2022-11-24 21:34:52 +01:00
Matthias Krüger
80dc91c6c3
Rollup merge of #104514 - chenyukang:yukang/fix-104513-ice, r=petrochenkov
Use node_ty_opt to avoid ICE in visit_ty

Fixes #104513
2022-11-24 21:34:51 +01:00
bors
b3bc6bf312 Auto merge of #103693 - HKalbasi:master, r=oli-obk
Make rustc_target usable outside of rustc

I'm working on showing type size in rust-analyzer (https://github.com/rust-lang/rust-analyzer/pull/13490) and I currently copied rustc code inside rust-analyzer, which works, but is bad. With this change, I would become able to use `rustc_target` and `rustc_index` directly in r-a, reducing the amount of copy needed.

This PR contains some feature flag to put nightly features behind them to make crates buildable on the stable compiler + makes layout related types generic over index type + removes interning of nested layouts.
2022-11-24 20:29:13 +00:00
bors
5dfb4b0afa Auto merge of #104321 - Swatinem:async-gen, r=oli-obk
Avoid `GenFuture` shim when compiling async constructs

Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`.

The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim.

The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through.

---

Given this demo code:

```rust
pub async fn a(arg: u32) -> Backtrace {
    let bt = b().await;
    let _arg = arg;
    bt
}

pub async fn b() -> Backtrace {
    Backtrace::force_capture()
}
```

I would get the following with the latest stable compiler (on Windows):

```
   4: async_codegen:🅱️:async_fn$0
             at .\src\lib.rs:10
   5: core::future::from_generator::impl$1::poll<enum2$<async_codegen:🅱️:async_fn_env$0> >
             at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\future\mod.rs:91
   6: async_codegen:🅰️:async_fn$0
             at .\src\lib.rs:4
   7: core::future::from_generator::impl$1::poll<enum2$<async_codegen:🅰️:async_fn_env$0> >
             at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\future\mod.rs:91
```

whereas now I get a much cleaner stack trace:

```
   3: async_codegen:🅱️:async_fn$0
             at .\src\lib.rs:10
   4: async_codegen:🅰️:async_fn$0
             at .\src\lib.rs:4
```
2022-11-24 17:14:42 +00:00
Vojtech Kral
07ccf67f59 Document split{_ascii,}_whitespace() for empty strings 2022-11-24 15:22:24 +01:00
hkalbasi
390a637e29 move things from rustc_target::abi to rustc_abi 2022-11-24 16:26:13 +03:30
hkalbasi
27fb904d68 move some layout logic to rustc_target::abi::layout 2022-11-24 16:26:12 +03:30
hkalbasi
09a384643e make rustc_target usable outside of rustc 2022-11-24 16:26:12 +03:30
Santiago Pastorino
66b4b8b907
with_query_mode -> new 2022-11-24 09:36:17 -03:00
Santiago Pastorino
1930c77de1
Remove normalize_projection_type 2022-11-24 09:02:55 -03:00
Boxy
72d8879c29 make error_reported check for delayed bugs 2022-11-24 11:12:46 +00:00
bors
1dda298ad3 Auto merge of #104809 - matthiaskrgr:rollup-8abjdwh, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #103908 (Suggest `.clone()` or `ref binding` on E0382)
 - #104517 (Throw error on failure in loading llvm-plugin)
 - #104594 (Properly handle `Pin<&mut dyn* Trait>` receiver in codegen)
 - #104742 (Make `deref_into_dyn_supertrait` lint the impl and not the usage)
 - #104753 (Pass `InferCtxt` to `DropRangeVisitor` so we can resolve vars)
 - #104771 (Add regression test for issue #99938)
 - #104772 (Small accessibility improvements)
 - #104775 (Use ObligationCtxt::normalize)
 - #104778 (⬆️ rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-24 09:44:46 +00:00
Arpad Borsos
9f36f988ad
Avoid GenFuture shim when compiling async constructs
Previously, async constructs would be lowered to "normal" generators,
with an additional `from_generator` / `GenFuture` shim in between to
convert from `Generator` to `Future`.

The compiler will now special-case these generators internally so that
async constructs will *directly* implement `Future` without the need
to go through the `from_generator` / `GenFuture` shim.

The primary motivation for this change was hiding this implementation
detail in stack traces and debuginfo, but it can in theory also help
the optimizer as there is less abstractions to see through.
2022-11-24 10:04:27 +01:00
Matthias Krüger
1afbd6e031
Rollup merge of #104778 - lnicola:rust-analyzer-2022-11-23, r=lnicola
⬆️ rust-analyzer

r? ```@ghost```
2022-11-24 08:42:37 +01:00
Matthias Krüger
2190b163a3
Rollup merge of #104775 - spastorino:use-obligation-ctxt-normalize, r=lcnr
Use ObligationCtxt::normalize

r? ```@lcnr```
2022-11-24 08:42:37 +01:00
Matthias Krüger
a3371560ee
Rollup merge of #104772 - GuillaumeGomez:small-accessibility-improvement, r=notriddle
Small accessibility improvements

From this [reddit post](https://www.reddit.com/r/rust/comments/z1gyz7/accessible_documentation/), I started to check a bit how to improve accessibility and how we could add test for it.

So these two fixes come from the use of the [pa11y tool](https://github.com/pa11y/pa11y). To make it work, I had to update its puppeteer version to the last one but otherwise it seems to be quite nice. I didn't fix all the errors it reported because they were about colors. To get the same result as mine, you can use this config:

```json
{
    "ignore": [
	"WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail",
	"WCAG2AA.Principle3.Guideline3_2.3_2_2.H32.2"
     ]
}
```

I think trying to improve accessibility is something we should definitely aim for. I'll try to integrate a tool to enforce this check (very likely `pa11y`) directly into the CI.

cc ``@jsha``
r? ``@notriddle``
2022-11-24 08:42:36 +01:00
Matthias Krüger
84ff4ab5a2
Rollup merge of #104771 - est31:if_let_chain_broken_mir_test, r=davidtwco
Add regression test for issue #99938

That issue was a dupe of #99852, and it got fixed since, but it's always better to have multiple regression tests rather than one.

closes #99938
2022-11-24 08:42:35 +01:00
Matthias Krüger
6938717ca5
Rollup merge of #104753 - compiler-errors:drop-tracking-var-ice, r=oli-obk
Pass `InferCtxt` to `DropRangeVisitor` so we can resolve vars

The types that we encounter in the  `TypeckResults` that we pass to the `DropRangeVisitor` are not yet fully resolved, since that only happens in writeback after type checking is complete.

Instead, pass down the whole `InferCtxt` so that we can resolve any inference vars that have been constrained since they were written into the results. This is similar to how the `MemCategorizationContext` in the `ExprUseVisitor` also needs to pass down both typeck results _and_ the inference context.

Fixes an ICE mentioned in this comment: https://github.com/rust-lang/rust/issues/104382#issuecomment-1324410781
2022-11-24 08:42:35 +01:00
Matthias Krüger
c08c57e856
Rollup merge of #104742 - WaffleLapkin:forbidden-SUPER-deref, r=compiler-errors
Make `deref_into_dyn_supertrait` lint the impl and not the usage

Proposed by ``@compiler-errors`` in https://github.com/rust-lang/rust/issues/89460#issuecomment-1320806785
r? ``@crlf0710``
2022-11-24 08:42:34 +01:00