Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 12 pull requests #82600

Closed
wants to merge 35 commits into from

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ecstatic-morse and others added 30 commits September 21, 2020 09:29
The author probably meant to call `hash_stable` on a reference to the
field in question.
StdoutLock and StderrLock does not have example, it would be better
to leave "see its documentation for more" like iter docs.
Turn the macro into a function. Also remove unused 'span' argument.
This version adds the ability to use `rdpmc` hardware-based performance
counters instead of wall-clock time for measuring duration. This also
introduces a dependency on the `perf-event-open-sys` crate on Linux
which is used when using hardware counters.
For some targets, rustc uses a "CRT fallback", where it links CRT
object files it ships instead of letting the host compiler link
them.

On musl, rustc currently links crt1, crti and crtn (provided by
libc), but does not link crtbegin and crtend (provided by libgcc).
In particular, crtend is responsible for terminating the .eh_frame
section. Lack of terminator may result in segfaults during
unwinding, as reported in rust-lang#47551 and encountered by the LLVM 12
update in rust-lang#81451.

This patch links crtbegin and crtend for musl as well, following
the table at the top of crt_objects.rs.
Like we say square root, not quadratic root.
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
This indicates that the div is an interactive element, and makes the
sidebar toggle "clickable" in assistive technologies.

Fixes rust-lang#82582
In particular, the following program works on Linux, but deadlocks on
mac:

    use std::{
        sync::{Arc, RwLock},
        thread,
        time::Duration,
    };

    fn main() {
        let lock = Arc::new(RwLock::new(()));

        let r1 = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _rg = lock.read();
                eprintln!("r1/1");
                sleep(1000);

                let _rg = lock.read();
                eprintln!("r1/2");

                sleep(5000);
            }
        });
        sleep(100);
        let w = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _wg = lock.write();
                eprintln!("w");
            }
        });
        sleep(100);
        let r2 = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _rg = lock.read();
                eprintln!("r2");
                sleep(2000);
            }
        });

        r1.join().unwrap();
        r2.join().unwrap();
        w.join().unwrap();
    }

    fn sleep(ms: u64) {
        std::thread::sleep(Duration::from_millis(ms))
    }
Co-authored-by: Steven Fackler <sfackler@gmail.com>
… r=lcnr

Lint for unused borrows as part of `UNUSED_MUST_USE`

Resolves rust-lang#76264.

This means an `unused_must_use` warning for statements like `&expr;` and `&mut expr;`. `unused_must_use` was chosen because it already lints for logical operators (`&&` and `||`) whose result is unused. Unused borrows actually appear fairly often in `rustc`'s test suite, since we have tests that rely on side-effects of the index operator (panicking). These cannot be written as `expr[..];`, since the result is unsized, but they can be written as `let _ = &expr[..];`, which is what this PR does.

See the linked issue for the motivating example. This lint also found a benign mistake in the derived impl of `HashStable`.
Suggest character encoding is incorrect when encountering random null bytes

