Commit Graph

207932 Commits

Author SHA1 Message Date
bors
bb93450ec4 Auto merge of #102915 - JohnTitor:rollup-5ht99y1, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #102258 (Remove unused variable in float formatting.)
 - #102277 (Consistently write `RwLock`)
 - #102412 (Never panic in `thread::park` and `thread::park_timeout`)
 - #102589 (scoped threads: pass closure through MaybeUninit to avoid invalid dangling references)
 - #102625 (fix backtrace small typo)
 - #102859 (Move lifetime resolution module to rustc_hir_analysis.)
 - #102898 (rustdoc: remove unneeded `<div>` wrapper from sidebar DOM)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-11 11:03:12 +00:00
Yuki Okushi
3011538b80
Rollup merge of #102898 - notriddle:notriddle/sidebar-block, r=GuillaumeGomez
rustdoc: remove unneeded `<div>` wrapper from sidebar DOM

When this was added, the sidebar had a bit more complex style. It can be removed, now.

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-block/std/index.html
2022-10-11 18:37:55 +09:00
Yuki Okushi
98764c0c72
Rollup merge of #102859 - cjgillot:collect-lifetimes, r=oli-obk
Move lifetime resolution module to rustc_hir_analysis.

Now that lifetime resolution has been removed from it, this file has nothing to do in `rustc_resolve`.  It's purpose is to compute Debruijn indices for lifetimes, so let's put it in type collection.
2022-10-11 18:37:55 +09:00
Yuki Okushi
b380518691
Rollup merge of #102625 - Rageking8:fix-backtrace-small-typo, r=m-ou-se
fix backtrace small typo
2022-10-11 18:37:54 +09:00
Yuki Okushi
919d6bf446
Rollup merge of #102589 - RalfJung:scoped-threads-dangling, r=m-ou-se
scoped threads: pass closure through MaybeUninit to avoid invalid dangling references

The `main` function defined here looks roughly like this, if it were written as a more explicit stand-alone function:
```rust
// Not showing all the `'lifetime` tracking, the point is that
// this closure might live shorter than `thread`.
fn thread(control: ..., closure: impl FnOnce() + 'lifetime) {
    closure();
    control.signal_done();
    // A lot of time can pass here.
}
```
Note that `thread` continues to run even after `signal_done`! Now consider what happens if the `closure` captures a reference of lifetime `'lifetime`:
- The type of `closure` is a struct (the implicit unnameable closure type) with a `&'lifetime mut T` field. References passed to a function are marked with `dereferenceable`, which is LLVM speak for *this reference will remain live for the entire duration of this function*.
- The closure runs, `signal_done` runs. Then -- potentially -- this thread gets scheduled away and the main thread runs, seeing the signal and returning to the user. Now `'lifetime` ends and the memory the reference points to might be deallocated.
- Now we have UB! The reference that as passed to `thread` with the promise of remaining live for the entire duration of the function, actually got deallocated while the function still runs. Oops.

Long-term I think we should be able to use `ManuallyDrop` to fix this without `unsafe`, or maybe a new `MaybeDangling` type. I am working on an RFC for that. But in the mean time it'd be nice to fix this so that Miri with `-Zmiri-retag-fields` (which is needed for "full enforcement" of all the LLVM flags we generate) stops erroring on scoped threads.

Fixes https://github.com/rust-lang/rust/issues/101983
r? `@m-ou-se`
2022-10-11 18:37:54 +09:00
Yuki Okushi
e0954cadc8
Rollup merge of #102412 - joboet:dont_panic, r=m-ou-se
Never panic in `thread::park` and `thread::park_timeout`

fixes #102398

`@rustbot` label +T-libs +T-libs-api
2022-10-11 18:37:53 +09:00
Yuki Okushi
387df55f26
Rollup merge of #102277 - mgeisler:rwlock, r=m-ou-se
Consistently write `RwLock`

Before the documentation sometimes referred to an "rwlock" and sometimes to "`RwLock`".
2022-10-11 18:37:52 +09:00
Yuki Okushi
ff903bbb71
Rollup merge of #102258 - cjgillot:core-kappa, r=m-ou-se
Remove unused variable in float formatting.
2022-10-11 18:37:52 +09:00
Guillaume Gomez
bca1005d6a Add GUI test for source code pages highlighting 2022-10-11 11:34:29 +02:00
Guillaume Gomez
202ccc50dd Migrate highlight style to CSS variables 2022-10-11 11:34:29 +02:00
bors
1e926f0652 Auto merge of #102755 - pcc:data-local-tmp, r=Mark-Simulacrum
tools/remote-test-{server,client}: Use /data/local/tmp on Android

