Commit Graph

171883 Commits

Author SHA1 Message Date
Takayuki Maeda
c9e2aa4d7f refactor: remove a redundant mutable variable 2022-07-05 18:28:36 +09:00
Oli Scherer
82c73af4a6 Prefer trace level instrumentation for the new noisy instrument attributes 2022-07-05 09:27:06 +00:00
Oli Scherer
c3aec3056e Add a helper method with an explicit name instead of hand rolling a match 3x 2022-07-05 09:26:45 +00:00
Chris Denton
9ac4a4e67a
Fix typo in src/bootstrap/bootstrap.py
Co-authored-by: Marco Colombo <mar.colombo13@gmail.com>
2022-07-05 09:06:43 +01:00
bors
4045ce641a Auto merge of #98910 - Dylan-DPC:rollup-9x82wdg, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #97300 (Implement `FusedIterator` for `std::net::[Into]Incoming`)
 - #98761 (more `need_type_info` improvements)
 - #98811 (Interpret: AllocRange Debug impl, and use it more consistently)
 - #98847 (fix interpreter validity check on Box)
 - #98854 (clean up the borrowing in rustc_hir_pretty)
 - #98873 (Suggest `#[derive(Default)]` to enums with `#[default]`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-05 06:44:49 +00:00
Laurențiu Nicola
170b173a3b ⬆️ rust-analyzer 2022-07-05 09:29:11 +03:00
Michael Howell
3ac1a9b50d rustdoc: filter '_ lifetimes from ty::Generics
Fixes a weirdly-rendered section of the std::string::String docs.
2022-07-04 22:21:38 -07:00
Dylan DPC
9a2274cf81
Rollup merge of #98873 - TaKO8Ki:suggest-default-derive-to-enum-with-default-attribute, r=fee1-dead
Suggest `#[derive(Default)]` to enums with `#[default]`

fixes #95226
2022-07-05 10:42:59 +05:30
Dylan DPC
6e5f1d491a
Rollup merge of #98854 - kadiwa4:rustc_hir_pretty_clean_up_borrowing, r=oli-obk
clean up the borrowing in rustc_hir_pretty

A whole lot of the `&`s and `ref`s were redundant. I hope doing this in one big commit is fine, because all of the changes are pretty self-contained.

`@rustbot` label: +C-cleanup
2022-07-05 10:42:58 +05:30
Dylan DPC
7702c50ea5
Rollup merge of #98847 - RalfJung:box-is-special, r=oli-obk
fix interpreter validity check on Box

Follow-up to https://github.com/rust-lang/rust/pull/98554: avoid walking over parts of the value twice.

And then move all that logic into the general visitor so not each visitor implementation has to deal with it...
2022-07-05 10:42:57 +05:30
Dylan DPC
522d52cef7
Rollup merge of #98811 - RalfJung:interpret-alloc-range, r=oli-obk
Interpret: AllocRange Debug impl, and use it more consistently

The two commits are pretty independent but it did not seem worth having two PRs for them.
r? ``@oli-obk``
2022-07-05 10:42:55 +05:30
Dylan DPC
6a9db39f6c
Rollup merge of #98761 - lcnr:need_type_info-cont, r=estebank
more `need_type_info` improvements

this now deals with macros in suggestions and the source cost computation does what I want for `channel` 🎉

r? ``@estebank``
2022-07-05 10:42:54 +05:30
Dylan DPC
d26ccf7067
Rollup merge of #97300 - ChayimFriedman2:patch-1, r=dtolnay
Implement `FusedIterator` for `std::net::[Into]Incoming`

They never return `None`, so they trivially fulfill the contract.

What should I put for the stability attribute of `Incoming`?
2022-07-05 10:42:52 +05:30
bors
880646ca9c Auto merge of #98872 - JakobDegen:no-invalidate, r=davidtwco
Add method to mutate MIR body without invalidating CFG caches.

In addition to adding this method, a handful of passes are updated to use it. There's still quite a few passes that could in principle make use of this as well, but do not at the moment because they use `VisitorMut` or `MirPatch`, which needs additional support for this.

The method name is slightly unwieldy, but I don't expect anyone to be writing it a lot, and at least it says what it does. If anyone has a suggestion for a better name though, would be happy to rename.

r? rust-lang/mir-opt
2022-07-05 04:04:04 +00:00
Ralf Jung
6f01ff61b3 interpret: fix CheckedBinOp behavior when overflow checking is disabled 2022-07-04 23:29:41 -04:00
bors
4008dd8c6d Auto merge of #98846 - RalfJung:alignment-is-a-type-thing, r=oli-obk
interpret: track place alignment together with the type, not the value

