Commit Graph

170975 Commits

Author SHA1 Message Date
Lucas Thormann
c9340ec71b
Fix typo 2022-06-21 15:40:08 -05:00
Hood Chatham
8e09f42042 Update Emscripten's no_default_libraries handling 2022-06-21 13:21:16 -07:00
beetrees
be5337cde5
Migrate builtin-macros-expected-one-cfg-pattern to SessionDiagnostic 2022-06-21 20:20:00 +01:00
Camille GILLOT
576661cb5f Rustdoc fallout. 2022-06-21 21:13:43 +02:00
Camille GILLOT
7437136f0e Use CreateParameter mode for closures too. 2022-06-21 21:13:43 +02:00
Camille GILLOT
32af719b07 Always create parameters for functions-like types. 2022-06-21 21:13:41 +02:00
beetrees
6264ffbfef
Migrate builtin-macros-requires-cfg-pattern to SessionDiagnostic 2022-06-21 20:10:31 +01:00
beetrees
d6072e53cd
Add UI test for cfg!(foo, bar) 2022-06-21 19:28:22 +01:00
beetrees
761c846a07
Add create_err and emit_err to ExtCtxt 2022-06-21 18:56:04 +01:00
Alan Egerton
75203eef19
Remove unecessary references to TypeFolder::Error 2022-06-21 17:39:44 +01:00
Alan Egerton
6ac6866bec
Reverse folder hierarchy
#91318 introduced a trait for infallible folders distinct from the fallible version.  For some reason (completely unfathomable to me now that I look at it with fresh eyes), the infallible trait was a supertrait of the fallible one: that is, all fallible folders were required to also be infallible.  Moreover the `Error` associated type was defined on the infallible trait!  It's so absurd that it has me questioning whether I was entirely sane.

This trait reverses the hierarchy, so that the fallible trait is a supertrait of the infallible one: all infallible folders are required to also be fallible (which is a trivial blanket implementation).  This of course makes much more sense!  It also enables the `Error` associated type to sit on the fallible trait, where it sensibly belongs.

There is one downside however: folders expose a `tcx` accessor method.  Since the blanket fallible implementation for infallible folders only has access to a generic `F: TypeFolder`, we need that trait to expose such an accessor to which we can delegate.  Alternatively it's possible to extract that accessor into a separate `HasTcx` trait (or similar) that would then be a supertrait of both the fallible and infallible folder traits: this would ensure that there's only one unambiguous `tcx` method, at the cost of a little additional boilerplate.  If desired, I can submit that as a separate PR.

r? @jackh726
2022-06-21 17:38:22 +01:00
bors
dc80ca78b6 Auto merge of #98098 - bjorn3:archive_refactor, r=michaelwoerister
Remove the source archive functionality of ArchiveWriter

