]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoRollup merge of #102533 - notriddle:notriddle/a-source, r=Dylan-DPC
Matthias Krüger [Sat, 1 Oct 2022 14:45:05 +0000 (16:45 +0200)]
Rollup merge of #102533 - notriddle:notriddle/a-source, r=Dylan-DPC

rustdoc: remove unused CSS selector `a.source`

The link with this class attribute was removed in https://github.com/rust-lang/rust/commit/4d16de01d0beb84dc4a351022ea5cb587b4ab557#diff-3fe025bd3bd6b48044d0bd8d8c3122de5ecdb1dcd72a9dbe3c24430883595012L1281-R1324

21 months agoRollup merge of #102500 - compiler-errors:parse-sess-cleanup, r=cjgillot
Matthias Krüger [Sat, 1 Oct 2022 14:45:05 +0000 (16:45 +0200)]
Rollup merge of #102500 - compiler-errors:parse-sess-cleanup, r=cjgillot

Remove `expr_parentheses_needed` from `ParseSess`

Not sure why this method needed to exist on `ParseSess`, but we can achieve the same behavior by just inlining it everywhere.

21 months agoRollup merge of #101675 - beetrees:set-times-no-panic, r=joshtriplett
Matthias Krüger [Sat, 1 Oct 2022 14:45:04 +0000 (16:45 +0200)]
Rollup merge of #101675 - beetrees:set-times-no-panic, r=joshtriplett

Improve `File::set_times` error handling

Makes `File::set_times` return an error if the `SystemTime` cannot fit into the required type instead of panicking in `FileTimes::set_{accessed,modified}`. Also makes `File::set_times` return an error on Windows if either of the passed times are `0xFFFF_FFFF_FFFF_FFFF`, as [the documentation for `SetFileTime`](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfiletime) states that this will prevent operations on the file handle from updating the corresponding file time instead of setting the corresponding file time to that value.

Tracking issue: #98245

21 months agoAuto merge of #101986 - WaffleLapkin:move_lint_note_to_the_bottom, r=estebank
bors [Sat, 1 Oct 2022 10:44:25 +0000 (10:44 +0000)]
Auto merge of #101986 - WaffleLapkin:move_lint_note_to_the_bottom, r=estebank

Move lint level source explanation to the bottom

So, uhhhhh

r? `@estebank`

## User-facing change

"note: `#[warn(...)]` on by default" and such are moved to the bottom of the diagnostic:
```diff
-   = note: `#[warn(unsupported_calling_conventions)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
+   = note: `#[warn(unsupported_calling_conventions)]` on by default
```

Why warning is enabled is the least important thing, so it shouldn't be the first note the user reads, IMO.

## Developer-facing change

`struct_span_lint` and similar methods have a different signature.

Before: `..., impl for<'a> FnOnce(LintDiagnosticBuilder<'a, ()>)`
After: `..., impl Into<DiagnosticMessage>, impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>) -> &'b mut DiagnosticBuilder<'a, ()>`

The reason for this is that `struct_span_lint` needs to edit the diagnostic _after_ `decorate` closure is called. This also makes lint code a little bit nicer in my opinion.

Another option is to use `impl for<'a> FnOnce(LintDiagnosticBuilder<'a, ()>) -> DiagnosticBuilder<'a, ()>` altough I don't _really_ see reasons to do `let lint = lint.build(message)` everywhere.

## Subtle problem

By moving the message outside of the closure (that may not be called if the lint is disabled) `format!(...)` is executed earlier, possibly formatting `Ty` which may call a query that trims paths that crashes the compiler if there were no warnings...

I don't think it's that big of a deal, considering that we move from `format!(...)` to `fluent` (which is lazy by-default) anyway, however this required adding a workaround which is unfortunate.

## P.S.

I'm sorry, I do not how to make this PR smaller/easier to review. Changes to the lint API affect SO MUCH 😢

21 months agoRemove `LintDiagnosticBuilder`
Maybe Waffle [Sun, 18 Sep 2022 17:19:13 +0000 (21:19 +0400)]
Remove `LintDiagnosticBuilder`

21 months ago`ui-fulldeps`: adopt to the new rustc lint API
Maybe Waffle [Thu, 22 Sep 2022 14:25:05 +0000 (18:25 +0400)]
`ui-fulldeps`: adopt to the new rustc lint API

21 months agobless rustdoc-ui
Maybe Waffle [Fri, 23 Sep 2022 18:34:34 +0000 (22:34 +0400)]
bless rustdoc-ui

21 months agobless a miri test
Maybe Waffle [Fri, 23 Sep 2022 09:41:15 +0000 (13:41 +0400)]
bless a miri test

21 months agobless clippy
Maybe Waffle [Thu, 22 Sep 2022 16:04:22 +0000 (20:04 +0400)]
bless clippy

21 months agobless ui tests
Maybe Waffle [Sun, 18 Sep 2022 15:55:36 +0000 (19:55 +0400)]
bless ui tests

21 months agoMove lint level source explanation to the bottom
Maybe Waffle [Sun, 18 Sep 2022 15:47:21 +0000 (19:47 +0400)]
Move lint level source explanation to the bottom

21 months agorustdoc: adopt to the new lint API
Maybe Waffle [Fri, 16 Sep 2022 15:07:20 +0000 (19:07 +0400)]
rustdoc: adopt to the new lint API

21 months agoclippy: adopt to the new lint API
Maybe Waffle [Fri, 16 Sep 2022 15:07:01 +0000 (19:07 +0400)]
clippy: adopt to the new lint API

21 months agoRefactor rustc lint API
Maybe Waffle [Fri, 16 Sep 2022 07:01:02 +0000 (11:01 +0400)]
Refactor rustc lint API