The /data/tmp directory does not exist, at least not on recent versions of Android, which currently leads to test failures on that platform. I checked a virtual device running AOSP master and a Nexus 5 running Android Marshmallow and on both devices the /data/tmp directory does not exist and /data/local/tmp does, so let's switch to /data/local/tmp.
2022-10-11 08:09:41 +00:00
Laurențiu Nicola
c867288d1b ⬆️ rust-analyzer 2022-10-11 10:37:35 +03:00
woppopo
a53e3acca9 Change tracking issue from #76156 to #102911 2022-10-11 06:40:37 +00:00
Camille GILLOT
152cd63226 Report duplicate definitions in trait impls during resolution. 2022-10-11 06:24:51 +00:00
zyctree
11a335d5e8
fix link in syntax.md 2022-10-11 14:05:04 +08:00
Vadim Petrochenkov
1a8f177772 rustc_hir: Less error-prone methods for accessing PartialRes resolution 2022-10-11 09:04:52 +04:00
bors
365578445c Auto merge of #102724 - pcc:scs-fix-test, r=Mark-Simulacrum
Fix the sanitizer_scs_attr_check.rs test

The test is failing when targeting aarch64 Android. The intent appears to have been to look for a function attributes comment (or the absence of one) on the line preceding the function declaration. But this isn't quite possible with FileCheck and the test as written was looking for a line with `no_scs` after a line with `scs`, which doesn't appear in the output. Instead, match on the function attributes comment on the line following the demangled function name comment.
2022-10-11 04:27:13 +00:00
Michael Howell
44f466cb08
Remove outdated comment 2022-10-10 17:53:27 -07:00
bors
518263d889 Auto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #101360 (Point out incompatible closure bounds)
 - #101789 (`let`'s not needed in struct field definitions)
 - #102846 (update to syn-1.0.102)
 - #102871 (rustdoc: clean up overly complex `.trait-impl` CSS selectors)
 - #102876 (suggest candidates for unresolved import)
 - #102888 (Improve rustdoc-gui search-color test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-11 00:36:26 +00:00
Ariel Davis
d1762d7a96 Do not alias for fs 2022-10-10 17:05:59 -07:00
bors
5d49951913 Auto merge of #13357 - Veykril:minicore, r=Veykril
internal: Allow minicore flags specification to be order independent
2022-10-10 21:43:17 +00:00
bors
36c8e291a6 Auto merge of #101720 - GuillaumeGomez:warn-INVALID_HTML_TAGS, r=notriddle
Change default level of INVALID_HTML_TAGS to warning and stabilize it

Fixes of #67799.

cc `@Nemo157`
r? `@notriddle`
2022-10-10 21:41:02 +00:00
bors
21319d135f Auto merge of #13329 - Veykril:rustc-proc-macro, r=Veykril
Use $crate instead of std for panic builtin_fn_macro

This should be closer to the expected output and gets rid of a few type mismatches in rustc/library
2022-10-10 21:35:07 +00:00
bors
99c205c70f Auto merge of #13392 - Veykril:spec-pref, r=Veykril
Prefer similar tokens when expanding macros speculatively

Should improve completions in proc-macros in some cases
2022-10-10 20:49:06 +00:00
Lukas Wirth
c069f1b7d2 Prefer similar tokens when expanding macros speculatively 2022-10-10 22:47:52 +02:00
Cameron Steffen
d933092dc5 Check representability in adt_sized_constraint 2022-10-10 14:36:12 -05:00
Matthias Krüger
a52eba4a89
Rollup merge of #102888 - GuillaumeGomez:improve-search-color-check, r=notriddle
Improve rustdoc-gui search-color test

Thanks to the add of "functions" in `browser-ui-test`, we can start to reduce the size of the scripts. It'll be very useful for all color checks.

r? `@notriddle`
2022-10-10 20:47:34 +02:00
Matthias Krüger
0bd1cba98b
Rollup merge of #102876 - SparrowLii:import-candidate, r=fee1-dead
suggest candidates for unresolved import

Currently we prompt suggestion of candidates(help notes of `use xxx::yyy`) for names which cannot be resolved, but we don't do that for import statements themselves that couldn't be resolved. It seems reasonable to add candidate help information for these statements as well.
Fixes #102711
2022-10-10 20:47:34 +02:00
Matthias Krüger
40c1410ce4
Rollup merge of #102871 - notriddle:notriddle/trait-impl-anchor, r=GuillaumeGomez
rustdoc: clean up overly complex `.trait-impl` CSS selectors

When added in 45964368f4, these multi-class selectors were present in the initial commit, but no reason was given why the shorter selector wouldn't work.
2022-10-10 20:47:33 +02:00
Matthias Krüger
973afb15e0
Rollup merge of #102846 - zertosh:update-syn, r=dtolnay
update to syn-1.0.102

This update removes the only `.gitignore` found in `rustc-src`:

    vendor/syn/tests/.gitignore
    vendor/syn-1.0.91/tests/.gitignore
    vendor/syn-1.0.95/tests/.gitignore

To check-in `rustc-src` for hermetic builds in environments with
restrictive `.gitignore` policies, one has to remove these
`tests/.gitignore` and patch the respective
`.cargo-checksum.json`.`syn` >1.0.101 includes dtolnay/syn@3c49303bed,
which removes its `tests/.gitignore`. Now the `syn` crates.io package
has no `.gitignore`.

