Commit Graph

216474 Commits

Author SHA1 Message Date
bors
f02439dea7 Auto merge of #107241 - clubby789:bootstrap-lto-off, r=simulacrum
Add `rust.lto=off` to bootstrap and set as compiler/library default

Closes #107202

The issue mentions `embed-bitcode=on`, but here c8e6a9e8b6/src/bootstrap/compile.rs (L379-L381)
it appears that this is always set for std stage 1+, so I'm unsure if changes are needed here.

`@rustbot` label +A-bootstrap
2023-02-03 01:19:04 +00:00
Chris Wailes
134a5aea52 Add a linker argument back to boostrap.py
In https://github.com/rust-lang/rust/pull/101783 I accidentally removed
a load-bearing linker argument.  This PR adds it back in.
2023-02-02 16:10:43 -08:00
Camille GILLOT
5c39ba2027 Bless 32bit. 2023-02-02 23:26:34 +00:00
Camille GILLOT
473d0c5510 Introduce write_aggregate. 2023-02-02 23:26:34 +00:00
Camille GILLOT
83173c68f5 Add partial propagation test. 2023-02-02 23:26:29 +00:00
Camille GILLOT
10ec94930b Bless tests. 2023-02-02 23:26:26 +00:00
Camille GILLOT
134d819072 Stop deaggegating MIR. 2023-02-02 23:20:29 +00:00
Camille GILLOT
6a0b218161 Stop deaggregating enums in MIR. 2023-02-02 23:20:27 +00:00
Camille GILLOT
b62a9da0c8 Handle aggregates in DataflowConstProp. 2023-02-02 23:09:51 +00:00
Camille GILLOT
20dd5e09fd Codegen SetDiscriminant after field assignment.
This matches the order in which deaggregation was performed.
2023-02-02 23:09:51 +00:00
Camille GILLOT
feccf469fb Interpret aggregates. 2023-02-02 23:09:51 +00:00
Camille GILLOT
0241c29123 Put a DefId in AggregateKind. 2023-02-02 23:09:51 +00:00
Nicholas Nethercote
a86fc727fa Rename Cursor/CursorRef as TokenTreeCursor/RefTokenTreeCursor.
This makes it clear they return token trees, and makes for a nice
comparison against `TokenCursor` which returns tokens.
2023-02-03 10:06:52 +11:00
Nicholas Nethercote
b5ecbbb998 Remove TokenCursorFrame.
The motivation here is to eliminate the `Option<(Delimiter,
DelimSpan)>`, which is `None` for the outermost token stream and `Some`
for all other token streams.

We are already treating the innermost frame specially -- this is the
`frame` vs `stack` distinction in `TokenCursor`. We can push that
further so that `frame` only contains the cursor, and `stack` elements
contain the delimiters for their children. When we are in the outermost
token stream `stack` is empty, so there are no stored delimiters, which
is what we want because the outermost token stream *has* no delimiters.

This change also shrinks `TokenCursor`, which shrinks `Parser` and
`LazyAttrTokenStreamImpl`, which is nice.
2023-02-03 10:06:52 +11:00
Nicholas Nethercote
b23f272db0 Make clear that TokenTree::Token shouldn't contain a delimiter. 2023-02-03 10:06:52 +11:00
Nicholas Nethercote
af1d16e82d Improve doc comment desugaring.
Sometimes the parser needs to desugar a doc comment into `#[doc =
r"foo"]`. Currently it does this in a hacky way: by pushing a "fake" new
frame (one without a delimiter) onto the `TokenCursor` stack.

This commit changes things so that the token stream itself is modified
in place. The nice thing about this is that it means
`TokenCursorFrame::delim_sp` is now only `None` for the outermost frame.
2023-02-03 10:06:52 +11:00
Michael Goulet
745d60c239
Tweak misleading comment 2023-02-02 15:02:21 -08:00
clubby789
d8651aae22 Don't generate unecessary &&self.field in deriving Debug 2023-02-02 22:06:23 +00:00
Joseph Ryan
eb5e9713b5 Use triple rather than arch for fuchsia test runner 2023-02-02 13:29:03 -08:00
bors
6c991b0740 Auto merge of #107000 - GuillaumeGomez:fix-items-in-doc-hidden-block, r=notriddle,petrochenkov
Fix handling of items inside a `doc(hidden)` block

Fixes #106373.

