Commit graph

139870 commits

Author SHA1 Message Date
bors
43fc1b3e24 Auto merge of #82601 - terhechte:catalyst-support-m1-fix, r=petrochenkov
Fixed support for macOS Catalyst on ARM64

When I initially added Arm64 Catalyst support in https://github.com/rust-lang/rust/pull/77484 I had access to a DTK. However, while waiting to merge the PR some other changes were merged which caused conflicts in the branch. When fixing those conflicts I had no access to the DTK anymore and didn't try out if the resulting binaries did indeed work on Apple Silicon. I finally have a M1 and I realized that some small changes were necessary to support Apple Silicon. This PR adds the required changes. I've been running binaries generated with this branch for some time now and they work without issues.
2021-03-01 00:07:29 +00:00
Giacomo Stevanato
6214ef8a0f Bless some tests 2021-02-28 23:21:18 +01:00
Giacomo Stevanato
2f8fa012ca Use identifier's span in unused lint 2021-02-28 23:21:18 +01:00
Dan Gohman
e27eba3397 Add a test in src/test/rustdoc/doc-cfg.rs 2021-02-28 14:07:05 -08:00
Guillaume Gomez
c3f88a0be8 Add GUI tests 2021-02-28 23:01:29 +01:00
Erik Jensen
2616960be2
Clarify that SyncOnceCell::set blocks.
Reading the discussion of this feature, I gained the mistaken impression that neither `set` nor `get` blocked, and thus calling `get` immediately after `set` was not guaranteed to succeed. It turns out that `set` *does* block, guaranteeing that the cell contains a value once `set` returns. This change updates the documentation to state that explicitly.
2021-02-28 12:57:38 -08:00
Camelid
4b3490f64d Convert some lang item comments to doc-comments 2021-02-28 12:05:07 -08:00
Camelid
da0099a9ff Enable extended_key_value_attributes in rustc_hir 2021-02-28 11:56:16 -08:00
Camelid
58758f0275 Allow variant attributes in enum_from_u32! 2021-02-28 11:53:55 -08:00
Steven Fackler
6e52b23fa9 Fix jemalloc usage on OSX
Closes #82423
2021-02-28 14:53:21 -05:00
Camelid
e5f1e8883a Improve lang item generated docs
cc https://rust-lang.zulipchat.com/#narrow/stream/146229-wg-secure-code/topic/Is.20.60core.60.20part.20of.20the.20compiler.3F/near/226738260
2021-02-28 11:43:25 -08:00
bors
e37a13cc35 Auto merge of #81349 - jyn514:blanket-impls-cleanup, r=lcnr
Remove unnecessary `self_ty` parameter to `get_blanket_impls`

It can be calculated when necessary at the callsite, there's no need to
pass it separately.

This also renames `param_env_def_id` to `item_def_id`.

cc `@eddyb`
2021-02-28 19:19:09 +00:00
pierwill
ebe798e31e Fix typos in rustc_infer::infer::nll_relate 2021-02-28 10:10:58 -08:00
Ömer Sinan Ağacan
c4b90dfdc5 Remove an old FIXME comment and inline attribute
Apparently #35870 caused a problem in this code (which originally
returned an impl trait) and `#[inline]` was added as a workaround, in
ade79d7609.

The issue is now fixed and the comment and `#[inline]` can now be
removed.
2021-02-28 20:43:58 +03:00
Joshua Nelson
c47c2c6016 Remove unnecessary self_ty parameter to get_blanket_impls
It can be calculated when necessary at the callsite, there's no need to
pass it separately.

This also renames `param_env_def_id` to `item_def_id`.
2021-02-28 11:09:11 -05:00
bors
573a697a61 Auto merge of #82560 - tspiteri:releases-typo, r=ehuss
fix typo in RELEASES.md
2021-02-28 15:39:41 +00:00
Yuki Okushi
5091209750 Fix a typo in the find_anon_type doc 2021-02-28 23:10:55 +09:00
Vytautas Astrauskas
cdfff98394 Try to clarify GlobalAlloc::realloc documentation comment. 2021-02-28 14:30:26 +01:00
Yuki Okushi
9adb462e6c Erase late bound regions to avoid ICE 2021-02-28 22:20:15 +09:00
bors
1b1d85fd4c Auto merge of #82603 - RalfJung:miri, r=RalfJung
update Miri

