Commit Graph

227566 Commits

Author SHA1 Message Date
Oli Scherer b323f587fc Handle weak type aliases by immediately resolving them to their aliased type 2023-06-22 15:51:19 +00:00
Oli Scherer b0b4a07959 ICE on types that should not be defining opaque types 2023-06-22 15:51:19 +00:00
Oli Scherer 0af4a211be Document what is going on in opaque_types_defined_by 2023-06-22 15:51:19 +00:00
Oli Scherer cb161e77ba Move some field extraction logic onto a method on Node 2023-06-22 15:51:19 +00:00
Oli Scherer 30ff127036 Re-use error code for duplicate error 2023-06-22 15:51:14 +00:00
Oli Scherer d6e1b20623 Fix a codegen test 2023-06-22 15:36:46 +00:00
Oli Scherer a71628c114 Treat opaque types failing the signature defining scope check as defining, as we already errored and can hide subsequent errors this way. 2023-06-22 15:36:42 +00:00
Oli Scherer 41881aece2 Stop failing eagerly, and collect all opaque types even if some are erroneous. 2023-06-22 15:08:18 +00:00
Oli Scherer 326a9fa8e8 Add tests showcasing our short circuiting behaviour in the signature checks for defining scopes 2023-06-22 15:02:44 +00:00
Oli Scherer 12243ec415 Point to argument/return type instead of the whole function header 2023-06-22 15:00:12 +00:00
Oli Scherer bae645451e Only create the opaque collector once and visit it many times 2023-06-22 14:31:15 +00:00
Oli Scherer c8979e587b Move opaque_type_origin_unchecked onto TyCtxt and re-use it where it was open coded 2023-06-22 14:31:15 +00:00
bors fa06a371b7 Auto merge of #112695 - nnethercote:inline-before-merging-cgus, r=wesleywiser
Inline before merging cgus

Because CGU merging relies on CGU sizes, but the CGU sizes before inlining aren't accurate.

This change doesn't have much effect on compile perf, but it makes follow-on changes that involve more sophisticated reasoning about CGU sizes much easier.

r? `@wesleywiser`
2023-06-22 08:34:32 +00:00
bors 0928a1f757 Auto merge of #112914 - matthiaskrgr:rollup-f0kdqh9, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #112876 (Don't substitute a GAT that has mismatched generics in `OpaqueTypeCollector`)
 - #112906 (rustdoc: render the body of associated types before the where-clause)
 - #112907 (Update cargo)
 - #112908 (Print def_id on EarlyBoundRegion debug)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-22 05:42:01 +00:00
Matthias Krüger b13c9417cf Rollup merge of #112908 - spastorino:add-def-id-to-early-bound-region-debug, r=compiler-errors
Print def_id on EarlyBoundRegion debug

It's not the first time that I can't make sense out of the default debug print on `EarlyBoundRegion`. As I was working on #112682 I needed this.

I was doing some git archeology and found that we used to print everything https://github.com/spastorino/rust/blob/dfbc9608ce5c9655a36b63f6cc9694f5e4ad9890/src/librustc/util/ppaux.rs#L425-L430 but we lost the ability in some refactor midway.
2023-06-22 06:29:34 +02:00
Matthias Krüger 1b57b163d7 Rollup merge of #112907 - weihanglo:update-cargo, r=weihanglo
Update cargo

