Commit Graph

227921 Commits

Author SHA1 Message Date
bors
de22388873 Auto merge of #113134 - TaKO8Ki:rollup-4hvqzf6, r=TaKO8Ki
Rollup of 5 pull requests

Successful merges:

 - #112946 (Improve cgu naming and ordering)
 - #113048 (Fix build on Solaris where fd-lock cannot be used.)
 - #113100 (Fix display of long items in search results)
 - #113107 (add check for ConstKind::Value(_) to in_operand())
 - #113119 (rustdoc: Reduce internal function visibility.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-29 07:07:37 +00:00
bors
0a32ca9831 Auto merge of #113146 - matthiaskrgr:rollup-bxtr51e, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #112670 (privacy: Type privacy lints fixes and cleanups)
 - #112929 (Test that we require implementing trait items whose bounds don't hold in the current impl)
 - #113054 (Make `rustc_on_unimplemented` std-agnostic)
 - #113137 (don't suggest `move` for borrows that aren't closures)
 - #113139 (style-guide: Clarify let-else further)
 - #113140 (style-guide: Add an example of formatting a multi-line attribute)
 - #113143 (style-guide: Narrow guidance about references and dereferencing)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-29 04:34:46 +00:00
Matthias Krüger
7a7ffced6a
Rollup merge of #113143 - joshtriplett:style-guide-narrow-dereference-guidance, r=calebcartwright
style-guide: Narrow guidance about references and dereferencing

The style guide advises "prefer dereferencing to taking references", but
doesn't give guidance on when that "preference" should get overridden by
other considerations. Give an example of when it's fine to ignore
that advice.
2023-06-29 05:48:41 +02:00
Matthias Krüger
c0e37ad127
Rollup merge of #113140 - joshtriplett:style-guide-example-multi-line-attribute, r=calebcartwright
style-guide: Add an example of formatting a multi-line attribute

We already say to format attributes like functions, but we didn't have
an example of formatting a multi-line attribute.
2023-06-29 05:48:41 +02:00
Matthias Krüger
c4dc70eb31
Rollup merge of #113139 - joshtriplett:style-clarify-let-else, r=calebcartwright
style-guide: Clarify let-else further

Give some additional examples with multi-line patterns.

Make it clearer to go on to the next case if the conditions aren't met.
2023-06-29 05:48:41 +02:00
Matthias Krüger
7e1869f9b4
Rollup merge of #113137 - lukas-code:no-moving-references, r=compiler-errors
don't suggest `move` for borrows that aren't closures

fixes https://github.com/rust-lang/rust/issues/113087
2023-06-29 05:48:40 +02:00
Matthias Krüger
f35f213d27
Rollup merge of #113054 - Rageking8:make-rustc_on_unimplemented-std-agnostic, r=WaffleLapkin
Make `rustc_on_unimplemented` std-agnostic

See #112923

r? `@WaffleLapkin`
2023-06-29 05:48:40 +02:00
Matthias Krüger
1963688f93
Rollup merge of #112929 - oli-obk:what_if_an_impl_item_just_doesnt_wanna_be_impld, r=compiler-errors
Test that we require implementing trait items whose bounds don't hold in the current impl

I initially tried to make most of these pass, but that's a big can of worms, so I'm just adding them as tests, considering we have no tests for these things.
2023-06-29 05:48:39 +02:00
Matthias Krüger
42a495da7e
Rollup merge of #112670 - petrochenkov:typriv, r=eholk
privacy: Type privacy lints fixes and cleanups

See individual commits.
Follow up to https://github.com/rust-lang/rust/pull/111801.
2023-06-29 05:48:39 +02:00
Josh Triplett
025dd3aef0 style-guide: Narrow guidance about references and dereferencing
The style guide advises "prefer dereferencing to taking references", but
doesn't give guidance on when that "preference" should get overridden by
other considerations. Give an example of when it's fine to ignore
that advice.
2023-06-28 17:10:03 -07:00
bors
75726cae37 Auto merge of #112629 - compiler-errors:atb-imply, r=jackh726
Make associated type bounds in supertrait position implied

`trait A: B<Assoc: C> {}` should be able to imply both `Self: B` and `<Self as B>::Assoc: C`. Adjust the way that we collect implied predicates to do so.

