Commit Graph

241884 Commits

Author SHA1 Message Date
Michael Woerister 115885ba7e Replace some instances of FxHashMap/FxHashSet with stable alternatives (mostly in rustc_hir and rustc_ast_lowering)
Part of https://github.com/rust-lang/compiler-team/issues/533
2023-12-18 21:03:32 +01:00
Celina G. Val 1a83c5b55b Add function ABI and type layout to StableMIR
This change introduces a new module to StableMIR named `abi` with
information from `rustc_target::abi` and `rustc_abi`, that allow users
to retrieve more low level information required to perform
bit-precise analysis.

The layout of a type can be retrieved via `Ty::layout`, and the instance
ABI can be retrieved via `Instance::fn_abi()`.

To properly handle errors while retrieve layout information, we had
to implement a few layout related traits.
2023-12-18 19:58:48 +00:00
Michael Goulet 132a2884ad Use alias-eq in structural normalization 2023-12-18 19:22:43 +00:00
bors bf9229a2e3 Auto merge of #119082 - matthiaskrgr:rollup-3pzzwxk, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #118941 (llvm-wrapper: adapt for LLVM API changes)
 - #119068 (Copy 1.74.1 release notes to master)
 - #119080 (Comment out `change-id` in `config.example.toml`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-18 18:45:31 +00:00
bjorn3 9d98f79c53 Rustup to rustc 1.76.0-nightly (6a6287132 2023-12-17) 2023-12-18 18:31:49 +00:00
bjorn3 f6c0006b2a Sync from rust 6a62871320 2023-12-18 18:24:49 +00:00
bjorn3 973dd562e8 fix computing the offset of an unsized field in a packed struct
cc rust-lang/rust#118540
Fixes rust-lang/rustc_codegen_cranelift#1435
2023-12-18 18:12:29 +00:00
rustbot 03c7a9d951 Update books 2023-12-18 12:00:47 -05:00
bjorn3 1ab05b6cbe fix dynamic size/align computation logic for packed types with dyn trait tail
cc rust-lang/rust#118538
2023-12-18 16:13:54 +00:00
Matthias Krüger 9a24d8a101
Rollup merge of #119080 - onur-ozkan:comment-change-id-in-example-config, r=Kobzol
Comment out `change-id` in `config.example.toml`