2 commits in dead4b8740c4b6a8ed5211e37c99cf81d01c3b1c..4cebd130ebca3bc219180a54f3e26cc1b14a91de
2023-06-20 20:07:17 +0000 to 2023-06-21 18:59:29 +0000
- fix: Allow embedded manifests in all commands (rust-lang/cargo#12289)
- feat(cli): Support `cargo Cargo.toml` (rust-lang/cargo#12281)

r? `@ghost`
2023-06-22 06:29:34 +02:00
Matthias Krüger 3ba66df643 Rollup merge of #112906 - fmease:rustdoc-render-assoc-ty-body-before-where-clause, r=notriddle
rustdoc: render the body of associated types before the where-clause

Fixes #112903.
2023-06-22 06:29:33 +02:00
Matthias Krüger cc93c5fca0 Rollup merge of #112876 - compiler-errors:check-subst-compat-in-OpaqueTypeCollector, r=oli-obk
Don't substitute a GAT that has mismatched generics in `OpaqueTypeCollector`

Fixes #111828

I didn't put up minimized UI tests for #112510 or #112873 because they'd minimize to literally the same code, but with different substs on the trait/impl. I don't think that warrants duplicate tests given the nature of the fix.

r? `@oli-obk`

----

Side-note: I checked, and this isn't fixed by #112652 -- I think we discussed whether or not that PR fixed it either intentionally or by accident. The code here isn't really touched by that PR either as far as I can tell?

Also, sorry, did some other drive-bys. Hope it doesn't make rebasing #112652 too difficult 😅
2023-06-22 06:29:33 +02:00
bors fba636a387 Auto merge of #112814 - antoyo:sync-cg_gcc-2023-06-19, r=bjorn3
Sync rustc_codegen_gcc 2023/06/19

Hi.
This is a sync of the rustc_codegen_gcc subtree.
Thanks.
2023-06-22 02:11:08 +00:00
Nicholas Nethercote abde9ba527 Tweak CGU size estimate code.
- Rename `create_size_estimate` as `compute_size_estimate`, because that
  makes more sense for the second and subsequent calls for each CGU.
- Change `CodegenUnit::size_estimate` from `Option<usize>` to `usize`.
  We can still assert that `compute_size_estimate` is called first.
- Move the size estimation for `place_mono_items` inside the function,
  for consistency with `merge_codegen_units`.
2023-06-22 09:33:06 +10:00
bors f272fc3a86 Auto merge of #103503 - thomcc:tvos-support, r=workingjubilee
Support Apple tvOS in libstd

This target has existed in the compiler for a while, was `no_std`-only previously (even requiring `#![feature(restricted_std)]`). Apple tvOS is essentially the same as iOS, down to using the same version numbering, so there's no reason for this to be a `no_std`-only target the way it is currently.

Not yet tested much (I have an Apple TV, but haven't tested that this can deploy and run programs on it, nor the simulator). Uses the implementation strategy as the watchOS support in https://github.com/rust-lang/rust/pull/98101 and etc. That is, no `std::os::` interfaces aside from those in `std::os::unix`.

Includes an update to libc in order to pull in https://github.com/rust-lang/libc/pull/2958.
2023-06-21 22:45:37 +00:00
Santiago Pastorino 3ef510ca80 Print def_id on EarlyBoundRegion debug 2023-06-21 19:34:21 -03:00
Nicholas Nethercote 105ac1c26d Merge root and inlined item placement.
There's no longer any need for them to be separate, and putting them
together reduces the amount of code.
2023-06-22 08:10:29 +10:00
Nicholas Nethercote 6f228e3420 Inline before merging CGUs.
Because CGU merging relies on CGU sizes, but the CGU sizes before
inlining aren't accurate.

This requires tweaking how the sizes are updated during merging: if CGU
A and B both have an inlined function F, then `size(A + B)` will be a
little less than `size(A) + size(B)`, because `A + B` will only have one
copy of F. Also, the minimum CGU size is increased because it now has to
account for inlined functions.

This change doesn't have much effect on compile perf, but it makes
follow-on changes that involve more sophisticated reasoning about CGU
sizes much easier.
2023-06-22 08:10:29 +10:00
Nicholas Nethercote f6cadae163 Streamline some comments. 2023-06-22 08:10:29 +10:00
Thom Chiovoloni af0662f18c Note that posix_spawnp probably still does not work the way people may want 2023-06-21 15:01:12 -07:00
Thom Chiovoloni 5ef4d1fb2e Actually save all the files 2023-06-21 14:59:40 -07:00
Thom Chiovoloni a7ecc71a48 Note the incomplete Command support in the apple-tvos.md document 2023-06-21 14:59:40 -07:00
Thom Chiovoloni 37854aab76 Update tvOS support elsewhere in the stdlib 2023-06-21 14:59:40 -07:00
Thom Chiovoloni 49da0acb71 Avoid fork/exec spawning on tvOS/watchOS, as those functions are marked as prohibited 2023-06-21 14:59:40 -07:00
Thom Chiovoloni b80e0b7f53 Reorder tvos_* functions in apple_base.rs to avoid breaking sorted order 2023-06-21 14:59:40 -07:00
Thom Chiovoloni a3f5566858 Apply suggestions from code review
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2023-06-21 14:59:40 -07:00
Thom Chiovoloni 6e62961474 Fix missing link in SUMMARY.md 2023-06-21 14:59:40 -07:00
Thom Chiovoloni b18ff59690 Fix rustc_target::spec::apple::tests 2023-06-21 14:59:40 -07:00
Thom Chiovoloni df9640211d Add a tvOS entry to the platform-support documentation 2023-06-21 14:59:39 -07:00
Thom Chiovoloni abb1911682 Fix the tvOS targets to use the right LLVM target and respect the deployment target environment variables 2023-06-21 14:59:39 -07:00
Thom Chiovoloni 3785a17dd9 Fix busted data_layout (mismatch vs LLVM) in x86_64 tvOS simulator target 2023-06-21 14:59:39 -07:00
Thom Chiovoloni f978d7ea42 Finish up preliminary tvos support in libstd 2023-06-21 14:59:39 -07:00
Thom Chiovoloni bdc3db944c wip: Support Apple tvOS in libstd 2023-06-21 14:59:37 -07:00
Weihang Lo b610be68e9 Update cargo 2023-06-21 21:36:50 +01:00
León Orell Valerian Liehr b866113d19 rustdoc: render the assoc ty body before the where-clause 2023-06-21 21:53:55 +02:00
bors 065a1f5df9 Auto merge of #112900 - GuillaumeGomez:rollup-1blf4io, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #112538 (Removed unnecessary &String -> &str, now that &String implements StableOrd as well)
 - #112868 (Liberate bound vars properly when suggesting missing async-fn-in-trait)
 - #112892 (resolve: Minor cleanup to `fn resolve_path_with_ribs`)
 - #112894 (Fix union fields display)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-21 19:48:41 +00:00
Guillaume Gomez f5470af6a6 Rollup merge of #112894 - GuillaumeGomez:gui-fields-display, r=notriddle
Fix union fields display

![Screenshot from 2023-06-21 16-47-24](https://github.com/rust-lang/rust/assets/3050060/833b0fe6-7fb6-4371-86c3-d82fa0c3fe49)

So two bugs in this screenshot: no whitespace between field name and type name, both fields are on the same line. Both problems come from issues in the templates because all whitespace are removed if a askama "command" follows.

r? `@notriddle`
2023-06-21 20:00:51 +02:00
Guillaume Gomez d938be153c Rollup merge of #112892 - petrochenkov:cleanres, r=oli-obk
resolve: Minor cleanup to `fn resolve_path_with_ribs`

A single-use closure is inlined and one unnecessary enum is removed.

Noticed when reviewing https://github.com/rust-lang/rust/pull/112686.
2023-06-21 20:00:50 +02:00
Guillaume Gomez 5ed75a9628 Rollup merge of #112868 - compiler-errors:liberate-afit-sugg, r=WaffleLapkin
Liberate bound vars properly when suggesting missing async-fn-in-trait

Fixes #112848
2023-06-21 20:00:50 +02:00
Guillaume Gomez a5561eb4d5 Rollup merge of #112538 - ndrewxie:issue-84447-partial-1, r=compiler-errors
Removed unnecessary &String -> &str, now that &String implements StableOrd as well

Applied a few nits suggested by lcnr to PR #110040 (nits can be found [here](https://github.com/rust-lang/rust/pull/110040#pullrequestreview-1469452191).)

Making a new PR because the old one was already merged, and given that this just applies changes that were already suggested, reviewing it should be fairly open-and-shut.
2023-06-21 20:00:49 +02:00
Michael Goulet c4cd607100 Additional test demonstrating check for full trait ref 2023-06-21 16:41:52 +00:00
bors 006a26c0b5 Auto merge of #111684 - ChayimFriedman2:unused-offset-of, r=WaffleLapkin
Warn on unused `offset_of!()` result

The usage of `core::hint::must_use()` means that we don't get a specialized message. I figured out that since there are plenty of other methods that just have `#[must_use]` with no message it'll be fine, but it is a bit unfortunate that the error mentions `must_use` and not `offset_of!`.

Fixes #111669.
2023-06-21 16:40:54 +00:00
Michael Goulet 5344ed23fa Don't substitute a GAT that has mismatched generics in OpaqueTypeCollector 2023-06-21 16:33:17 +00:00
Michael Goulet 7563909a28 Liberate bound vars properly when suggesting missing AFIT 2023-06-21 16:32:26 +00:00