Commit Graph

241793 Commits

Author SHA1 Message Date
bors
e999d8b6e1 Auto merge of #119047 - mu001999:fix/118772, r=wesleywiser
Check generic params after sigature for main-fn-ty

Fixes #118772
2023-12-19 02:41:58 +00:00
Caleb Zulawski
e61aaf91c8 Disable new intrinsics for bootstrap 2023-12-18 21:41:50 -05:00
Celina G. Val
36bb79fc5e Add the function body span to StableMIR 2023-12-18 17:13:49 -08:00
bors
59096cdad0 Auto merge of #119061 - compiler-errors:async-gen-abi, r=wesleywiser
Desugar `yield` in `async gen` correctly, ensure `gen` always returns unit

1. Ensure `async gen` blocks desugar `yield $expr` to `task_context = yield async_gen_ready($expr)`. Previously we were not assigning the `task_context` correctly, meaning that `yield` expressions in async generators returned type `ResumeTy` instead of `()`, and that we were not storing the `task_context`  (which is probably unsound if we were reading the old task-context which has an invalidated borrow or something...)
2. Ensure that all `(async?) gen` blocks and `(async?) gen` fns return unit. Previously we were only checking this for `gen fn`, meaning that `gen {}` and `async gen {}` and `async gen fn` were allowed to return values that weren't unit. This is why #119058 was an ICE rather than an E0308.

Fixes #119058.
2023-12-19 00:42:50 +00:00
Michael Goulet
0f10acf768 Add a test demonstrating that RFC's note on diverging returns is subsumed by just inferring unit as ret type 2023-12-18 23:56:44 +00:00
Michael Goulet
e1c03e9bda Adjust the ignore-compare-mode-next-solver for hangs 2023-12-18 23:55:47 +00:00
bors
e719b6fc40 Auto merge of #118946 - onur-ozkan:fix-clean, r=clubby789
fix `x clean` for cross-compiled artifacts

```toml
build = "x86_64-unknown-linux-gnu"
host = ["arm-unknown-linux-gnueabihf"]
target = ["arm-unknown-linux-gnueabihf"]
```

On `x86_64-unknown-linux-gnu`, after cross-compiling with the sample configuration above, artifacts under `build/x86_64-unknown-linux-gnu` never gets cleaned with `x clean`. This PR fixes that.
2023-12-18 22:42:16 +00:00
bors
3f28fe1334 Auto merge of #119023 - compiler-errors:fn-trait-constness, r=fee1-dead
Check `FnPtr`/`FnDef` built-in fn traits correctly with effects

1. Teach the (old) trait solver how to handle the constness for built-in impls of the `Fn*` family of traits. This unfortunately doesn't support const closures just yet.
2. Fix the `const_eval_select`. It turns out that the `where` clause bounds on `const_eval_select` force the effect parameter for both fndefs to be `true` -- with effects, we will leave off any explicit where clauses and register these obligations manually.

I can elaborate on (2.) if you think it needs a better explanation!

r? fee1-dead
2023-12-18 20:44:09 +00:00
Michael Goulet
faea6ad579 Check const_eval_select intrinsic correctly 2023-12-18 20:28:06 +00:00
Michael Goulet
69f360d00c Check FnPtr/FnDef built-in fn traits correctly with effects 2023-12-18 20:28:06 +00:00
bors
1929606c3e Auto merge of #3220 - saethlin:strict-mmap, r=RalfJung
Make mmap not use expose semantics

Fixes https://github.com/rust-lang/miri/issues/3041 per https://github.com/rust-lang/miri/issues/3041#issuecomment-1711235196
2023-12-18 20:10:43 +00:00
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
bors
91b406f3f6 Auto merge of #3221 - RalfJung:edition, r=RalfJung
./miri run: default to edition 2021

Fixes https://github.com/rust-lang/miri/issues/2999
2023-12-18 17:53:07 +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
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