21 months agoAuto merge of #102237 - GuillaumeGomez:sidebar-links-color, r=notriddle
bors [Sat, 1 Oct 2022 08:14:25 +0000 (08:14 +0000)]
Auto merge of #102237 - GuillaumeGomez:sidebar-links-color, r=notriddle

Migrate sidebar links color to CSS variables and unify themes with ayu

Part of https://github.com/rust-lang/rust/pull/98460.

This PR does two things:
 1. Migrate more theme CSS rules toward CSS variables.
 2. Remove `a.current` specific colors depending on the kind of the item behind the link. The `ayu` theme was already doing it this way and I think it makes much more sense like this.

You can test it [here](https://rustdoc.crud.net/imperio/sidebar-links-color/lib2/struct.Foo.html) by hovering other module's items in the sidebar (or check the selector `a.current`).

cc `@jsha`
r? `@notriddle`

21 months agorustdoc: remove unused CSS selector `a.source`
Michael Howell [Sat, 1 Oct 2022 05:17:04 +0000 (22:17 -0700)]
rustdoc: remove unused CSS selector `a.source`

The link with this class attribute was removed in
4d16de01d0beb84dc4a351022ea5cb587b4ab557.

21 months agoAuto merge of #102526 - matthiaskrgr:rollup-9o6p98c, r=matthiaskrgr
bors [Sat, 1 Oct 2022 03:56:21 +0000 (03:56 +0000)]
Auto merge of #102526 - matthiaskrgr:rollup-9o6p98c, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #102361 (Fix ICE in const_trait check code)
 - #102373 (Flush delayed bugs before codegen)
 - #102483 (create def ids for impl traits during ast lowering)
 - #102490 (Generate synthetic region from `impl` even in closure body within an associated fn)
 - #102492 (Don't lower assoc bindings just to deny them)
 - #102493 (Group together more size assertions.)
 - #102521 (rustdoc: add missing margin to no-docblock methods)

Failed merges:

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

21 months ago`SetFileTime` doesn't allow setting the file time to `0xFFFF_FFFF_FFFF_FFFF`
beetrees [Sat, 10 Sep 2022 10:33:23 +0000 (11:33 +0100)]
`SetFileTime` doesn't allow setting the file time to `0xFFFF_FFFF_FFFF_FFFF`

21 months agoError instead of panicking when setting file times if the passed `SystemTime` doesn...
beetrees [Sat, 10 Sep 2022 10:29:01 +0000 (11:29 +0100)]
Error instead of panicking when setting file times if the passed `SystemTime` doesn't fit into the required type

21 months agoAuto merge of #101969 - reez12g:issue-101306, r=reez12g
bors [Sat, 1 Oct 2022 01:03:35 +0000 (01:03 +0000)]
Auto merge of #101969 - reez12g:issue-101306, r=reez12g

Make fmt downloaded on every invocation of bootstrap

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

21 months agoAdd a comment to downloading fmt statement
Rento Ezoe [Fri, 30 Sep 2022 23:06:24 +0000 (08:06 +0900)]
Add a comment to downloading fmt statement

Co-authored-by: Joshua Nelson <github@jyn.dev>
21 months agoRollup merge of #102521 - notriddle:notriddle/impl-items-section, r=GuillaumeGomez
Matthias Krüger [Fri, 30 Sep 2022 21:38:27 +0000 (23:38 +0200)]
Rollup merge of #102521 - notriddle:notriddle/impl-items-section, r=GuillaumeGomez

rustdoc: add missing margin to no-docblock methods

Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, this time fixing the appearance of methods that have no docblock (we didn't notice this one because libstd docs *always* have docblocks).

See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/enum.Type.html#implementations

<details>

# Before

![image](https://user-images.githubusercontent.com/1593513/193318777-2bc082fb-6579-4bd8-a0e3-d23a32b4820f.png)

# After

![image](https://user-images.githubusercontent.com/1593513/193318968-b6ccacad-940b-4ed3-a0ae-dcf2079c2bae.png)

</details>

See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/trait.AttributesExt.html

<details>

# Before

![image](https://user-images.githubusercontent.com/1593513/193319636-7ff9c99e-0208-462c-99de-7672e92ce4d6.png)

# After

![image](https://user-images.githubusercontent.com/1593513/193322675-403bd165-7394-43e2-8ab4-d1f364666093.png)

</details>

21 months agoRollup merge of #102493 - nnethercote:improve-size-assertions-some-more, r=lqd
Matthias Krüger [Fri, 30 Sep 2022 21:38:27 +0000 (23:38 +0200)]
Rollup merge of #102493 - nnethercote:improve-size-assertions-some-more, r=lqd

Group together more size assertions.

Also add a few more assertions for some relevant token-related types.

And fix an erroneous comment in `rustc_errors`.

r? `@lqd`

21 months agoRollup merge of #102492 - compiler-errors:simplify-deny-assoc-bindings, r=cjgillot
Matthias Krüger [Fri, 30 Sep 2022 21:38:26 +0000 (23:38 +0200)]
Rollup merge of #102492 - compiler-errors:simplify-deny-assoc-bindings, r=cjgillot

Don't lower assoc bindings just to deny them

Some clean-up: https://github.com/rust-lang/rust/pull/102338#discussion_r981590931

21 months agoRollup merge of #102490 - compiler-errors:closure-body-impl-lifetime, r=cjgillot
Matthias Krüger [Fri, 30 Sep 2022 21:38:26 +0000 (23:38 +0200)]
Rollup merge of #102490 - compiler-errors:closure-body-impl-lifetime, r=cjgillot

Generate synthetic region from `impl` even in closure body within an associated fn

Fixes #102209

21 months agoRollup merge of #102483 - spastorino:create-defs-on-lowering, r=cjgillot
Matthias Krüger [Fri, 30 Sep 2022 21:38:25 +0000 (23:38 +0200)]
Rollup merge of #102483 - spastorino:create-defs-on-lowering, r=cjgillot

create def ids for impl traits during ast lowering

r? `@cjgillot`

21 months agoRollup merge of #102373 - Nilstrieb:cannot-get-layout-of-branch-error, r=cjgillot
Matthias Krüger [Fri, 30 Sep 2022 21:38:25 +0000 (23:38 +0200)]
Rollup merge of #102373 - Nilstrieb:cannot-get-layout-of-branch-error, r=cjgillot

Flush delayed bugs before codegen

Sometimes it can happen that invalid code like a TyKind::Error makes its way through the compiler without triggering any errors (this is always a bug in rustc but bugs do happen sometimes :)). These ICEs will manifest in the backend like as cg_llvm not being able to get the layout of `[type error]`, which makes it hard to debug. By flushing before codegen, we display all the delayed bugs, making it easier to trace it to the root of the problem.

I tried this on #102366 and it showed tons of of delayed bugs and no error in cg_llvm, so it seems to be working.

21 months agoRollup merge of #102361 - fee1-dead-contrib:fix-102156, r=eholk
Matthias Krüger [Fri, 30 Sep 2022 21:38:24 +0000 (23:38 +0200)]
Rollup merge of #102361 - fee1-dead-contrib:fix-102156, r=eholk

Fix ICE in const_trait check code

This fixes #102156.

21 months agoGroup together more size assertions.
Nicholas Nethercote [Thu, 29 Sep 2022 23:23:55 +0000 (09:23 +1000)]
Group together more size assertions.

Also add a few more assertions for some relevant token-related types.

And fix an erroneous comment in `rustc_errors`.

21 months agoAuto merge of #102517 - nikic:update-llvm-8, r=cuviper
bors [Fri, 30 Sep 2022 20:41:26 +0000 (20:41 +0000)]
Auto merge of #102517 - nikic:update-llvm-8, r=cuviper

Update LLVM submodule

This merges in the current upstream release/15.x branch.

Fixes #102402.

21 months agoFix typo
nils [Fri, 30 Sep 2022 19:02:53 +0000 (21:02 +0200)]
Fix typo

21 months agorustdoc: update test cases for `<section>` tags in traits
Michael Howell [Fri, 30 Sep 2022 18:17:03 +0000 (11:17 -0700)]
rustdoc: update test cases for `<section>` tags in traits

21 months agocreate def ids for impl traits during ast lowering
Santiago Pastorino [Fri, 30 Sep 2022 13:45:02 +0000 (10:45 -0300)]
create def ids for impl traits during ast lowering

21 months agoUpdate compiler/rustc_interface/src/queries.rs
Camille Gillot [Fri, 30 Sep 2022 17:50:48 +0000 (19:50 +0200)]
Update compiler/rustc_interface/src/queries.rs

21 months agoAuto merge of #102520 - matthiaskrgr:rollup-7nreat0, r=matthiaskrgr
bors [Fri, 30 Sep 2022 17:47:57 +0000 (17:47 +0000)]
Auto merge of #102520 - matthiaskrgr:rollup-7nreat0, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #102276 (Added more const_closure functionality)
 - #102382 (Manually order `DefId` on 64-bit big-endian)
 - #102421 (remove the unused :: between trait and type to give user correct diag…)
 - #102495 (Reinstate `hir-stats.rs` test for stage 1.)
 - #102505 (rustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`)
 - #102506 (Specify `DynKind::Dyn`)

Failed merges:

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

21 months agorustdoc: add gui test for no-docblock margins
Michael Howell [Fri, 30 Sep 2022 17:44:15 +0000 (10:44 -0700)]
rustdoc: add gui test for no-docblock margins

21 months agorustdoc: add missing margin to no-docblock trait items
Michael Howell [Fri, 30 Sep 2022 17:15:59 +0000 (10:15 -0700)]
rustdoc: add missing margin to no-docblock trait items

Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee,
this time fixing the appearance of methods that have no docblock (we didn't
notice this one because libstd docs *always* have docblocks).

See how it looks at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/trait.AttributesExt.html

21 months agoRollup merge of #102506 - TaKO8Ki:specify-dyn-kind, r=lcnr
Matthias Krüger [Fri, 30 Sep 2022 17:06:07 +0000 (19:06 +0200)]
Rollup merge of #102506 - TaKO8Ki:specify-dyn-kind, r=lcnr

Specify `DynKind::Dyn`

ref: https://github.com/rust-lang/rust/pull/101212#discussion_r958861297

21 months agoRollup merge of #102505 - notriddle:sub-variant-h4, r=GuillaumeGomez
Matthias Krüger [Fri, 30 Sep 2022 17:06:06 +0000 (19:06 +0200)]
Rollup merge of #102505 - notriddle:sub-variant-h4, r=GuillaumeGomez

rustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`

This rule, added in 69df43b041f76251391f11264c1ff763ca2a64a0 to override the default `h4` style, has been obsoleted when a65c98fefb78cddee955b87214732b0de30a769f changed it so that only the top docblock put `border-bottom` on `h4.`

21 months agoRollup merge of #102495 - nnethercote:reinstate-hir-stats, r=lqd
Matthias Krüger [Fri, 30 Sep 2022 17:06:06 +0000 (19:06 +0200)]
Rollup merge of #102495 - nnethercote:reinstate-hir-stats, r=lqd

Reinstate `hir-stats.rs` test for stage 1.

It was disabled in #94075 for stage 1 because that PR changed type layouts such that the results for this test were different for stage 1 and stage 2. But now that #94075 is in beta, the results for this test are now the same for stage 1 and stage 2.

r? ```@lqd```

21 months agoRollup merge of #102421 - lyming2007:issue-101866, r=lcnr
Matthias Krüger [Fri, 30 Sep 2022 17:06:05 +0000 (19:06 +0200)]
Rollup merge of #102421 - lyming2007:issue-101866, r=lcnr

remove the unused :: between trait and type to give user correct diag…

…nostic information

modified:   compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
new file:   src/test/ui/type/issue-101866.rs
new file:   src/test/ui/type/issue-101866.stderr

21 months agoRollup merge of #102382 - cuviper:defid-order, r=fee1-dead
Matthias Krüger [Fri, 30 Sep 2022 17:06:05 +0000 (19:06 +0200)]
Rollup merge of #102382 - cuviper:defid-order, r=fee1-dead

Manually order `DefId` on 64-bit big-endian

`DefId` uses different field orders on 64-bit big-endian vs. others, in
order to optimize its `Hash` implementation. However, that also made it
derive different lexical ordering for `PartialOrd` and `Ord`. That
caused spurious differences wherever `DefId`s are sorted, like the
candidate sources list in `report_method_error`.

Now we manually implement `PartialOrd` and `Ord` on 64-bit big-endian to
match the same lexical ordering as other targets, fixing at least one
test, `src/test/ui/methods/method-ambig-two-traits-cross-crate.rs`.

21 months agoRollup merge of #102276 - ink-feather-org:const_closure_ext, r=fee1-dead
Matthias Krüger [Fri, 30 Sep 2022 17:06:04 +0000 (19:06 +0200)]
Rollup merge of #102276 - ink-feather-org:const_closure_ext, r=fee1-dead

Added more const_closure functionality

Enables ConstFnMutClosure to use a tuple of mutable references instead of just a mutable reference to a tuple.

Removes the new function, since it would barely be usable with this new code.

r? `@fee1-dead`

21 months agorustdoc: add missing margin to no-docblock methods
Michael Howell [Fri, 30 Sep 2022 16:42:07 +0000 (09:42 -0700)]
rustdoc: add missing margin to no-docblock methods

Fixes another regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee,
this time fixing the appearance of methods that have no docblock (we didn't
notice this one because libstd docs *always* have docblocks).

See how it looks without the fix at https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/clean/types/enum.Type.html#implementations

21 months agoAdd back ConstFnMutClosure::new, fix formatting
onestacked [Fri, 30 Sep 2022 15:41:01 +0000 (17:41 +0200)]
Add back ConstFnMutClosure::new, fix formatting

21 months agoFixed Documentation for wrap_mut_2_imp
onestacked [Fri, 30 Sep 2022 15:16:59 +0000 (17:16 +0200)]
Fixed Documentation for wrap_mut_2_imp

21 months agoAdded more const_closure functionality.
onestacked [Fri, 30 Sep 2022 15:16:59 +0000 (17:16 +0200)]
Added more const_closure functionality.

21 months agoUpdate LLVM submodule
Nikita Popov [Fri, 30 Sep 2022 14:39:32 +0000 (16:39 +0200)]
Update LLVM submodule

Fixes #102402.

21 months agoAuto merge of #102484 - beetrees:duration-debug-bug-fix, r=scottmcm
bors [Fri, 30 Sep 2022 14:16:57 +0000 (14:16 +0000)]
Auto merge of #102484 - beetrees:duration-debug-bug-fix, r=scottmcm

Fix integer overflow in `format!("{:.0?}", Duration::MAX)`

Currently `format!("{:.0?}", Duration::MAX)` causes an integer overflow in the `Duration` `Debug` impl ([playground link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=67675c6895bdb2e37ee727f0ed7622b2)). This is because the carry from the rounding of the fractional_part into the integer_part will cause the integer_part to overflow as it is already `u64::MAX`. This PR uses a larger integer type to avoid that issue, and adds a test for the correct behaviour.

21 months agoAdd comment explaining why we flush delayed bugs before codegen
nils [Fri, 30 Sep 2022 12:11:18 +0000 (14:11 +0200)]
Add comment explaining why we flush delayed bugs before codegen

21 months agoAdd GUI test for sidebar links color
Guillaume Gomez [Sat, 24 Sep 2022 14:31:34 +0000 (16:31 +0200)]
Add GUI test for sidebar links color

21 months ago* Migrate sidebar links color to new CSS theme handling
Guillaume Gomez [Sat, 24 Sep 2022 13:49:10 +0000 (15:49 +0200)]
* Migrate sidebar links color to new CSS theme handling
* Remove specific color handling for ".current" items in the sidebar.

21 months agoAuto merge of #102509 - matthiaskrgr:rollup-gtenet8, r=matthiaskrgr
bors [Fri, 30 Sep 2022 10:39:09 +0000 (10:39 +0000)]
Auto merge of #102509 - matthiaskrgr:rollup-gtenet8, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #101075 (Migrate rustc_codegen_gcc to SessionDiagnostics )
 - #102350 (Improve errors for incomplete functions in struct definitions)
 - #102481 (rustdoc: remove unneeded CSS `.rust-example-rendered { position }`)
 - #102491 (rustdoc: remove no-op source sidebar `opacity`)
 - #102499 (Adjust the s390x data layout for LLVM 16)

Failed merges:

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

21 months agoRollup merge of #102499 - cuviper:llvm-16-s390x, r=nikic
Matthias Krüger [Fri, 30 Sep 2022 08:22:39 +0000 (10:22 +0200)]
Rollup merge of #102499 - cuviper:llvm-16-s390x, r=nikic

Adjust the s390x data layout for LLVM 16

LLVM [D131158] changed the SystemZ data layout to always set 64-bit
vector alignment, which used to be conditional on the "vector" feature.

[D131158]: https://reviews.llvm.org/D131158

r? `@nikic`

21 months agoRollup merge of #102491 - notriddle:notriddle/sidebar-opacity, r=GuillaumeGomez
Matthias Krüger [Fri, 30 Sep 2022 08:22:38 +0000 (10:22 +0200)]
Rollup merge of #102491 - notriddle:notriddle/sidebar-opacity, r=GuillaumeGomez

rustdoc: remove no-op source sidebar `opacity`

These rules were added in dc2c9723343c985740be09919236a6e96c4e4433 to work with CSS transitions. They're otherwise redundant, since the `visibility` property already hides everything.

https://github.com/rust-lang/rust/blob/dc2c9723343c985740be09919236a6e96c4e4433/src/librustdoc/html/static/css/rustdoc.css#L350-L354

The transition was remove with 237d62588ddb4b7a93f3f5c61ea9253eba30ed5d, but the now-redundant `opacity` property was not.

21 months agoRollup merge of #102481 - notriddle:notriddle/rust-example-rendered, r=GuillaumeGomez
Matthias Krüger [Fri, 30 Sep 2022 08:22:38 +0000 (10:22 +0200)]
Rollup merge of #102481 - notriddle:notriddle/rust-example-rendered, r=GuillaumeGomez

rustdoc: remove unneeded CSS `.rust-example-rendered { position }`

The Run button isn't inside the `<pre>` any more. It's instead nested below the example wrapper.

The class name can't be removed from the DOM, because `main.js` uses it.

21 months agoRollup merge of #102350 - TaKO8Ki:incomplete-fn-in-struct-definition, r=fee1-dead
Matthias Krüger [Fri, 30 Sep 2022 08:22:37 +0000 (10:22 +0200)]
Rollup merge of #102350 - TaKO8Ki:incomplete-fn-in-struct-definition, r=fee1-dead

Improve errors for incomplete functions in struct definitions

Given the following code:

```rust
fn main() {}

struct Foo {
    fn
}
```

[playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=29139f870511f6918324be5ddc26c345)

The current output is:

```
   Compiling playground v0.0.1 (/playground)
error: functions are not allowed in struct definitions
 --> src/main.rs:4:5
  |
4 |     fn
  |     ^^
  |
  = help: unlike in C++, Java, and C#, functions are declared in `impl` blocks
  = help: see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information

error: could not compile `playground` due to previous error
```

In this case, rustc should suggest escaping `fn` to use it as an identifier.

21 months agoRollup merge of #101075 - ellishg:rustc_codegen_gcc_diagnostics, r=davidtwco
Matthias Krüger [Fri, 30 Sep 2022 08:22:36 +0000 (10:22 +0200)]
Rollup merge of #101075 - ellishg:rustc_codegen_gcc_diagnostics, r=davidtwco

Migrate rustc_codegen_gcc to SessionDiagnostics

As part of #100717 this pr migrates diagnostics to `SessionDiagnostics` for the `rustc_codegen_gcc` crate.

``@rustbot`` label +A-translation

21 months agoAuto merge of #102387 - nnethercote:inline-Token-PartialEq, r=lqd
bors [Fri, 30 Sep 2022 07:57:12 +0000 (07:57 +0000)]
Auto merge of #102387 - nnethercote:inline-Token-PartialEq, r=lqd

Inline a few functions.

r? `@ghost`

21 months agorustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`
Michael Howell [Fri, 30 Sep 2022 06:57:01 +0000 (23:57 -0700)]
rustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`

This rule, added in 69df43b041f76251391f11264c1ff763ca2a64a0 to override the
default `h4` style, has been obsoleted when
a65c98fefb78cddee955b87214732b0de30a769f changed it so that only the top
docblock put `border-bottom` on `h4.`

21 months agospecify `DynKind::Dyn`
Takayuki Maeda [Fri, 30 Sep 2022 06:52:20 +0000 (15:52 +0900)]
specify `DynKind::Dyn`

21 months agoAuto merge of #102164 - compiler-errors:rpitit-foreign, r=TaKO8Ki
bors [Fri, 30 Sep 2022 04:24:14 +0000 (04:24 +0000)]
Auto merge of #102164 - compiler-errors:rpitit-foreign, r=TaKO8Ki

Serialize return-position `impl Trait` in trait hidden values in foreign libraries

Fixes #101630

21 months agoRemove expr_parentheses_needed from ParseSess
Michael Goulet [Fri, 30 Sep 2022 01:38:15 +0000 (01:38 +0000)]
Remove expr_parentheses_needed from ParseSess

21 months agoAuto merge of #102304 - lcnr:coherence-cleanup, r=compiler-errors
bors [Fri, 30 Sep 2022 01:32:15 +0000 (01:32 +0000)]
Auto merge of #102304 - lcnr:coherence-cleanup, r=compiler-errors

remove outdated coherence hack

we have a more precise detection for downstream conflicts in candidate assembly: the `is_knowable` check in `candidate_from_obligation_no_cache`.

r? types cc `@nikomatsakis`

21 months agoAdjust the s390x data layout for LLVM 16
Josh Stone [Fri, 30 Sep 2022 01:18:26 +0000 (18:18 -0700)]
Adjust the s390x data layout for LLVM 16

LLVM [D131158] changed the SystemZ data layout to always set 64-bit
vector alignment, which used to be conditional on the "vector" feature.

[D131158]: https://reviews.llvm.org/D131158

21 months agoUse let chains instead of let else
fee1-dead [Fri, 30 Sep 2022 00:31:53 +0000 (00:31 +0000)]
Use let chains instead of let else

21 months agoReinstate `hir-stats.rs` test for stage 1.
Nicholas Nethercote [Fri, 30 Sep 2022 00:18:36 +0000 (10:18 +1000)]
Reinstate `hir-stats.rs` test for stage 1.

It was disabled in #94075 for stage 1 because that PR changed type
layouts such that the results for this test were different for stage 1
and stage 2. But now that #94075 is in beta, the results for this test
are now the same for stage 1 and stage 2.

21 months agoAuto merge of #101887 - nnethercote:shrink-Res, r=spastorino
bors [Thu, 29 Sep 2022 22:45:24 +0000 (22:45 +0000)]
Auto merge of #101887 - nnethercote:shrink-Res, r=spastorino

Shrink `hir::def::Res`

r? `@spastorino`

21 months agoDon't lower assoc bindings just to deny them
Michael Goulet [Thu, 29 Sep 2022 22:44:24 +0000 (22:44 +0000)]
Don't lower assoc bindings just to deny them

21 months agorustdoc: update test case now that the UI animation is removed
Michael Howell [Thu, 29 Sep 2022 22:40:24 +0000 (15:40 -0700)]
rustdoc: update test case now that the UI animation is removed

21 months agorustdoc: remove no-op source sidebar `opacity`
Michael Howell [Thu, 29 Sep 2022 22:33:02 +0000 (15:33 -0700)]
rustdoc: remove no-op source sidebar `opacity`

These rules were added in dc2c9723343c985740be09919236a6e96c4e4433 to work
with CSS transitions. They're otherwise redundant, since the `visibility`
property already hides everything.

https://github.com/rust-lang/rust/blob/dc2c9723343c985740be09919236a6e96c4e4433/src/librustdoc/html/static/css/rustdoc.css#L350-L354

The transition was remove with 237d62588ddb4b7a93f3f5c61ea9253eba30ed5d, but
the now-redundant `opacity` property was not.

21 months agoGenerate synthetic impl region even in closure body in associated fn
Michael Goulet [Thu, 29 Sep 2022 22:27:50 +0000 (22:27 +0000)]
Generate synthetic impl region even in closure body in associated fn

21 months agoFix integer overflow in `format!("{:.0?}", Duration::MAX)`
beetrees [Thu, 29 Sep 2022 17:50:10 +0000 (18:50 +0100)]
Fix integer overflow in `format!("{:.0?}", Duration::MAX)`

21 months agoremove the unused :: between trait and type to give user correct diagnostic information
Yiming Lei [Wed, 28 Sep 2022 16:59:03 +0000 (09:59 -0700)]
remove the unused :: between trait and type to give user correct diagnostic information
modified:   compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
new file:   src/test/ui/type/issue-101866.rs
new file:   src/test/ui/type/issue-101866.stderr

21 months agoAuto merge of #102482 - notriddle:rollup-fjm618g, r=notriddle
bors [Thu, 29 Sep 2022 19:52:48 +0000 (19:52 +0000)]
Auto merge of #102482 - notriddle:rollup-fjm618g, r=notriddle

Rollup of 7 pull requests

Successful merges:

 - #102214 (Fix span of byte-escaped left format args brace)
 - #102426 (Don't export `__wasm_init_memory` on WebAssembly.)
 - #102437 (rustdoc: cut margin-top from first header in docblock)
 - #102442 (rustdoc: remove bad CSS font-weight on `.impl`, `.method`, etc)
 - #102447 (rustdoc: add method spacing to trait methods)
 - #102468 (tidy: make rustc dependency error less confusing)
 - #102476 (Split out the error reporting logic into a separate function)

Failed merges:

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

21 months agoRollup merge of #102476 - oli-obk:split_error_path, r=cjgillot
Michael Howell [Thu, 29 Sep 2022 17:15:20 +0000 (10:15 -0700)]
Rollup merge of #102476 - oli-obk:split_error_path, r=cjgillot

Split out the error reporting logic into a separate function

I was trying to read the function and got distracted by the huge block of code in the middle of it. Turns out it only reports diagnostics and all paths within it end in an error. The main function is now more readable imo.

21 months agoRollup merge of #102468 - RalfJung:tidy, r=jyn514
Michael Howell [Thu, 29 Sep 2022 17:15:20 +0000 (10:15 -0700)]
Rollup merge of #102468 - RalfJung:tidy, r=jyn514

tidy: make rustc dependency error less confusing

The current wording leads to very confusing messages:
```
tidy error: Dependencies for main workspace not explicitly permitted:
* unicode-ident 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)
```
Miri is part of that workspace, and there never was a problem adding Miri dependencies. The actual error is that due to a crate bump this now showed up as a rustc dependency, and *those* are restricted.

21 months agoRollup merge of #102447 - notriddle:notriddle/method-toggle, r=jsha
Michael Howell [Thu, 29 Sep 2022 17:15:19 +0000 (10:15 -0700)]
Rollup merge of #102447 - notriddle:notriddle/method-toggle, r=jsha

rustdoc: add method spacing to trait methods

More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait layouts when things are collapsed.

This PR makes two changes to the appearance of trait pages:

* It adds the `method-toggle` class to method toggles on traits, making the DOM more consistent with type pages (which already have this class).

  ## Before

  ![image](https://user-images.githubusercontent.com/1593513/192914353-ed17e1eb-df1d-480b-9998-3b5e8283b0ee.png)

  ## After

  ![image](https://user-images.githubusercontent.com/1593513/192914570-bdd0f2e1-5254-4e2e-9576-a797b82b3b3b.png)

* It adds a bottom margin to docblocks nested directly in the implementors list, giving it a similar appearance to if it was nested within a toggle.

  ## Before

  ![image](https://user-images.githubusercontent.com/1593513/192914503-1c3f39d5-690f-44ec-8f11-385302477d04.png)

  ## After

  ![image](https://user-images.githubusercontent.com/1593513/192914702-cbce4b3b-5cc6-49dc-b7f8-73be9e76791c.png)

21 months agoRollup merge of #102442 - notriddle:notriddle/header-weight, r=GuillaumeGomez
Michael Howell [Thu, 29 Sep 2022 17:15:19 +0000 (10:15 -0700)]
Rollup merge of #102442 - notriddle:notriddle/header-weight, r=GuillaumeGomez

rustdoc: remove bad CSS font-weight on `.impl`, `.method`, etc

This line was added in c494a06064017f307a8d9dc4797e614d2ed99143, because at the time, the headers had these classes on them. Now, the headers are children of the `<section>` with the class on it.

This commit also adds a test case, to make sure the srclink font weight does not regress again.

21 months agoRollup merge of #102437 - notriddle:notriddle/margin-top-h2, r=jsha
Michael Howell [Thu, 29 Sep 2022 17:15:18 +0000 (10:15 -0700)]
Rollup merge of #102437 - notriddle:notriddle/margin-top-h2, r=jsha

rustdoc: cut margin-top from first header in docblock

Fixes a regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, where a header's top margin used to be collapsed, but isn't any more.

## Before

![image](https://user-images.githubusercontent.com/1593513/192893092-8e158bf7-ae18-41ef-8f11-6f34c724d345.png)

## After

![image](https://user-images.githubusercontent.com/1593513/192893139-d6ee06bf-9c0b-4194-bd5d-636312c89367.png)

21 months agoRollup merge of #102426 - sunfishcode:sunfishcode/no-wasm-init-memory, r=nagisa
Michael Howell [Thu, 29 Sep 2022 17:15:18 +0000 (10:15 -0700)]
Rollup merge of #102426 - sunfishcode:sunfishcode/no-wasm-init-memory, r=nagisa

Don't export `__wasm_init_memory` on WebAssembly.

Since #72889, the Rust wasm target doesn't use --passive-segments, so remove the `--export=__wasm_init_memory`.

As documented in the [tool-conventions Linking convention], `__wasm_init_memory` is not intended to be exported.

[tool-conventions Linking convention]: https://github.com/WebAssembly/tool-conventions/blob/7c064f304858f67ebf22964a84b7e9658e29557a/Linking.md#shared-memory-and-passive-segments

21 months agoRollup merge of #102214 - cassaundra:fix-format-args-span, r=cjgillot
Michael Howell [Thu, 29 Sep 2022 17:15:17 +0000 (10:15 -0700)]
Rollup merge of #102214 - cassaundra:fix-format-args-span, r=cjgillot

Fix span of byte-escaped left format args brace

Fix #102057 (see issue for example).

Previously, the use of escaped left braces (`\x7B`) in format args resulted in an incorrectly offset span. This patch fixes that by considering any escaped characters within the string instead of using a constant offset.

21 months agorustdoc: remove unneeded CSS `.rust-example-rendered { position }`
Michael Howell [Thu, 29 Sep 2022 17:08:12 +0000 (10:08 -0700)]
rustdoc: remove unneeded CSS `.rust-example-rendered { position }`

The Run button isn't inside the `<pre>` any more. It's instead nested below
the example wrapper.

The class name can't be removed from the DOM, because `main.js` uses it.

21 months agoAuto merge of #101893 - oli-obk:lift_derive, r=lcnr
bors [Thu, 29 Sep 2022 17:05:00 +0000 (17:05 +0000)]
Auto merge of #101893 - oli-obk:lift_derive, r=lcnr

Fix perf regression from TypeVisitor changes

Regression occurred in https://github.com/rust-lang/rust/pull/101858#issuecomment-1248732579

Instead of just reverting, we only fixed part of the regression. The main regression was due to actually correctly visiting a type that contains types and consts and should therefor be visited. This is not actually observable (yet?), but we should still do it correctly instead of risking major bugs in the future.

21 months agoSplit out the error reporting logic into a separate function
Oli Scherer [Thu, 29 Sep 2022 14:29:36 +0000 (14:29 +0000)]
Split out the error reporting logic into a separate function

21 months agomore clear function and variable names
Ralf Jung [Thu, 29 Sep 2022 14:09:14 +0000 (16:09 +0200)]
more clear function and variable names

21 months agoAuto merge of #102471 - Dylan-DPC:rollup-ij3okjt, r=Dylan-DPC
bors [Thu, 29 Sep 2022 13:27:28 +0000 (13:27 +0000)]
Auto merge of #102471 - Dylan-DPC:rollup-ij3okjt, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #102336 (Fix associated type bindings with anon const in GAT position)
 - #102342 (Add negation methods for signed non-zero integers.)
 - #102385 (Don't export `__heap_base` and `__data_end` on wasm32-wasi.)
 - #102435 (Improve example of Iterator::reduce)
 - #102436 (rustdoc: clean up "normalize.css 8" input override CSS)
 - #102452 (fix minor ungrammatical sentence)
 - #102455 (Use let-chaining in `WhileTrue::check_expr`.)

Failed merges:

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

21 months agoRollup merge of #102455 - nnethercote:WhileTrue-check_expr, r=lqd
Dylan DPC [Thu, 29 Sep 2022 12:43:22 +0000 (18:13 +0530)]
Rollup merge of #102455 - nnethercote:WhileTrue-check_expr, r=lqd

Use let-chaining in `WhileTrue::check_expr`.

This has been bugging me for a while.

r? `@lqd`

21 months agoRollup merge of #102452 - granolocks:grammar-tweak, r=thomcc
Dylan DPC [Thu, 29 Sep 2022 12:43:21 +0000 (18:13 +0530)]
Rollup merge of #102452 - granolocks:grammar-tweak, r=thomcc

fix minor ungrammatical sentence

This fixes an innocuous ungrammatical sentence in example code in the  `TryFrom` documentation.

21 months agoRollup merge of #102436 - notriddle:notriddle/normalize-form, r=GuillaumeGomez
Dylan DPC [Thu, 29 Sep 2022 12:43:21 +0000 (18:13 +0530)]
Rollup merge of #102436 - notriddle:notriddle/normalize-form, r=GuillaumeGomez

rustdoc: clean up "normalize.css 8" input override CSS

These rules were copied from normalize.css 3, and are mostly redundant.

* `optgroup` isn't used in rustdoc at all
* `textarea` is only used for the "copy" button, so it's not visible
* The remaining buttons and inputs mostly have styles set anyway.
* We should never be setting `color` without also setting the background to something. Otherwise, you get white-on-gray text. That seems to be [the reason] why `normalize.css` changed this.

[the reason]: https://github.com/necolas/normalize.css/pull/502

21 months agoRollup merge of #102435 - GuillaumeGomez:improve-iterator-reduce-example, r=thomcc...
Dylan DPC [Thu, 29 Sep 2022 12:43:20 +0000 (18:13 +0530)]
Rollup merge of #102435 - GuillaumeGomez:improve-iterator-reduce-example, r=thomcc,vacuus

Improve example of Iterator::reduce

Fixes #81819.

I took your example `@bstrie` from https://github.com/rust-lang/rust/issues/81819 and applied it here.

r? `@thomcc`

21 months agoRollup merge of #102385 - sunfishcode:sunfishcode/wasm-no-export-heap-base, r=davidtwco
Dylan DPC [Thu, 29 Sep 2022 12:43:20 +0000 (18:13 +0530)]
Rollup merge of #102385 - sunfishcode:sunfishcode/wasm-no-export-heap-base, r=davidtwco

Don't export `__heap_base` and `__data_end` on wasm32-wasi.

`__heap_base` and `__data_end` are exported for use by wasm-bindgen, which uses the wasm32-unknown-unknown target. On wasm32-wasi, as a step toward implementing the Canonical ABI, and as an aid to building speicalized WASI API polyfill wrappers, don't export `__heap_base` and `__data_end` on wasm32-wasi.

21 months agoRollup merge of #102342 - jmillikin:nonzero-negation, r=scottmcm
Dylan DPC [Thu, 29 Sep 2022 12:43:19 +0000 (18:13 +0530)]
Rollup merge of #102342 - jmillikin:nonzero-negation, r=scottmcm

Add negation methods for signed non-zero integers.

Performing negation with defined wrapping semantics (such as `wrapping_neg()`) on a non-zero integer currently requires unpacking to a primitive and re-wrapping. Since negation of non-zero signed integers always produces a non-zero result, it is safe to implement the various `*_neg()` methods for `NonZeroI{N}`.

I'm not sure what to do about the `#[unstable(..., issue = "none")]` here -- should I file a tracking issue, or is that handled by the Rust dev team?

ACP: https://github.com/rust-lang/libs-team/issues/105

21 months agoRollup merge of #102336 - compiler-errors:issue-102333, r=jackh726
Dylan DPC [Thu, 29 Sep 2022 12:43:19 +0000 (18:13 +0530)]
Rollup merge of #102336 - compiler-errors:issue-102333, r=jackh726

Fix associated type bindings with anon const in GAT position

The first commit formats `type_of.rs`, which is really hard to maintain since it uses a bunch of features like `let`-chains and `if let` match arm bindings. Best if you just review the second two diffs.

Fixes #102333

21 months agomake tidy dependency error less confusing
Ralf Jung [Thu, 29 Sep 2022 11:42:57 +0000 (13:42 +0200)]
make tidy dependency error less confusing

21 months agoAuto merge of #102461 - oli-obk:split_collect_rs, r=lcnr
bors [Thu, 29 Sep 2022 10:44:29 +0000 (10:44 +0000)]
Auto merge of #102461 - oli-obk:split_collect_rs, r=lcnr

Split collect.rs

This file was way too big (adding a few lines of code caused tidy to trigger)

21 months agoSome path updates
Oli Scherer [Thu, 29 Sep 2022 09:33:30 +0000 (09:33 +0000)]
Some path updates

21 months agoSplit collect.rs
Oli Scherer [Thu, 29 Sep 2022 09:31:46 +0000 (09:31 +0000)]
Split collect.rs

21 months agoAuto merge of #102328 - cuviper:ibm-stack-probes, r=nagisa
bors [Thu, 29 Sep 2022 08:00:54 +0000 (08:00 +0000)]
Auto merge of #102328 - cuviper:ibm-stack-probes, r=nagisa

Enable inline stack probes on PowerPC and SystemZ

The LLVM PowerPC and SystemZ targets have both supported `"probe-stack"="inline-asm"` for longer than our current minimum LLVM 13 requirement, so we can turn this on for all `powerpc`, `powerpc64`, `powerpc64le`, and `s390x` targets in Rust. These are all tier-2 or lower, so CI does not run their tests, but I have confirmed that their `linux-gnu` variants do pass on RHEL.

cc #43241

21 months agoAuto merge of #102450 - JohnTitor:rollup-ahleg93, r=JohnTitor
bors [Thu, 29 Sep 2022 05:12:30 +0000 (05:12 +0000)]
Auto merge of #102450 - JohnTitor:rollup-ahleg93, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #98368 (Make `std::os::fd` public.)
 - #102085 (Code refactoring smart_resolve_report_errors)
 - #102351 (Improve E0585 help)
 - #102368 (Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`)
 - #102393 (Add regression test for issue 94923)
 - #102399 (Account for use of index-based lifetime names in print of binder)
 - #102416 (remove FIXME, improve documentation)
 - #102433 (env::temp_dir: fix a typo)

Failed merges:

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