Commit Graph

196180 Commits

Author SHA1 Message Date
Miguel Guarniz
16513d689e Rename local_did to def_id
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 18:26:10 -04:00
Miguel Guarniz
25bdc8965e Change maybe_body_owned_by to take local def id
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 18:25:58 -04:00
bors
3924dac7bb Auto merge of #99577 - est31:remove_box_librustdoc, r=jsha
Remove remaining uses of box syntax from librustdoc

Remove the remaining uses of box syntax from librustdoc. Followup of #99066 where these changes were split out because they were responsible for a small but noticeable regression. This PR avoids the regression by boxing some large variants of `ItemKind` to reduce the enum's size by half from 224 bytes to 112 bytes (on x86-64). This should also help with reducing memory usage.
2022-07-29 18:44:53 +00:00
est31
fabb4b0661 Statically ensure the size of ItemKind 2022-07-29 19:30:25 +02:00
est31
1116fc164f Box FunctionItem, TyMethodItem, MethodItem, ForeignFunctionItem
This reduces ItemKind size from 160 bytes to 112 bytes
2022-07-29 19:30:25 +02:00
est31
96c051fd07 Box TypedefItem, ImplItem, AssocTypeItem variants of ItemKind
This reduces ItemKind size from 224 bytes to 160 bytes.
2022-07-29 19:30:25 +02:00
est31
0bf65c7c92 Remove box_syntax feature gate from librustdoc 2022-07-29 19:30:25 +02:00
est31
79246e8e9a Remove box syntax from doctest.rs 2022-07-29 19:30:25 +02:00
est31
e62f6a0e87 Remove box syntax from Box<rustdoc::clean::types::ItemKind> construction
The type has 240 bytes according to compiler internal rustdoc.
2022-07-29 19:30:23 +02:00
bors
5dda74a48c Auto merge of #99467 - BelovDV:add_option_link_arg, r=petrochenkov
flag '-l link-arg=___ was added

#99427
2022-07-29 15:36:52 +00:00
bors
9fa62f2d85 Auto merge of #99715 - tmiasko:coverage-run-make, r=Mark-Simulacrum
Move coverage tests from run-make-fulldeps to run-make
2022-07-29 12:45:47 +00:00
bors
2f847b81a0 Auto merge of #99892 - JohnTitor:rollup-qi4fem8, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #99686 (add suggestion when there is a impl of external trait on pointer with wrong coherence rules)
 - #99760 (doc/rustc: describe the uefi target platforms)
 - #99766 (Htmldocck: Substitute the doc channel when blessing)
 - #99781 (Use String::from_utf8_lossy in CStr demo)
 - #99803 (Update mentions to `rustc_metadata::rmeta::Lazy`)
 - #99845 (Remove `$` prefix for bash scripts in doc)
 - #99850 (rustdoc: Remove more Clean trait implementations)
 - #99872 (Clone the `src/llvm-project` submodule if profiling is enabled)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-29 09:57:44 +00:00
bors
7dfdd64433 Auto merge of #99667 - ouz-a:some_branch, r=oli-obk
Optimize `UnDerefer`