This adds a note whenever null bytes are seen at the start of a token unexpectedly, since those tend to come from UTF-16 encoded files without a [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) (if a UTF-16 BOM appears it won't be valid UTF-8, but if there is no BOM it be both valid UTF-16 and valid but garbled UTF-8). This approach was suggested in rust-lang#73979 (comment).

Closes rust-lang#73979.
Add missing "see its documentation for more" stdio

StdoutLock and StderrLock does not have example, it would be better
to leave "see its documentation for more" like iter docs.
…hewjasper

Remove a redundant macro

Turn the macro into a function. Also remove unused 'span' argument.
…ewjasper

Use log level to control partitioning debug output
Link crtbegin/crtend on musl to terminate .eh_frame

For some targets, rustc uses a "CRT fallback", where it links CRT
object files it ships instead of letting the host compiler link
them.

On musl, rustc currently links crt1, crti and crtn (provided by
libc), but does not link crtbegin and crtend (provided by libgcc).
In particular, crtend is responsible for terminating the .eh_frame
section. Lack of terminator may result in segfaults during
unwinding, as reported in rust-lang#47551 and encountered by the LLVM 12
update in rust-lang#81451.

This patch links crtbegin and crtend for musl as well, following
the table at the top of crt_objects.rs.

r? `@nagisa`
…-obk

Update measureme dependency to the latest version

This version adds the ability to use `rdpmc` hardware-based performance
counters instead of wall-clock time for measuring duration. This also
introduces a dependency on the `perf-event-open-sys` crate on Linux
which is used when using hardware counters.

r? ``@oli-obk``
doc: cube root, not cubic root

Like we say square root, not quadratic root.
…jyn514

Fix intra-doc handling of `Self` in enum

Fixes rust-lang#82209
Add ARIA role to sidebar toggle in Rustdoc

This indicates that the div is an interactive element, and makes the sidebar toggle "clickable" in assistive technologies.

Example of Vimium after this change has been applied (see the issue mentioned below for a screenshot of before):

![Screenshot of Vimium link hints on a Rustdoc page, indicating that the sidebar toggle is clickable](https://user-images.githubusercontent.com/1552853/109384961-ff935400-78f8-11eb-8199-1d35181aeff0.png)

Fixes rust-lang#82582
clarify RW lock's priority gotcha

In particular, the following program works on Linux, but deadlocks on
mac:

```rust
    use std::{
        sync::{Arc, RwLock},
        thread,
        time::Duration,
    };

    fn main() {
        let lock = Arc::new(RwLock::new(()));

        let r1 = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _rg = lock.read();
                eprintln!("r1/1");
                sleep(1000);

                let _rg = lock.read();
                eprintln!("r1/2");

                sleep(5000);
            }
        });
        sleep(100);
        let w = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _wg = lock.write();
                eprintln!("w");
            }
        });
        sleep(100);
        let r2 = thread::spawn({
            let lock = Arc::clone(&lock);
            move || {
                let _rg = lock.read();
                eprintln!("r2");
                sleep(2000);
            }
        });

        r1.join().unwrap();
        r2.join().unwrap();
        w.join().unwrap();
    }

    fn sleep(ms: u64) {
        std::thread::sleep(Duration::from_millis(ms))
    }
```

Context: I was completely mystified by a my CI deadlocking on mac ([here](matklad/xshell#7)), until `@azdavis` debugged the issue. See a stand-alone reproduciton here: matklad/xshell#15
@rustbot rustbot added the rollup A PR which is a rollup label Feb 27, 2021
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 27, 2021

📌 Commit 985669a has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 27, 2021
@bors
Copy link
Contributor

bors commented Feb 27, 2021

⌛ Testing commit 985669a with merge 697753edacbdb970d42b6429be3ae6be6b7ded14...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- compile_test stdout ----

error: failed to compile fixed code
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin/clippy-driver" "tests/ui/bytes_nth.fixed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/clippy-0487049019a34248/out/test_build_base" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/clippy-0487049019a34248/out/test_build_base/bytes_nth.stage-id" "--emit=metadata" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "-Dwarnings" "-Zui-testing" "--extern" "clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-84b0775b3c81c97f.rlib" "--extern" "serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-f0962f37786a4888.rlib" "--extern" "syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-cd40a3b060be150c.rlib" "--extern" "quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-b396e06d7d6d4d75.rlib" "--extern" "regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-4cd0b4140eeb9c8d.rlib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/clippy-0487049019a34248/out/test_build_base/bytes_nth.stage-id.aux"
stdout:
------------------------------------------

------------------------------------------
------------------------------------------
stderr:
------------------------------------------
{"message":"unused borrow that must be used","code":{"code":"unused_must_use","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/bytes_nth.fixed","byte_start":163,"byte_end":183,"line_start":9,"line_end":9,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    &s.as_bytes().get(3);","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`-D unused-must-use` implied by `-D warnings`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: unused borrow that must be used\n  --> tests/ui/bytes_nth.fixed:9:5\n   |\nLL |     &s.as_bytes().get(3);\n   |     ^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: `-D unused-must-use` implied by `-D warnings`\n\n"}

------------------------------------------

thread 'compile_test' panicked at 'Some tests failed', /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/compiletest_rs-0.6.0/src/lib.rs:105:22

@bors
Copy link
Contributor

bors commented Feb 27, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 27, 2021
@Dylan-DPC-zz Dylan-DPC-zz deleted the rollup-wopncnt branch February 27, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.