cc `@aDotInTheVoid`
r? `@notriddle`
2023-02-02 21:14:44 +00:00
Aidan Olsen
c3a71ede7c Emit warnings on unused parens/braces in index expressions 2023-02-02 12:46:31 -07:00
bors
f3126500f2 Auto merge of #107601 - matthiaskrgr:rollup-07zaafe, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #106919 (Recover `_` as `..` in field pattern)
 - #107493 (Improve diagnostic for missing space in range pattern)
 - #107515 (Improve pretty-printing of `HirIdValidator` errors)
 - #107524 (Remove both StorageLive and StorageDead in CopyProp.)
 - #107532 (Erase regions before doing uninhabited check in borrowck)
 - #107559 (Rename `rust_2015` → `is_rust_2015`)
 - #107577 (Reinstate the `hir-stats.rs` tests on stage 1.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-02 17:56:53 +00:00
Esteban Küber
0ba687a95e Parse and recover from type ascription in patterns 2023-02-02 17:18:48 +00:00
yukang
fe84cecf60 fix #107590, Fix benchmarks in library/core with black_box 2023-02-03 00:33:36 +08:00
Esteban Küber
e6b84eb797 Suggest move in nested closure when appropriate
Fix #64008.
2023-02-02 16:26:01 +00:00
Matthias Krüger
08181eabfe
Rollup merge of #107577 - nnethercote:reinstate-hir-stats, r=jyn514
Reinstate the `hir-stats.rs` tests on stage 1.

r? ```@the8472```
2023-02-02 17:14:08 +01:00
Matthias Krüger
3d92100955
Rollup merge of #107559 - WaffleLapkin:is_it_2015¿, r=davidtwco
Rename `rust_2015` → `is_rust_2015`

r? ```@compiler-errors```
https://github.com/rust-lang/rust/pull/107508#discussion_r1092300088
2023-02-02 17:14:08 +01:00
Matthias Krüger
3e0995a440
Rollup merge of #107532 - compiler-errors:erase-regions-in-uninhabited, r=jackh726
Erase regions before doing uninhabited check in borrowck

~Also, fingerprint query keys/values when debug assertions are enabled. This should make it easier to check for issues like this without `-Cincremental`, and make UI tests a bit cleaner.~ edit: moving that to a separate PR

Fixes #107505
2023-02-02 17:14:07 +01:00
Matthias Krüger
6917040cf0
Rollup merge of #107524 - cjgillot:both-storage, r=RalfJung
Remove both StorageLive and StorageDead in CopyProp.

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

https://github.com/rust-lang/rust/pull/106908 removed StorageDead without the accompanying StorageLive. In loops, execution would see repeated StorageLive, without any StorageDead, which is UB.

So when removing storage statements, we have to remove both StorageLive and StorageDead.

~I also added a MIR validation pass for StorageLive. It may be a bit overzealous.~
2023-02-02 17:14:06 +01:00
Matthias Krüger
230c9e91fd
Rollup merge of #107515 - Swatinem:hirvalidator, r=compiler-errors
Improve pretty-printing of `HirIdValidator` errors

This now uses `node_to_string` for both missing and seen Ids, which includes the snippet of code for which the Id was allocated. Also removes the duplicated printing of `HirId`, as `node_to_string` also includes that.
2023-02-02 17:14:06 +01:00
Matthias Krüger
e9c4e291c4
Rollup merge of #107493 - clubby789:range-fat-arrow-followup, r=estebank
Improve diagnostic for missing space in range pattern

Improves the diagnostic in #107425 by turning it into a note explaining the parsing issue.

r? `@compiler-errors`
2023-02-02 17:14:05 +01:00
Matthias Krüger
8f47954742
Rollup merge of #106919 - compiler-errors:underscore-typo-in-field-pat, r=jackh726
Recover `_` as `..` in field pattern
2023-02-02 17:14:05 +01:00
Michael Woerister
227b2858da Retry opening proc-macro DLLs a few times on Windows. 2023-02-02 16:18:16 +01:00
clubby789
4ab75de934 Improve diagnostic for missing space in range pattern 2023-02-02 13:18:12 +00:00
bors
97872b792c Auto merge of #107478 - compiler-errors:anon-enum-tys-are-ambiguous, r=estebank
Revert "Teach parser to understand fake anonymous enum syntax" and related commits

anonymous enum types are currently ambiguous in positions like:

* `|` operator: `a as fn() -> B | C`
* closure args: `|_: as fn() -> A | B`

I first tried to thread around `RecoverAnonEnum` into all these positions, but the resulting complexity in the compiler is IMO not worth it, or at least worth a bit more thinking time. In the mean time, let's revert this syntax for now, so we can go back to the drawing board.

Fixes #107461

cc: `@estebank` `@cjgillot` #106960

---
### Squashed revert commits:

Revert "review comment: Remove AST AnonTy"

This reverts commit 020cca8d36.

Revert "Ensure macros are not affected"

This reverts commit 12d18e4031.

Revert "Emit fewer errors on patterns with possible type ascription"

This reverts commit c847a01a3b.

