]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoRollup merge of #105623 - compiler-errors:generator-type-size-fix, r=Nilstrieb
Matthias Krüger [Thu, 15 Dec 2022 11:46:00 +0000 (12:46 +0100)]
Rollup merge of #105623 - compiler-errors:generator-type-size-fix, r=Nilstrieb

Fix `-Z print-type-sizes` for generators with discriminant field ordered first

Fixes #105589
Fixes #105591

18 months agoRollup merge of #104592 - ComputerDruid:async_check, r=compiler-errors
Matthias Krüger [Thu, 15 Dec 2022 11:46:00 +0000 (12:46 +0100)]
Rollup merge of #104592 - ComputerDruid:async_check, r=compiler-errors

Ensure async trait impls are async (or otherwise return an opaque type)

As a workaround for the full `#[refine]` semantics not being implemented
yet, forbit returning a concrete future type like `Box<dyn Future>` or a
manually implemented Future.

`-> impl Future` is still permitted; while that can also cause
accidental refinement, that's behind a different feature gate
(`return_position_impl_trait_in_trait`) and that problem exists
regardless of whether the trait method is async, so will have to be
solved more generally.

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

18 months agoAllow `impl ~const Trait` opaque types
Deadbeef [Thu, 15 Dec 2022 00:51:34 +0000 (00:51 +0000)]
Allow `impl ~const Trait` opaque types

18 months agoAuto merge of #105285 - compiler-errors:conflicting-param-env-2, r=estebank
bors [Thu, 15 Dec 2022 11:11:49 +0000 (11:11 +0000)]
Auto merge of #105285 - compiler-errors:conflicting-param-env-2, r=estebank

Highlight conflicting param-env candidates, again

Un-reverts #98794 (i.e. reverts #99290).

