Commit Graph

241632 Commits

Author SHA1 Message Date
jyn
b5d8361909 rename to verbose-internals 2023-12-19 13:35:37 -05:00
bors
558ac1cfb7 Auto merge of #118853 - calebzulawski:simd-intrinsics, r=RalfJung
Add core::intrinsics::simd

Intended to close rust-lang/portable-simd#381.

r? ralfjung
2023-12-19 12:42:33 +00:00
bors
69e4545a8d Auto merge of #119110 - matthiaskrgr:rollup-vr6ha8x, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #119087 (Update books)
 - #119091 (Use alias-eq in structural normalization)
 - #119098 (Adjust the ignore-compare-mode-next-solver for hangs)
 - #119100 (Add the function body span to StableMIR)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-19 10:45:09 +00:00
Matthias Krüger
739364b77c
Rollup merge of #119100 - celinval:smir-body-span, r=compiler-errors
Add the function body span to StableMIR

We were missing the body span, which differs from the function definition span, since it covers the entire function body.

r? `@ouz-a`
2023-12-19 10:50:09 +01:00
Matthias Krüger
1333632ae9
Rollup merge of #119098 - compiler-errors:hangs, r=lcnr
Adjust the ignore-compare-mode-next-solver for hangs

Some new tests hang, some old tests don't hang.

r? lcnr or anyone in `@rust-lang/initiative-trait-system-refactor`
2023-12-19 10:50:09 +01:00
Matthias Krüger
9a72b7d04f
Rollup merge of #119091 - compiler-errors:alias-eq-in-structural-normalize, r=lcnr
Use alias-eq in structural normalization

We don't need to register repeated normalizes-to goals in a loop in structural normalize, but instead we can piggyback on the fact that alias-eq will already normalize aliases until they are rigid.

This fixes rust-lang/trait-system-refactor-initiative#78.

r? lcnr
2023-12-19 10:50:08 +01:00
Matthias Krüger
d1e52a8f5c
Rollup merge of #119087 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/edition-guide

2 commits in 34fca48ed284525b2f124bf93c51af36d6685492..bbffb074e16bef89772818b400b6c76a65eac126
2023-12-11 18:46:08 UTC to 2023-12-06 21:38:11 UTC

