Commit Graph

206302 Commits

Author SHA1 Message Date
Michael Goulet
79c665b2a3 Calculate ProjectionTy::trait_def_id correctly 2022-09-22 19:49:18 +00:00
Matthias Krüger
dfeff64550
Rollup merge of #102147 - notriddle:notriddle/location-border-none, r=GuillaumeGomez
rustdoc: remove no-op CSS `.location:empty { border: none }`

This rule was added in 2bb2a2975f to remove a border placed around the location when it's empty. That rule was removed in 6a5f8b1aef, so this rule does nothing.
2022-09-22 21:34:56 +02:00
Matthias Krüger
23370637ef
Rollup merge of #102144 - chriss0612:const_convert_control_flow, r=scottmcm
Extend const_convert with const {FormResidual, Try} for ControlFlow.

Very small change so I just used the existing `const_convert` feature flag.  #88674
Newly const API:
```
impl<B, C> const ops::Try for ControlFlow<B, C>;
impl<B, C> const ops::FromResidual for ControlFlow<B, C>;
```

`@usbalbin` I hope it is ok that I added to your feature.
2022-09-22 21:34:55 +02:00
Matthias Krüger
a99e675a98
Rollup merge of #102135 - GuillaumeGomez:rename-alltypes-fields, r=notriddle
Improve some AllTypes fields name

r? `@notriddle`
2022-09-22 21:34:55 +02:00
Matthias Krüger
aa384834d7
Rollup merge of #102133 - b-naber:use-valtrees-in-fast-reject, r=lcnr
Use valtrees for comparison

r? `@lcnr`
2022-09-22 21:34:54 +02:00
Matthias Krüger
b93c9a7d37
Rollup merge of #102128 - oli-obk:const_unification, r=lcnr
Const unification is already infallible, remove the error handling logic

r? `@lcnr`

is this expected to be used in the future? Right now it is dead code.
2022-09-22 21:34:53 +02:00
Matthias Krüger
c5d223033b
Rollup merge of #102127 - TaKO8Ki:use-appropriate-variable-names, r=lcnr
Use appropriate variable names
2022-09-22 21:34:52 +02:00
Matthias Krüger
dee0c422e7
Rollup merge of #102125 - notriddle:notriddle/content-item-info, r=GuillaumeGomez
rustdoc: remove no-op CSS `.content .item-info { position: relative }`

This rule was added to help position the marker line in 110e7270ab, which was a `position: absolute` pseudo-element that relied on its parent to put it in the right spot. (it was changed from a line to an arrow in 1ffb9cf8d7, then a different arrow in ae3a53ff58).

The arrow was removed in 73d0f7c7b6, so the `relative` position is no longer necessary.
2022-09-22 21:34:52 +02:00
Matthias Krüger
86acea401a
Rollup merge of #102123 - schteve:clippy-note, r=Manishearth
Add note to clippy::non_expressive_names doc

Addresses confusion in rust-lang/rust-clippy#9514 by updating the lint docs.
2022-09-22 21:34:51 +02:00
Matthias Krüger
ecbc00fa9e
Rollup merge of #102118 - notriddle:notriddle/line-numbers, r=GuillaumeGomez
rustdoc: clean up line numbers on code examples

* First commit switches from `display: inline-flex; width: 100%` to `display: flex`.

  `display: inline-flex` was used as part of e961d397ca, the original commit that added these line numbers. Does anyone know why it was done this way?

* Second commit makes it so that toggling this checkbox will update the page in real time, just like changing themes does.

Preview: https://notriddle.com/notriddle-rustdoc-test/line-numbers/std/vec/struct.Vec.html
2022-09-22 21:34:50 +02:00
Matthias Krüger
41ad726110
Rollup merge of #102113 - RalfJung:opty-assert-mem, r=oli-obk
OpTy: fix a method taking self rather than &self

r? `@oli-obk`
2022-09-22 21:34:49 +02:00
Ralf Jung
a7cdfafafb make Miri build in stage 0 2022-09-22 21:01:23 +02:00
Ralf Jung
7927f0919f add regression test for miri issue 2433 2022-09-22 21:01:13 +02:00
Michael Howell
8abf4870ce rustdoc: remove no-op CSS .location:empty { border: none }
This rule was added in 2bb2a2975f to remove a
border placed around the location when it's empty. That rule was removed in
6a5f8b1aef, so this rule does nothing.
2022-09-22 11:09:29 -07:00
bors
e7119a0300 Auto merge of #98840 - cjgillot:span-inline-ctxt, r=wesleywiser
Inline SyntaxContext in both encoded span representation.

