Commit Graph

171796 Commits

Author SHA1 Message Date
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
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
Camille GILLOT
e3d63203a3 Only compute DefKind through the query. 2022-07-04 10:42:23 +02:00
topjohnwu
22b4ea4813 Proper macOS libLLVM symlink when cross compiling
When cross compiling on macOS with `llvm.link-shared` enabled,
the symlink creation will fail after compiling LLVM for the target
architecture, because it will attempt to create the symlink in the
host LLVM directory, which was already created when being built.

This commit changes the symlink path to the actual LLVM output.
2022-07-04 01:38:05 -07:00
lcnr
8deadfa271 fully move dropck to mir 2022-07-04 10:26:23 +02:00
Michael Goulet
eef56306f0 Fix wrap parenthesis suggestion for async closure 2022-07-04 08:07:12 +00:00
lcnr
658b7f3652 more rustc_pass_by_value 2022-07-04 09:40:58 +02:00
bors
9c9ae85a47 Auto merge of #98874 - matthiaskrgr:rollup-0u4hm54, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #98501 (rustc_passes/src/entry.rs: De-duplicate more code with `fn throw_attr_err()`)
 - #98774 (rustdoc: make source sidebar toggle a real button)
 - #98806 (Fix long declaration trailing whitespace)
 - #98823 (Fix rust-call ICE in mir-inliner)
 - #98870 (Add regression test for #86784)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-04 06:35:29 +00:00
Jakob Degen
26d153ac67 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.
2022-07-03 23:26:39 -07:00
Matthias Krüger
c41e2080de
Rollup merge of #98870 - TaKO8Ki:add-regression-test-for-86784, r=compiler-errors
Add regression test for #86784

closes #86784
2022-07-04 06:08:11 +02:00
Matthias Krüger
79add33692
Rollup merge of #98823 - compiler-errors:rust-call-mir-inline, r=cjgillot
Fix rust-call ICE in mir-inliner

Fixes #98821
r? ``@cjgillot``
2022-07-04 06:08:10 +02:00
Matthias Krüger
f236b6853a
Rollup merge of #98806 - GuillaumeGomez:decl-trailing-whitespace, r=notriddle
Fix long declaration trailing whitespace

Fixes https://github.com/rust-lang/rust/issues/98803.

Interestingly enough, it even simplifies the code a bit.

r? `@notriddle`
2022-07-04 06:08:09 +02:00
Matthias Krüger
47456ad4ef
Rollup merge of #98774 - notriddle:notriddle/source-code-sidebar-button, r=GuillaumeGomez
rustdoc: make source sidebar toggle a real button

This fixes tab focus, so that you can open and close the sidebar from keyboard.

This should cause no visible change in appearance at all. The only way you'd know anything different is if you tried to use keyboard controls to open the source code file navigation sidebar.

Separated out from #98772
2022-07-04 06:08:08 +02:00
Matthias Krüger
7352c7b6cd
Rollup merge of #98501 - Enselic:err_if_attr_found, r=compiler-errors
rustc_passes/src/entry.rs: De-duplicate more code with `fn throw_attr_err()`