- Update links and text about rustfix. (rust-lang/edition-guide#287)
- Add C-string literals. (rust-lang/edition-guide#286)

## rust-embedded/book

1 commits in 22bca3d0f6e9b9b556689b54ce96f25b46ecd1b3..3f9df2b9885c6741365da2e12ed6662cd0e827d6
2023-12-11 21:22:20 UTC to 2023-12-11 21:22:20 UTC

- #363 (rust-embedded/book#364)

## rust-lang/nomicon

2 commits in 83d015105e6d490fc30d6c95da1e56152a50e228..f6bd083c4ccfc4ce6699b8b4154e3c45c5a27a8c
2023-12-10 03:19:24 UTC to 2023-12-10 03:18:32 UTC

- Minor improvements to Vec (rust-lang/nomicon#415)
- Improve the `PhantomData` table (rust-lang/nomicon#417)

## rust-lang/reference

1 commits in 692d216f5a1151e8852ddb308ba64040e634c876..f9f5b5babd95515e7028c32d6ca4d9790f64c146
2023-12-10 16:16:17 UTC to 2023-12-10 16:16:17 UTC

- Document object unsafety of async-fn-in-trait  (rust-lang/reference#1435)

## rust-lang/rust-by-example

11 commits in da0a06aada31a324ae84a9eaee344f6a944b9683..4c2b24ff9d9cf19f2fcff799a3a49b9a2c50ae8e
2023-12-18 13:02:23 UTC to 2023-12-10 12:10:43 UTC

- nested destructure example for structs (rust-lang/rust-by-example#1787)
- Make example in pipe.md compatible with both Windows and Unix-type system with less code (rust-lang/rust-by-example#1780)
- Add i18n support (rust-lang/rust-by-example#1760)
- Add pub keyword before mod bar definition in doc.md (rust-lang/rust-by-example#1785)
- Update address and title of github source of rust playground in playground.md (rust-lang/rust-by-example#1784)
- Update example in ffi.md to make it compatible with both Windows OS and Unit-type systems (rust-lang/rust-by-example#1781)
- Update the path of html_playground_url in playground.md (rust-lang/rust-by-example#1783)
- Update unit_testing.md ignore running the last example because it's test (rust-lang/rust-by-example#1782)
- Update example in fs.md and use target_family instead of target_os (rust-lang/rust-by-example#1779)
- Update the example in pipe.md to make it compatible with both Windows OS and Unix-type systems (rust-lang/rust-by-example#1778)
- Update the example in fs.md to ensure compatibility with both Window and Unix-type systems. (rust-lang/rust-by-example#1777)

## rust-lang/rustc-dev-guide

7 commits in 904bb5aa7b21adad58ffae610e2830c7b0f813b0..0610665a8687b1b0aa037917a1598b9f2a21e3ef
2023-12-17 17:21:38 UTC to 2023-12-05 16:40:26 UTC

- add a mailmap (rust-lang/rustc-dev-guide#1839)
- Move Editions chapter to "Contributing to Rust". (rust-lang/rustc-dev-guide#1838)
- Remove feature edition fields. (rust-lang/rustc-dev-guide#1836)
- Add a chapter on editions. (rust-lang/rustc-dev-guide#1835)
- Remove mentions of plugin lints (rust-lang/rustc-dev-guide#1833)
- Fix typo of unused_parens (rust-lang/rustc-dev-guide#1832)
- Replace experts map with reviewers from triagebot (rust-lang/rustc-dev-guide#1831)
2023-12-19 10:50:08 +01:00
bors
32f5db9890 Auto merge of #119093 - michaelwoerister:mcp533-18, r=petrochenkov
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. We should be getting close to being able to remove the HashStable impl of HashMap.
2023-12-19 08:46:02 +00:00
bors
be69926a73 Auto merge of #119074 - leohowell:new-aarch64-apple-watchos-target, r=wesleywiser
Add new tier 3 aarch64-apple-watchos target

Apple Xcode 14/15 releases add a new apple watchos target architecture arm64 out of arm64_32 and armv7k, now add a new tier 3 target support for this target.

### Tier 3 Target Requirements
Adds support for Apple WatchOS aarch64-apple-watchos target.

Below are details on how this target meets the requirements for tier 3:

> tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

`@leohowell`  has volunteered to be the target maintainer. I am also happy to help if a second maintainer is required.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

Uses the same naming as the LLVM target, and the same convention as other Apple targets.

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

I don't believe there is any ambiguity here.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

I don't see any legal issues here.

> The target must not introduce license incompatibilities.
> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).
> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.
> If the target supports building host tools (such as rustc or cargo), those host tools must not depend on proprietary (non-FOSS) libraries, other than ordinary runtime libraries supplied by the platform and commonly used by other binaries built for the target. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.
> Targets should not require proprietary (non-FOSS) components to link a functional binary or library.
> "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.

I see no issues with any of the above.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.
> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

Only relevant to those making approval decisions.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

core and alloc can be used. std support will be added in a subsequent PR.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running tests (even if they do not pass), the documentation must explain how to run tests for the target, using emulation if possible or dedicated hardware if necessary.

Use --target= option to cross compile, just like any target. Tests can be run using the WatchOS simulator (see https://developer.apple.com/documentation/xcode/running-your-app-in-the-simulator-or-on-a-device).

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.
> Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

I don't foresee this being a problem.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.
> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

No other targets should be affected by the pull request.

r? compiler-team
2023-12-19 06:47:58 +00:00
bors
b37d43efd9 Auto merge of #117654 - alistair23:alistair/riscv-docker, r=Mark-Simulacrum
ci: docker: dist-various-1: Include RISC-V C compilers

The compiler-builtins for RISC-V are missing some key functions, such as __bswapsi2 [1].

We can't just pull in the LLVM compiler-rt builtins as the rust-lang/rust distribution container doesn't have a C compiler [2].

This patch adds RISC-V C compilers to the CI Dockerfile as the first step towards enabling LLVM compiler-rt builtins for RISC-V Rust.

1: https://github.com/rust-lang/compiler-builtins/issues/350
2: e4f46b91ca
2023-12-19 04:48:24 +00:00
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
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
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
rustbot
03c7a9d951 Update books 2023-12-18 12:00:47 -05: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(66033ec4e5762bc7d6b274938c294ac65e12161d)

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
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
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
1e831e38ce Fix up some ui-fulldeps tests. 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