The current interned representation for spans does not use the `ctxt_or_zero: u16` field.  This PR proposes to use this field to store the `SyntaxContext` of the interned span instead.  When `ctxt_or_zero` and the interned span's `ctxt` don't match, the inlined one takes precedence.

This allows to implement `Span::ctxt` and `Span::with_ctxt` with much less probability to access the interner.  Those functions are used a lot for hygiene, so this may be worth it.
2022-09-22 17:59:27 +00:00
Camille GILLOT
fc43df0333 Revert "Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk"
This reverts commit 2cb9a65684, reversing
changes made to 750bd1a7ff.
2022-09-22 19:36:11 +02:00
Camille GILLOT
381bd2a836 Revert "Auto merge of #101862 - cjgillot:lint-regression, r=oli-obk"
This reverts commit bc7b17cfe3, reversing
changes made to 5253b0a0a1.
2022-09-22 19:34:01 +02:00
Rageking8
c66c2e82c1
Fix slight issues with stderr 2022-09-23 00:24:30 +08:00
onestacked
5a5138df59 Constify {FormResidual, Try} for ControlFlow 2022-09-22 18:21:34 +02:00
Rageking8
f4170b38c8
Change UI test stderr 2022-09-23 00:02:50 +08:00
Rageking8
a1062b9bdc
recover from struct nested in struct 2022-09-22 23:41:38 +08:00
Xiretza
336a72a8da Unify subdiagnostic attribute parsing 2022-09-22 17:25:50 +02:00
Xiretza
ae56d2a118 Add missing code="" attributes to suggestion subdiagnostics 2022-09-22 17:25:50 +02:00
Xiretza
57679fb1c5 Better error recovery in Subdiagnostic derive 2022-09-22 17:25:50 +02:00
Xiretza
e7251cc441 Extract subdiagnostic attribute parsing 2022-09-22 17:25:50 +02:00
Xiretza
d4a1a6f698 Make SetOnce nicer to use 2022-09-22 17:25:50 +02:00
Xiretza
efb20bc855 Point to previous applicability when declared multiple times 2022-09-22 17:25:50 +02:00
Xiretza
ec85a1b263 Ensure #[suggestion] is only applied to correct tuple types 2022-09-22 17:25:50 +02:00
Xiretza
2e72387fd0 Ensure code= in #[suggestion(...)] is only set once 2022-09-22 17:25:50 +02:00
Xiretza
adcc55d622 Cleanups in SessionDiagnostic derive 2022-09-22 17:25:50 +02:00
bors
89e4e1f1b3 Auto merge of #102139 - Dylan-DPC:rollup-ljlipt8, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #101598 (Update rustc's information on Android's sanitizers)
 - #102036 (Remove use of `io::ErrorKind::Other` in std)
 - #102037 (Make cycle errors recoverable)
 - #102069 (Skip `Equate` relation in `handle_opaque_type`)
 - #102076 (rustc_transmute: fix big-endian discriminants)
 - #102107 (Add missing space between notable trait tooltip and where clause)
 - #102119 (Fix a typo “pararmeter” in error message)
 - #102131 (Added which number is computed in compute_float.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-22 15:18:35 +00:00
Maybe Waffle
98a32305af Apply changes proposed in the review 2022-09-22 17:44:06 +04:00
Dylan DPC
33b7ff128f
Rollup merge of #102131 - orlp:patch-1, r=thomcc
Added which number is computed in compute_float.

The original comment was very elaborate but ultimately did not mention at all what is being computed using parameters `w, q`, only referencing an external article for the algorithm.
2022-09-22 18:25:57 +05:30
Dylan DPC
53e08f36be
Rollup merge of #102119 - steffahn:fix-pararmeter, r=dtolnay
Fix a typo “pararmeter” in error message

Issue reported on IRLO: https://internals.rust-lang.org/t/fixing-a-typo/17427
2022-09-22 18:25:56 +05:30
Dylan DPC
83bea3ddec
Rollup merge of #102107 - Urgau:rustdoc-missing-space-before-where-clause, r=GuillaumeGomez
Add missing space between notable trait tooltip and where clause

This PR add a missing space between the notable trait tooltip and the where clause.

