Commit Graph

233487 Commits

Author SHA1 Message Date
bors
e3abbd4994 Auto merge of #114946 - anforowicz:generic-fix-for-asan-lto, r=tmiasko
Preserve ASAN-related symbols during LTO.

Fixes https://github.com/rust-lang/rust/issues/113404
2023-09-06 20:04:03 +00:00
Gijs Burghoorn
2b02142eab Bump: Include RISC-V intrinsics for stdarch 2023-09-06 20:53:54 +02:00
bjorn3
521ed6e308 Merge commit 'dda103b1e33c4902deca8bccf614991ada781fa6' into sync_cg_clif-2023-09-06 2023-09-06 18:51:03 +00:00
bjorn3
dda103b1e3 Rustup to rustc 1.74.0-nightly (a991861ec 2023-09-05) 2023-09-06 18:33:08 +00:00
bjorn3
5920ae5e7b Sync from rust a991861ec9 2023-09-06 18:28:02 +00:00
bors
4e2116296c Auto merge of #115615 - matthiaskrgr:rollup-49fosdf, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #114511 (Remove the unhelpful let binding diag comes from FormatArguments)
 - #115473 (Add explanatory note to 'expected item' error)
 - #115574 (Replace `rustc_data_structures` dependency with `rustc_index` in `rustc_parse_format`)
 - #115578 (Clarify cryptic comments)
 - #115587 (fix #115348)
 - #115596 (A small change)
 - #115598 (Fix log formatting in bootstrap)
 - #115605 (Better Debug for `Ty` in smir)
 - #115614 (Fix minor grammar typo)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-09-06 18:16:06 +00:00
Matthias Krüger
1d3451d495
Rollup merge of #115614 - dariuswiles:patch-1, r=cuviper
Fix minor grammar typo
2023-09-06 19:31:52 +02:00
Matthias Krüger
9a901dad6f
Rollup merge of #115605 - ouz-a:smir_better_debug, r=oli-obk
Better Debug for `Ty` in smir

Similar to what I did here https://github.com/rust-lang/rust/pull/115534.

r? ``@oli-obk``
2023-09-06 19:31:51 +02:00
Matthias Krüger
23537ce47e
Rollup merge of #115598 - GoldsteinE:fix-bootstrap-formatting, r=onur-ozkan
Fix log formatting in bootstrap

`format!()` was missing, so log was just showing `{target}` verbatim.

(I also applied a small clippy suggestion in `builder.info()`)
2023-09-06 19:31:51 +02:00
Matthias Krüger
da44234b64
Rollup merge of #115596 - nnethercote:two-small-changes, r=lqd
A small change

A small change I made while poking around the code.

r? `@lqd`
2023-09-06 19:31:50 +02:00
Matthias Krüger
3e42a12a54
Rollup merge of #115587 - mojave2:issue-115348, r=oli-obk
fix #115348

fix #115348
It looks that:

- In `rustc_mir_build::build`, the body of function will not be built, when the `tcx.check_match(def)` fails due to `non-exhaustive patterns`
- In `rustc_mir_transform::check_unsafety`, the `UnsafetyChecker` collects all `used_unsafe_blocks` in the MIR of a function, and the `UnusedUnsafeVisitor` will visit all `UnsafeBlock`s in the HIR and collect `unused_unsafes`, which are not contained in `used_unsafe_blocks`, and report `unnecessary_unsafe`s
- So the unsafe block in the issue example code will be reported as `unnecessary_unsafe`.
2023-09-06 19:31:50 +02:00
Matthias Krüger
93543bc8bc
Rollup merge of #115578 - ouz-a:rustc_clarify, r=oli-obk
Clarify cryptic comments

Clarifies some unclear comments that lurked in the compiler.

r? ``@oli-obk``
2023-09-06 19:31:49 +02:00
Matthias Krüger
7498dca311
Rollup merge of #115574 - Veykril:rustc_parse_format-dep, r=Nilstrieb
Replace `rustc_data_structures` dependency with `rustc_index` in `rustc_parse_format`

`rustc_data_structures` is only used for the `static_assert_size` macro, yet that is defined in `rustc_index` and merely re-exported. `rustc_index` is a lot more lightweight than `rustc_data_structures` which would make this a lot more reusable for rust-analyzer.
2023-09-06 19:31:49 +02:00
Matthias Krüger
4a31cc859b
Rollup merge of #115473 - gurry:113110-expected-item, r=compiler-errors
Add explanatory note to 'expected item' error

Fixes #113110

It changes the diagnostic from this:

```
error: expected item, found `5`
 --> ../test.rs:1:1
  |
1 | 5
  | ^ expected item
 ```
