about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-05-03Rollup merge of #84835 - wcampbell0x2a:add-issue-34202-link, r=m-ou-seGuillaume Gomez-1/+3
Add link to Issue #34202 in udp docs
2021-05-03Auto merge of #84845 - wcampbell0x2a:clippy-redundant-field-names, ↵bors-2/+2
r=joshtriplett [clippy] remove redundant field names
2021-05-03Auto merge of #84842 - blkerby:null_lowercase, r=joshtriplettbors-75/+75
Replace 'NULL' with 'null' This replaces occurrences of "NULL" with "null" in docs, comments, and compiler error/lint messages. This is for the sake of consistency, as the lowercase "null" is already the dominant form in Rust. The all-caps NULL looks like the C macro (or SQL keyword), which seems out of place in a Rust context, given that NULL does not exist in the Rust language or standard library (instead having [`ptr::null()`](https://doc.rust-lang.org/stable/std/ptr/fn.null.html)).
2021-05-02[clippy] remove redundant field nameswcampbell-2/+2
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
2021-05-03Auto merge of #84840 - Dylan-DPC:rollup-uzk7w0h, r=Dylan-DPCbors-94/+383
Rollup of 6 pull requests Successful merges: - #84072 (Allow setting `target_family` to multiple values, and implement `target_family="wasm"`) - #84744 (Add ErrorKind::OutOfMemory) - #84784 (Add help message to suggest const for unused type param) - #84811 (RustDoc: Fix bounds linking trait.Foo instead of traitalias.Foo) - #84818 (suggestion for unit enum variant when matched with a patern) - #84832 (Do not print visibility in external traits) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-02Change 'NULL' to 'null'Brent Kerby-75/+75
2021-05-02Add link to Issue #34202 in udp docswcampbell-1/+3
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
2021-05-03Rollup merge of #84832 - Stupremee:dont-print-vis-in-external-traits, r=jyn514Dylan DPC-3/+24
Do not print visibility in external traits This PR fixes the bug that caused traits, which were re-exported, having visibility modifiers in front of methods, which is invalid. It would be nice to add a test for this, but I don't even know if tests with multiple crates are possible. Resolves #81274
2021-05-03Rollup merge of #84818 - ABouttefeux:enum-suggest, r=jackh726Dylan DPC-35/+193
suggestion for unit enum variant when matched with a patern resolve #84700 add suggestion for code like ```rust enum FarmAnimal { Worm, Cow, Bull, Chicken { num_eggs: usize }, Dog (String), } fn what_does_the_animal_say(animal: &FarmAnimal) { let noise = match animal { FarmAnimal::Cow(_) => "moo".to_string(), _ => todo!() }; println!("{:?} says: {:?}", animal, noise); } ``` ``` error[E0532]: expected tuple struct or tuple variant, found unit variant `FarmAnimal::Cow` --> $DIR/issue-84700.rs:15:9 | LL | Cow, | --- `FarmAnimal::Cow` defined here ... LL | FarmAnimal::Cow(_) => "moo".to_string(), | ^^^^^^^^^^^^^^^^^^ help: use this syntax instead: `FarmAnimal::Cow` ```
2021-05-03Rollup merge of #84811 - scottmcm:rustdoc-trait-alias-fix, r=jyn514Dylan DPC-17/+58
RustDoc: Fix bounds linking trait.Foo instead of traitalias.Foo Fixes #84782 The code was assuming `Trait` when adding bounds to the cache, so add a check on the DefId to see what its kind really is. r? `@jyn514` Before: ![image](https://user-images.githubusercontent.com/18526288/116775611-6a751e80-aa53-11eb-84d0-ed6b7782be3c.png) After: ![image](https://user-images.githubusercontent.com/18526288/116802227-d19cdc80-ab00-11eb-8133-7b34dd750da2.png)
2021-05-03Rollup merge of #84784 - JulianKnodt:suggest_const, r=lcnrDylan DPC-3/+49
Add help message to suggest const for unused type param r? `@lcnr`
2021-05-03Rollup merge of #84744 - kornelski:enomem, r=joshtriplettDylan DPC-2/+15
Add ErrorKind::OutOfMemory Ability to express `ENOMEM` as an `io::Error`. I've used `OutOfMemory` as opposed to `NotEnoughMem` or `AllocationFailed`, because "OOM" is used in Rust already. See also #84612
2021-05-03Rollup merge of #84072 - nagisa:target-family-two-the-movie, r=petrochenkovDylan DPC-34/+44
Allow setting `target_family` to multiple values, and implement `target_family="wasm"` As per the conclusion in [this thread](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Are.20we.20comfortable.20with.20adding.20an.20insta-stable.20cfg.28wasm.29.3F/near/233158441), this implements an ability to specify any number of `target_family` values, allowing for more flexible generic groups, or "families", to be created than just the OS-based unix/windows dichotomy. cc https://github.com/rust-lang/reference/pull/1006
2021-05-02Auto merge of #82576 - gilescope:to_string, r=Amanieubors-0/+41
i8 and u8::to_string() specialisation (far less asm). Take 2. Around 1/6th of the assembly to without specialisation. https://godbolt.org/z/bzz8Mq (partially fixes #73533 )
2021-05-03Set target_family="wasm" for wasm targetsSimonas Kazlauskas-5/+9
2021-05-02Auto merge of #84754 - GuillaumeGomez:toggle-migration, r=jshabors-232/+186
Migrate trait and impl blocks' toggles into Part of #83332 After this, I think only the "global" doc comment will be used as JS toggle. Once this PR is merged, I check what remains and remove them. There is one change that this PR brings: ![Screenshot from 2021-04-30 15-39-04](https://user-images.githubusercontent.com/3050060/116713412-0f9ce200-a9d5-11eb-979c-2e7a73d16706.png) ![Screenshot from 2021-04-30 15-39-07](https://user-images.githubusercontent.com/3050060/116713415-10357880-a9d5-11eb-9868-1ba9e5ebf65e.png) As you can see, I had to move the "undocumented" items below, they're not mixed with the others anymore. Unfortunately, I don't see a way to keep the current appearance without JS. As a a reminder, currently it looks like this: ![Screenshot from 2021-04-30 15-39-12](https://user-images.githubusercontent.com/3050060/116713547-31966480-a9d5-11eb-90bb-686042eefeec.png) ![Screenshot from 2021-04-30 15-39-15](https://user-images.githubusercontent.com/3050060/116713549-322efb00-a9d5-11eb-94a9-cfea073120db.png) r? `@jsha`
2021-05-02PR feedbackScott McMurray-11/+18
2021-05-02Do not print visibility in external traitsJustus K-3/+24
2021-05-02Improve code readabilityGuillaume Gomez-18/+18
2021-05-02Auto merge of #84822 - Dylan-DPC:rollup-wego8d6, r=Dylan-DPCbors-249/+664
Rollup of 5 pull requests Successful merges: - #84358 (Update closure capture error logging for disjoint captures for disjoint captures) - #84392 (Make AssertKind::fmt_assert_args public) - #84752 (Fix debuginfo for generators) - #84763 (shrink doctree::Module) - #84821 (Fix nit in rustc_session::options) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-02Rollup merge of #84821 - jyn514:fix-nit, r=Mark-SimulacrumDylan DPC-1/+1
Fix nit in rustc_session::options Addresses https://github.com/rust-lang/rust/pull/84802#discussion_r624578203 - I never actually pushed the commit before that PR got merged. r? `@Mark-Simulacrum`
2021-05-02Rollup merge of #84763 - tdelabro:shrink-doctree-module, r=jyn514Dylan DPC-15/+14
shrink doctree::Module helps https://github.com/rust-lang/rust/issues/76382
2021-05-02Rollup merge of #84752 - lrh2000:generator-debuginfo, r=tmandryDylan DPC-80/+114
Fix debuginfo for generators First, all fields except the discriminant (including `outer_fields`) should be put into structures inside the variant part, which gives an equivalent layout but offers us much better integration with debuggers. Second, artificial flags in generator variants should be removed. - Literally, variants are not artificial. We have `yield` statements, upvars and inner variables in the source code. - Functionally, we don't want debuggers to suppress the variants. It contains the state of the generator, which is useful when debugging. So they shouldn't be marked artificial. - Debuggers may use artificial flags to find the active variant. In this case, marking variants artificial will make debuggers not work properly. Fixes #62572. Fixes #79009. And refer https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Debuginfo.20for.20generators.
2021-05-02Rollup merge of #84392 - dario23:fmt-assert-args-pub, r=varkor,RalfJungDylan DPC-1/+1
Make AssertKind::fmt_assert_args public
2021-05-02Rollup merge of #84358 - sexxi-goose:print_captures_borrowck_rebased, ↵Dylan DPC-152/+534
r=nikomatsakis Update closure capture error logging for disjoint captures for disjoint captures Improved error logging when `#![feature(capture_disjoint_fields)]` is used. Closes https://github.com/rust-lang/project-rfc-2229/issues/8 Closes https://github.com/rust-lang/project-rfc-2229/issues/36 Closes https://github.com/rust-lang/project-rfc-2229/issues/39 Closes #76005
2021-05-02Fix nit in rustc_session::optionsJoshua Nelson-1/+1
2021-05-02Update testsGuillaume Gomez-30/+42
2021-05-02Add missing CSS rules for associated typesGuillaume Gomez-8/+11
2021-05-02Migrate trait and impl blocks' toggles intoGuillaume Gomez-185/+124
2021-05-02add suggestion for unit enum variant when matched with a paternAliénore Bouttefeux-35/+193
2021-05-02Auto merge of #84802 - jyn514:option-dead-code, r=Mark-Simulacrumbors-429/+453
Remove dead code in `rustc_session::Options` - Don't recompile the same functions for each debugging option This reduces the amount of items in the crate by quite a lot. - Remove unused `parse_opt_list` and `parse_pathbuf_push` functions - Remove unused macro parameters - Remove `allow(dead_code)`.
2021-05-02Use ErrorKind::OutOfMemory in unix, windows, and wasiKornel-0/+5
2021-05-02Add ErrorKind::OutOfMemoryKornel-2/+10
2021-05-02Auto merge of #84805 - Mark-Simulacrum:no-dup-extend, r=cjgillotbors-8/+5
Avoid generating QueryMap::extend for each key type Should be a small win on compile times for rustc_query_impl, where this ends up getting codegen'd.
2021-05-02fix nll test stderrChris Pardy-1/+1
2021-05-02Auto merge of #84750 - jyn514:nix-cargo, r=Mark-Simulacrumbors-5/+7
Don't download cargo twice when download-rustc is set Previously, this caused a bug on NixOS: 1. bootstrap.py would download and patch stage0/cargo 2. bootstrap.py would download nightly cargo, but extract it to stage0/cargo instead of ci-rustc/cargo. It would still try (and fail) to patch ci-rustc/cargo. 3. bootstrap.py would fail to build rustbuild because stage0/cargo wasn't patched. The "proper" fix is to extract nightly cargo to ci-rustc instead, but it doesn't seem to be necessary at all, so this just skips downloading it instead. Fixes https://github.com/rust-lang/rust/issues/84702
2021-05-01RustDoc: Fix bounds linking trait.Foo instead of traitalias.FooScott McMurray-16/+50
2021-05-02Auto merge of #84725 - sebpop:arm64-isb, r=joshtriplettbors-1/+1
[Arm64] use isb instruction instead of yield in spin loops On arm64 we have seen on several databases that ISB (instruction synchronization barrier) is better to use than yield in a spin loop. The yield instruction is a nop. The isb instruction puts the processor to sleep for some short time. isb is a good equivalent to the pause instruction on x86. Below is an experiment that shows the effects of yield and isb on Arm64 and the time of a pause instruction on x86 Intel processors. The micro-benchmarks use https://github.com/google/benchmark.git ``` $ cat a.cc static void BM_scalar_increment(benchmark::State& state) { int i = 0; for (auto _ : state) benchmark::DoNotOptimize(i++); } BENCHMARK(BM_scalar_increment); static void BM_yield(benchmark::State& state) { for (auto _ : state) asm volatile("yield"::); } BENCHMARK(BM_yield); static void BM_isb(benchmark::State& state) { for (auto _ : state) asm volatile("isb"::); } BENCHMARK(BM_isb); BENCHMARK_MAIN(); $ g++ -o run a.cc -O2 -lbenchmark -lpthread $ ./run -------------------------------------------------------------- Benchmark Time CPU Iterations -------------------------------------------------------------- AWS Graviton2 (Neoverse-N1) processor: BM_scalar_increment 0.485 ns 0.485 ns 1000000000 BM_yield 0.400 ns 0.400 ns 1000000000 BM_isb 13.2 ns 13.2 ns 52993304 AWS Graviton (A-72) processor: BM_scalar_increment 0.897 ns 0.874 ns 801558633 BM_yield 0.877 ns 0.875 ns 800002377 BM_isb 13.0 ns 12.7 ns 55169412 Apple Arm64 M1 processor: BM_scalar_increment 0.315 ns 0.315 ns 1000000000 BM_yield 0.313 ns 0.313 ns 1000000000 BM_isb 9.06 ns 9.06 ns 77259282 ``` ``` static void BM_pause(benchmark::State& state) { for (auto _ : state) asm volatile("pause"::); } BENCHMARK(BM_pause); Intel Skylake processor: BM_scalar_increment 0.295 ns 0.295 ns 1000000000 BM_pause 41.7 ns 41.7 ns 16780553 ``` Tested on Graviton2 aarch64-linux with `./x.py test`.
2021-05-02Auto merge of #84638 - mark-i-m:unignore-tests, r=Mark-Simulacrumbors-4/+1
Unignore a couple of tests
2021-05-01Avoid generating QueryMap::extend for each key typeMark Rousskov-8/+5
2021-05-01Auto merge of #84471 - jyn514:linkcheck-llvm, r=Mark-Simulacrumbors-1/+4
Allow running `x.py test --stage 2 src/tools/linkchecker` with `download-rustc = true` Previously, the LD_LIBRARY_PATH for the linkchecker looked like `build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib`, because the linkchecker depends on the master copy of the standard library. This is true, but doesn't include the library path for the compiler libraries: ``` /home/joshua/src/rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools-bin/error_index_generator: error while loading shared libraries: libLLVM-12-rust-1.53.0-nightly.so: cannot open shared object file: No such file or directory ``` That file is in `build/x86_64-unknown-linux-gnu/stage1/lib/libLLVM-12-rust-1.53.0-nightly.so`, which wasn't included in the dynamic path. This adds `build/x86_64-unknown-linux-gnu/stage1/lib` to the dynamic path for the linkchecker.
2021-05-01Remove unused macro parametersJoshua Nelson-3/+3
2021-05-01Remove unused `parse_pathbuf_push` functionJoshua Nelson-12/+0
This also remove the `allow(dead_code)`.
2021-05-01Don't recompile the same functions for each debugging optionJoshua Nelson-412/+461
This reduces the amount of items in the crate by quite a lot.
2021-05-01add docstrings and add issue to FIXMEsChris Pardy-3/+5
2021-05-01Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rsChrisPardy-1/+1
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2021-05-01Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rsChrisPardy-1/+1
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2021-05-01Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rsChrisPardy-2/+2
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2021-05-01Closure capture borrow diagnostics for disjoint capturesChris Pardy-151/+531
2021-05-01Remove unused parse_opt_list functionJoshua Nelson-13/+0