Commit Graph

199441 Commits

Author SHA1 Message Date
Michael Howell
b9093f4008 rustdoc: remove no-op CSS #settings-menu { padding: 0 }
This CSS was added in 5e01ba36c9, and served to
override CSS right above it that set a 5px padding for several kinds of
buttons in the same toolbar.

The CSS that it overrode is still there, but now it only applies to
`#settings-menu > a`, so there's nothing to override.
2022-09-08 10:34:57 -07:00
bors
ccb5595df2 Auto merge of #98900 - lcnr:region-stuff, r=jackh726
const_generics: correctly deal with bound variables

removes the hack in `resolve` which was needed because we evaluated constants without caring about their bound variables.

Each commit should be fairly self-contained, even if they build on each other

r? `@jackh726`
2022-09-08 10:30:00 +00:00
lcnr
e6660326a3 bound variables during ctfe are a bug 2022-09-08 11:41:00 +02:00
lcnr
d15b00af48 don't evaluate with escaping bound vars 2022-09-08 11:41:00 +02:00
lcnr
01adb7e98d stop evaluating constants in Relate 2022-09-08 11:14:33 +02:00
lcnr
060f3e0c65 generalize: no need to cache errors 2022-09-08 11:14:33 +02:00
bors
b42244c2ab Auto merge of #101560 - Dylan-DPC:rollup-8m8yr89, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #101153 (Migrate another part of rustc_infer to session diagnostic)
 - #101399 (Shrink span for bindings with subpatterns.)
 - #101422 (Hermit: Add File::set_time stub)
 - #101455 (Avoid UB in the Windows filesystem code in... bootstrap?)
 - #101498 (rustc: Parameterize `ty::Visibility` over used ID)
 - #101549 (Use HashStable_Generic in rustc_type_ir)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-08 08:00:57 +00:00
Dylan DPC
7f46d7313c
Rollup merge of #101549 - eholk:type-ir-derive-hashstable_generic, r=jackh726
Use HashStable_Generic in rustc_type_ir

A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate.

This doesn't update all the types, because some would require `I: Interner + HashStable`.

r? `@cjgillot`
2022-09-08 11:55:10 +05:30
Dylan DPC
12b810063d
Rollup merge of #101498 - petrochenkov:visparam, r=cjgillot
rustc: Parameterize `ty::Visibility` over used ID

It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-08 11:55:09 +05:30
Dylan DPC
1c35596762
Rollup merge of #101455 - thomcc:why-is-this-here, r=jyn514
Avoid UB in the Windows filesystem code in... bootstrap?

This basically a subset of the changes from https://github.com/rust-lang/rust/pull/101171. I didn't think to look in src/bootstrap for more windows filesystem API usage, which was apparently a mistake on my part. It's kinda goofy that stuff like this is in here, but what are you gonna do, computers are awful.

I also added `winbase` to the `winapi` dep -- I tested this in a tmp crate but needed to add this to your Cargo.toml -- you `use winapi::stuff::winbase` in this function, but are relying on something else turning on that feature.
2022-09-08 11:55:08 +05:30
Dylan DPC
7064344ba4
Rollup merge of #101422 - mkroening:hermit-file-time, r=joshtriplett
Hermit: Add File::set_time stub

This is not supported on hermit yet. This change is required for compiling std.
2022-09-08 11:55:07 +05:30
Dylan DPC
0d61a507f5
Rollup merge of #101399 - cjgillot:borrowck-binding-span, r=estebank
Shrink span for bindings with subpatterns.

Bindings with nested patterns (`binding @ pat` syntax) currently point to the full pattern.  This PR proposes to shrink the span to stop before the ````@`.```  This makes the diagnostics for move/mutability conflicts clearer, as they not point to the `binding` only, instead of the full pat.

r? ```@estebank```
2022-09-08 11:55:06 +05:30
Dylan DPC
e3ea8008cc
Rollup merge of #101153 - IntQuant:issue-100717-infer-2, r=davidtwco
Migrate another part of rustc_infer to session diagnostic