to this:
```
error: expected item, found `5`
 --> ../test.rs:1:1
  |
1 | 5
  | ^ expected item
  |
  = note: items are things that can appear at the root of a module
  = note: for a full list see https://doc.rust-lang.org/reference/items.html
```
2023-09-06 19:31:48 +02:00
Matthias Krüger
b046541b62
Rollup merge of #114511 - chenyukang:yukang-fix-114374-fmt-args, r=b-naber
Remove the unhelpful let binding diag comes from FormatArguments

Fixes #114374
2023-09-06 19:31:48 +02:00
Darius Wiles
408dca7241
Fix minor grammar typo 2023-09-06 09:47:22 -07:00
bors
a5b2ac6906 Auto merge of #115252 - cjgillot:mir-composite, r=davidtwco
Represent MIR composite debuginfo as projections instead of aggregates

Composite debuginfo for MIR is currently represented as
```
debug name => Type { projection1 => place1, projection2 => place2 };
```
ie. a single `VarDebugInfo` object with that name, and its value a `VarDebugInfoContents::Composite`.

This PR proposes to reverse the representation to be
```
debug name.projection1 => place1;
debug name.projection2 => place2;
```
ie. multiple `VarDebugInfo` objects with each their projection.

This simplifies the handling of composite debuginfo by the compiler by avoiding weird nesting.

Based on https://github.com/rust-lang/rust/pull/115139
2023-09-06 16:10:11 +00:00
Camille GILLOT
f96c6e04cb Propagate PlaceElem::Index. 2023-09-06 16:09:31 +00:00
Camille GILLOT
fc63543792 Support array length. 2023-09-06 16:05:04 +00:00
Camille GILLOT
22986b72e5 Implement algebraic simplifications. 2023-09-06 15:57:50 +00:00
Camille GILLOT
74a967bcec Support a few more rvalues. 2023-09-06 15:52:06 +00:00
Ralf Jung
73d8dcb803 miri: catch function calls where the argument is caller-invalid / the return value callee-invalid 2023-09-06 16:36:00 +02:00
ouz-a
cc7c5ad20b Ty Debug now prints id and kind 2023-09-06 15:02:03 +03:00
bors
a0c28cd9dc Auto merge of #115401 - Zoxc:freeze, r=oli-obk
Add `FreezeLock` type and use it to store `Definitions`

This adds a `FreezeLock` type which allows mutation using a lock until the value is frozen where it can be accessed lock-free. It's used to store `Definitions` in `Untracked` instead of a `RwLock`. Unlike the current scheme of leaking read guards this doesn't deadlock if definitions is written to after no mutation are expected.
2023-09-06 11:48:43 +00:00
Guillaume Gomez
c4bb70f51b Add regression test for private fields in tuple struct 2023-09-06 13:26:56 +02:00
bors
c1d80ba9e2 Auto merge of #115532 - oli-obk:smir_folder, r=compiler-errors
Implement SMIR generic parameter instantiation

Also demonstrates the use of it with a test.

This required a few smaller changes that may conflict with `@ericmarkmartin` work, but should be easy to resolve any conflicts on my end if their stuff lands first.
2023-09-06 09:50:13 +00:00
mojave2
cfa2119563
add a regression test 2023-09-06 17:46:46 +08:00
mojave2
df6e6a6d08
fix #115348 2023-09-06 17:46:46 +08:00
John Kåre Alsaker
35e8b67fc2 Use a reference to the lock in the guards 2023-09-06 11:44:06 +02:00
Oli Scherer
65f25fe194 Don't report any errors in lower_intrinsics. They should have been typecked before. 2023-09-06 09:38:15 +00:00
Michael Goulet
1abbd4cd4f Render missing fields in tuple struct/enum as /* private fields */ 2023-09-06 11:16:05 +02:00
Ralf Jung
e66913f8fe rustc_layout/abi: error when attribute is applied to the wrong thing 2023-09-06 11:11:06 +02:00
Ralf Jung
9570cac019 rustc_abi: also support debugging function pointers 2023-09-06 11:11:06 +02:00
ouz-a
7928c5f830 make comments less cryptic 2023-09-06 12:09:29 +03:00
Oli Scherer
0f4ff52e00 Implement and test monomorphization 2023-09-06 08:16:04 +00:00
Oli Scherer
202fbed1a6 Allow fetching the SMIR body of FnDefs 2023-09-06 08:16:04 +00:00
Oli Scherer
98d26d9c4d Deopaquify ParamConst 2023-09-06 08:16:04 +00:00
Oli Scherer
627fa80bdf Add types to all constants 2023-09-06 08:16:04 +00:00
Oli Scherer
a370f1baa3 Also use Const in SMIR instead of just ConstantKind 2023-09-06 08:16:04 +00:00
Oli Scherer
7f009e54bd Fail to test argument instantiation since we don't have types for most constants 2023-09-06 08:16:04 +00:00
Oli Scherer
b43e3b9f41 Add type folder to SMIR 2023-09-06 08:15:42 +00:00
bors
24bece8420 Auto merge of #115453 - ibraheemdev:patch-16, r=joshtriplett
Stabilize `io_error_other` feature

