Commit Graph

240784 Commits

Author SHA1 Message Date
Nadrieril
5d6c539c2d Fix item visibilities 2023-12-11 11:20:55 +01:00
Nadrieril
de3f983bcd Make MaybeInfiniteInt rustc-independent 2023-12-11 11:20:55 +01:00
Nadrieril
24adca0a26 Move lints to their own module 2023-12-11 11:20:55 +01:00
Nadrieril
3691a0aee5 Gather rustc-specific functions around MatchCheckCtxt 2023-12-11 11:20:55 +01:00
Nadrieril
281002d42c Extract exhaustiveness into its own crate 2023-12-11 11:20:55 +01:00
bors
61afc9c928 Auto merge of #116949 - hamza1311:stablize-arc_unwrap_or_clone, r=dtolnay
Stablize arc_unwrap_or_clone

Fixes: #93610

This likely needs FCP. I created this PR as it's stabilization is trivial and FCP can be just conducted here. Not sure how to ping the libs API team (last attempt didn't work apparently according to GH UI)
2023-12-10 05:01:00 +00:00
bors
c71c246876 Auto merge of #118550 - cjgillot:filecheck-const-prop, r=Mark-Simulacrum
Add FileCheck annotations to const_prop tests

Unblocks https://github.com/rust-lang/rust/pull/116012
Advances https://github.com/rust-lang/rust/issues/116971
2023-12-10 03:00:58 +00:00
bors
f7253f2317 Auto merge of #118787 - GuillaumeGomez:rollup-fj5wr3q, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #117966 (add safe compilation options)
 - #118747 (Remove extra check cfg handled by libc directly)
 - #118774 (add test for inductive cycle hangs)
 - #118775 (chore: add test case for type with generic)
 - #118782 (use `&` instead of start-process in x.ps1)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-10 01:02:42 +00:00
bors
8cd8d31369 Auto merge of #118069 - onur-ozkan:bypass_bootstrap_lock, r=Mark-Simulacrum
allow bypassing the build directory lock

As bootstrap locks its entire build directory, parallel bootstrapping for anything becomes impossible. This change enables developers to bypass the locking mechanism (with `--bypass-bootstrap-lock` flag) when it is unnecessary for their specific use case.

more context: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Build.20.28miri.3F.29.20sysroots.20in.20parallel

cc `@saethlin`
2023-12-09 23:02:05 +00:00
bors
06e02d5b25 Auto merge of #118308 - Nadrieril:sound-exhaustive-patterns-take-3, r=compiler-errors
Don't warn an empty pattern unreachable if we're not sure the data is valid

Exhaustiveness checking used to be naive about the possibility of a place containing invalid data. This could cause it to emit an "unreachable pattern" lint on an arm that was in fact reachable, as in https://github.com/rust-lang/rust/issues/117119.

This PR fixes that. We now track whether a place that is matched on may hold invalid data. This also forced me to be extra precise about how exhaustiveness manages empty types.

Note that this now errs in the opposite direction: the following arm is truly unreachable (because the binding causes a read of the value) but not linted as such. I'd rather not recommend writing a `match ... {}` that has the implicit side-effect of loading the value. [Never patterns](https://github.com/rust-lang/rust/issues/118155) will solve this cleanly.
```rust
match union.value {
    _x => unreachable!(),
}
```

I recommend reviewing commit by commit. I went all-in on the test suite because this went through a lot of iterations and I kept everything. The bit I'm least confident in is `is_known_valid_scrutinee` in `check_match.rs`.

Fixes https://github.com/rust-lang/rust/issues/117119.
2023-12-09 19:03:03 +00:00
onur-ozkan
6860654d82 allow bypassing the build directory lock
As bootstrap locks its entire build directory, parallel bootstrapping
for anything becomes impossible. This change enables developers to bypass
the locking mechanism when it is unnecessary for their specific use case.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-09 20:12:40 +03:00
bors
c722d5191c Auto merge of #117771 - tmandry:fuchsia-gha, r=Mark-Simulacrum
Build Fuchsia in CI