We now build archives through strictly additive means rather than taking an existing archive and potentially substracting parts. This is simpler and makes it easier to swap out the archive writer in https://github.com/rust-lang/rust/pull/97485.
2022-06-21 16:24:56 +00:00
Santiago Pastorino
5ed1495041
This comment is out dated and misleading
Arms are about TAIT and RPIT, as the variants clearly show.
2022-06-21 12:43:58 -03:00
Tom Milligan
2c8b3bef2b
ci: include config_proc_macro crate in ci (#5389)
* config_proc_macro: fix failing doctests

* ci: include config_proc_macro crate in ci

* [review] working native windows ci

* [fix] add --locked file for ci

* [fix] quoting of cmd variables
2022-06-21 10:23:13 -05:00
bors
72fd41a8b4 Auto merge of #98335 - JohnTitor:rollup-j2zudxv, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #94033 (Improve docs for `is_running` to explain use case)
 - #97269 (adjust transmute const stabilization version)
 - #97805 (Add proper tracing spans to rustc_trait_selection::traits::error_reporting)
 - #98022 (Fix erroneous span for borrowck error)
 - #98124 (Improve loading of crates.js and sidebar-items.js)
 - #98278 (Some token stream cleanups)
 - #98306 (`try_fold_unevaluated` for infallible folders)
 - #98313 (Remove lies in comments.)
 - #98323 (⬆️ rust-analyzer)
 - #98329 (Avoid an ICE and instead let the compiler report a useful error)
 - #98330 (update ioslice docs to use shared slices)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-21 13:41:37 +00:00
Caio
b6290debed Move some tests to more reasonable directories 2022-06-21 09:33:14 -03:00
León Orell Valerian Liehr
67508f3714 Remove #[doc(hidden)] logic from unused_attributes lint 2022-06-21 14:06:32 +02:00
Yuki Okushi
e5092425eb
Rollup merge of #98330 - conradludgate:io-slice-mut-docs, r=Dylan-DPC
update ioslice docs to use shared slices

I noticed that IoSlice docs were taking unnecessary mut slices, when they only accept shared slices
2022-06-21 20:08:17 +09:00
Yuki Okushi
1b48f09536
Rollup merge of #98329 - oli-obk:fast_path_ice, r=cjgillot
Avoid an ICE and instead let the compiler report a useful error

Fixes #98299
2022-06-21 20:08:16 +09:00
Yuki Okushi
21a20b419a
Rollup merge of #98323 - lnicola:rust-analyzer-2022-06-21, r=lnicola
⬆️ rust-analyzer

r? ``@ghost``
2022-06-21 20:08:15 +09:00
Yuki Okushi
18b01d5ea0
Rollup merge of #98313 - m-ou-se:fix-comments, r=joshtriplett
Remove lies in comments.

> does not have a const constructor

> pub const fn new() -> Self

🤔
2022-06-21 20:08:14 +09:00
Yuki Okushi
51a60911fb
Rollup merge of #98306 - eggyal:add-unevaluated-to-blanket-fallibletypefolder, r=nnethercote
`try_fold_unevaluated` for infallible folders

#97447 added folding of unevaluated constants, but did not include an override of the default (fallible) operation in the blanket impl of `FallibleTypeFolder` for infallible folders.  Here we provide that missing override.

r? ```@nnethercote```
2022-06-21 20:08:13 +09:00
Yuki Okushi
b1d2e5c0cc
Rollup merge of #98278 - nnethercote:some-token-stream-cleanups, r=petrochenkov
Some token stream cleanups

Best reviewed one commit at a time.

r? ```@petrochenkov```
2022-06-21 20:08:12 +09:00
Yuki Okushi
75f17ed909
Rollup merge of #98124 - jsha:defer-crates, r=GuillaumeGomez
Improve loading of crates.js and sidebar-items.js

Now that the "All Crates" dropdown is only rendered on the search results page,
there is no need to load crates.js on most pages. Load it only on crate pages.
Also, add the `defer` attribute so it does not block HTML parsing.

For sidebar-items.js, move the script tag to `<head>`. Since it already has the
defer attribute it won't block loading. The defer attribute does preserve
ordering between scripts, so instead of the callback on load, it can set a
global variable on load, which is slightly simpler. Also, since it is required
to finish rendering the page, beginning its load earlier is better.

Remove generation and handling of sidebar-vars. Everything there can be computed
with information available in JS via other means.

Remove the extra_scripts fields of the `Page` template. They were only
used by source-script.js and source-files.js, which are now linked by the template
based on whether it is rendering a source page.

Remove the "other" wrapper in the sidebar. It was unnecessary.

r? ```@GuillaumeGomez```

Demo: https://rustdoc.crud.net/jsha/defer-crates/std/index.html
2022-06-21 20:08:11 +09:00
Yuki Okushi
a7f789b502
Rollup merge of #98022 - compiler-errors:erroneous-borrowck-span, r=oli-obk
Fix erroneous span for borrowck error

I am not confident that this is the correct fix, but it does the job. Open to suggestions for a real fix instead.

Fixes #97997

The issue is that we pass a [dummy location](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/mir/visit.rs.html#302) when type-checking the ["required consts"](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.required_consts) that are needed by the MIR body during borrowck. This means that when we fail to evaluate the constant, we use the span of `bb0[0]`, instead of the actual span of the constant.

There are quite a few other places that use `START_BLOCK.start_location()`, `Location::START`, etc. when calling for a random/unspecified `Location` value. This is because, unlike (for example) `Span`, we don't have a dummy/miscellaneous value to use instead. I would appreciate guidance (either in this PR, or a follow-up) on what needs to be done to clean this up in general.
2022-06-21 20:08:10 +09:00
Yuki Okushi
9c800ec4e9
Rollup merge of #97805 - coolreader18:trace-suggestions, r=oli-obk
Add proper tracing spans to rustc_trait_selection::traits::error_reporting

While I was trying to figure out #97704 I did some of this to make the logs more legible, so I figured I'd do the whole module and open a PR with it. afaict this is an ongoing process in the compiler from the log->tracing transition? but lmk if there was a reason for the more verbose forms of logging as they are.

Also, for some of the functions with only one log in them, I put the function name as a message for that log instead of `#[instrument]`-ing the whole function with a span? but maybe the latter would actually be preferable, I'm not actually sure.
2022-06-21 20:08:09 +09:00
Yuki Okushi
b20aff2b33
Rollup merge of #97269 - RalfJung:transmute, r=m-ou-se
adjust transmute const stabilization version

With 1.46, this became callable only in `const`/`static` items.

Only since 1.56 is this callable in `const fn`: [changelog](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1560-2021-10-21)

Also see [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/transmute.20const.20fn.20stabilization).
2022-06-21 20:08:08 +09:00
Yuki Okushi
84c17c200a
Rollup merge of #94033 - joshtriplett:documentation-is-running-better-go-catch-it, r=m-ou-se
Improve docs for `is_running` to explain use case
2022-06-21 20:08:07 +09:00
bors
a25b1315ee Auto merge of #95576 - DrMeepster:box_erasure, r=oli-obk
Remove dereferencing of Box from codegen

Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains.

Hopefully, this is the end of the Box<T, A> ICEs.
2022-06-21 11:00:39 +00:00
notseanray
8eb7ddfd17 update cpu-usage-over-time-plot script
fix tidy checks and correct cpu-usage-over-time-plot script
2022-06-21 06:15:31 -04:00
Yuki Okushi
31476e7096
Add a full regression test for #73727
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-21 19:08:48 +09:00
Mara Bos
ac38258dcc Use futex based thread parker on Fuchsia. 2022-06-21 11:49:59 +02:00
Conrad Ludgate
44dbd9808e update ioslice docs to use shared slices 2022-06-21 11:45:17 +02:00
Oli Scherer
d2ea7e2059 Avoid an ICE and instead let the compiler report a useful error 2022-06-21 08:47:02 +00:00
bors
abace0a1f1 Auto merge of #97657 - Urgau:check-cfg-many-mut, r=oli-obk
Use get_many_mut to reduce the cost of setting up check cfg values

This PR use the newly added [`get_many_mut`](https://github.com/rust-lang/rust/issues/97601) function in [`HashMap`](https://doc.rust-lang.org/nightly/std/collections/hash_map/struct.HashMap.html#method.get_many_mut) to reduce the cost of setting up the initial check cfg values.

cc `@petrochenkov`
2022-06-21 07:40:32 +00:00
Ross MacArthur
bbdff1fff4
Add Iterator::next_chunk 2022-06-21 08:57:02 +02:00
Laurențiu Nicola
db542e46c2 ⬆️ rust-analyzer 2022-06-21 08:12:17 +03:00
Michael Goulet
f924e74fb1 Provide a segment res in more cases 2022-06-20 21:27:42 -07:00
Michael Goulet
e900a35496 Give name if anonymous region appears in impl signature 2022-06-20 20:56:51 -07:00
bors
42dcf70f99 Auto merge of #98148 - c410-f3r:assert-compiler, r=oli-obk
[RFC 2011] Expand expressions where possible

Tracking issue: https://github.com/rust-lang/rust/issues/44838
Fourth step of https://github.com/rust-lang/rust/pull/96496

Extends https://github.com/rust-lang/rust/pull/97665 considering expressions that are good candidates for expansion.

r? `@oli-obk`
2022-06-21 03:44:54 +00:00
bors
0887113991 Auto merge of #98307 - matthiaskrgr:rollup-rb3huha, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #98235 (Drop magic value 3 from code)
 - #98267 (Don't omit comma when suggesting wildcard arm after macro expr)
 - #98276 (Mention formatting macros when encountering `ArgumentV1` method in const)
 - #98296 (Add a link to the unstable book page on Generator doc comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-20 22:34:50 +00:00
Jacob Hoffman-Andrews
b37a05bd01 rustdoc: optimize loading of source sidebar
The source sidebar has a setting to remember whether it should be open or
closed. Previously, this setting was handled in source-script.js, which
is loaded with `defer`, meaning it is often run after the document is rendered.
Since CSS renders the source sidebar as closed by default, changing this
after the initial render results in a relayout.

Instead, handle the setting in storage.js, which is the first script to load
and is the only script that blocks render. This avoids a relayout and means
navigating between files with the sidebar open is faster.
2022-06-20 15:08:02 -07:00
Guillaume Gomez
beb2f364cc Fix panic by checking if CStore has the crate data we want before actually querying it 2022-06-20 23:39:26 +02:00
Mara Bos
a171a6b7ec Remove lies in comments. 2022-06-20 23:02:21 +02:00
Josh Triplett
7098a714e8 Improve docs for is_running to explain use case 2022-06-20 13:42:49 -07:00
Guillaume Gomez
987c73158e Integrate generate_macro_def_id_path into href_with_root_path 2022-06-20 22:40:19 +02:00
Guillaume Gomez
f4db07ed4c Add test for macro support in "jump to def" feature 2022-06-20 21:09:55 +02:00
Guillaume Gomez
810254b31e Improve code readability and documentation 2022-06-20 21:09:55 +02:00
Matthias Krüger
dfa933d420
Rollup merge of #98296 - JohnTitor:generator-unstable-book-link, r=Dylan-DPC
Add a link to the unstable book page on Generator doc comment

This makes it easier to jump into the Generator section on the unstable book.

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-20 20:13:12 +02:00
Matthias Krüger
5eb7238928
Rollup merge of #98276 - compiler-errors:const-format-macro, r=oli-obk
Mention formatting macros when encountering `ArgumentV1` method in const

Also open to just closing this if it's overkill. There are a lot of other distracting error messages around, so maybe it's not worth fixing just this one.

Fixes #93665
2022-06-20 20:13:11 +02:00