Commit graph

163686 commits

Author SHA1 Message Date
Matthias Krüger 40afbdd148
Rollup merge of #94240 - compiler-errors:pathbuf-display, r=lcnr
Suggest calling .display() on `PathBuf` too

Fixes #94210
2022-02-23 12:26:42 +01:00
Matthias Krüger 14ac74d438
Rollup merge of #94213 - digama0:patch-4, r=Dylan-DPC
fix names in feature(...) suggestion
2022-02-23 12:26:41 +01:00
Matthias Krüger 8bb6051317
Rollup merge of #94137 - aDotInTheVoid:abi-enum, r=CraftSpider
rustdoc-json: Better Header Type

- Make ABI an enum, instead of being stringly typed
- Replace Qualifier HashSet with 3 bools
- Merge ABI field into header, as they always occor together

r? ``@CraftSpider``

``@rustbot`` modify labels: +A-rustdoc-json +T-rustdoc
2022-02-23 12:26:41 +01:00
Matthias Krüger 0c676a8a84
Rollup merge of #94128 - mqy:master, r=Dylan-DPC
rustdoc: several minor fixes

``@rustbot`` label A-docs
2022-02-23 12:26:40 +01:00
bjorn3 f596dce542 Merge commit '35d9c6bf256968e1b40e0d554607928bdf9cebea' into sync_cg_clif-2022-02-23 2022-02-23 11:49:34 +01:00
bjorn3 35d9c6bf25 Rustup to rustc 1.61.0-nightly (68369a041 2022-02-22) 2022-02-23 11:45:41 +01:00
bjorn3 ca1f3e752e Sync from rust bafe8d06e0 2022-02-23 11:38:28 +01:00
Marcel Hellwig c403424203 remove feature gate in control_flow examples 2022-02-23 10:42:46 +01:00
bors c651ba8a54 Auto merge of #94277 - ehuss:update-cargo, r=ehuss
Update cargo