Fixes #112573
Fixes #112568
2023-06-28 23:58:28 +00:00
Josh Triplett
4cc80651b8 style-guide: Add an example of formatting a multi-line attribute
We already say to format attributes like functions, but we didn't have
an example of formatting a multi-line attribute.
2023-06-28 15:35:05 -07:00
Lukas Markeffsky
5e83ddd279 don't suggest move for borrows that aren't closures 2023-06-28 23:56:58 +02:00
Josh Triplett
5abeb801b8 syle-guide: Clarify let-else further
Give some additional examples with multi-line patterns.

Make it clearer to go on to the next case if the conditions aren't met.
2023-06-28 14:56:21 -07:00
Takayuki Maeda
8a5272cb37
Rollup merge of #113119 - aDotInTheVoid:reduce-viz, r=notriddle
rustdoc: Reduce internal function visibility.

As suggested [here](1862fcb1df (r1211200570)).
2023-06-29 03:29:34 +09:00
Takayuki Maeda
74d6958297
Rollup merge of #113107 - mj10021:issue-113012-fix, r=oli-obk
add check for ConstKind::Value(_) to in_operand()

Added check for valtree value to close #113012 which fixes the issue, although I am not sure if adding the check there is sound or not cc `@oli-obk`
2023-06-29 03:29:33 +09:00
Takayuki Maeda
5871bc8486
Rollup merge of #113100 - GuillaumeGomez:search-result-long-name, r=notriddle
Fix display of long items in search results

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