Probably will migrate another file before marking this one as ready-to-merge.

`@rustbot` label +A-translation
r? rust-lang/diagnostics
cc https://github.com/rust-lang/rust/issues/100717
2022-09-08 11:55:06 +05:30
bors
44adfccffe Auto merge of #101504 - lqd:rust-lld-fix, r=petrochenkov
Fix `-Zgcc-ld=lld`

`-Zgcc-ld=lld` is currently broken. CI is currently ignoring its tests.

cc `@Mark-Simulacrum` on the `compiletest` change: I'm not sure which of `bootstrap`'s test step or `compiletest` is currently incorrect wrt windows' `--compile-lib-path`. Since `sysroot/bin` is passed on windows, that means that `compiletest` can't find `rust-lld` on windows and tests are currently ignored: it's looking for something that is in `sysroot/lib` instead.

They are currently ignored on unixes for a different reason: the lld wrapper has a different name than what is checked.

(I've changed `compiletest` in this PR, just because I could make a very targeted change there, whereas completely changing the intentional lib path that is passed seemed it'd have wider reaching implications on all tests.)

And in both unix/win cases, I've changed the detection to look for `rust-lld` rather than the wrappers in `bin/gcc-ld/`. It seems like the more stable of all these executable names.

r? `@petrochenkov`