8 commits in ea2a21c994ca1e4d4c49412827b3cf4dcb158b1d..d6cdde584a1f15ea086bae922e20fd27f7165431
2022-02-15 04:24:07 +0000 to 2022-02-22 19:55:51 +0000
- Add common profile validation. (rust-lang/cargo#10411)
- Add -Z check-cfg-features to enable compile-time checking of features (rust-lang/cargo#10408)
- Remove invalid target-specific dependency example. (rust-lang/cargo#10401)
- Fix errors in `cargo fetch` usage guide (rust-lang/cargo#10398)
- Fix some broken doc links. (rust-lang/cargo#10404)
- Implement "artifact dependencies" (RFC-3028) (rust-lang/cargo#9992)
- Print executable name on cargo test --no-run rust-lang/cargo#2 (rust-lang/cargo#10346)
- Avoid new deprecation warnings from clap 3.1.0 (rust-lang/cargo#10396)
2022-02-23 08:04:34 +00:00
Tomasz Miąsko 1113cd5bbe Rename region_should_not_be_omitted to should_print_region
to avoid double negation
2022-02-23 08:58:36 +01:00
Tomasz Miąsko eaf4c917af Print ParamTy and ParamConst instead of displaying them
Display for `ParamTy` and `ParamConst` is implemented in terms of print.
Using print avoids creating a new `FmtPrinter` just to display the
parameter name.
2022-02-23 08:48:33 +01:00
Eric Huss 474803f9a1 Update cargo 2022-02-22 23:22:42 -08:00
Eduard-Mihai Burtescu b7e95dee65 rustc_errors: let DiagnosticBuilder::emit return a "guarantee of emission". 2022-02-23 06:38:52 +00:00
Eduard-Mihai Burtescu 0b9d70cf6d rustc_errors: take self by value in DiagnosticBuilder::cancel. 2022-02-23 06:08:06 +00:00
Jason Newcomb 382b3f0601 Fix counting the number of unchangeable arguments in ptr_arg 2022-02-23 01:04:49 -05:00
Eduard-Mihai Burtescu 8562d6b752 rustc_errors: remove struct_dummy. 2022-02-23 05:38:24 +00:00
Eduard-Mihai Burtescu d4fc5ae25c rustc_errors: handle force_warn only through DiagnosticId::Lint. 2022-02-23 05:38:24 +00:00
Eduard-Mihai Burtescu 02ff9e0aef Replace &mut DiagnosticBuilder, in signatures, with &mut Diagnostic. 2022-02-23 05:38:19 +00:00
pierwill 516e965bfd Remove unused ordering derivations and bounds for SimplifiedTypeGen 2022-02-22 22:29:13 -06:00
Eduard-Mihai Burtescu f24ff1815f rustc_errors: add downgrade_to_delayed_bug to Diagnostic itself. 2022-02-23 03:46:51 +00:00
Dylan DPC 057dc09eae add some more summary from pr discussion 2022-02-23 03:29:02 +01:00
Dylan DPC 37cbc7d120 add some more summary from pr discussion 2022-02-23 03:28:27 +01:00
Dylan DPC 4905814249 add matching to errorkind 2022-02-23 03:22:23 +01:00
bors bafe8d06e0 Auto merge of #93984 - nnethercote:ChunkedBitSet, r=Mark-Simulacrum
Introduce `ChunkedBitSet` and use it for some dataflow analyses.

This reduces peak memory usage significantly for some programs with very
large functions.

r? `@ghost`
2022-02-23 01:26:07 +00:00
Ralf Jung d0192e6291 Miri: extend comments on downcast operation 2022-02-22 19:09:11 -05:00
Nicholas Nethercote 36b495f3cf Introduce ChunkedBitSet and use it for some dataflow analyses.
This reduces peak memory usage significantly for some programs with very
large functions, such as:
- `keccak`, `unicode_normalization`, and `match-stress-enum`, from
  the `rustc-perf` benchmark suite;
- `http-0.2.6` from crates.io.

The new type is used in the analyses where the bitsets can get huge
(e.g. 10s of thousands of bits): `MaybeInitializedPlaces`,
`MaybeUninitializedPlaces`, and `EverInitializedPlaces`.

Some refactoring was required in `rustc_mir_dataflow`. All existing
analysis domains are either `BitSet` or a trivial wrapper around
`BitSet`, and access in a few places is done via `Borrow<BitSet>` or
`BorrowMut<BitSet>`. Now that some of these domains are `ClusterBitSet`,
that no longer works. So this commit replaces the `Borrow`/`BorrowMut`
usage with a new trait `BitSetExt` containing the needed bitset
operations. The impls just forward these to the underlying bitset type.
This required fiddling with trait bounds in a few places.

The commit also:
- Moves `static_assert_size` from `rustc_data_structures` to
  `rustc_index` so it can be used in the latter; the former now
  re-exports it so existing users are unaffected.
- Factors out some common "clear excess bits in the final word"
  functionality in `bit_set.rs`.
- Uses `fill` in a few places instead of loops.
2022-02-23 10:18:49 +11:00
Mark Rousskov f1bcb0f3af Delete Decoder::read_unit 2022-02-22 18:14:51 -05:00
Mark Rousskov 2098ea6eba Provide copy-free access to raw Decoder bytes 2022-02-22 18:11:59 -05:00
Mark Rousskov da3b2ca956 Provide raw &str access from Decoder 2022-02-22 18:05:51 -05:00
Loïc BRANSTETT 3d234770b1 Improve diagnostic of the unexpected_cfgs lint 2022-02-22 23:17:13 +01:00
Loïc BRANSTETT fbe1c153ec Add test for well known names defined by rustc 2022-02-22 22:59:16 +01:00
bors 7f8760a44c Auto merge of #8451 - matthiaskrgr:ui_speedup, r=llogiq
tests: default to more threads for ui-tests

Benchmarks (tested on i5-7200U, 2 cores, 4 threads)

```
master branch:

cargo test // prime caches
cargo --color=always test  70,39s user 21,91s system 180% cpu 51,035 total
cargo --color=always test  70,77s user 22,13s system 180% cpu 51,579 total
cargo --color=always test  70,97s user 22,12s system 180% cpu 51,673 total

cargo --color=always nextest run  78,74s user 22,27s system 220% cpu 45,829 total
cargo --color=always nextest run  78,46s user 21,92s system 224% cpu 44,674 total
cargo --color=always nextest run  78,31s user 22,21s system 228% cpu 43,909 total

Patched (ui_speedup branch):

cargo test // prime cache
cargo --color=always test  97,51s user 32,02s system 288% cpu 44,905 total
cargo --color=always test  99,19s user 31,91s system 276% cpu 47,436 total
cargo --color=always test  98,47s user 31,84s system 284% cpu 45,744 total

cargo --color=always nextest run  102,18s user 30,80s system 350% cpu 37,902 total
cargo --color=always nextest run  99,75s user 29,86s system 350% cpu 36,935 total
cargo --color=always nextest run  100,36s user 29,93s system 351% cpu 37,061 total
```

changelog: use more threads for running clippys ui-tests for ~10% walltime speedup
2022-02-22 21:58:24 +00:00
Loïc BRANSTETT da896d35f4 Improve CheckCfg internal representation 2022-02-22 22:41:49 +01:00
bors 5bd1ec3283 Auto merge of #83706 - a1phyr:fix_vec_layout_calculation, r=JohnTitor
Fix a layout possible miscalculation in `alloc::RawVec`

A layout miscalculation could happen in `RawVec` when used with a type whose size isn't a multiple of its alignment. I don't know if such type can exist in Rust, but the Layout API provides ways to manipulate such types. Anyway, it is better to calculate memory size in a consistent way.
2022-02-22 20:50:38 +00:00
bjorn3 dc973aef2a Rustup to rustc 1.61.0-nightly (03a8cc7df 2022-02-21) 2022-02-22 20:37:22 +01:00
bjorn3 33cf8fafd8 Sync from rust 03a8cc7df1 2022-02-22 19:55:24 +01:00
NyantasticUwU c61d5923f2
Fix typo.
Yeah just a typo (probably some breaking changes in here be careful) :)
2022-02-22 11:44:45 -06:00
Antti Korpi 98bc47ff2d
Typo fix: Close inline-code backtick 2022-02-22 18:26:41 +01:00
Guillaume Gomez 1d95acba34 Add test for infinite redirection 2022-02-22 16:18:18 +01:00
Guillaume Gomez a849857bda Prevent generation of infinite redirections 2022-02-22 16:18:18 +01:00
bors 68369a041c Auto merge of #94254 - matthiaskrgr:rollup-7llbjhd, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #94169 (Fix several asm! related issues)
 - #94178 (tidy: fire less "ignoring file length unneccessarily" warnings)
 - #94179 (solarish current_exe using libc call directly)
 - #94196 (compiletest: Print process output info with less whitespace)
 - #94208 (Add the let else tests found missing in the stabilization report)
 - #94237 (Do not suggest wrapping an item if it has ambiguous un-imported methods)
 - #94246 (ScalarMaybeUninit is explicitly hexadecimal in its formatting)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-02-22 14:41:26 +00:00
Krasimir Georgiev 21987c11aa Bump download-ci-llvm-stamp for llvm-nm inclusion
We started using it in https://github.com/rust-lang/rust/pull/94023.
2022-02-22 14:47:44 +01:00
Santiago Pastorino d82a7bc1b5
local_id is always != 0 at this point 2022-02-22 09:37:47 -03:00
Matthias Krüger e3814629c4
Rollup merge of #94246 - RalfJung:hex, r=oli-obk
ScalarMaybeUninit is explicitly hexadecimal in its formatting

This makes `ScalarMaybeUninit` consistent with `Scalar` after the changes in https://github.com/rust-lang/rust/pull/94189.

r? ``@oli-obk``
2022-02-22 12:16:34 +01:00
Matthias Krüger 396910a664
Rollup merge of #94237 - compiler-errors:dont-wrap-ambiguous-receivers, r=lcnr
Do not suggest wrapping an item if it has ambiguous un-imported methods

If the method is defined for the receiver we have, but is ambiguous during probe, then it probably comes from one of several traits that just weren't `use`d. Don't suggest wrapping the receiver in `Box`/etc., even if that makes the method probe unambiguous.

Fixes #94218
2022-02-22 12:16:33 +01:00
Matthias Krüger b322382893
Rollup merge of #94208 - est31:let_else, r=Mark-Simulacrum
Add the let else tests found missing in the stabilization report

In the stabilization report of `let else`, in #93628, I found various cases which weren't tested. This PR adds them.
2022-02-22 12:16:32 +01:00
Matthias Krüger 1177b30ac9
Rollup merge of #94196 - aDotInTheVoid:terse-procres-info, r=Mark-Simulacrum
compiletest: Print process output info with less whitespace

Before:

```
error: jsondocck failed!
status: exit status: 1
command: "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondocck" "--doc-dir" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait" "--template" "/data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
Invalid command: Tried to use the previous path in the first command on line 10
Error: "Jsondocck failed for /data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs"

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

Rustdoc Output:
status: exit status: 0
command: "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "-L" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait/auxiliary" "-o" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait" "--deny" "warnings" "/data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs" "--output-format" "json" "-Zunstable-options"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------

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

```

After:

```

error: jsondocck failed!
status: exit status: 1
command: "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondocck" "--doc-dir" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait" "--template" "/data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs"
stdout: none
--- stderr -------------------------------
Invalid command: Tried to use the previous path in the first command on line 10
Error: "Jsondocck failed for /data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs"
------------------------------------------

Rustdoc Output:
status: exit status: 0
command: "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "-L" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait/auxiliary" "-o" "/data/ne321/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/supertrait" "--deny" "warnings" "/data/ne321/rust/src/test/rustdoc-json/traits/supertrait.rs" "--output-format" "json" "-Zunstable-options"
stdout: none
stderr: none

```
2022-02-22 12:16:31 +01:00
Matthias Krüger 21fb81405e
Rollup merge of #94179 - devnexen:getexecname_directcall, r=kennytm
solarish current_exe using libc call directly
2022-02-22 12:16:30 +01:00
Matthias Krüger a53b604fea
Rollup merge of #94178 - est31:tolerant_lines_check, r=Mark-Simulacrum
tidy: fire less "ignoring file length unneccessarily" warnings

This avoids a situation where a file is at the border of the limit,
and alternates between hitting the limit and not hitting it, causing
a back and forth of addition of the ignore-tidy-linelength directive.

As an example, consider the ignore-tidy-filelength of compiler/rustc_typeck/src/collect.rs.

It was added in 2ca4964db5, removed in
37354ebc97 (a revert of the earlier commit), added again in 448d07683a,
removed in 3171bd5bf5, added in 438826fd1a,
and removed in bb0a2f985c.

To avoid this back and forth, we exempt files from the unneccessary
ignoring warning that have length of at least 70% of the limit.
2022-02-22 12:16:29 +01:00
Matthias Krüger a063e138b6 Rollup merge of #94169 - Amanieu:asm_stuff, r=nagisa
Fix several asm! related issues

This is a combination of several fixes, each split into a separate commit. Splitting these into PRs is not practical since they conflict with each other.

Fixes #92378
Fixes #85247

r? ``@nagisa``
2022-02-22 12:16:28 +01:00