Addresses the performance [issues](https://github.com/rust-lang/rust/pull/98145#issuecomment-1183548597) faced here.

r? `@oli-obk`
2022-07-29 07:11:50 +00:00
Yuki Okushi
a8f77ade97
Rollup merge of #99872 - Nilstrieb:bootstrap-llvm, r=jyn514
Clone the `src/llvm-project` submodule if profiling is enabled

To compile rustc with profiling information, `compiler-rt` from LLVM is required. Building it requires the `src/llvm-project` submodule to be initialized and updated.

Fixes #99869
2022-07-29 15:40:04 +09:00
Yuki Okushi
51dda5067c
Rollup merge of #99850 - GuillaumeGomez:clean-more-items, r=notriddle
rustdoc: Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`
2022-07-29 15:40:03 +09:00
Yuki Okushi
da3f951bb0
Rollup merge of #99845 - xtexChooser:patch-1, r=GuillaumeGomez
Remove `$` prefix for bash scripts in doc
2022-07-29 15:40:02 +09:00
Yuki Okushi
fd3610ed2e
Rollup merge of #99803 - JohnTitor:update-lazy-docs, r=compiler-errors
Update mentions to `rustc_metadata::rmeta::Lazy`

While working on https://github.com/rust-lang/rustc-dev-guide/pull/1411, I noticed there are still some mentions of `Lazy`. This updates them to `LazyValue`, `LazyArray`, or `LazyTable`.

r? ````@compiler-errors````

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-07-29 15:40:01 +09:00
Yuki Okushi
9b3f49f1bd
Rollup merge of #99781 - workingjubilee:demo-string-from-cstr, r=thomcc
Use String::from_utf8_lossy in CStr demo

Fixes rust-lang/rust#99755.
2022-07-29 15:40:00 +09:00
Yuki Okushi
55296c47f4
Rollup merge of #99766 - fmease:htmldocck-subst-channel-when-blessing, r=Mark-Simulacrum
Htmldocck: Substitute the doc channel when blessing

Since #84942, the snippet `{{channel}}` gets substituted with the concrete “doc channel” (e.g. `https://doc.rust-lang.org/nightly`) when snapshot files are checked against the actual rustdoc output.

However, when you `--bless` rustdoc tests, htmldocck just dumps the concrete channel into the snapshot file and
you have to manually do a find-and-replace after blessing to uphold what #84942 set out to fix.

I admit it's a bit fragile to blindly replace URLs like this but I guess it's not too bad in practice.
Feel free to close this PR if you don't think that this is a good idea.

`@rustbot` label T-rustdoc A-testsuite
2022-07-29 15:39:59 +09:00
Yuki Okushi
b7beec9677
Rollup merge of #99760 - dvdhrm:rw/uefiplat, r=ehuss
doc/rustc: describe the uefi target platforms

Add a `platform-support` entry to the rustc-docs for the different `*-unknown-uefi` targets. This describes in detail how this platform works, a few basic examples, and how to compile for the platform.

Red Hat is sponsoring my work on this platform, so I am putting myself down as target maintainer. Co-maintainers are more than welcome to join me in the effort. Communication is going on off-list to coordinate the different efforts.

Note that the ultimate goal is to move the UEFI targets to Tier-2 so bootloaders can be more easily supported in commercial products. This documentation is the first step towards that goal, but should be a viable documentation even for the current Tier-3 status of the targets.

I also want to point out that there is an ongoing GSoC-effort to port the rust standard library to UEFI (by Ayush Singh). While this work is not necessarily required to get to Tier-2, we definitely should coordinate the efforts and update the documentation as soon as any such ports are merged.

Note that the targets are already used by multiple commercial and non commercial production systems, including, but not limited to:

 * Tianocore-EDK2 (Official UEFI SDK by Intel) comes with rust support
   in its staging repository (not part of any release, yet).
   (https://github.com/tianocore/edk2-staging/tree)
 * Intel's research program "Project Mu" uses the rust UEFI targets to
   show possible future replacements for Tianocore-EDK2.
 * The Rust OS "Redox" uses the UEFI targets for its bootloader.
   (https://www.redox-os.org/)
 * The hugely popular in-depth documentation of OS development in Rust
   by Philipp Oppermann uses the UEFI targets.
   (https://os.phil-opp.com/)
2022-07-29 15:39:58 +09:00
Yuki Okushi
a573adf3cb
Rollup merge of #99686 - vincenzopalazzo:macros/impl_on_ptr, r=compiler-errors
add suggestion when there is a impl of external trait on pointer with wrong coherence rules

Closes https://github.com/rust-lang/rust/issues/99572

This will try to improve the node in the error message by suggesting a general solution because the solution, in this case, is application depended.

I'm not super happy regarding the code quality, but I'm happy to have feedback on it.

`@rustbot` r? `@compiler-errors`
2022-07-29 15:39:57 +09:00
bors
ea6ab1bd84 Auto merge of #99660 - PrestonFrom:issue_99265, r=compiler-errors
Generate correct suggestion with named arguments used positionally

Address issue #99265 by checking each positionally used argument
to see if the argument is named and adding a lint to use the name
instead. This way, when named arguments are used positionally in a
different order than their argument order, the suggested lint is
correct.

For example:
```
println!("{b} {}", a=1, b=2);
```
This will now generate the suggestion:
```
println!("{b} {a}", a=1, b=2);
```

Additionally, this check now also correctly replaces or inserts
only where the positional argument is (or would be if implicit).
Also, width and precision are replaced with their argument names
when they exists.

Since the issues were so closely related, this fix for issue #99265
also fixes issue #99266.

Fixes #99265
Fixes #99266
2022-07-29 04:23:08 +00:00
bors
9de7474830 Auto merge of #99512 - nikic:llvm-15-fixes, r=cuviper
LLVM 15 compatibility fixes

These are LLVM 15 compatibility fixes split out from #99464. There are three changes here:

 * Emit elementtype attribtue for ldrex/strex intrinsics. This is requires as part of the opaque pointers migration.
 * Make more tests compatible with opaque pointers. These are either new or aren't run on x86.
 * Remove a test for `#[rustc_allocator]`. Since #99574 there are more requirement on the function signature. I dropped the test entirely, since we already test the effect of the attribute elsewhere.
 * The main change: When a worker thread emits an error, wait for other threads to finish before unwinding the main thread and exiting. Otherwise workers may end up using globals for which destructors have already been run. This was probably never quite correct, but became an active problem with LLVM 15, because it started using global dtors in critical places, as part of ManagedStatic removal.

Fixes #99432 (and probably also #95679).

r? `@cuviper`
2022-07-29 01:35:15 +00:00
bors
c8893cc5e5 Auto merge of #99865 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2022-07-28 22:02:12 +00:00
Nilstrieb
e1e736b2a3 Clone the src/llvm-project submodule if profiling is enabled
To compile rustc with profiling information, `compiler-rt` from
LLVM is required. Building it requires the `src/llvm-project` submodule
to be initialized and updated.
2022-07-28 21:40:33 +02:00
bors
9067d5277d Auto merge of #99863 - Dylan-DPC:rollup-lq9w047, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #99628 (add more docs regarding ideographic numbers)
 - #99689 (Revert `write!` and `writeln!` to late drop temporaries)
 - #99807 (Fix PermissionDenied UI tests on WSL)
 - #99817 (rustdoc: remove Clean trait impls for more items)
 - #99851 (Fix small typo in Cargo.toml comment)
 - #99856 (fix: remove fake no_dead_strip for osx)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-28 19:12:21 +00:00
Philipp Krones
d673219ea3
Update Cargo.lock 2022-07-28 19:08:41 +02:00
Philipp Krones
7a782537b1
Merge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyup 2022-07-28 19:08:22 +02:00
bors
3c7e7dbc15 Auto merge of #9257 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2022-07-28 16:56:38 +00:00
Philipp Krones
510effce59
Bump nightly version -> 2022-07-28 2022-07-28 18:56:16 +02:00
Philipp Krones
0905ec465d
Merge remote-tracking branch 'upstream/master' into rustup 2022-07-28 18:55:32 +02:00
Dylan DPC
55f041e1f6
Rollup merge of #99856 - csmoe:osx-no-dead-strip, r=bjorn3
fix: remove fake no_dead_strip for osx

Closes https://github.com/rust-lang/rust/issues/99788

Link arg `-no_dead_strip` doesn't exist on OSX at all.
The `no_gc_sections` function was never called before export-executable-symols implementation, and `export-executable-symbols` still works, so we just remove it.
r? `@bjorn3`
2022-07-28 22:14:51 +05:30
Dylan DPC
889497cec0
Rollup merge of #99851 - yotamofek:patch-1, r=Mark-Simulacrum
Fix small typo in Cargo.toml comment
2022-07-28 22:14:50 +05:30
Dylan DPC
862074f7b0
Rollup merge of #99817 - notriddle:notriddle/clean-trait-removal, r=GuillaumeGomez
rustdoc: remove Clean trait impls for more items

Follow up to https://github.com/rust-lang/rust/pull/99638 and https://github.com/rust-lang/rust/pull/99672
2022-07-28 22:14:49 +05:30
Dylan DPC
a045788430
Rollup merge of #99807 - Nilstrieb:wsl-ui-test-fix, r=Mark-Simulacrum
Fix PermissionDenied UI tests on WSL

On my WSL with `appendWindowsPath=true`, running an invalid command returns `PermissionDenied` instead of `NotFound`, causing two UI tests to fail.
2022-07-28 22:14:48 +05:30
Dylan DPC
48efd30c9d
Rollup merge of #99689 - dtolnay:write, r=Mark-Simulacrum
Revert `write!` and `writeln!` to late drop temporaries

Closes (on master, but not on beta) #99684 by reverting the `write!` and `writeln!` parts of #96455.

argument position | before<br>#94868 | after<br>#94868 | after<br>#96455 | after<br>this PR | desired<br>(unimplementable)
--- |:---:|:---:|:---:|:---:|:---:
`write!($tmp, "…", …)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | **⸺late**
`write!(…, "…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | *early⸺*
`writeln!($tmp, "…", …)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | **⸺late**
`writeln!(…, "…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | **⸺late** | *early⸺*
`print!("…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`println!("…", $tmp)` | *early⸺* | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`eprint!("…", $tmp)` | **⸺late** | **⸺late** | *early⸺* | *early⸺* | *early⸺*
`eprintln!("…", $tmp)` | *early⸺* | **⸺late**| *early⸺* | *early⸺* | *early⸺*
`panic!("…", $tmp)` | *early⸺* | *early⸺* | *early⸺* | *early⸺* | *early⸺*

"Late drop" refers to dropping temporaries at the nearest semicolon **outside** of the macro invocation.

"Early drop" refers to dropping temporaries inside of the macro invocation.
2022-07-28 22:14:46 +05:30
Dylan DPC
a479cab09a
Rollup merge of #99628 - vincenzopalazzo:macros/is_number_doc, r=joshtriplett
add more docs regarding ideographic numbers

This was discussed in the last lib meeting and I try to avoid forgetting to open a PR because I think having some docs can help people.

However, I think we need to discuss a little bit if this is enough or if we need to add more clarification? Maybe an example?

Inspiration Source: https://github.com/rust-lang/rust/issues/84056#issuecomment-1184725924

Including suggestion https://github.com/rust-lang/rust/pull/99626#issuecomment-1192983043 my bad command git close the PR
2022-07-28 22:14:46 +05:30
bors
36f4f4aa38 Auto merge of #99780 - Nilstrieb:mir-opt-test-line-no, r=oli-obk
Use line numbers relative to the function in mir-opt tests

As shown in #99770, the line numbers can be a big source of needless and confusing diffs. This PR adds a new flag `-Zmir-pretty-relative-line-numbers` to make them relative to the function declaration, which avoids most needless diffs from attribute changes.

`@JakobDegen` told me that there has been a zulip conversation about disabling line numbers with mixed opinions, so I'd like to get some feedback here, for this hopefully better solution.

r? rust-lang/wg-mir-opt
2022-07-28 16:22:19 +00:00
Vincenzo Palazzo
47a0a56c1d add more docs regarding ideographic numbers
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-07-28 15:52:18 +00:00
csmoe
03f9efedb1 fix: remove fake no_dead_strip for osx 2022-07-28 22:22:13 +08:00
bors
e5682615bb Auto merge of #99849 - Dylan-DPC:rollup-1yfpplw, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #99714 (Fix regression introduced with #99383)
 - #99723 (Allow using stable os::fd::raw items through unstable os::wasi module)
 - #99810 (Fix settings slider on small width screens)
 - #99837 (Avoid `Symbol` to `String` conversions)
 - #99846 (Refactor `UnresolvedImportError`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-28 13:32:35 +00:00
Tomasz Miąsko
01f4534b42 Build rust demangler before running run-make tests 2022-07-28 14:33:29 +02:00
Tomasz Miąsko
2e7b421778 Diagnose missing make includes 2022-07-28 14:33:29 +02:00
Tomasz Miąsko
866d5c621c Move coverage tests from run-make-fulldeps to run-make 2022-07-28 14:33:29 +02:00
Nilstrieb
11c0280798 bless mir opt tests 2022-07-28 14:24:44 +02:00
Yotam Ofek
ee0ce346e8
Fix small typo in Cargo.toml comment 2022-07-28 14:29:58 +03:00
Dylan DPC
71b0e95b82
Rollup merge of #99846 - TaKO8Ki:refactor-UnresolvedImportError, r=davidtwco
Refactor `UnresolvedImportError`

This patch changes the type of `note` field in `UnresolvedImportError` to `Option<String>`.
2022-07-28 16:38:35 +05:30
Dylan DPC
3a37c9a47e
Rollup merge of #99837 - TaKO8Ki:avoid-symbol-to-string-conversions, r=fee1-dead
Avoid `Symbol` to `String` conversions

follow-up to #99508
2022-07-28 16:38:34 +05:30
Dylan DPC
3c4a66d04e
Rollup merge of #99810 - GuillaumeGomez:fix-settings-slider-small-width, r=notriddle
Fix settings slider on small width screens

Fixes #99794.

Screenshot of the fix:

![Screenshot from 2022-07-27 14-17-08](https://user-images.githubusercontent.com/3050060/181250007-55f982d1-89db-45b7-a4f1-0d1729e6a3e3.png)

cc `````@jsha`````
r? `````@notriddle`````
2022-07-28 16:38:31 +05:30
Dylan DPC
f3266923fe
Rollup merge of #99723 - bstrie:wasifd, r=yaahc
Allow using stable os::fd::raw items through unstable os::wasi module

This fixes a regression from stable to nightly.

Closes #99502.
2022-07-28 16:38:31 +05:30