Fittingly, when I first put this up it was failing due to discovering an ICE in clippy (looks like fixed in https://github.com/rust-lang/rust-clippy/pull/11760), probably more fallout from recent type system changes. Other recent regressions this would have caught include

- #117455 and #117493
- #117602

Originally we discussed basing this on cargotest, but they ended up not sharing anything. Fuchsia has its own tool to manage checkouts and its own build system. What it requires is a fully "install"ed toolchain with a host and fuchsia target. We share logic from the dist-various-2 builder to build the fuchsia target.

Right now this runs clippy and skips linking a bunch of targets, since most issues we catch are in the frontend. In theory we could probably get the build CPU time down quite a bit with this approach, but right now some linked targets are creeping into the dependencies anyway and we don't have a good way of preventing that yet.

The approach is basically to get a checkout at a pinned commit and then run a [script](https://fuchsia-review.git.corp.google.com/c/fuchsia/+/943833/6/scripts/rust/build_fuchsia_from_rust_ci.sh) at a predetermined location. I would like to update that pin every few weeks. Partial checkouts are used to minimize clone time, but we don't filter out prebuilt packages.

r? `@Mark-Simulacrum`

Based on discussion in [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Putting.20Fuchsia.20in.20crater).
2023-12-09 17:00:54 +00:00
Guillaume Gomez
dd234696ed
Rollup merge of #118782 - jyn514:powershell, r=ChrisDenton
use `&` instead of start-process in x.ps1

start-process has weird parsing rules and buggy behavior. we've already had to work around them several times, and the workarounds were not complete. i wonder who could have added it HMMMMMM
```
PS C:\Users\jyn\src\rust> git log --reverse -S Start-Process x.ps1
commit 775c3c0493
Author: Jynn Nelson <github@jyn.dev>
Date:   Sun Jul 31 14:02:31 2022 -0500

    Add `x.sh` and `x.ps1` shell scripts
```

the latest broken thing is trailing backslashes:
```
$ x.ps1 t .\tests\ui\error-emitter\
```
would be transformed into
```
['t', '.\\tests\\ui\\error-emitter"']
```

rather than trying to hack around that too, abandon start-process altogether and just use `&`.

r? `@ChrisDenton`
2023-12-09 18:00:38 +01:00
Guillaume Gomez
034d73d6d7
Rollup merge of #118775 - Young-Flash:fix, r=compiler-errors
chore: add test case for type with generic

follow up https://github.com/rust-lang/rust/pull/118502
2023-12-09 18:00:37 +01:00
Guillaume Gomez
5b9e917b64
Rollup merge of #118774 - lcnr:region-refactor-uwu, r=compiler-errors
add test for inductive cycle hangs

the same pattern is already tested for coinductive cycles, but I now understand the underlying issue and want to make sure we also test it for inductive ones

r? `@compiler-errors`
2023-12-09 18:00:37 +01:00
Guillaume Gomez
cc821d3ae6
Rollup merge of #118747 - Urgau:check-cfg-freebsd-cleanup, r=onur-ozkan
Remove extra check cfg handled by libc directly

The `libc` crate has handle for quite some time now [check-cfg in it's own build script](497ac428bc/build.rs (L6-L32)).

We therefor no longer need to manually define them.
2023-12-09 18:00:36 +01:00
Guillaume Gomez
83e814f88c
Rollup merge of #117966 - lxy19980601:safe_compilation_options, r=Mark-Simulacrum
add safe compilation options

Add two options when building rustc : strip and stack protector.
If set `strip = true`, `rustc` will be stripped of symbols using `-Cstrip=symbols`.
Also can set `stack-protector` and then `rustc` will be compiled with stack protectors.
2023-12-09 18:00:36 +01:00
jyn
2cf54e9f99 use & instead of start-process in x.ps1
start-process has weird parsing rules and buggy behavior. we've already had to work around them several times, and the workarounds were not complete.
i wonder who could have added it HMMMMMM
```
PS C:\Users\jyn\src\rust> git log --reverse -S Start-Process x.ps1
commit 775c3c0493
Author: Jynn Nelson <github@jyn.dev>
Date:   Sun Jul 31 14:02:31 2022 -0500

    Add `x.sh` and `x.ps1` shell scripts
```

the latest broken thing is trailing backslashes:
```
$ x.ps1 t .\tests\ui\error-emitter\
```
would be transformed into
```
['t', '.\\tests\\ui\\error-emitter"']
```

rather than trying to hack around that too, abandon start-process altogether and just use `&`.
2023-12-09 09:46:16 -05:00
bors
08587a56f1 Auto merge of #118780 - GuillaumeGomez:rollup-nd0syaf, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #117953 (Add more SIMD platform-intrinsics)
 - #118057 (dedup for duplicate suggestions)
 - #118638 (More `rustc_mir_dataflow` cleanups)
 - #118702 (Strengthen well known check-cfg names and values test)
 - #118734 (Unescaping cleanups)
 - #118766 (Lower some forgotten spans)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-09 14:35:10 +00:00
Guillaume Gomez
fd60c5a788
Rollup merge of #118766 - compiler-errors:lower-spans, r=spastorino
Lower some forgotten spans

I wrote a HIR visitor that visited all of the spans in the HIR, and made it ICE when we have a unlowered span. That led me to discover these unlowered spans.
2023-12-09 14:05:11 +01:00
Guillaume Gomez
a1c252fccd
Rollup merge of #118734 - nnethercote:literal-cleanups, r=fee1-dead
Unescaping cleanups

Minor improvements I found while working on #118699.

r? `@fee1-dead`
2023-12-09 14:05:11 +01:00
Guillaume Gomez
78d2c8e637
Rollup merge of #118702 - Urgau:check-cfg-strengthen-well-known, r=nnethercote
Strengthen well known check-cfg names and values test

https://github.com/rust-lang/rust/pull/118494 is changing the implementation of how we expect well known check-cfg names and values, but we currently don't have a test that checks every well known only some of them.

This PR therefore strengthen our well known names/values test to include all of the configs to at least avoid unintended regressions and validate new entry.

*this PR also contains some drive-by consolidation of unexpected `target_os`, `target_arch` into a single file*

r? `@nnethercote` (maybe? feel free to re-assign)
2023-12-09 14:05:10 +01:00
Guillaume Gomez
546643c13c
Rollup merge of #118638 - nnethercote:rustc_mir_dataflow-more, r=cjgillot
More `rustc_mir_dataflow` cleanups

r? `@cjgillot`
2023-12-09 14:05:10 +01:00
Guillaume Gomez
0865eefcaf
Rollup merge of #118057 - bvanjoi:fix-118048, r=cjgillot
dedup for duplicate suggestions

Fixes #118048

An easy fix.
2023-12-09 14:05:09 +01:00
Guillaume Gomez
c57b0549af
Rollup merge of #117953 - farnoy:masked-load-store, r=workingjubilee
Add more SIMD platform-intrinsics

- [x] simd_masked_load
  - [x] LLVM codegen - llvm.masked.load
  - [x] cranelift codegen - implemented but untested
- [ ] simd_masked_store
  - [x] LLVM codegen - llvm.masked.store
  - [ ] cranelift codegen

Also added a run-pass test to test both intrinsics, and additional build-fail & check-fail to cover validation for both intrinsics
2023-12-09 14:05:09 +01:00
bors
1dfb2283d7 Auto merge of #116170 - matthewjasper:remove-thir-destruction-scopes, r=cjgillot
Don't include destruction scopes in THIR

They are not used by anyone, and add memory/performance overhead.
2023-12-09 12:38:32 +00:00
Jakub Okoński
97ae5095f5
Add simd_masked_{load,store} platform-intrinsics
This maps to the LLVM intrinsics: llvm.masked.load and llvm.masked.store
2023-12-09 12:36:08 +01:00
Urgau
4c1671674e Avoid target_os and target_arch in some check-cfg tests
as they unnecessarily clutter the diagnostic output and make the
experience of adding a new target to the compiler more painful than
it should be.

target_os and target_arch are still being tested in the
well-known-values.rs test, but in one place.
2023-12-09 11:59:46 +01:00
Urgau
bba9862b95 Strengthen well known check-cfg names and values test 2023-12-09 11:59:46 +01:00
bors
ce670339c3 Auto merge of #118771 - workingjubilee:rollup-q1p3riz, r=workingjubilee
Rollup of 7 pull requests

Successful merges:

 - #118198 (coverage: Use `SpanMarker` to improve coverage spans for `if !` expressions)
 - #118512 (Add tests related to normalization in implied bounds)
 - #118610 (update target feature following LLVM API change)
 - #118666 (coverage: Simplify the heuristic for ignoring `async fn` return spans)
 - #118737 (Extend tidy alphabetical checking to `tests/`.)
 - #118762 (Some more minor `async gen`-related nits)
 - #118764 (Make async generators fused by default)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-09 10:39:54 +00:00
lcnr
ef796db5f0 add test for inductive cycle hangs 2023-12-09 10:35:07 +00:00
Young-Flash
cb6984217f chore: add test case for type with generic 2023-12-09 17:49:40 +08:00
Jubilee
61dfb1f8d0
Rollup merge of #118764 - compiler-errors:fused-async-iterator, r=eholk
Make async generators fused by default

I actually changed my mind about this since the implementation PR landed. I think it's beneficial for `async gen` blocks to be "fused" by default -- i.e., for them to repeatedly return `Poll::Ready(None)` -- rather than panic.

We have [`FusedStream`](https://docs.rs/futures/latest/futures/stream/trait.FusedStream.html) in futures-rs to represent streams with this capability already anyways.

r? eholk
cc ```@rust-lang/wg-async,``` would like to know if anyone else has opinions about this.
2023-12-09 00:48:11 -08:00
Jubilee
402cfb17f7
Rollup merge of #118762 - compiler-errors:gen-nits, r=eholk
Some more minor `async gen`-related nits

Tiny tweaks found after `async gen` pr landed

r? eholk
2023-12-09 00:48:11 -08:00
Jubilee
ad9114125d
Rollup merge of #118737 - nnethercote:tidy-alphabetical-in-testsa, r=Nilstrieb
Extend tidy alphabetical checking to `tests/`.

This is desired for #118702.

r? ```@Nilstrieb```
2023-12-09 00:48:10 -08:00
Jubilee
feb879394a
Rollup merge of #118666 - Zalathar:body-closure, r=cjgillot
coverage: Simplify the heuristic for ignoring `async fn` return spans

The code for extracting coverage spans from MIR has a special heuristic for dealing with `async fn`, so that the function's closing brace does not have a confusing double count.

The code implementing that heuristic is currently mixed in with the code for flushing remaining spans after the main refinement loop, making the refinement code harder to understand.

We can solve that by hoisting the heuristic to an earlier stage, after the spans have been extracted and sorted but before they have been processed by the refinement loop.

The coverage tests verify that the heuristic is still effective, so coverage mappings/reports for `async fn` have not changed.

---

This PR also has the side-effect of fixing the `None some_prev` panic that started appearing after #118525.

The old code assumed that `prev` would always be present after the refinement loop. That was only true if the list of collected spans was non-empty, but prior to #118525 that didn't seem to come up in practice. After that change, the list of collected spans could be empty in some specific circumstances, leading to panics.

The new code uses an `if let` to inspect `prev`, which correctly does nothing if there is no span present.
2023-12-09 00:48:10 -08:00
Jubilee
85c9de9799
Rollup merge of #118610 - krasimirgg:llvm-18-dec, r=nikic
update target feature following LLVM API change

LLVM commit e817966718 renamed* the `unaligned-scalar-mem` target feature to `fast-unaligned-access`.

(*) technically the commit folded two previous features into one, but there are no references to the other one in rust.
2023-12-09 00:48:09 -08:00
Jubilee
8f9d8277de
Rollup merge of #118512 - spastorino:add-implied-bounds-related-tests, r=jackh726
Add tests related to normalization in implied bounds

Getting ```@aliemjay's``` tests from #109763, so we can better track what's going on in every different example.

r? ```@jackh726```
2023-12-09 00:48:09 -08:00
Jubilee
a71ab454ac
Rollup merge of #118198 - Zalathar:if-not, r=cjgillot
coverage: Use `SpanMarker` to improve coverage spans for `if !` expressions

Coverage instrumentation works by extracting source code spans from MIR. However, some kinds of syntax are effectively erased during MIR building, so their spans don't necessarily exist anywhere in MIR, making them invisible to the coverage instrumentor (unless we resort to various heuristics and hacks to recover them).

This PR introduces `CoverageKind::SpanMarker`, which is a new variant of `StatementKind::Coverage`. Its sole purpose is to represent spans that would otherwise not appear in MIR, so that the coverage instrumentor can extract them.

When coverage is enabled, the MIR builder can insert these dummy statements as needed, to improve the accuracy of spans used by coverage mappings.

Fixes #115468.

---

```@rustbot``` label +A-code-coverage
2023-12-09 00:48:08 -08:00
bors
c41669970a Auto merge of #118150 - roblabla:new-win7-targets, r=davidtwco
Add new targets {x86_64,i686}-win7-windows-msvc

This PR adds two new Tier 3 targets, x86_64-win7-windows-msvc and i686-win7-windows-msvc, that aim to support targeting Windows 7 after the `*-pc-windows-msvc` target drops support for it (slated to happen in 1.76.0).

# Tier 3 target policy

> At this tier, the Rust project provides no official support for a target, so we place minimal requirements on the introduction of targets.
>
> A proposed new tier 3 target must be reviewed and approved by a member of the compiler team based on these requirements. The reviewer may choose to gauge broader compiler team consensus via a [Major Change Proposal (MCP)](https://forge.rust-lang.org/compiler/mcp.html).
>
> A proposed target or target-specific patch that substantially changes code shared with other targets (not just target-specific code) must be reviewed and approved by the appropriate team for that shared code before acceptance.
>
>  - A 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.)

This is me, `@roblabla` on github.

> - 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.

I went with naming the target `x86_64-win7-windows-msvc`, inserting the `win7` in the vendor field (usually set to to `pc`). This is done to avoid ecosystem churn, as quite a few crates have `cfg(target_os = "windows")` or `cfg(target_env = "msvc")`, but nearly no `cfg(target_vendor = "pc")`. Since my goal is to be able to seamlessly swap to the `win7` target, I figured it'd be easier this way.

>  - 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 believe the naming is pretty explicit.

>  - If possible, use only letters, numbers, dashes and underscores for the name. Periods (`.`) are known to cause issues in Cargo.

The name comforms to this requirement.

> - 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.
>    - 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.
>    - Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. 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.
>    - "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.

As far as I understand it, this target has exactly the same legal situation as the existing Tier 1 x86_64-pc-windows-msvc.

> - 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.

Understood.

> - 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.

This target supports the whole libstd surface, since it's essentially reusing all of the x86_64-pc-windows-msvc target. Understood.

> - 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 binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

Wrote some documentation on how to build, test and cross-compile the target in the `platform-support` part. Hopefully it's enough to get started.

> - 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.

Understood.

> - 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.

Understood.

> If a tier 3 target stops meeting these requirements, or the target maintainers no longer have interest or time, or the target shows no signs of activity and has not built for some time, or removing the target would improve the quality of the Rust codebase, we may post a PR to remove it; any such PR will be CCed to the target maintainers (and potentially other people who have previously worked on the target), to check potential interest in improving the situation.

Understood.
2023-12-09 08:41:50 +00:00
bors
608f32435a Auto merge of #117873 - quininer:android-emutls, r=Amanieu
Add emulated TLS support

This is a reopen of https://github.com/rust-lang/rust/pull/96317 . many android devices still only use 128 pthread keys, so using emutls can be helpful.

Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false.

This commit has some changes to allow users to enable emutls:

1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key.
2. when using emutls, decorate symbol names to find thread local symbol correctly.
3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls.

r? `@Amanieu`
2023-12-09 05:32:35 +00:00
bors
1a3aa4ad14 Auto merge of #114136 - TennyZhuang:linked-list-retain, r=thomcc
add LinkedList::{retain,retain_mut}

Implement #114135

The API is consistent with other collections.
2023-12-09 02:38:45 +00:00
Nadrieril
c3df51a976 Some types cannot show up as the type of a pattern 2023-12-09 01:22:28 +01:00
bors
dc3a3539d5 Auto merge of #118763 - matthiaskrgr:rollup-mgyf5hp, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #117586 (Uplift the (new solver) canonicalizer into `rustc_next_trait_solver`)
 - #118502 (fix: correct the arg for 'suggest to use associated function syntax' diagnostic)
 - #118694 (Add instance evaluation and methods to read an allocation in StableMIR)
 - #118715 (privacy: visit trait def id of projections)
 - #118730 (recurse into refs when comparing tys for diagnostics)
 - #118736 (temporarily revert "ice on ambguity in mir typeck")

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-09 00:11:49 +00:00
Michael Goulet
c980fae35c Lower some forgotten coroutine spans 2023-12-09 00:10:36 +00:00
Michael Goulet
97de8fba56 Lower spans for opaque duplicated lifetimes, const infer vars 2023-12-09 00:10:36 +00:00
Michael Goulet
3818fc02c4 Lower constness span in host param 2023-12-09 00:10:36 +00:00
Nadrieril
ddef5b61f1 Don't warn an empty pattern unreachable if we're not sure the data is valid 2023-12-09 00:44:49 +01:00
Nadrieril
f5dbb54648 Track place validity 2023-12-09 00:40:00 +01:00
Nadrieril
1978168c13 Detect cycles in InhabitedPredicate::apply
This is for post-monomorphization cycles. These are only caught later
(in drop elaboration for the example that I saw), so we need to handle
them here.

This issue wasn't noticed before because exhaustiveness only checked
inhabitedness when `exhaustive_patterns` was on. The preceding commit
now check inhabitedness always, which revealed the problem.
2023-12-09 00:40:00 +01:00