[`rustc-src`'s `vendor`][] is produced from the root `Cargo.toml`,
`src/tools/rust-analyzer/Cargo.toml`,
`compiler/rustc_codegen_cranelift/Cargo.toml`, and
`src/bootstrap/Cargo.toml`. `rustc_codegen_cranelift` does not use
`syn`.

[`rustc-src`'s `vendor`]:
  https://github.com/rust-lang/rust/blob/c0784109daa0/src/bootstrap/dist.rs#L934-L940

This was produced with:

    cargo update --package syn --precise 1.0.102 \

    cargo update --package syn --precise 1.0.102 \
        --manifest-path src/tools/rust-analyzer/Cargo.toml

    cargo update --package syn --precise 1.0.102 \
        --manifest-path src/bootstrap/Cargo.toml
2022-10-10 20:47:33 +02:00
Matthias Krüger
01a2246000
Rollup merge of #101789 - gimbles:let, r=estebank
`let`'s not needed in struct field definitions

Fixes #101683
2022-10-10 20:47:32 +02:00
Matthias Krüger
d8d01e3216
Rollup merge of #101360 - compiler-errors:multiple-closure-bounds, r=petrochenkov
Point out incompatible closure bounds

Fixes #100295
2022-10-10 20:47:31 +02:00
Guillaume Gomez
d565200270 Fix unclosed HTML tag in clippy doc 2022-10-10 20:45:04 +02:00
bors
a6b7274a46 Auto merge of #102596 - scottmcm:option-bool-calloc, r=Mark-Simulacrum
Do the `calloc` optimization for `Option<bool>`

Inspired by <https://old.reddit.com/r/rust/comments/xtiqj8/why_is_this_functional_version_faster_than_my_for/iqqy37b/>.
2022-10-10 18:42:40 +00:00
Michael Howell
b63b02f872 rustdoc: remove unneeded <div> wrapper from sidebar DOM
When this was added, the sidebar had a bit more complex style. It can be
removed, now.
2022-10-10 11:40:15 -07:00
Ralf Jung
a52cde3da5 update compiler_builtins 2022-10-10 20:13:45 +02:00
Takayuki Maeda
68260289b5 fix #102878 2022-10-11 02:43:36 +09:00
Camille GILLOT
a474ec50b7 Move lifetime resolution module to rustc_hir_analysis. 2022-10-10 17:40:52 +00:00
bors
43c7f3ca3d Auto merge of #13391 - dvdsk:update-manual, r=lnicola
Update manual now stable can be installed with rustup

this a new PR for #13374 as `bors squash` seemed to have broken `bors`
_______
`rustup` can now install `rust-analyzer` for the stable tool-chain. This commit removes the note that `rustup` can only install for the nightly branch and adjusts the command.

I also added a note on how to find the path to the `rust-analyzer` binary when installed using `rustup`, and suggestions on how to work around it not being placed in `~/.cargo/bin`.

I thought it would be ideal to point everyone to use `rustup run stable rust-analyzer` to start `rust-analyzer`. That would make it trivial to switch to nightly however I could not get this to work in `nvim` therefore I left it as a suggestion at the end.
2022-10-10 17:03:44 +00:00
dvdsk
76be44eed5
Update manual now stable can be installed with rustup
`rustup` can now install `rust-analyzer` for the stable tool-chain. This commit removes the note that `rustup` can only install for the nightly branch and adjusts the command.

I also added a note on how to find the path to the `rust-analyzer` binary when installed using `rustup`, and suggestions on how to work around it not being placed in `~/.cargo/bin`.

I thought it would be ideal to point everyone to use `rustup run stable rust-analyzer` to start `rust-analyzer`. That would make it trivial to switch to nightly however I could not get this to work in `nvim` therefore I left it as a suggestion at the end.
2022-10-10 19:00:47 +02:00
Guillaume Gomez
14de94aec5 Fix unclosed HTML tag in rustfmt doc 2022-10-10 18:29:17 +02:00
Guillaume Gomez
adc24d1b5e Fix compiler docs 2022-10-10 18:28:29 +02:00
Guillaume Gomez
3416fa1882 Fix doc lint error 2022-10-10 18:28:29 +02:00
Guillaume Gomez
d9570e0510 Stabilize rustdoc CHECK_INVALID_HTML_TAGS check 2022-10-10 18:28:29 +02:00
Guillaume Gomez
c23ed655eb Update rustdoc tests 2022-10-10 18:28:29 +02:00
Guillaume Gomez
6add6a1e1e Change default lint level of INVALID_HTML_TAGS to warning 2022-10-10 18:28:29 +02:00
Nathan Stocks
5ef1c03bd8 make up your mind, rustfmt 2022-10-10 10:06:52 -06:00
Andrew Brown
9530ba0fe2 Implement env_lock with RwLock
Copying the approach of the Unix target, this change uses the standard
`RwLock` to protect against concurrent access of libc's environment.
This locking is only enabled when WebAssembly's `atomics` feature is
also enabled.
2022-10-10 09:01:42 -07:00
Guillaume Gomez
9c5a769119 Simplify result color checks 2022-10-10 18:00:10 +02:00
Guillaume Gomez
c6803fa30e Update browser-ui-test version to 0.12.2 2022-10-10 18:00:05 +02:00