The issue can be seeing on the [BufRead](https://doc.rust-lang.org/nightly/std/io/trait.BufRead.html) page.

Added a simple snapshot regression test in `src/test/rustdoc/where.rs`.

Before:
![image](https://user-images.githubusercontent.com/3616612/191566999-2f80e138-29c9-4f66-8bed-07781cbd9783.png)

After:
![image](https://user-images.githubusercontent.com/3616612/191567025-0ed3f7d4-7cec-4788-901f-5980fc241daa.png)

r? `@GuillaumeGomez`
2022-09-22 18:25:55 +05:30
Dylan DPC
7cac18e1be
Rollup merge of #102076 - cuviper:transmute-discr-endian, r=jackh726
rustc_transmute: fix big-endian discriminants

I noticed that some new tests were failing in Fedora on s390x only, which usually means there's a problem with big-endian, and sure enough there's a FIXME(``@jswrenn)`` for that in `rustc_transmute`. This patch implements the appropriate consideration for target endianness, rather than using native (host) endian.
2022-09-22 18:25:54 +05:30
Dylan DPC
8bf533593d
Rollup merge of #102069 - compiler-errors:no-eq-in-register-opaque, r=oli-obk
Skip `Equate` relation in `handle_opaque_type`

r? ``@oli-obk``
2022-09-22 18:25:54 +05:30
Dylan DPC
d5ae6737bf
Rollup merge of #102037 - jyn514:normalize-docs, r=lcnr
Make cycle errors recoverable

In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation.

In the past, ```@jackh726``` has said we need to be careful about overflow errors: https://github.com/rust-lang/rust/pull/91430#issuecomment-983997013

> Off the top of my head, we definitely should be careful about treating overflow errors the same as
"not implemented for some reason" errors. Otherwise, you could end up with behavior that is
different depending on recursion depth. But, that might be context-dependent.

But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered.

Helps with https://github.com/rust-lang/rust/issues/81091.

r? ```@lcnr``` cc ```@matthewjasper```
2022-09-22 18:25:53 +05:30
Dylan DPC
c99a603b87
Rollup merge of #102036 - Patiga:remove-io-errorkind-other-use-in-std, r=Mark-Simulacrum
Remove use of `io::ErrorKind::Other` in std

The documentation states that this `ErrorKind` is not used by the standard library. Instead, `io::ErrorKind::Uncategorized` should be used.

The two instances are in the unstable API [linux_pidfd](https://github.com/rust-lang/rust/issues/82971).
2022-09-22 18:25:52 +05:30
Dylan DPC
b36a10af7e
Rollup merge of #101598 - chriswailes:sanitizers, r=nagisa,eholk
Update rustc's information on Android's sanitizers

This patch updates sanitizer support definitions for Android inside the compiler.  It also adjusts the logic to make sure no pre-built sanitizer runtime libraries are emitted as these are instead provided dynamically on Android targets.
2022-09-22 18:25:51 +05:30
bors
8ab71ab59f Auto merge of #100980 - compiler-errors:normalize-opaque-w-bound-vars, r=lcnr
Normalize opaques w/ bound vars

First, we reenable normalization of opaque types with escaping late bound regions to fix rust-lang/miri#2433. This essentially reverts #89285.

Second, we mitigate the perf regression found in #88862 by simplifying the way that we relate (sub and eq) GeneratorWitness types.

This relies on the fact that we construct these GeneratorWitness types somewhat particularly (with all free regions found in the witness types replaced with late bound regions) -- but those bound regions really should be treated as existential regions, not universal ones. Those two facts leads me to believe that we do not need to use the full `higher_ranked_sub` machinery to relate two generator witnesses. I'm pretty confident that this is correct, but I'm glad to discuss this further.
2022-09-22 12:47:31 +00:00
b-naber
a9e657dbfc don't convert valtree to constvalue during normalization 2022-09-22 14:46:14 +02:00
Vadim Petrochenkov
4ddff03917 resolve: Set effective visibilities for imports more precisely
Instead of setting them for all primary and additional IDs of the import, only set them for the binding's true ID.
2022-09-22 15:00:24 +03:00
Vadim Petrochenkov
5be901abb7 effective visibility: Add test for a reexport of two names
in different namespaces, one public and another private.
2022-09-22 14:55:11 +03:00
Luca Palmieri
e572d513bd Distribute rust-json-docs via rustup. 2022-09-22 12:22:49 +01:00
b-naber
e8594257f6 use valtrees for comparison 2022-09-22 13:10:53 +02:00
Guillaume Gomez
d3f97a331c Improve some AllTypes fields name 2022-09-22 13:08:59 +02:00
b-naber
efb908991b address review 2022-09-22 12:35:29 +02:00
b-naber
db7df59418 bless tests 2022-09-22 12:35:28 +02:00
b-naber
9f3784df89 introduce mir::Unevaluated 2022-09-22 12:35:28 +02:00