I've tested the `lld-wrapper` change on linux and osx, but couldn't test on windows gnu targets (I only have MSVC targets, and these can't use `rust-lld` via `-Zgcc-ld=lld`, nor do they use the lld wrapper IIUC).

I'd expect it to work whether or not the wrapper is called with or without an executable suffix. But at least now CI should test it in these targets.

Fixes #101370.
2022-09-08 05:02:32 +00:00
bors
4af35b8e30 Auto merge of #101303 - jyn514:jnelson/handle-cycle-enum, r=cjgillot
Make `HandleCycleError` an enum instead of a macro-generated closure

Helps with https://github.com/rust-lang/rust/issues/96524. Based on https://github.com/rust-lang/rust/pull/100943 to avoid merge conflicts, so it looks larger than it is (only the last commit is relevant).

cc https://rust-lang.zulipchat.com/#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/Moving.20.60Value.60.20to.20rustc_query_system.20.2396524

r? `@cjgillot`
2022-09-08 02:21:16 +00:00
bors
512bd84f51 Auto merge of #94075 - mikebenfield:wip-enum, r=oli-obk
Use niche-filling optimization even when multiple variants have data.

Fixes #46213
2022-09-07 23:40:06 +00:00
Eric Holk
578fc49fc1 Use HashStable_Generic in rustc_type_ir
A lot of the types in this crate implemented HashStable directly to
avoid circular dependencies. One way around that is to use
HashStable_Generic. We adopt that here to avoid a lot of boilerplate.

This doesn't update all the types, because some would require
`I: Interner + HashStable`.
2022-09-07 16:05:06 -07:00
bors
c2804e6ec2 Auto merge of #101544 - matthiaskrgr:rollup-4urx917, r=matthiaskrgr
Rollup of 14 pull requests

Successful merges:

 - #101343 (Add -api-level to pm command)
 - #101416 (stdio: Document no support for writing to non-blocking stdio/stderr)
 - #101435 (Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH`)
 - #101493 (Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::reborrow)
 - #101502 (Do not suggest a semicolon for a macro without `!`)
 - #101503 (Add debug calls)
 - #101506 (rustdoc: remove unused CSS `#main-content > .since`)
 - #101507 (rustdoc: remove unused CSS `#main-content > table td`)
 - #101521 (Rustdoc-Json: More accurate struct type.)
 - #101525 (Fix typo in pass_manager.rs)
 - #101534 (rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`)
 - #101535 (Fix error printing mistake in tidy)
 - #101536 (Add documentation for Attr::is_doc_comment)
 - #101538 (rustdoc: remove unused CSS `.content .methods > div`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-07 21:17:30 +00:00
Michael Benfield
d7a750b504 Use niche-filling optimization even when multiple variants have data.
Fixes #46213
2022-09-07 20:12:45 +00:00
Michael Benfield
1a08b96a0b Change name of "dataful" variant to "untagged"
This is in anticipation of a new enum layout, in which the niche
optimization may be applied even when multiple variants have data.
2022-09-07 20:12:45 +00:00
Matthias Krüger
eae48c31cb
Rollup merge of #101538 - notriddle:notriddle/content-methods-div, r=GuillaumeGomez
rustdoc: remove unused CSS `.content .methods > div`

This selector has its roots in these commits:

  * current version:

    `.content .methods > div:not(.notable-traits):not(.method)` from 9077d540da

  * intermediate version:

    `.content .methods > div:not(.important-traits)` from d86621f69e

  * original version:

    `.content .methods > div { margin-left: 40px; }` from 0a46933c4d

Based on the call stack, where [`class='methods'`] calls `trait_item` and [`trait_item`] calls [`document`], this div selector was probably intended to target docblock and stability tags.

In the current version of the code, neither of these can possibly be nested directly below the `class='methods'` wrapper, because the [current version of the `trait_item` function] always wraps them in a `<details>` tag if they exist. The only div tag that can possibly be nested directly below it now is the one with class `method`, which is explicitly excluded.

[`class='methods'`]: 0a46933c4d/src/librustdoc/html/render.rs (L1811-L1842)

[`trait_item`]: 0a46933c4d/src/librustdoc/html/render.rs (L1807)

[`document`]: 0a46933c4d/src/librustdoc/html/render.rs (L1515-L1523)

[current version of the `trait_item` function]: e7c7aa7288/src/librustdoc/html/render/print_item.rs (L710)
2022-09-07 21:48:23 +02:00
Matthias Krüger
41e1830a43
Rollup merge of #101536 - GuillaumeGomez:is_doc_comment-doc, r=lqd
Add documentation for Attr::is_doc_comment

The function name is very misleading, some explanations won't hurt.

r? `@lqd`
2022-09-07 21:48:23 +02:00
Matthias Krüger
497e170503
Rollup merge of #101535 - est31:tidy_error_fix, r=Mark-Simulacrum
Fix error printing mistake in tidy

Fixes a small bug in the error printing code added by #100591 .
2022-09-07 21:48:22 +02:00
Matthias Krüger
09e7bb427e
Rollup merge of #101534 - rust-lang:notriddle/rustdoc-flex-direction, r=GuillaumeGomez
rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`

According to MDN, [flex-direction] only applies to [flex containers], which are boxes with `display: flex` or `inline-flex`.

However, the `.rustdoc` body container is not a flex-container on mobile. A few lines above, it's set to `display: block`, so this selector does not have any effect.

[flex-direction]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction

[flex containers]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox#the_flex_container
2022-09-07 21:48:21 +02:00
Matthias Krüger
acb3d11f1b
Rollup merge of #101525 - eltociear:patch-16, r=cjgillot
Fix typo in pass_manager.rs

overriden -> overridden
2022-09-07 21:48:20 +02:00
Matthias Krüger
8d21e97d64
Rollup merge of #101521 - aDotInTheVoid:rdj-structkind, r=GuillaumeGomez
Rustdoc-Json: More accurate struct type.

Closes #101489

r? `@GuillaumeGomez`
2022-09-07 21:48:19 +02:00
Matthias Krüger
fbae06e75f
Rollup merge of #101507 - notriddle:notriddle/main-content-table-td, r=GuillaumeGomez
rustdoc: remove unused CSS `#main-content > table td`

This rule was added in 4e2c59a970 to benefit the module items table. However, the module items table stopped using table tags when 6020c79dde switched us over to grid layout.

You can see when this one used to be triggered by visiting <https://doc.rust-lang.org/1.54.0/alloc/slice/index.html#structs-1> in a very narrow window, but it doesn't any more, because the module table is now rendered using `<div>` tags.
2022-09-07 21:48:18 +02:00
Matthias Krüger
46fe72b359
Rollup merge of #101506 - notriddle:notriddle/rustdoc-main-since-2, r=GuillaumeGomez
rustdoc: remove unused CSS `#main-content > .since`

I missed one from #101298
2022-09-07 21:48:17 +02:00
Matthias Krüger
0a1c816dcd
Rollup merge of #101503 - spastorino:add-debug-calls, r=compiler-errors
Add debug calls

`@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? `@oli-obk` `@cjgillot`
2022-09-07 21:48:16 +02:00
Matthias Krüger
c365ce3ffd
Rollup merge of #101502 - TaKO8Ki:do-not-suggest-semicolon-for-macro-without-exclamation-mark, r=wesleywiser
Do not suggest a semicolon for a macro without `!`

Fixes a regression in #101490
2022-09-07 21:48:15 +02:00
Matthias Krüger
9361297dfc
Rollup merge of #101493 - spastorino:borrow-mut-impl-trait-context, r=oli-obk
Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::reborrow

`@oli-obk` requested this and other changes as a way of simplifying #101345. This is just going to make the diff of #101345 smaller.

r? `@oli-obk` `@cjgillot`
2022-09-07 21:48:14 +02:00
Matthias Krüger
1d65e9619d
Rollup merge of #101435 - JakobDegen:bitwidth-tests, r=wesleywiser
Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH`

This commit removes the annotation only for those tests where the 32 bit and 64 bit files were exactly identical. I didn't touch anything in the `mir-opt/const` directory, since having this annotation there seems more principled, even if it doesn't make a difference.

This also removes four additional files related to the `separate_const_switch.rs` test. The associated annotations were removed in #100827 , but I forgot to remove the files as well. (#97564 is the issue tracking an automated check here)

r? ```@wesleywiser```
2022-09-07 21:48:13 +02:00
Matthias Krüger
d1ebba41c1
Rollup merge of #101416 - uarif1:doc_non_blocking_stdio, r=joshtriplett
stdio: Document no support for writing to non-blocking stdio/stderr

Printing to stdio/stderr that have been opened with non-blocking
(O_NONBLOCK in linux) can result in an error, which is not handled
by std::io module causing a panic.

Signed-off-by: Usama Arif <usama.arif@bytedance.com>
2022-09-07 21:48:12 +02:00
Matthias Krüger
870a46df88
Rollup merge of #101343 - diminishedprime:patch-3, r=tmandry
Add -api-level to pm command

As of ~Aug 30th, `pm build` commands require an `api-level` flag. This flag should match the fuchsia api-level that's being targeted by the code. Since this is dependent on the version of the SDK that's being used, we may want to change this to something a bit more robust in the future.
2022-09-07 21:48:11 +02:00
bors
9682b5d3a3 Auto merge of #101476 - ChrisDenton:BCryptRandom-fix, r=thomcc
Open a BCrypt algorithm handle

Fixes #101474, supplants #101456.

Replaces use of a pseduo handle with manually opening a algorithm handle.

Most interesting thing here is the atomics.

r? `@thomcc`
2022-09-07 18:54:03 +00:00
Michael Howell
43681db48d rustdoc: remove unused CSS #main-content > table td
This rule was added in 4e2c59a970
to benefit the module items table. However, the module items table stopped
using table tags when 6020c79dde
switched us over to grid layout.

You can see when this one used to be triggered by visiting
<https://doc.rust-lang.org/1.54.0/alloc/slice/index.html#structs-1> in a
very narrow window, but it doesn't any more, because the module table is
now rendered using `<div>` tags.
2022-09-07 09:52:49 -07:00
bors
f91ca2878a Auto merge of #101522 - oli-obk:miriup, r=oli-obk
Update miri submodule

fixes #101344

cc `@rust-lang/miri`

r? `@ghost`
2022-09-07 16:31:39 +00:00
Michael Howell
10fc2ff806 rustdoc: remove unused CSS .content .methods > div
This selector has its roots in these commits:

  * current version:

    `.content .methods > div:not(.notable-traits):not(.method)` from
    9077d540da

  * intermediate version:

    `.content .methods > div:not(.important-traits)` from
    d86621f69e

  * original version:

    `.content .methods > div { margin-left: 40px; }` from
    0a46933c4d

Based on the call stack, where [`class='methods'`] calls `trait_item` and
[`trait_item`] calls [`document`], this div selector was probably intended to
target docblock and stability tags.

In the current version of the code, neither of these can possibly be nested
directly below the `class='methods'` wrapper, because the [current version of
the `trait_item` function] always wraps them in a `<details>` tag if they
exist. The only div tag that can possibly be nested directly below it now is
the one with class `method`, which is explicitly excluded.

[`class='methods'`]: 0a46933c4d/src/librustdoc/html/render.rs (L1811-L1842)

[`trait_item`]: 0a46933c4d/src/librustdoc/html/render.rs (L1807)

[`document`]: 0a46933c4d/src/librustdoc/html/render.rs (L1515-L1523)

[current version of the `trait_item` function]: e7c7aa7288/src/librustdoc/html/render/print_item.rs (L710)
2022-09-07 08:42:31 -07:00
Oli Scherer
419c4e1c4f Update miri submodule 2022-09-07 15:42:12 +00:00
bors
a4d034126d Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnr
Shrink `PredicateS`

r? `@ghost`
2022-09-07 13:49:58 +00:00
est31
dc2af5f876 Fix error printing mistake in tidy 2022-09-07 15:48:11 +02:00
Santiago Pastorino
d42afd2bd1
Format hir_id_validator error using pretty print 2022-09-07 10:46:17 -03:00
Santiago Pastorino
e3a738a942
Add instrument and debug calls 2022-09-07 10:46:14 -03:00
Michael Howell
210c851dcd rustdoc: remove unused mobile CSS .rustdoc { flex-direction }
According to MDN, [flex-direction] only applies to [flex containers], which
are boxes with `display: flex` or `inline-flex`.

However, the `.rustdoc` body container is not a flex-container on mobile.
A few lines above, it's set to `display: block`, so this selector does
not have any effect.

[flex-direction]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction

[flex containers]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox#the_flex_container
2022-09-07 06:42:36 -07:00
Guillaume Gomez
88fa621bab
Add documentation for Attr::is_doc_comment 2022-09-07 15:34:16 +02:00
Usama Arif
dfbc1f712d stdio: Document no support for writing to non-blocking stdio/stderr
Printing to stdio/stderr that have been opened with non-blocking
(O_NONBLOCK in linux) can result in an error, which is not handled
by std::io module causing a panic.

Signed-off-by: Usama Arif <usama.arif@bytedance.com>
2022-09-07 14:22:57 +01:00
Chris Denton
832c7af0ea
Don't break windows/rand for miri 2022-09-07 14:00:15 +01:00
Rémy Rakic
318d0eba8b ignore -Zgcc-ld=lld test on msvc
now that CI correctly detects rust-lld in run-make tests, we ignore this
test since it relies on `-Zgcc-ld=lld` which is not made to work on the
windows-msvc targets: it requires a gcc flavor.
2022-09-07 14:51:54 +02:00
Rémy Rakic
c805c62562 fix compiletest detection of needs-rust-lld tests
for both windows and unixes
2022-09-07 14:51:54 +02:00
Rémy Rakic
5f25154813 fix lld-wrapper lld flavor detection 2022-09-07 14:51:54 +02:00