So we can more easily re-use the code for other attributes later. More specifically [`#[unix_sigpipe]`](https://github.com/rust-lang/rust/pull/97802). This refactoring is covered by this test:
8aab472d52/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs (L120)
(Well, only `#[start]`, but the code for `#[rustc_main]` is identical.)
2022-07-04 06:08:07 +02:00
bors
a5c6a48aee Auto merge of #98731 - InfRandomness:fix-#98728, r=Mark-Simulacrum
Revert #95993 fix

This reverts the temporary fix implemented by https://github.com/rust-lang/rust/pull/95993 since a permanent fix has been implemented by https://github.com/rust-lang/cargo/pull/10594

Fixes https://github.com/rust-lang/rust/issues/98728
2022-07-04 03:54:47 +00:00
Ralf Jung
d7edf66a5a move Box mess handling into general visitor 2022-07-03 22:55:25 -04:00
Ralf Jung
7fc77806d4 fix interpreter validity check on Box 2022-07-03 22:42:50 -04:00
Takayuki Maeda
15a86f7f2e add regression test for #86784 2022-07-04 11:07:13 +09:00
bors
d46c728bcd Auto merge of #98446 - nnethercote:derive-no-match-destructuring, r=scottmcm
Don't use match-destructuring for derived ops on structs.

r? `@scottmcm`
2022-07-04 01:06:54 +00:00
Nicholas Nethercote
ecc6e95ed4 Don't use match-destructuring for derived ops on structs.
All derive ops currently use match-destructuring to access fields. This
is reasonable for enums, but sub-optimal for structs. E.g.:
```
fn eq(&self, other: &Point) -> bool {
    match *other {
	Self { x: ref __self_1_0, y: ref __self_1_1 } =>
	    match *self {
		Self { x: ref __self_0_0, y: ref __self_0_1 } =>
		    (*__self_0_0) == (*__self_1_0) &&
			(*__self_0_1) == (*__self_1_1),
	    },
    }
}
```
This commit changes derive ops on structs to use field access instead, e.g.:
```
fn eq(&self, other: &Point) -> bool {
    self.x == other.x && self.y == other.y
}
```
This is faster to compile, results in smaller binaries, and is simpler to
generate. Unfortunately, we have to keep the old pattern generating code around
for `repr(packed)` structs because something like `&self.x` (which doesn't show
up in `PartialEq` ops, but does show up in `Debug` and `Hash` ops) isn't
allowed. But this commit at least changes those cases to use let-destructuring
instead of match-destructuring, e.g.:
```
fn hash<__H: ::core:#️⃣:Hasher>(&self, state: &mut __H) -> () {
    {
	let Self(ref __self_0_0) = *self;
	{ ::core:#️⃣:Hash::hash(&(*__self_0_0), state) }
    }
}
```
There are some unnecessary blocks remaining in the generated code, but I
will fix them in a follow-up PR.
2022-07-04 10:48:15 +10:00
Nicholas Nethercote
528343f93b Comment fixes.
Remove an out-of-date sentence, and fix a typo.
2022-07-04 10:48:15 +10:00
Nicholas Nethercote
18f8495677 Add an interesting case to the deriving-all-codegen.rs test. 2022-07-04 10:48:15 +10:00
bors
2557603f32 Auto merge of #98864 - RalfJung:rollup-ptzklyc, r=RalfJung
Rollup of 4 pull requests

Successful merges:

 - #94831 (Link to stabilization section in std-dev-guide for library tracking issue template)
 - #98764 (add Miri to the nightly docs)
 - #98773 (rustdoc: use <details> tag for the source code sidebar)
 - #98799 (Fix bug in `rustdoc -Whelp`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-03 22:20:10 +00:00
Ralf Jung
ce76d7312f
Rollup merge of #98799 - jyn514:rustdoc-lint-help, r=GuillaumeGomez
Fix bug in `rustdoc -Whelp`

Previously, this printed the debugging options, not the lint options,
and only handled `-Whelp`, not `-A/-D/-F`.

This also fixes a few other misc issues:
- Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests
- Add lint headers for tool lints, not just builtin lints

https://github.com/rust-lang/rust/pull/98533#issuecomment-1172004197

r? ```@GuillaumeGomez```
2022-07-03 16:41:57 -04:00
Ralf Jung
87df0f1fbe
Rollup merge of #98773 - notriddle:notriddle/source-sidebar-details, r=GuillaumeGomez
rustdoc: use <details> tag for the source code sidebar

This fixes the extremely poor accessibility of the old system, making it possible to navigate the sidebar by keyboard, and also implicitly gives the sidebar items the correct ARIA roles.

Split out separately from #98772
2022-07-03 16:41:56 -04:00
Ralf Jung
b0d831a486
Rollup merge of #98764 - InfRandomness:miri-rustdoc, r=jyn514
add Miri to the nightly docs

This is a follow-up to https://github.com/rust-lang/rust/pull/97773 and to https://github.com/rust-lang/rust/pull/98714

It adds miri to the doc.rust-lang.org/nightly/nightly-rustc](https://doc.rust-lang.org/nightly/nightly-rustc/
2022-07-03 16:41:54 -04:00
Ralf Jung
ff5e5ec71f
Rollup merge of #94831 - yaahc:lib-tracking-issue-template-update, r=JohnTitor
Link to stabilization section in std-dev-guide for library tracking issue template

This shouldn't land until https://github.com/rust-lang/std-dev-guide/pull/32 is merged.
2022-07-03 16:41:53 -04:00