Pulls in a fix for unnecessary rebuilds that basically breaks Playground.
2021-02-28 12:53:39 +00:00
LinkTed
9e4e739209 unix: Non-mutable bufs in send_vectored_with_ancillary_to
Change the arguments of `send_vectored_with_ancillary` and
`send_vectored_with_ancillary_to` to take an non-mutable bufs.
2021-02-28 13:33:09 +01:00
Ralf Jung
6f101f4f52 update Miri 2021-02-28 12:07:53 +01:00
Tomasz Miąsko
2abe7c8f9c Update tracing to 0.1.25 2021-02-28 11:24:24 +01:00
Nikita Popov
092643a266 Explicitly mark x86-interrupt ABI argument as byval
The first argument to an x86-interrupt ABI function was implicitly
treated as byval prior to LLVM 12. Since LLVM 12, it has to be
marked as such explicitly: 2e0e03c6a0
2021-02-28 10:19:44 +01:00
Nikita Popov
55f345f325 Support LLVM 12 in rustc 2021-02-28 10:19:44 +01:00
bors
247337f409 Auto merge of #82350 - ehuss:test-chapter, r=jyn514
Add a chapter on the test harness.

There isn't really any online documentation on the test harness, so this adds a chapter to the rustc book which provides information on how the harness works and details on the command-line options.
2021-02-28 09:18:27 +00:00
bors
7c3a914b5d Auto merge of #82605 - cuviper:issue81051, r=nikic
Revert LLVM D81803 because it broke Windows 7

This submodule update reverts <https://reviews.llvm.org/D81803>.

While that change is meant to fix a real bug, [LLVM PR42623], it caused
new permission errors on Windows 7 that make it unable to build any
archives. This is probably the same root cause as [LLVM PR48378].

Fixes #81051. We'll file a new Rust issue to track the LLVM resolution.

[LLVM PR42623]: https://bugs.llvm.org/show_bug.cgi?id=42623
[LLVM PR48378]: https://bugs.llvm.org/show_bug.cgi?id=48378
2021-02-28 06:37:18 +00:00
Joshua Nelson
df156c1958 Apply lint restrictions from renamed lints
Previously, if you denied the old name of a renamed lint, it would warn
about using the new name, but otherwise do nothing. Now, it will behave
the same as if you'd used the new name.
2021-02-28 01:04:34 -05:00
Joshua Nelson
05140ec091 Propagate --test-args for x.py test src/tools/cargo 2021-02-28 01:00:26 -05:00
bors
6e2801c44e Auto merge of #82594 - nagisa:nagisa/remove-rumprun, r=petrochenkov
Remove the x86_64-rumprun-netbsd target

Herein we remove the target from the compiler and the code from libstd intended to support the now-defunct rumprun project.

Closes #81514
2021-02-28 03:56:16 +00:00
bors
130b2ab0ed Auto merge of #82611 - Dylan-DPC:rollup-l7xlpks, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #81856 (Suggest character encoding is incorrect when encountering random null bytes)
 - #82395 (Add missing "see its documentation for more" stdio)
 - #82401 (Remove a redundant macro)
 - #82498 (Use log level to control partitioning debug output)
 - #82534 (Link crtbegin/crtend on musl to terminate .eh_frame)
 - #82537 (Update measureme dependency to the latest version)
 - #82561 (doc: cube root, not cubic root)
 - #82563 (Fix intra-doc handling of `Self` in enum)
 - #82584 (Add ARIA role to sidebar toggle in Rustdoc)
 - #82596 (clarify RW lock's priority gotcha)
 - #82607 (Add a getter for Frame.loc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-28 01:15:16 +00:00
Tomasz Miąsko
57de468ff9 Use -O in try_identity test that requires storage markers 2021-02-28 00:00:00 +00:00
Tomasz Miąsko
70760507e6 compiletest: run mir-opt tests with -C opt-level=1
The storage markers are removed at -C opt-level=0 and as a result output
of mir opt tests vary based on used optimization level. Use opt-level=1
for mir-opt tests to avoid the issue.
2021-02-28 20:10:45 +01:00
Tomasz Miąsko
8b184ff1b8 Remove storage markers if they won't be used during code generation
The storage markers constitute a substantial portion of all MIR
statements. At the same time, for builds without any optimizations,
the storage markers have no further use during and after MIR
optimization phase.