Revert "Teach parser to understand fake anonymous enum syntax"

This reverts commit 2d82420665.
2023-02-02 12:01:17 +00:00
Mads Ravn
f922c8395d PR fixing wrong order of format parameters in strings. Issue #106572
Adding

Adding

Fixing small issues for PR

Adding tests

Removing unused binding

Changing the wording on note

Fixing PR comment
2023-02-02 12:56:04 +01:00
Krasimir Georgiev
4614e5b5bf llvm-wrapper: adapt for LLVM API changes
Adapts the wrapper for 516e301752,
where the constructor of PGOOptions gained a new FileSystem argument.
Adapted to use the real file system, similarly to the changes inside of
LLVM:
516e301752 (diff-f409934ba27ad86494f3012324e9a3995b56e0743609ded7a387ba62bbf5edb0R236)
2023-02-02 10:09:48 +00:00
bors
a9985cf172 Auto merge of #107584 - matthiaskrgr:rollup-vav4ljz, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #107201 (Remove confusing 'while checking' note from opaque future type mismatches)
 - #107312 (Add Style Guide rules for let-else statements)
 - #107488 (Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.)
 - #107531 (Inline CSS background images directly into the CSS)
 - #107576 (Add proc-macro boilerplate to crt-static test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-02 09:05:18 +00:00
Maybe Waffle
a7f97a7689 Use rust_2018 instead of !is_rust_2015 2023-02-02 08:17:18 +00:00
Maybe Waffle
9fe8ae792e Rename rust_2015 => is_rust_2015 2023-02-02 08:17:13 +00:00
John Kåre Alsaker
2b8f8922ee Remove unneeded extern crate 2023-02-02 07:47:39 +01:00
John Kåre Alsaker
2aceaf4849 Add a new rustc_driver dylib to rexport rustc_driver_impl 2023-02-02 07:34:41 +01:00
John Kåre Alsaker
73681323e6 Rename rustc_driver to rustc_driver_impl 2023-02-02 07:12:10 +01:00
Michael Goulet
9dd5d3e8e4 Recover _ as .. in field pattern 2023-02-02 06:10:02 +00:00
Michael Goulet
39db65c526 Add a test 2023-02-02 05:54:35 +00:00
Michael Goulet
e4b2936983 Revert "Teach parser to understand fake anonymous enum syntax" and related commits
Revert "review comment: Remove AST AnonTy"

This reverts commit 020cca8d36.

Revert "Ensure macros are not affected"

This reverts commit 12d18e4031.

Revert "Emit fewer errors on patterns with possible type ascription"

This reverts commit c847a01a3b.

Revert "Teach parser to understand fake anonymous enum syntax"

This reverts commit 2d82420665.
2023-02-02 05:54:35 +00:00
Matthias Krüger
643fc97fd3
Rollup merge of #107576 - P1n3appl3:master, r=tmandry
Add proc-macro boilerplate to crt-static test

I was seeing this failure when running ui tests with with a `-Cpanic=abort` stdlib targeting fuchsia:

```
---- [ui] tests/ui/proc-macro/crt-static.rs stdout ----
normalized stderr:
warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic

warning: 1 warning emitted

The actual stderr differed from the expected stderr.
```

`force-host` was enough to stop it from running/failing, not sure if I should also add `needs-unwind`?
2023-02-02 06:52:15 +01:00
Matthias Krüger
75ea3a9948
Rollup merge of #107531 - GuillaumeGomez:inline-images-in-css, r=notriddle
Inline CSS background images directly into the CSS

A nice advantage of this is that it removes a few entries in the list of static files.

r? ``@notriddle``
2023-02-02 06:52:15 +01:00
Matthias Krüger
150b9d753b
Rollup merge of #107488 - nnethercote:fix-PartialEq-syntax, r=RalfJung
Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.

If you do `derive(PartialEq)` on a packed struct, the output shown by `-Zunpretty=expanded` includes expressions like this:
```
{ self.x } == { other.x }
```
This is invalid syntax. This doesn't break compilation, because the AST nodes are constructed within the compiler. But it does mean anyone using `-Zunpretty=expanded` output as a guide for hand-written impls could get a nasty surprise.

This commit fixes things by instead using this form:
```
({ self.x }) == ({ other.x })
```

r? ``@RalfJung``
2023-02-02 06:52:14 +01:00
Matthias Krüger
f838fa87b2
Rollup merge of #107312 - calebcartwright:style-let-else, r=joshtriplett
Add Style Guide rules for let-else statements

cc `@rust-lang/style` `@rust-lang/rustfmt`

[rendered](c694d07c64/src/doc/style-guide/src/statements.md (else-blocks-let-else-statements))
2023-02-02 06:52:13 +01:00