Per the FCP for https://github.com/rust-lang/rust/issues/91946.
2023-09-06 08:00:25 +00:00
Goldstein
e0593f30fb
fix log formatting in bootstrap 2023-09-06 10:14:09 +03:00
Nicholas Nethercote
42dbc72d7b Adjust to_attr_token_stream.
It uses `once` chained with `(0..self.num_calls).map(...)` followed by
`.take(self.num_calls`. I found this hard to read. It's simpler to just
use `repeat_with`.
2023-09-06 17:12:07 +10:00
bors
3767e315ac Auto merge of #115593 - weihanglo:update-cargo, r=weihanglo
Update cargo

21 commits in 96fe1c9e1aecd8f57063e3753969bb6418fd2fd5..d14c85f4e6e7671673b1a1bc87231ff7164761e1
2023-08-29 20:10:34 +0000 to 2023-09-05 22:28:10 +0000
- fix(resolver): Make resolver behavior independent of package order (rust-lang/cargo#12602)
- cargo-credential: change serialization of cache expiration (rust-lang/cargo#12622)
- Update registry-web-api.md yank/unyank comments (rust-lang/cargo#12619)
- test: new options of debuginfo are no longer unstable (rust-lang/cargo#12618)
- use split_once for cleaner code (rust-lang/cargo#12615)
- stop using lazy_static (rust-lang/cargo#12616)
- doc: adjust all doc headings one level up (rust-lang/cargo#12595)
- chore(deps): update compatible (rust-lang/cargo#12609)
- chore(deps): update rust crate cargo_metadata to 0.17.0 (rust-lang/cargo#12610)
- Prepare for partial-version package specs (rust-lang/cargo#12591)
- refactor: Use more serde_untagged (rust-lang/cargo#12581)
- fix(cli): Help users know possible `--target` values (rust-lang/cargo#12607)
- Tab completion for --target uses rustup but fallsback to rustc (rust-lang/cargo#12606)
- Fewer temporary needless strings (rust-lang/cargo#12604)
- fix(help): Provide better commands heading for styling (rust-lang/cargo#12593)
- fix(update): Clarify meaning of --aggressive as --recursive (rust-lang/cargo#12544)
- docs(changelog): Clarify language for Cargo.lock policy (rust-lang/cargo#12601)
- fix typo: "default branch branch" -> "default branch" (rust-lang/cargo#12598)
- fix: add error for unsupported credential provider version (rust-lang/cargo#12590)
- fix(help): Explain --explain (rust-lang/cargo#12592)
- fix(help): Remove redundant information from new/init (rust-lang/cargo#12594)

r? ghost
2023-09-06 06:11:25 +00:00
Weihang Lo
2619a6ea51
Update cargo 2023-09-06 12:58:59 +08:00
bors
51a9df8c70 Auto merge of #115584 - ezekielathome:docs-pattern-inconsistency, r=compiler-errors
replace doc occurrences of ItemLikeVisitor

Solves #114885

ItemLikeVisitor used to have comments describing visit patterns. After it was removed, it was moved to `rustc_hir::intravisit` but references in `intravisit.rs` weren't updated.
2023-09-06 04:24:36 +00:00
Gurinder Singh
6a286e775c Add explanatory note to 'expected item' error 2023-09-06 09:05:07 +05:30
bors
aeddd2ddfd Auto merge of #115529 - chenyukang:yukang-fix-115402-overflowsize, r=compiler-errors
Fix error report for size overflow from transmute

Fixes #115402

The span in the error reporting always points to the `dst`, this is an old issue, I may open another PR to fix it.
2023-09-06 02:37:41 +00:00
bors
25283f4e13 Auto merge of #115371 - matthewjasper:if-let-guard-parsing, r=cjgillot
Make if let guard parsing consistent with normal guards

- Add tests that struct expressions are not allowed in `if let` and `while let` (no change, consistent with `if` and `while`)
- Allow struct expressions in `if let` guards (consistent with `if` guards).

r? `@cjgillot`

Closes #93817
cc #51114
2023-09-06 00:46:21 +00:00