If storage markers are not necessary for code generation, remove them.
2021-02-28 20:10:44 +01:00
Guillaume Gomez
5ab4d46e9a Update rustdoc test to make it work with newly added rustc passes 2021-02-28 00:48:43 +01:00
Guillaume Gomez
25e030bc42 Add test for rustdoc new check pass 2021-02-28 00:48:43 +01:00
Guillaume Gomez
9f1abe89b8 Run some rustc passes in rustdoc 2021-02-28 00:48:43 +01:00
Dylan DPC
7847f690fd
Rollup merge of #82607 - bjorn3:frame_loc_getter, r=RalfJung
Add a getter for Frame.loc

This is necessary for Priroda.

For context see https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Frame.3A.3Aloc.20no.20longer.20public/near/228070266 and oli-obk/priroda#27.

cc `@DJMcNab`

r? `@RalfJung`
2021-02-27 21:56:25 +01:00
Dylan DPC
e38b3eb0b5
Rollup merge of #82596 - matklad:rwlock, r=sfackler
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:🧵:sleep(Duration::from_millis(ms))
    }
```

Context: I was completely mystified by a my CI deadlocking on mac ([here](https://github.com/matklad/xshell/pull/7)), until ``@azdavis`` debugged the issue. See a stand-alone reproduciton here: https://github.com/matklad/xshell/pull/15
2021-02-27 21:56:24 +01:00
Dylan DPC
a70be0bec9
Rollup merge of #82584 - tazjin:rustdoc-aria, r=GuillaumeGomez
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 #82582
2021-02-27 21:56:23 +01:00
Dylan DPC
b5f5c106c0
Rollup merge of #82563 - lucas-deangelis:issue-82209-fix, r=jyn514
Fix intra-doc handling of `Self` in enum

Fixes #82209
2021-02-27 21:56:22 +01:00
Dylan DPC
b1113abacd
Rollup merge of #82561 - tspiteri:cube-root, r=Dylan-DPC
doc: cube root, not cubic root

Like we say square root, not quadratic root.
2021-02-27 21:56:21 +01:00
Dylan DPC
6d288c65df
Rollup merge of #82537 - wesleywiser:update_measureme, r=oli-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```
2021-02-27 21:56:20 +01:00
Dylan DPC
a7f9aca0a6
Rollup merge of #82534 - nikic:musl-crtend, r=nagisa
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 #47551 and encountered by the LLVM 12
update in #81451.

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

r? ``@nagisa``
2021-02-27 21:56:19 +01:00
Dylan DPC
13ea3fab5f
Rollup merge of #82498 - tmiasko:partitioning-debug, r=matthewjasper
Use log level to control partitioning debug output
2021-02-27 21:56:18 +01:00
Dylan DPC
840622910f
Rollup merge of #82401 - osa1:remove_redundant_macro, r=matthewjasper
Remove a redundant macro

Turn the macro into a function. Also remove unused 'span' argument.
2021-02-27 21:56:17 +01:00
Dylan DPC
ea43e5e21d
Rollup merge of #82395 - pickfire:see-more, r=GuillaumeGomez
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.
2021-02-27 21:56:16 +01:00
Dylan DPC
be3d1eb301
Rollup merge of #81856 - Smittyvb:utf16-warn, r=matthewjasper
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 https://github.com/rust-lang/rust/issues/73979#issuecomment-653976451.

Closes #73979.
2021-02-27 21:56:15 +01:00
bjorn3
632a89529a Add a getter for Frame.loc
This is necessary for Priroda.
2021-02-27 21:01:02 +01:00
Josh Stone
31814c41aa Revert LLVM D81803 because it broke Windows 7
This submodule update reverts <https://reviews.llvm.org/D81803>.

While that change is meant to fix a real bug, [LLVM PR42623], it caused
new permission errors on Windows 7 that make it unable to build any
archives. This is probably the same root cause as [LLVM PR48378].

Fixes #81051. We'll file a new Rust issue to track the LLVM resolution.

[LLVM PR42623]: https://bugs.llvm.org/show_bug.cgi?id=42623
[LLVM PR48378]: https://bugs.llvm.org/show_bug.cgi?id=48378
2021-02-27 11:09:00 -08:00