This matches how I handle alignment in [MiniRust](https://github.com/RalfJung/minirust). I think it makes conceptually a lot more sense.
Fixes https://github.com/rust-lang/rust/issues/63085

r? `@oli-obk`
2022-07-05 01:23:09 +00:00
bors
e1d1848cc6 Auto merge of #98904 - matthiaskrgr:rollup-05owsx7, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #98738 (Clarify MIR semantics of checked binary operations)
 - #98782 (Improve spans for specialization error)
 - #98793 (Lint against executable files in the root directory)
 - #98814 (rustdoc: Censor certain complex unevaluated const exprs)
 - #98878 (add more `rustc_pass_by_value`)
 - #98879 (Fix "wrap closure in parenthesis" suggestion for `async` closure)
 - #98886 (incr.comp.: Make split-dwarf commandline options [TRACKED].)
 - #98898 (Add "no-div-regex" eslint rule)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-04 22:42:15 +00:00
Matthias Krüger
08d558dbe9
Rollup merge of #98898 - GuillaumeGomez:new-eslint-rul, r=Dylan-DPC
Add "no-div-regex" eslint rule

r? `@Dylan-DPC`
2022-07-04 23:11:15 +02:00
Matthias Krüger
adfcb74db0
Rollup merge of #98886 - michaelwoerister:tracked-split-dwarf-kind, r=davidtwco
incr.comp.: Make split-dwarf commandline options [TRACKED].

This commandline options have an influence on the contents of object files (and .dwo files), so they need to be `[TRACKED]`.

r? `@davidtwco`
2022-07-04 23:11:14 +02:00
Matthias Krüger
accb41ef01
Rollup merge of #98879 - compiler-errors:async-closure-wrap-parens, r=oli-obk
Fix "wrap closure in parenthesis" suggestion for `async` closure

Fixes #98023
2022-07-04 23:11:13 +02:00
Matthias Krüger
cb2d3bb198
Rollup merge of #98878 - lcnr:more-rustc_pass_by_value, r=oli-obk
add more `rustc_pass_by_value`

r? ```@oli-obk``` cc #98766
2022-07-04 23:11:12 +02:00
Matthias Krüger
9ad3ef13ac
Rollup merge of #98814 - fmease:minimal-fix-for-issue-97933, r=GuillaumeGomez
rustdoc: Censor certain complex unevaluated const exprs

Fixes #97933.

This is more of a hotfix for the aforementioned issue. By that, I mean that my proposed patch is
not the best solution but one that does not change as much existing code.
It treats symptoms rather than the root cause.

This PR “censors” certain complex unevaluated constant expressions like `match`es, blocks, function calls, struct literals etc. by pretty-printing them as `_` / `{ _ }` (number and string literals, paths and `()` are still printed as one would expect).
Resorting to this placeholder is preferable to printing the full expression verbatim since
they can be quite large and verbose resulting in an unreadable mess in the generated documentation.
Further, mindlessly printing the const would leak private and `doc(hidden)` struct fields (#97933), at least in the current
stable & nightly implementations which rely on `span_to_snippet` (!) and `rustc_hir_pretty::id_to_string`.

The censoring of _verbose_ expressions is probably going to stay longer term.
However, in regards to private and `doc(hidden)` struct fields, I have a more proper fix in mind
which I have already partially implemented locally and for which I am going to open a separate PR sometime soon.
For that, I was already in contact with `@GuillaumeGomez.`
The proper fix involves rustdoc not falling back on pretty-printing unevaluated consts so easily (what this PR is concerned about)
and instead preferring to print evaluated consts which contain more information allowing it to selectively hide private and `doc(hidden)` fields, create hyperlinks etc. generally making the output more granular and precise (compared to the brutal `_` placeholder).

Unfortunately, I was a bit too late and the issue just hit stable (1.62).
Should this be backported to beta or even a potential 1.62.1?

r? `@GuillaumeGomez`
2022-07-04 23:11:11 +02:00
Matthias Krüger
2a4091187a
Rollup merge of #98793 - Mark-Simulacrum:fix-tidy-bins, r=jyn514
Lint against executable files in the root directory

This avoids accidental introduction (such as in #97488) of executable files into the root directory, not just under library/, src/ or compiler/.

Resolves #98792
2022-07-04 23:11:10 +02:00
Matthias Krüger
da630de3bd
Rollup merge of #98782 - compiler-errors:specialization-error-span, r=oli-obk
Improve spans for specialization error

Fixes #98777
2022-07-04 23:11:09 +02:00
Matthias Krüger
82660a2525
Rollup merge of #98738 - tmiasko:checked-binop, r=oli-obk
Clarify MIR semantics of checked binary operations
2022-07-04 23:11:07 +02:00
bors
27eb6d7018 Auto merge of #98627 - RalfJung:interpret-arith, r=lcnr
interpret: don't rely on ScalarPair for overflowed arithmetic

This is for https://github.com/rust-lang/rust/pull/97861.
Cc `@eddyb`

I would like to avoid making this depend on `dest.layout.abi` to avoid a branch that we are not usually covering both sides of. Though OTOH this seems like fairly straight-forward code. But let's benchmark this option first to see how bad that extra `force_allocation` really is.
2022-07-04 20:00:41 +00:00
León Orell Valerian Liehr
d3181a9a01 rustdoc: censor certain complex unevaluated const exprs 2022-07-04 18:39:52 +02:00
bors
17581a79ad Auto merge of #98573 - krasimirgg:nlmb-llvm-nm, r=nikic
adapt native-link-modifier-bundle test to use llvm-nm

No functional changes intended.

This updates the test case to use `llvm-nm` as an alternative to https://github.com/rust-lang/rust/pull/98424.

This fixes a test failure over at the experimental build of rustc with HEAD LLVM:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/11144#01814d0f-a46a-4c19-91cf-41e720edb6f9/684-691.

The issue is that this test uses the system nm, which may not be recent
enough to understand the bitcode produced by rustc when compiled against HEAD LLVM.

Similar to what we did for another test in https://github.com/rust-lang/rust/pull/94023.
2022-07-04 15:59:44 +00:00
Guillaume Gomez
9d0f44436d Add "no-div-regex" eslint rule 2022-07-04 17:50:19 +02:00
Chris Denton
b1541ff198
bootstrap.py: Always use .exe for Windows
This ensure that it will run the Windows executable if other files in the directory (such as Linux executables) have the same file name minus the extension.
2022-07-04 15:57:10 +01:00
Takayuki Maeda
dcd6620e36 add regression test for #79467 2022-07-04 22:29:03 +09:00
Ralf Jung
0850bad94d extra assertion, extra sure 2022-07-04 09:12:22 -04:00
Ralf Jung
b1568e6f34 clarify comment 2022-07-04 09:05:23 -04:00
lcnr
9f95c605f8 region obligations, remove body_id 2022-07-04 14:35:20 +02:00
lcnr
a0d2d9f315 implied bounds byebye nested hir ids 2022-07-04 14:35:20 +02:00
lcnr
e78e0e2ad0 rip out RegionCtxt from hir typeck 2022-07-04 14:35:20 +02:00
lcnr
68d70fc5bd only use FnCtxt for regionck inside of bodies 2022-07-04 14:35:20 +02:00
lcnr
edd45f9d41 RegionCtxt merged body_id with body_owner 2022-07-04 14:35:20 +02:00
lcnr
24799e3720 remove an unused DefId 2022-07-04 14:35:19 +02:00
Krasimir Georgiev
aa4c8f6fab adapt native-link-modifier-bundle test to use llvm-nm 2022-07-04 12:33:23 +00:00
bors
d2074cbeec Auto merge of #98817 - the8472:dont-optimize-ui-tests, r=Mark-Simulacrum
Only obey optimize-tests flag on UI tests that are run-pass

stage1 UI tests walltime on my machine:

```
optimize-tests = false, master
25.98s

optimize-tests = true, master
34.69s

optimize-tests = true, patched
28.79s
```

Effects:

- faster UI tests
- llvm asserts get exercised less on build-pass tests
- the difference between opt and nopt builds shrinks a bit
- aux libs don't get optimized since they don't have a pass mode and almost never have explicit compile flags
2022-07-04 12:32:39 +00:00
Michael Woerister
822957f49c incr.comp.: Make split-dwarf commandline options [TRACKED]. 2022-07-04 14:11:28 +02:00
lcnr
f475e880a4 InferSource::GenericArg, check for contains 2022-07-04 14:04:07 +02:00
lcnr
7952d2ed83 resolve vars in node substs 2022-07-04 13:58:29 +02:00
lcnr
eef34a648b stop suggesting things inside of macros 2022-07-04 13:58:29 +02:00
lcnr
f1836c453a update infer cost computation for types 2022-07-04 13:58:29 +02:00
lcnr
c2ed08715b remove unused function argument 2022-07-04 13:58:28 +02:00
Takayuki Maeda
eb80407d79 suggest #[derive(Default)] to enums with #[default] 2022-07-04 20:46:59 +09:00
Jakub Beránek
928c17203a
Only validate HIR with debug_assertions on 2022-07-04 11:38:11 +02:00
bors
a3beeaa84d Auto merge of #98641 - lcnr:mir-dropck, r=oli-obk
fully move dropck to mir

r? `@oli-obk`
2022-07-04 09:23:01 +00:00