You can test the result [here](https://rustdoc.crud.net/imperio/search-result-long-name/lib2/index.html).

To make it a bit better, I also reduced a bit the size of the short documentation from half to 2 fifth of the width.

r? `@notriddle`
2023-06-29 03:29:33 +09:00
Takayuki Maeda
376c944bd2
Rollup merge of #113048 - psumbera:solaris-bootstrap-cfgs, r=ozkanonur
Fix build on Solaris where fd-lock cannot be used.

This fixes build regression after e7e584b7d9.

Resolves #113085
2023-06-29 03:29:32 +09:00
Takayuki Maeda
bad0688563
Rollup merge of #112946 - nnethercote:improve-cgu-naming-and-ordering, r=wesleywiser
Improve cgu naming and ordering

Some quality of life improvements when debugging and profiling CGU formation.

r? `@wesleywiser`
2023-06-29 03:29:32 +09:00
bors
5bd28f5eac Auto merge of #98867 - cjgillot:metaloop, r=oli-obk
Refactor metadata emission to avoid visiting HIR

This PR refactors metadata emission to be based on tables and iteration over definitions.

In a first part, this PR moves information from the `EntryKind` enum to tables, until removing the `EntryKind` enum.
In a second part, the iteration scheme is refactored to avoid fetching HIR unless strictly necessary.

r? `@ghost`
2023-06-28 16:16:27 +00:00
bors
eb76764ea4 Auto merge of #113120 - Dylan-DPC:rollup-cz4qr3o, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #111571 (Implement proposed API for `proc_macro_span`)
 - #112236 (Simplify computation of killed borrows)
 - #112867 (More `ImplSource` nits)
 - #113019 (add note for non-exhaustive matches with guards)
 - #113094 (Fix invalid HTML DIV tag used in HEAD)
 - #113111 (add myself to review for t-types stuff)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-28 13:25:41 +00:00
Dylan DPC
11c8dbf9f7
Rollup merge of #113111 - BoxyUwU:boxy_t_types_review, r=compiler-errors
add myself to review for t-types stuff

I think this is how the triagebot stuff works 😅 should mean that `r? types` can now assign me
2023-06-28 18:28:48 +05:30
Dylan DPC
a70842c7d1
Rollup merge of #113094 - GuillaumeGomez:fix-invalid-div-tag-in-head, r=notriddle,fmease
Fix invalid HTML DIV tag used in HEAD

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

The issue also nicely explains the whole problem.

r? ``@notriddle``
2023-06-28 18:28:48 +05:30
Dylan DPC
e4e1a995dc
Rollup merge of #113019 - ericmarkmartin:warning-for-guard-non-exhaustion, r=fee1-dead
add note for non-exhaustive matches with guards

Associated issue: #92197

When a match statement includes guards on every match arm (and is therefore necessarily non-exhaustive), add a note to the error E0004 diagnostic noting this.
2023-06-28 18:28:47 +05:30
Dylan DPC
fc2c587cd0
Rollup merge of #112867 - compiler-errors:more-impl-source-nits, r=lcnr
More `ImplSource` nits

Even more clean-ups, I'll put this up in parallel with the `select_in_new_trait_solver` PR.

r? ``@lcnr``
2023-06-28 18:28:47 +05:30
Dylan DPC
dabcbae535
Rollup merge of #112236 - cjgillot:interval-kill, r=davidtwco
Simplify computation of killed borrows

Follow-up to https://github.com/rust-lang/rust/pull/111759

Processing the first block manually once makes the pre-order walk simpler.
2023-06-28 18:28:46 +05:30
Dylan DPC
fa56e01b35
Rollup merge of #111571 - jhpratt:proc-macro-span, r=m-ou-se
Implement proposed API for `proc_macro_span`

As proposed in [#54725 (comment)](https://github.com/rust-lang/rust/issues/54725#issuecomment-1546918161). I have omitted the byte-level API as it's already available as [`Span::byte_range`](https://doc.rust-lang.org/nightly/proc_macro/struct.Span.html#method.byte_range).

`@rustbot` label +A-proc-macros

r? `@m-ou-se`
2023-06-28 18:28:46 +05:30
Alona Enraght-Moony
13ff41eda3 rustdoc: Reduce internal function visibility.
As suggested in
1862fcb1df (r1211200570).
2023-06-28 12:34:26 +00:00
James Dietz
71362c733f remove FIXME and add test 2023-06-28 07:59:36 -04:00
James Dietz
ce5ed5b6cc add check for ConstKind::Value(_) 2023-06-28 07:49:50 -04:00
bors
8882507bc7 Auto merge of #112708 - flip1995:clippy-freezing-pc-with-ice, r=oli-obk
Avoid calling queries during query stack printing

This has the side effect, that when Clippy should ICE (during an EarlyPass?) it will fill up the RAM with 2 GB/s and then freezes my Laptop. This is blocking the Clippy sync and might give some people really bad experiences, so this should be merged ASAP.

r? `@cjgillot`
cc `@Zoxc`

I only commented this on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60try_print_query_stack.60.20has.20.60ImplicitCtx.60.20during.20.60EarlyPass.60/near/363926180). I should've left a comment on the PR as well. My bad.
2023-06-28 09:40:07 +00:00
Guillaume Gomez
a716c79c29 Update GUI tests 2023-06-28 11:21:57 +02:00
Guillaume Gomez
0c10eb0b6a Fix display of long items in search results 2023-06-28 11:14:02 +02:00
Oli Scherer
7c15779ff1 Rustdoc nit: refer to macro from docs 2023-06-28 07:07:16 +00:00
Eric Mark Martin
96bd056695 remove cruft 2023-06-28 01:55:32 -04:00
Eric Mark Martin
2017a176eb use translatable subdiagnostic 2023-06-28 01:51:53 -04:00
Eric Mark Martin
e79b179412 add comment back 2023-06-28 01:51:53 -04:00
Eric Mark Martin
fbd1e0252f add note for non-exhaustive matches with guards 2023-06-28 01:51:53 -04:00
bors
08fd6f719e Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwco
Validate fluent variable references in tests

Closes #101109

Under `cfg(test)`, the `fluent_messages` macro will emit a list of variables referenced by each message and its attributes. The derive attribute will now emit a `#[test]` that checks that each referenced variable exists in the structure it's applied to.
2023-06-28 03:47:02 +00:00
bors
bb95b7dcd6 Auto merge of #112307 - lcnr:operand-ref, r=compiler-errors
mir opt + codegen: handle subtyping

fixes #107205

the same issue was caused in multiple places:
- mir opts: both copy and destination propagation
- codegen: assigning operands to locals (which also propagates values)

I changed codegen to always update the type in the operands used for locals which should guard against any new occurrences of this bug going forward. I don't know how to make mir optimizations more resilient here. Hopefully the added tests will be enough to detect any trivially wrong optimizations going forward.
2023-06-28 00:41:37 +00:00
Boxy
acbab96a8e add boxy to t-types review 2023-06-27 23:52:10 +01:00
bors
6b46c996e1 Auto merge of #113105 - matthiaskrgr:rollup-rci0uym, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #112207 (Add trustzone and virtualization target features for aarch32.)
 - #112454 (Make compiletest aware of targets without dynamic linking)
 - #112628 (Allow comparing `Box`es with different allocators)
 - #112692 (Provide more context for `rustc +nightly -Zunstable-options` on stable)
 - #112972 (Make `UnwindAction::Continue` explicit in MIR dump)
 - #113020 (Add tests impl via obj unless denied)
 - #113084 (Simplify some conditions)
 - #113103 (Normalize types when applying uninhabited predicate.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-27 21:31:47 +00:00
Guillaume Gomez
acbfb8c3bd Replace id attribute with name for <meta> tag 2023-06-27 23:22:44 +02:00
Matthias Krüger
4b1d0682a6
Rollup merge of #113103 - cjgillot:normalize-inhabited, r=compiler-errors
Normalize types when applying uninhabited predicate.

Fixes https://github.com/rust-lang/rust/issues/112997
2023-06-27 22:10:16 +02:00
Matthias Krüger
d505582ce2
Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb
Simplify some conditions

r? `@Nilstrieb`

Some things taken out of my `is_none_or` pr.
2023-06-27 22:10:15 +02:00
Matthias Krüger
db11b77bdd
Rollup merge of #113020 - AnthonyKalaitzis:add-tests-impl-via-obj-unless-denied, r=compiler-errors
Add tests impl via obj unless denied

Fixes #112737

Add simple tests to check feature change in #112320 is performing as expected.

Note:

- Unsure about filenames, locations & function signature names (tried to make them something sensible)
2023-06-27 22:10:15 +02:00
Matthias Krüger
9ec676dd7f
Rollup merge of #112972 - nbdd0121:mir, r=davidtwco
Make `UnwindAction::Continue` explicit in MIR dump

Makes it easier to spot unwinding related issues in MIR by making `UnwindAction::Continue` explicit, just like all other `UnwindAction`s.
2023-06-27 22:10:14 +02:00
Matthias Krüger
b6144cd843
Rollup merge of #112692 - jieyouxu:better-err-msg-for-unstable-options, r=davidtwco
Provide more context for `rustc +nightly -Zunstable-options` on stable

<img width="724" alt="Screenshot 2023-06-16 123456" src="https://github.com/rust-lang/rust/assets/39484203/1933e172-cb9f-4e51-9540-ade803a88360">

Closes #110090.
2023-06-27 22:10:14 +02:00
Matthias Krüger
448d2a8417
Rollup merge of #112628 - gootorov:box_alloc_partialeq, r=joshtriplett
Allow comparing `Box`es with different allocators

Currently, comparing `Box`es over different allocators is not allowed:
```Rust
error[E0308]: mismatched types
  --> library/alloc/tests/boxed.rs:22:20
   |
22 |     assert_eq!(b1, b2);
   |                    ^^ expected `Box<{integer}, ConstAllocator>`, found `Box<{integer}, AnotherAllocator>`
   |
   = note: expected struct `Box<{integer}, ConstAllocator>`
              found struct `Box<{integer}, AnotherAllocator>`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `alloc` (test "collectionstests") due to previous error
```
This PR lifts this limitation
2023-06-27 22:10:13 +02:00
Matthias Krüger
353dd71d73
Rollup merge of #112454 - ferrocene:pa-compiletest-dynamic-linking, r=davidtwco
Make compiletest aware of targets without dynamic linking

Some parts of the compiletest internals and some tests require dynamic linking to work, which is not supported by all targets. Before this PR, this was handled by if branches matching on the target name.

This PR loads whether a target supports dynamic linking or not from the target spec, and adds a `// needs-dynamic-linking` attribute for tests that require it. Note that I was not able to replace all the old conditions based on the target name, as some targets have `dynamic_linking: true` in their spec but pretend they don't have it in compiletest.

Also, to get this to work I had to *partially* revert #111472 (cc `@djkoloski` `@tmandry` `@bjorn3).` On one hand, only the target spec contains whether a target supports dynamic linking, but on the other hand a subset of the fields can be overridden through `-C` flags (as far as I'm aware only `-C panic=$strategy`). The solution I came up with is to take the target spec as the base, and then override the panic strategy based on `--print=cfg`. Hopefully that should not break y'all again.
2023-06-27 22:10:13 +02:00