This way, we only update CONFIG_CHANGE_HISTORY for major changes, which is much simpler (and updating example.toml doesn't make much sense)

r? `@Kobzol` (as this was mainly your idea)
2023-12-18 17:03:12 +01:00
Matthias Krüger e8046d3c14
Rollup merge of #119068 - sksat:copy-1.74.1-release-note-to-master, r=Mark-Simulacrum
Copy 1.74.1 release notes to master

- #119065
- this cherry-pick 1.74.1 release note from #118607(66033ec4e5)

Fixes #119065.
2023-12-18 17:03:12 +01:00
Matthias Krüger b053a9c2ea
Rollup merge of #118941 - krasimirgg:llvm-cov, r=nikic
llvm-wrapper: adapt for LLVM API changes

Adapt for 8ecbb0404d.

r? `@nikic`
`@rustbot` label: +llvm-main
2023-12-18 17:03:11 +01:00
bors 2a7634047a Auto merge of #119024 - lqd:linker-docs, r=petrochenkov
Document unstable linker flags in the unstable book

This PR:
- removes the unstable linker flavors from the stable documentation
- documents the unstable `-C linker-flavor` values in the unstable book (including the ones previously described as stable)
- documents the unstable `-C link-self-contained` components in the unstable book

I don't know if these have some common reviewers, but if not r? `@petrochenkov` as the most knowledgeable person in this area. Please feel free to reassign, I know that you are quite busy.
2023-12-18 15:57:14 +00:00
bjorn3 c4567c1841 Implement has_ptr_meta without computing type layout
This matches type_has_metadata in cg_ssa and doesn't require computing
the layout of the type. It is also a bit faster.
2023-12-18 15:24:06 +00:00
bjorn3 697aa0a320 Fix test for size_of_val and align_of_val panicking on extern types 2023-12-18 15:15:35 +00:00
bjorn3 fdcf56c5b7 Panic for size_of_val and align_of_val of extern type
cc rust-lang/rust#118534
2023-12-18 15:09:41 +00:00
r0cky a7d6f42db3 Check generic params after sigature for main-fn-ty 2023-12-18 22:24:10 +08:00
bors a7690a366c Auto merge of #118584 - gurry:118144-projection-kind-mismatched, r=WaffleLapkin
Fix ICE `ProjectionKinds Deref and Field were mismatched`

Fix #118144

Removed the check that ICEd if the sequence of projection kinds were different across captures. Instead we now sort based only on `Field` projection kinds.
2023-12-18 13:58:20 +00:00
onur-ozkan ce2eaa6325 Comment out `change-id` in `config.example.toml`
This way, we only update CONFIG_CHANGE_HISTORY for major changes, which is
much simpler (and updating example.toml doesn't make much sense)

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-18 15:54:10 +03:00
bors 3562c535fe Auto merge of #117818 - fmease:properly-reject-defaultness-on-free-consts, r=cjgillot
Properly reject `default` on free const items

Fixes #117791.

Technically speaking, this is a breaking change but I doubt it will lead to any real-world regressions (maybe in some macro-trickery crates?). Doing a crater run probably isn't worth it.
2023-12-18 11:59:34 +00:00
Krasimir Georgiev 0a285e8de7 llvm-wrapper: adapt for LLVM API changes
Adapt for 8ecbb0404d.
2023-12-18 11:25:31 +00:00
Gurinder Singh c3a739e4c8 Fix ICE `ProjectionKinds Deref and Field were mismatched` 2023-12-18 16:46:12 +05:30
bors 37340a12c7 Auto merge of #119070 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`
2023-12-18 10:01:35 +00:00
Nicholas Nethercote cea683c08f Use `.into_diagnostic()` less.
This commit replaces this pattern:
```
err.into_diagnostic(dcx)
```
with this pattern:
```
dcx.create_err(err)
```
in a lot of places.

It's a little shorter, makes the error level explicit, avoids some
`IntoDiagnostic` imports, and is a necessary prerequisite for the next
commit which will add a `level` arg to `into_diagnostic`.

This requires adding `track_caller` on `create_err` to avoid mucking up
the output of `tests/ui/track-diagnostics/track4.rs`. It probably should
have been there already.
2023-12-18 20:46:13 +11:00
Rémy Rakic 3006e62909 fix typo in stable doc codegen-options chapter 2023-12-18 09:38:52 +00:00
Rémy Rakic d39324b525 describe unstable self-contained linking components in the unstable book 2023-12-18 09:38:52 +00:00
leohowell e57294c139 Add new tier 3 aarch64-apple-watchos target 2023-12-18 16:26:54 +08:00
bors e004adb556 Auto merge of #119069 - matthiaskrgr:rollup-xxk4m30, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #118852 (coverage: Skip instrumenting a function if no spans were extracted from MIR)
 - #118905 ([AIX] Fix XCOFF metadata)
 - #118967 (Add better ICE messages for some undescriptive panics)
 - #119051 (Replace `FileAllocationInfo` with `FileEndOfFileInfo`)
 - #119059 (Deny `~const` trait bounds in inherent impl headers)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-18 08:03:22 +00:00
lcnr 4a38442c90 dont discard overflow from normalizes-to goals 2023-12-18 09:01:54 +01:00
lcnr ca718ffd2d track the source of nested goals 2023-12-18 08:47:29 +01:00
Laurențiu Nicola ebba9b346d Merge commit '21b06c1beb9bb59369ffd652f5d617bcf6952e05' into sync-from-ra 2023-12-18 09:21:55 +02:00
Matthias Krüger c088f6af8f
Rollup merge of #119059 - fmease:no-tilde-const-in-inh-impl-headers, r=fee1-dead
Deny `~const` trait bounds in inherent impl headers

Follow-up to #117817.
Implements https://github.com/rust-lang/rust/pull/117817#discussion_r1416213747.

Fixes #117004.

r? fee1-dead or compiler
2023-12-18 08:08:24 +01:00
Matthias Krüger 10ad10ee2a
Rollup merge of #119051 - ChrisDenton:wine, r=workingjubilee
Replace `FileAllocationInfo` with `FileEndOfFileInfo`

This fixes WINE support
2023-12-18 08:08:24 +01:00
Matthias Krüger 578a7dd35e
Rollup merge of #118967 - RossSmyth:panic-messages, r=TaKO8Ki
Add better ICE messages for some undescriptive panics

Add some better messages at some panics

re: #118955

I took a look at some others but either was not able to figure out what they did, or it was unclear what they should say instead. For example in the query system whether each time a poisoned value is matched upon if they should all just call `FatalError.raise()`
2023-12-18 08:08:23 +01:00
Matthias Krüger 18294d6e1d
Rollup merge of #118905 - bzEq:revert-u64-on-xcoff, r=WaffleLapkin
[AIX] Fix XCOFF metadata

#118344  accidentally changed the way to get metadata from XCOFF file and broken our internal CI.

This PR reverts part of #118344 .
2023-12-18 08:08:23 +01:00
Matthias Krüger 418ae3e9a0
Rollup merge of #118852 - Zalathar:no-spans, r=cjgillot
coverage: Skip instrumenting a function if no spans were extracted from MIR

The immediate symptoms of #118643 were fixed by #118666, but some users reported that their builds now encounter another coverage-related ICE:

```
error: internal compiler error: compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs:98:17: A used function should have had coverage mapping data but did not: (...)
```

I was able to reproduce at least one cause of this error: if no relevant spans could be extracted from a function, but the function contains `CoverageKind::SpanMarker` statements, then codegen still thinks the function is instrumented and complains about the fact that it has no coverage spans.

This PR prevents that from happening in two ways:
- If we didn't extract any relevant spans from MIR, skip instrumenting the entire function and don't create a `FunctionCoverateInfo` for it.
- If coverage codegen sees a `CoverageKind::SpanMarker` statement, skip it early and avoid creating `func_coverage`.

---

Fixes #118850.
2023-12-18 08:08:22 +01:00
Mark Rousskov 03d0ac62aa
copy 1.74.1 release notes to master 2023-12-18 15:45:07 +09:00
bors cda4736f1e Auto merge of #119063 - nnethercote:dcx, r=compiler-errors
Consistent `Handler` naming

This PR implements the renaming described in https://github.com/rust-lang/compiler-team/issues/699.

r? `@compiler-errors`
2023-12-18 06:03:53 +00:00
Nicholas Nethercote eeb3db1130 Rename many `DiagCtxt` and `EarlyDiagCtxt` locals. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote 1e831e38ce Fix up some `ui-fulldeps` tests. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote 8b5a5daad4 Rename many `DiagCtxt` arguments. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote f6aa418c9f Rename many `DiagCtxt` and `EarlyDiagCtxt` locals. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote d58e372853 Rename many `EarlyDiagCtxt` arguments. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote f422dca3ae Rename many `DiagCtxt` arguments. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote 4dc7fab56f Rename `__diagnostic_handler_sess` as `_sess`. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote e97d353359 Rename `default_handler` as `default_dcx`. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote e13b5c8efb Rename `new_handler` as `new_dcx`. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote 7b8644e5cf Rename `DiagnosticDeriveKind::Diagnostic::handler` as `DiagnosticDeriveKind::Diagnostic::dcx`. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote f7125f1f66 Rename `CollectProcMacros::handler` as `CollectProcMacros::dcx`. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote b107ab81ad Rename `EarlyDiagCtxt::handler` as `EarlyDiagCtxt::dcx`. 2023-12-18 16:06:22 +11:00