The previous time I attempted to land this PR, it was because of an incremental issue (#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by `@lcnr)` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly.

The main motivation for trying to re-land this is that it fixes #105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates:

```
error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>`
   |
note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found
  --> $DIR/conflicting-bounds.rs:3:1
   |
LL | pub trait Gen<'source> {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL |         Self: for<'s> Gen<'s, Output = T>;
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
```

Fixes #105131.
Fixes (again) #98786

18 months agoAuto merge of #105713 - bjorn3:sync_cg_clif-2022-12-14, r=bjorn3
bors [Thu, 15 Dec 2022 07:23:38 +0000 (07:23 +0000)]
Auto merge of #105713 - bjorn3:sync_cg_clif-2022-12-14, r=bjorn3

Sync rustc_codegen_cranelift

This time there are a bunch of bugfixes, some new llvm intrinsic implementations and refactorings to the build system in preparation for running cg_clif tests as part of `./x.py test`.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler

18 months agoVarious cleanups to dest prop
Jakob Degen [Wed, 14 Dec 2022 05:30:42 +0000 (21:30 -0800)]
Various cleanups to dest prop

18 months agoAdd regression test for #55976
Yuki Okushi [Thu, 15 Dec 2022 06:04:23 +0000 (15:04 +0900)]
Add regression test for #55976

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agorustdoc: remove no-op CSS `.item-info:before { color }`
Michael Howell [Thu, 15 Dec 2022 05:11:59 +0000 (22:11 -0700)]
rustdoc: remove no-op CSS `.item-info:before { color }`

No content is set, so this pseudo-element does not exist. The CSS was
obsoleted by 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0.

18 months agoAuto merge of #105657 - oli-obk:mk_projection_ty, r=lcnr
bors [Thu, 15 Dec 2022 04:21:25 +0000 (04:21 +0000)]
Auto merge of #105657 - oli-obk:mk_projection_ty, r=lcnr

Guard ProjectionTy creation against passing the wrong number of substs

r? `@lcnr`

18 months agoMerge `SimplifiedTypeGen<D>` into `SimplifiedType`.
Nicholas Nethercote [Thu, 15 Dec 2022 04:13:19 +0000 (15:13 +1100)]
Merge `SimplifiedTypeGen<D>` into `SimplifiedType`.

`SimplifiedTypeGen<DefId>` is the only instantiation used, so we don't
need the generic parameter.

18 months agoMerge `SimplifiedTypeGen<D>` into `SimplifiedType`.
Nicholas Nethercote [Thu, 15 Dec 2022 04:13:19 +0000 (15:13 +1100)]
Merge `SimplifiedTypeGen<D>` into `SimplifiedType`.

`SimplifiedTypeGen<DefId>` is the only instantiation used, so we don't
need the generic parameter.

18 months agoRemove `SimplifiedTypeGen::map_def`.
Nicholas Nethercote [Thu, 15 Dec 2022 04:04:09 +0000 (15:04 +1100)]
Remove `SimplifiedTypeGen::map_def`.

It's unused.

18 months agoTweak output for bare `dyn Trait` in arguments
Esteban Küber [Thu, 15 Dec 2022 02:51:55 +0000 (18:51 -0800)]
Tweak output for bare `dyn Trait` in arguments

Fix #35825.

18 months agoAuto merge of #104765 - chenyukang:yukang-fix-104639-lifetime-check, r=oli-obk
bors [Thu, 15 Dec 2022 01:28:16 +0000 (01:28 +0000)]
Auto merge of #104765 - chenyukang:yukang-fix-104639-lifetime-check, r=oli-obk

Find the right lower bound region in the scenario of partial order relations

Fixes #104639

18 months agoEnsure async trait impls are async (or otherwise return an opaque type)
Dan Johnson [Thu, 3 Nov 2022 00:45:08 +0000 (17:45 -0700)]
Ensure async trait impls are async (or otherwise return an opaque type)

As a workaround for the full `#[refine]` semantics not being implemented
yet, forbit returning a concrete future type like `Box<dyn Future>` or a
manually implemented Future.

`-> impl Future` is still permitted; while that can also cause
accidental refinement, that's behind a different feature gate
(`return_position_impl_trait_in_trait`) and that problem exists
regardless of whether the trait method is async, so will have to be
solved more generally.

Fixes #102745

18 months agorustdoc: remove no-op CSS `.scrape-example .src-line-numbers { margin: 0 }`
Michael Howell [Wed, 14 Dec 2022 23:25:26 +0000 (16:25 -0700)]
rustdoc: remove no-op CSS `.scrape-example .src-line-numbers { margin: 0 }`

This is the default CSS for `<pre>` tags in `.code-wrapper` anyway, so this
line does nothing.

18 months agomore clippy::complexity fixes
Matthias Krüger [Wed, 14 Dec 2022 23:06:34 +0000 (00:06 +0100)]
more clippy::complexity fixes

18 months agoAuto merge of #105704 - weihanglo:update-cargo, r=weihanglo
bors [Wed, 14 Dec 2022 22:24:31 +0000 (22:24 +0000)]
Auto merge of #105704 - weihanglo:update-cargo, r=weihanglo

Update cargo

8 commits in 70898e522116f6c23971e2a554b2dc85fd4c84cd..cc0a320879c17207bbfb96b5d778e28a2c62030d 2022-12-05 19:43:44 +0000 to 2022-12-14 14:46:57 +0000
- artifact deps should works when target field specified coexists with `optional = true` (rust-lang/cargo#11434)
- Add `home` crate to cargo crates (rust-lang/cargo#11359)
- Use proper git URL for GitHub repos (rust-lang/cargo#11475)
- Fixes flock(fd, LOCK_UN) emulation on Solaris. (rust-lang/cargo#11474)
- Allow Check targets needed for optional doc-scraping to fail without killing the build (rust-lang/cargo#11450)
- fix: gleaning rustdocflags from `target.cfg(…)` is not supported (rust-lang/cargo#11323)
- Fix typo (rust-lang/cargo#11470)
- resolver.md: Fix naming in example (rust-lang/cargo#11469)

r? `@ghost`

18 months agoaddress review
b-naber [Fri, 9 Dec 2022 17:08:56 +0000 (18:08 +0100)]
address review

18 months agowrap output in BufWriter
Rémy Rakic [Wed, 14 Dec 2022 20:15:58 +0000 (20:15 +0000)]
wrap output in BufWriter

18 months agobless rustdoc test for unstable options
Rémy Rakic [Fri, 9 Dec 2022 01:55:03 +0000 (01:55 +0000)]
bless rustdoc test for unstable options

18 months agoadd `-Z dump-mono-stats`
Rémy Rakic [Thu, 8 Dec 2022 19:21:08 +0000 (19:21 +0000)]
add `-Z dump-mono-stats`

This option will output some stats from the monomorphization collection
pass to a file, to show estimated sizes from each instantiation.

18 months agoadd helper to get DefId from MonoItem
Rémy Rakic [Thu, 8 Dec 2022 19:20:16 +0000 (19:20 +0000)]
add helper to get DefId from MonoItem

18 months agoalways use anonymize_bound_vars
Michael Goulet [Wed, 14 Dec 2022 20:06:08 +0000 (20:06 +0000)]
always use anonymize_bound_vars

18 months agoDo not mention long types in E0599 label
Esteban Küber [Wed, 14 Dec 2022 19:26:32 +0000 (11:26 -0800)]
Do not mention long types in E0599 label

The type is already mentioned in the main message and the list of unmet
bounds.

18 months agoAuto merge of #105703 - matthiaskrgr:rollup-tfpeam2, r=matthiaskrgr
bors [Wed, 14 Dec 2022 19:14:39 +0000 (19:14 +0000)]
Auto merge of #105703 - matthiaskrgr:rollup-tfpeam2, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #105399 (Use more LFS functions.)
 - #105578 (Fix transmutes between pointers in different address spaces (e.g. fn ptrs on AVR))
 - #105598 (explain mem::forget(env_lock) in fork/exec)
 - #105624 (Fix unsoundness in bootstrap cache code)
 - #105630 (Add a test for #92481)
 - #105684 (Improve rustdoc markdown variable naming)
 - #105697 (Remove fee1-dead from reviewers)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

18 months agoFix rustdoc
Oli Scherer [Wed, 14 Dec 2022 18:55:55 +0000 (18:55 +0000)]
Fix rustdoc

18 months agoAddress review comments <3
Fridtjof Stoldt [Wed, 14 Dec 2022 07:22:17 +0000 (08:22 +0100)]
Address review comments <3

Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
Co-authored-by: Alex Macleod <alex@macleod.io>
18 months agoAdd tidy exceptions
bjorn3 [Wed, 14 Dec 2022 18:47:46 +0000 (19:47 +0100)]
Add tidy exceptions

18 months agoRun `x test tidy` sooner in mingw-check
Joshua Nelson [Wed, 14 Dec 2022 18:46:47 +0000 (12:46 -0600)]
Run `x test tidy` sooner in mingw-check

It takes less time to run than the other tests and is more likely to fail.
`expand-yaml-anchors` is still run first to make sure the CI files are internally consistent.

18 months agoAdd test
Michael Goulet [Mon, 5 Dec 2022 04:38:58 +0000 (04:38 +0000)]
Add test

18 months agoHighlight conflicting param-env candidates, again
Michael Goulet [Tue, 15 Nov 2022 23:11:11 +0000 (23:11 +0000)]
Highlight conflicting param-env candidates, again

18 months agoAuto traits in dyn are suggestable
Michael Goulet [Mon, 12 Dec 2022 19:23:20 +0000 (19:23 +0000)]
Auto traits in dyn are suggestable

18 months agoMake report_projection_error more term agnostic
Michael Goulet [Mon, 12 Dec 2022 21:03:00 +0000 (21:03 +0000)]
Make report_projection_error more term agnostic

18 months agoMerge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
bjorn3 [Wed, 14 Dec 2022 18:30:46 +0000 (19:30 +0100)]
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14

18 months agodrive-by: Fix path spans
Michael Goulet [Sat, 12 Nov 2022 20:03:20 +0000 (20:03 +0000)]
drive-by: Fix path spans

18 months agoUse impl's def id when calculating type to specify UFCS
Michael Goulet [Sat, 12 Nov 2022 19:42:06 +0000 (19:42 +0000)]
Use impl's def id when calculating type to specify UFCS

18 months agobail in collect_trait_impl_trait_tys if signatures reference errors
Michael Goulet [Wed, 14 Dec 2022 18:24:21 +0000 (18:24 +0000)]
bail in collect_trait_impl_trait_tys if signatures reference errors

18 months agorustdoc: remove unnecessary CSS `kbd { cursor: default }`
Michael Howell [Wed, 14 Dec 2022 17:26:39 +0000 (10:26 -0700)]
rustdoc: remove unnecessary CSS `kbd { cursor: default }`

Added along with theme picker changes in
e78f1392b79779fa184f9a63e7be04ac7074a1c2, but no reason seems to have been
given at the time for why this particular rule was added.

Removing this rule results in `<kbd>` elements getting an I-bar, while the
rule causes them to use the "default" arrow, but since selecting the text in
these elements works fine, the I-bar is not misleading.

18 months agoDon't bug if we're trying to cast dyn* to a nother type
Michael Goulet [Wed, 14 Dec 2022 18:00:56 +0000 (18:00 +0000)]
Don't bug if we're trying to cast dyn* to a nother type

18 months agoMake print_type_sizes test not use feature(start)
Michael Goulet [Mon, 12 Dec 2022 20:09:34 +0000 (20:09 +0000)]
Make print_type_sizes test not use feature(start)

18 months agoConsider discriminant fields that are ordered before variant fields
Michael Goulet [Mon, 12 Dec 2022 18:21:10 +0000 (18:21 +0000)]
Consider discriminant fields that are ordered before variant fields

18 months agoUpdate cargo
Weihang Lo [Wed, 14 Dec 2022 16:20:45 +0000 (16:20 +0000)]
Update cargo

8 commits in 70898e522116f6c23971e2a554b2dc85fd4c84cd..cc0a320879c17207bbfb96b5d778e28a2c62030d
2022-12-05 19:43:44 +0000 to 2022-12-14 14:46:57 +0000
- artifact deps should works when target field specified coexists with `optional = true` (rust-lang/cargo#11434)
- Add `home` crate to cargo crates (rust-lang/cargo#11359)
- Use proper git URL for GitHub repos (rust-lang/cargo#11475)
- Fixes flock(fd, LOCK_UN) emulation on Solaris. (rust-lang/cargo#11474)
- Allow Check targets needed for optional doc-scraping to fail without killing the build (rust-lang/cargo#11450)
- fix: gleaning rustdocflags from `target.cfg(…)` is not supported (rust-lang/cargo#11323)
- Fix typo (rust-lang/cargo#11470)
- resolver.md: Fix naming in example (rust-lang/cargo#11469)

18 months agoRollup merge of #105697 - fee1-dead-contrib:rm-fee1-dead, r=Mark-Simulacrum
Matthias Krüger [Wed, 14 Dec 2022 16:17:59 +0000 (17:17 +0100)]
Rollup merge of #105697 - fee1-dead-contrib:rm-fee1-dead, r=Mark-Simulacrum

Remove fee1-dead from reviewers

.. for now. I have been burned out a bit from reviews and I think I should take a break.

18 months agoRollup merge of #105684 - GuillaumeGomez:improve-rustdoc-var-name, r=notriddle
Matthias Krüger [Wed, 14 Dec 2022 16:17:59 +0000 (17:17 +0100)]
Rollup merge of #105684 - GuillaumeGomez:improve-rustdoc-var-name, r=notriddle

Improve rustdoc markdown variable naming

Opened on the right repository this time. :laughing:

r? `@notriddle`

18 months agoRollup merge of #105630 - albertlarsan68:test-92481, r=TaKO8Ki
Matthias Krüger [Wed, 14 Dec 2022 16:17:58 +0000 (17:17 +0100)]
Rollup merge of #105630 - albertlarsan68:test-92481, r=TaKO8Ki

Add a test for #92481

The test was copied ad-hoc from #92481, but I can't get the test to pass, because of needing to get twice the same error on the last line of the source.

Closes #92481

18 months agoRollup merge of #105624 - compiler-errors:cache-unsound, r=jyn514
Matthias Krüger [Wed, 14 Dec 2022 16:17:58 +0000 (17:17 +0100)]
Rollup merge of #105624 - compiler-errors:cache-unsound, r=jyn514

Fix unsoundness in bootstrap cache code

Discovered via #105575, which showed that rustc was failing to build during a perf run.

18 months agoRollup merge of #105598 - RalfJung:more-comments, r=the8472
Matthias Krüger [Wed, 14 Dec 2022 16:17:57 +0000 (17:17 +0100)]
Rollup merge of #105598 - RalfJung:more-comments, r=the8472

explain mem::forget(env_lock) in fork/exec

I stumbled upon this while doing triage for https://github.com/rust-lang/rust/issues/64718.

18 months agoRollup merge of #105578 - erikdesjardins:addrspacecast, r=bjorn3
Matthias Krüger [Wed, 14 Dec 2022 16:17:57 +0000 (17:17 +0100)]
Rollup merge of #105578 - erikdesjardins:addrspacecast, r=bjorn3

Fix transmutes between pointers in different address spaces (e.g. fn ptrs on AVR)

Currently, this causes a verifier error (https://godbolt.org/z/YYohed4bj), since it uses `bitcast`, which can't convert between address spaces.

Uncovered due to https://github.com/rust-lang/rust/pull/105545#discussion_r1045269309

r? `@bjorn3`

18 months agoRollup merge of #105399 - mikebenfield:lfs, r=thomcc
Matthias Krüger [Wed, 14 Dec 2022 16:17:56 +0000 (17:17 +0100)]
Rollup merge of #105399 - mikebenfield:lfs, r=thomcc

Use more LFS functions.

On Linux, use mmap64, open64, openat64, and sendfile64 in place of their non-LFS counterparts.

This is relevant to #94173.

With these changes (together with rust-lang/backtrace-rs#501), the simple binaries I produce with rustc seem to have no non-LFS functions, so maybe #94173 is fixed. But I can't be sure if I've missed something and maybe some non-LFS functions could sneak in somehow.

18 months agoAuto merge of #105233 - mejrs:always_eager, r=estebank
bors [Wed, 14 Dec 2022 16:16:50 +0000 (16:16 +0000)]
Auto merge of #105233 - mejrs:always_eager, r=estebank

Always evaluate vecs of subdiagnostics eagerly

See https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20lists!/near/310186705 for context

18 months agoDebug assertions hate this trick
Oli Scherer [Wed, 14 Dec 2022 15:37:47 +0000 (15:37 +0000)]
Debug assertions hate this trick

18 months agoRemove TraitRef::new
Oli Scherer [Tue, 13 Dec 2022 11:25:31 +0000 (11:25 +0000)]
Remove TraitRef::new

18 months agoFix some comments and only get the generics in debug mode
Oli Scherer [Wed, 14 Dec 2022 14:37:16 +0000 (14:37 +0000)]
Fix some comments and only get the generics in debug mode

18 months agoEnsure no one constructs `AliasTy`s themselves
Oli Scherer [Tue, 13 Dec 2022 11:07:42 +0000 (11:07 +0000)]
Ensure no one constructs `AliasTy`s themselves

18 months agoFix a freshly detected wrong TraitRef
Oli Scherer [Tue, 13 Dec 2022 11:59:15 +0000 (11:59 +0000)]
Fix a freshly detected wrong TraitRef

18 months agoRemove TraitRef::new
Oli Scherer [Tue, 13 Dec 2022 11:25:31 +0000 (11:25 +0000)]
Remove TraitRef::new

18 months agoPrevent the creation of `TraitRef` without dedicated methods
Oli Scherer [Tue, 13 Dec 2022 11:18:58 +0000 (11:18 +0000)]
Prevent the creation of `TraitRef` without dedicated methods

18 months agoEnsure no one constructs `AliasTy`s themselves
Oli Scherer [Tue, 13 Dec 2022 11:07:42 +0000 (11:07 +0000)]
Ensure no one constructs `AliasTy`s themselves

18 months agoRemove one more usage of `mk_substs_trait`
Oli Scherer [Tue, 13 Dec 2022 10:49:30 +0000 (10:49 +0000)]
Remove one more usage of `mk_substs_trait`

18 months agoRemove many more cases of `mk_substs_trait` that can now use the iterator scheme`
Oli Scherer [Tue, 13 Dec 2022 10:44:35 +0000 (10:44 +0000)]
Remove many more cases of `mk_substs_trait` that can now use the iterator scheme`

18 months agoLet `mk_fn_def` take an iterator instead to simplify some call sites
Oli Scherer [Tue, 13 Dec 2022 10:37:19 +0000 (10:37 +0000)]
Let `mk_fn_def` take an iterator instead to simplify some call sites

18 months agoRename to match similar methods
Oli Scherer [Tue, 13 Dec 2022 10:26:11 +0000 (10:26 +0000)]
Rename to match similar methods

18 months agoGuard `AliasTy` creation against passing the wrong number of substs
Oli Scherer [Tue, 13 Dec 2022 10:25:21 +0000 (10:25 +0000)]
Guard `AliasTy` creation against passing the wrong number of substs

18 months agoRemove unnecessary git init
bjorn3 [Wed, 14 Dec 2022 15:23:24 +0000 (15:23 +0000)]
Remove unnecessary git init

18 months agoExplicitly provide dummy git author name and email
bjorn3 [Wed, 14 Dec 2022 15:21:18 +0000 (15:21 +0000)]
Explicitly provide dummy git author name and email

This avoids the need to tell git beforehand about your name and email

18 months agofs/tests: Fail fast on duplicate errors rather than looping indefinitely
Tavian Barnes [Wed, 14 Dec 2022 15:01:42 +0000 (10:01 -0500)]
fs/tests: Fail fast on duplicate errors rather than looping indefinitely

18 months agofs/tests: Explicitly kill the zombie rather than sleeping until it dies
Tavian Barnes [Wed, 14 Dec 2022 14:54:55 +0000 (09:54 -0500)]
fs/tests: Explicitly kill the zombie rather than sleeping until it dies

18 months agoAuto merge of #10053 - naosense:fix_9933, r=xFrednet
bors [Wed, 14 Dec 2022 13:48:53 +0000 (13:48 +0000)]
Auto merge of #10053 - naosense:fix_9933, r=xFrednet

improve `manual_is_ascii_check ` check

Sorry, not familiar the api, i can only check the method name of expression `<expr-1>.contains(<expr-2>)` after read clippy book and hints from #9933 . i dont know how to check
1.  if <expr-1> is a specific range
2. <expr-2> is a character

r? `@xFrednet` could you please provide some more hints? 😝️

---

changelog: Enhancement: [`manual_is_ascii_check`]: Now detects ranges with `.contains()` calls
[#10053](https://github.com/rust-lang/rust-clippy/pull/10053)
<!-- changelog_checked -->

18 months agostd: use a more efficient `Once` on platforms without threads
joboet [Wed, 14 Dec 2022 12:55:30 +0000 (13:55 +0100)]
std: use a more efficient `Once` on platforms without threads

18 months agoAuto merge of #105690 - matthiaskrgr:rollup-khtq97k, r=matthiaskrgr
bors [Wed, 14 Dec 2022 12:46:08 +0000 (12:46 +0000)]
Auto merge of #105690 - matthiaskrgr:rollup-khtq97k, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #105642 (Minor grammar nit.)
 - #105658 (Remove ..X from RELEASES.md)
 - #105663 (Adjust log line in `fuchsia-test-runner.py`)
 - #105664 (rustdoc: apply `pre-wrap` CSS to code-wrapped links)
 - #105665 (rustdoc: simplify popover CSS)
 - #105676 (rustdoc: add CSS margin between `impl` docblock and its items)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

18 months agoRemove fee1-dead from reviewers
Deadbeef [Wed, 14 Dec 2022 12:41:11 +0000 (12:41 +0000)]
Remove fee1-dead from reviewers

.. for now. I have been burned out a bit from reviews
and I think I should take a break.

18 months agoBless test
Albert Larsan [Wed, 14 Dec 2022 12:40:34 +0000 (13:40 +0100)]
Bless test

18 months agoRemove a couple of module.isa() calls
bjorn3 [Wed, 14 Dec 2022 12:25:53 +0000 (12:25 +0000)]
Remove a couple of module.isa() calls

18 months agoskip if val has ecaping bound vars
ouz-a [Wed, 14 Dec 2022 10:59:29 +0000 (13:59 +0300)]
skip if val has ecaping bound vars

18 months agoAdd a test for #92481
Albert Larsan [Mon, 12 Dec 2022 19:53:13 +0000 (20:53 +0100)]
Add a test for #92481

18 months agoAdd regression test for #104678
Yuki Okushi [Wed, 14 Dec 2022 09:52:14 +0000 (18:52 +0900)]
Add regression test for #104678

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105676 - notriddle:notriddle/impl-docblock, r=GuillaumeGomez
Matthias Krüger [Wed, 14 Dec 2022 09:58:49 +0000 (10:58 +0100)]
Rollup merge of #105676 - notriddle:notriddle/impl-docblock, r=GuillaumeGomez

rustdoc: add CSS margin between `impl` docblock and its items

## Before

![image](https://user-images.githubusercontent.com/1593513/207471025-c27c298b-4d48-461b-918b-a965b09db4f1.png)

## After

![image](https://user-images.githubusercontent.com/1593513/207471759-1bbabf71-0932-441c-b044-ad0e392ba552.png)

18 months agoRollup merge of #105665 - notriddle:notriddle/popover-css-merge, r=GuillaumeGomez
Matthias Krüger [Wed, 14 Dec 2022 09:58:48 +0000 (10:58 +0100)]
Rollup merge of #105665 - notriddle:notriddle/popover-css-merge, r=GuillaumeGomez

rustdoc: simplify popover CSS

* Merge the color-changing block into the regular rules, which was probably written that way because it used to be in the theme files, but has no reason to be written this way now that it's in rustdoc.css

* Get rid of redundant `display: block`, since `position: absolute` blockifies the layout anyway.

18 months agoRollup merge of #105664 - notriddle:notriddle/linkwrap, r=GuillaumeGomez
Matthias Krüger [Wed, 14 Dec 2022 09:58:48 +0000 (10:58 +0100)]
Rollup merge of #105664 - notriddle:notriddle/linkwrap, r=GuillaumeGomez

rustdoc: apply `pre-wrap` CSS to code-wrapped links

This is common syntax used for intra-doc links, so fixing it should help with doc formatting.

18 months agoRollup merge of #105663 - andrewpollack:patch-1, r=tmandry
Matthias Krüger [Wed, 14 Dec 2022 09:58:47 +0000 (10:58 +0100)]
Rollup merge of #105663 - andrewpollack:patch-1, r=tmandry

Adjust log line in `fuchsia-test-runner.py`

* Adjusting log line in `fuchsia-test-runner.py` to refer to self

r? ``@tmandry``

18 months agoRollup merge of #105658 - tronta:patch-2, r=Mark-Simulacrum
Matthias Krüger [Wed, 14 Dec 2022 09:58:47 +0000 (10:58 +0100)]
Rollup merge of #105658 - tronta:patch-2, r=Mark-Simulacrum

Remove ..X from RELEASES.md

this is not yet supported:
..X => https://github.com/rust-lang/rust/issues/37854 is still open

18 months agoRollup merge of #105642 - uberFoo:master, r=Dylan-DPC
Matthias Krüger [Wed, 14 Dec 2022 09:58:46 +0000 (10:58 +0100)]
Rollup merge of #105642 - uberFoo:master, r=Dylan-DPC

Minor grammar nit.

I was browsing the documentation and noticed that this should be an adverb.

18 months agoAuto merge of #105686 - matthiaskrgr:rollup-bedfk3j, r=matthiaskrgr
bors [Wed, 14 Dec 2022 09:33:57 +0000 (09:33 +0000)]
Auto merge of #105686 - matthiaskrgr:rollup-bedfk3j, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #103644 (Add docs for question mark operator for Option)
 - #105161 (Refine when invalid prefix case error arises)
 - #105491 (Illegal sized bounds: only suggest mutability change if needed)
 - #105502 (Suggest impl in the scenario of typo with fn)
 - #105523 (Suggest `collect`ing into `Vec<_>`)
 - #105595 (Suggest dereferencing receiver arguments properly)
 - #105611 (fold instead of obliterating args)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

18 months agoRollup merge of #105611 - BoxyUwU:more_granular_placeholderification, r=wesleywiser
Matthias Krüger [Wed, 14 Dec 2022 09:31:08 +0000 (10:31 +0100)]
Rollup merge of #105611 - BoxyUwU:more_granular_placeholderification, r=wesleywiser

fold instead of obliterating args

Fixes #105608

we call `const_eval_resolve` on the following constant:
```
def: playground::{impl#0}::and::{constant#0},
substs: [
  ConstKind::Unevaluated {
    def: playground::{impl#0}::and::{constant#0},
    substs: [
      ConstKind::Value(0x0),
      _,
    ]
  }
  _,
],
```
when expanded out to `ConstKind::Expr` there are no infer vars so we attempt to evaluate it after replacing infer vars with garbage, however the current logic for replacing with garbage replaces _the whole arg containing the infer var_ rather than just the infer var. This means that after garbage replacement has occured we attempt to evaluate:
```
def: playground::{impl#0}::and::{constant#0},
substs: [
  PLACEHOLDER,
  PLACEHOLDER,
],
```
Which then leads to ctfe being unable to evaluate the const. With this PR we attempt to evaluate:
```
def: playground::{impl#0}::and::{constant#0},
substs: [
  ConstKind::Unevaluated {
    def: playground::{impl#0}::and::{constant#0},
    substs: [
      ConstKind::Value(0x0),
      PLACEHOLDER,
    ]
  }
  PLACEHOLDER,
],
```
which ctfe _can_ handle.

I am not entirely sure why this function is supposed to replace params with placeholders rather than just inference vars :thinking:

18 months agoRollup merge of #105595 - TaKO8Ki:suggest-dereferencing-receiver-argument, r=compiler...
Matthias Krüger [Wed, 14 Dec 2022 09:31:07 +0000 (10:31 +0100)]
Rollup merge of #105595 - TaKO8Ki:suggest-dereferencing-receiver-argument, r=compiler-errors

Suggest dereferencing receiver arguments properly

Fixes #105429

18 months agoRollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errors
Matthias Krüger [Wed, 14 Dec 2022 09:31:07 +0000 (10:31 +0100)]
Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errors

Suggest `collect`ing into `Vec<_>`

Fix #105510.

18 months agoRollup merge of #105502 - chenyukang:yukang/fix-105366-impl, r=estebank
Matthias Krüger [Wed, 14 Dec 2022 09:31:06 +0000 (10:31 +0100)]
Rollup merge of #105502 - chenyukang:yukang/fix-105366-impl, r=estebank

Suggest impl in the scenario of typo with fn

Fixes #105366

18 months agoRollup merge of #105491 - sulami:master, r=compiler-errors
Matthias Krüger [Wed, 14 Dec 2022 09:31:05 +0000 (10:31 +0100)]
Rollup merge of #105491 - sulami:master, r=compiler-errors

Illegal sized bounds: only suggest mutability change if needed

In a scenario like

```rust
struct Type;

pub trait Trait {
    fn function(&mut self)
    where
        Self: Sized;
}

impl Trait for Type {
    fn function(&mut self) {}
}

fn main() {
    (&mut Type as &mut dyn Trait).function();
}
```

the problem is Sized, not the mutability of self. Thus don't emit the "you need &T instead of &mut T" note, or the other way around, as all it does is just invert the mutability of whatever was supplied.

Fixes #103622.

18 months agoRollup merge of #105161 - cassaundra:numeric-literal-error, r=nnethercote
Matthias Krüger [Wed, 14 Dec 2022 09:31:05 +0000 (10:31 +0100)]
Rollup merge of #105161 - cassaundra:numeric-literal-error, r=nnethercote

Refine when invalid prefix case error arises

Fix cases where the "invalid base prefix for number literal" error arises with suffixes that look erroneously capitalized but which are actually invalid.

18 months agoRollup merge of #103644 - catlee:catlee/option-question-mark-docs, r=workingjubilee
Matthias Krüger [Wed, 14 Dec 2022 09:31:04 +0000 (10:31 +0100)]
Rollup merge of #103644 - catlee:catlee/option-question-mark-docs, r=workingjubilee

Add docs for question mark operator for Option

As a beginner learning rust, it took me a while to figure out what `?` was doing with Options. I think the documentation of this could be improved.

I've used the question mark documentation from the `Result` type as a template here, and tried to come up with a simple example as well.

18 months agoAddress documentation suggestions
Jakob Degen [Sun, 11 Dec 2022 06:07:11 +0000 (22:07 -0800)]
Address documentation suggestions

18 months agoAdd documentation for custom mir
Jakob Degen [Tue, 6 Dec 2022 06:58:24 +0000 (22:58 -0800)]
Add documentation for custom mir

18 months agoSupport more projections in custom mir
Jakob Degen [Sun, 4 Dec 2022 08:20:37 +0000 (00:20 -0800)]
Support more projections in custom mir

18 months agoSupport common enum operations in custom mir
Jakob Degen [Sun, 4 Dec 2022 08:20:10 +0000 (00:20 -0800)]
Support common enum operations in custom mir

18 months agoFix unsafetyck disabling for custom MIR
Jakob Degen [Sun, 4 Dec 2022 07:54:55 +0000 (23:54 -0800)]
Fix unsafetyck disabling for custom MIR

18 months agoAuto merge of #105221 - alex:fat-archive-cleanup, r=bjorn3
bors [Wed, 14 Dec 2022 06:51:50 +0000 (06:51 +0000)]
Auto merge of #105221 - alex:fat-archive-cleanup, r=bjorn3

Avoid a temporary file when processing macOS fat archives

r? `@bjorn3`

18 months agoUse `expose_addr()` in `fmt::Pointer`
Thom Chiovoloni [Wed, 14 Dec 2022 04:53:14 +0000 (20:53 -0800)]
Use `expose_addr()` in `fmt::Pointer`

18 months agoAuto merge of #104875 - chenyukang:yukang/fix-104867-inc, r=estebank
bors [Wed, 14 Dec 2022 04:00:05 +0000 (04:00 +0000)]
Auto merge of #104875 - chenyukang:yukang/fix-104867-inc, r=estebank

Properly handle postfix inc/dec in standalone and subexpr scenarios

Fixes #104867
r? `@estebank`

18 months agoAuto merge of #104986 - compiler-errors:opaques, r=oli-obk
bors [Wed, 14 Dec 2022 01:19:24 +0000 (01:19 +0000)]
Auto merge of #104986 - compiler-errors:opaques, r=oli-obk

Combine `ty::Projection` and `ty::Opaque` into `ty::Alias`

Implements https://github.com/rust-lang/types-team/issues/79.

This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so:

```
enum AliasKind {
  Projection,
  Opaque,
}

struct AliasTy<'tcx> {
  def_id: DefId,
  substs: SubstsRef<'tcx>,
}
```

Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example:

```diff
  match ty.kind() {
-   ty::Opaque(..) =>
+   ty::Alias(ty::Opaque, ..) => {}
    _ => {}
  }
```

This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically.

r? `@ghost`