Commit graph

11068 commits

Author SHA1 Message Date
Nicholas Nethercote 9828e960ab Remove __rust_force_expr.
This was added (with a different name) to improve an error message. It
is no longer needed -- removing it changes the error message, but overall
I think the new message is no worse:
- the mention of `#` in the first line is a little worse,
- but the extra context makes it very clear what the problem is, perhaps
  even clearer than the old message,
- and the removal of the note about the `expr` fragment (an internal
  detail of `__rust_force_expr`) is an improvement.

Overall I think the error is quite clear and still far better than the
old message that prompted #61933, which didn't even mention patterns.

The motivation for this is #124141, which will cause pasted
metavariables to be tokenized and reparsed instead of the AST node being
cached. This change in behaviour occasionally has a non-zero perf cost,
and `__rust_force_expr` causes the tokenize/reparse step to occur twice.
Removing `__rust_force_expr` greatly reduces the extra overhead for the
`deep-vector` benchmark.
2024-06-25 14:35:09 +10:00
bors 433355166d Auto merge of #126745 - matthiaskrgr:rollup-xagplef, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #126095 (Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`)
 - #126629 (Migrate `run-make/compressed-debuginfo` to `rmake.rs`)
 - #126644 (Rewrite `extern-flag-rename-transitive`. `debugger-visualizer-dep-info`, `metadata-flag-frobs-symbols`, `extern-overrides-distribution` and `forced-unwind-terminate-pof` `run-make` tests to rmake)
 - #126735 (collect attrs in const block expr)
 - #126737 (Remove `feature(const_closures)` from libcore)
 - #126740 (add `needs-unwind` to UI test)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-20 18:21:01 +00:00
Matthias Krüger 7b5ed5a66c
Rollup merge of #126740 - ferrocene:ja-ui-test-needs-unwind, r=lcnr
add `needs-unwind` to UI test

the `tail-expr-lock-poisoning` UI test uses the `panic::catch_unwind` API so it relies on unwinding being implemented. this test ought not to run on targets that do not support unwinding. add the `needs-unwind` attribute to signal this
2024-06-20 18:20:14 +02:00
Matthias Krüger 2fa148e11a
Rollup merge of #126735 - bvanjoi:fix-126647, r=petrochenkov
collect attrs in const block expr

Fixes #126516
Fixes #126647

It was forgotten to collect these attributes in the const block expression.

r? `@petrochenkov`
2024-06-20 18:20:12 +02:00
Matthias Krüger bbf94b29fb
Rollup merge of #126644 - Oneirical:testla-coil, r=jieyouxu
Rewrite `extern-flag-rename-transitive`. `debugger-visualizer-dep-info`, `metadata-flag-frobs-symbols`, `extern-overrides-distribution` and `forced-unwind-terminate-pof` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

try-job: dist-x86_64-apple
2024-06-20 18:20:12 +02:00
Matthias Krüger 54e097d5ef
Rollup merge of #126629 - GuillaumeGomez:migrate-run-make-compressed-debuginfo, r=jieyouxu
Migrate `run-make/compressed-debuginfo` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? ````@jieyouxu````
2024-06-20 18:20:11 +02:00
Matthias Krüger 440504726c
Rollup merge of #126095 - Oneirical:final-testination, r=jieyouxu
Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Guaranteed to fail CI until #125736 gets merged. Will require addition of `fs_wrapper::set_permissions` in the associated module.

try-job: x86_64-msvc
2024-06-20 18:20:11 +02:00
bors cb8a7ea0ed Auto merge of #124807 - GuillaumeGomez:migrate-rustdoc-io-error, r=jieyouxu
Migrate `run-make/rustdoc-io-error` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@jieyouxu`

try-job: armhf-gnu
2024-06-20 16:09:14 +00:00
Jorge Aparicio f42fa4f6e0 add needs-unwind to UI test
the `tail-expr-lock-poisoning` UI test uses the `panic::catch_unwind`
API so it relies on unwinding being implemented. this test ought not to
run on targets that do not support unwinding. add the `needs-unwind`
attribute to signal this
2024-06-20 17:42:40 +02:00
bors 1ca578e68e Auto merge of #126736 - matthiaskrgr:rollup-rb20oe3, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #126380 (Add std Xtensa targets support)
 - #126636 (Resolve Clippy `f16` and `f128` `unimplemented!`/`FIXME`s )
 - #126659 (More status-quo tests for the `#[coverage(..)]` attribute)
 - #126711 (Make Option::as_[mut_]slice const)
 - #126717 (Clean up some comments near `use` declarations)
 - #126719 (Fix assertion failure for some `Expect` diagnostics.)
 - #126730 (Add opaque type corner case test)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-20 13:36:42 +00:00
Matthias Krüger b099c05b3a
Rollup merge of #126730 - oli-obk:opaque_type_diff_next_solver, r=lcnr
Add opaque type corner case test

r? ``@lcnr``

I can't make sense of the new solver tracing logs yet, so I just added the test without explanation.

The old solver does not yet figure out that `Foo == ()` from the where bounds. Unfortunately, even if we make it understand that, it will later try to prove `<X as Trait<'static>>::Out<Foo>: Sized` via the `is_sized_raw` query, which does not take a list of defineable opaque types, causing that check to fail with an ICE.

Thus I'm submitting this test case on its own just to ensure we handle it correctly in the future with any new solver or old solver changes.
2024-06-20 14:07:05 +02:00
Matthias Krüger f511f2b18d
Rollup merge of #126719 - nnethercote:fix-126521, r=oli-obk
Fix assertion failure for some `Expect` diagnostics.

In #120699 I moved some code dealing with `has_future_breakage` earlier in `emit_diagnostic`. Issue #126521 identified a case where that reordering was invalid (leading to an assertion failure) for some `Expect` diagnostics.

This commit partially undoes the change, by moving the handling of unstable `Expect` diagnostics earlier again. This makes `emit_diagnostic` a bit uglier, but is necessary to fix the problem.

Fixes #126521.

r? ``@oli-obk``
2024-06-20 14:07:04 +02:00
Matthias Krüger ef2e8bfcbf
Rollup merge of #126717 - nnethercote:rustfmt-use-pre-cleanups, r=jieyouxu
Clean up some comments near `use` declarations

#125443 will reformat all `use` declarations in the repository. There are a few edge cases involving comments on `use` declarations that require care. This PR cleans up some clumsy comment cases, taking us a step closer to #125443 being able to merge.

r? ``@lqd``
2024-06-20 14:07:04 +02:00
Matthias Krüger 9cbfbda165
Rollup merge of #126659 - Zalathar:test-coverage-attr, r=cjgillot
More status-quo tests for the `#[coverage(..)]` attribute

Follow-up to #126621, after I found even more weird corner-cases in the handling of the coverage attribute.

These tests reveal some inconsistencies that are tracked by #126658.
2024-06-20 14:07:02 +02:00
Matthias Krüger 586154b946
Rollup merge of #126380 - SergioGasquez:feat/std-xtensa, r=davidtwco
Add std Xtensa targets support

Adds std Xtensa targets. This enables using Rust on ESP32, ESP32-S2 and ESP32-S3 chips.

Tier 3 policy:

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

`@MabezDev,` `@ivmarkov` and I (`@SergioGasquez)` will maintain the targets.

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

The target triple is consistent with other 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.
> If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known
to cause issues in Cargo.

We follow the same naming convention as other targets.

> 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 does not introduce any legal issues.

> The target must not introduce license incompatibilities.

There are no license incompatibilities

> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).
Everything added is under that licenses

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

Requirements are not changed for any other target.

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

The linker used by the targets is the GCC linker from the GCC toolchain cross-compiled for Xtensa.
GNU GPL.

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

No such terms exist for this target

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

The targets implement libStd almost in its entirety, except for the missing support for process, as
this is a bare metal platform. The process `sys\unix` module is currently stubbed to return "not
implemented" errors.

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

Here is how to build for the target https://docs.esp-rs.org/book/installation/riscv-and-xtensa.html
and it also covers how to run binaries on the target.

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

No other targets should be affected

> Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends
from any host target.

It can produce assembly, but it requires a custom LLVM with Xtensa support
(https://github.com/espressif/llvm-project/). The patches are trying to be upstreamed
(https://github.com/espressif/llvm-project/issues/4)
2024-06-20 14:07:01 +02:00
Guillaume Gomez b30ef41833 Ignore arm targets as well for run-make/rustdoc-io-error tests 2024-06-20 14:06:37 +02:00
bohan 1e42bb606d collect attrs in const block expr 2024-06-20 19:59:27 +08:00
bors 1aaab8b9f8 Auto merge of #116088 - nbdd0121:unwind, r=Amanieu,RalfJung
Stabilise `c_unwind`

Fix #74990
Fix #115285 (that's also where FCP is happening)

Marking as draft PR for now due to `compiler_builtins` issues

r? `@Amanieu`
2024-06-20 11:22:59 +00:00
Oli Scherer 53f10b936b Add opaque type test 2024-06-20 09:20:45 +00:00
bors 1d96de2a20 Auto merge of #126409 - pacak:incr-uplorry, r=michaelwoerister
Trying to address an incremental compilation issues

This pull request contains two independent changes, one makes it so when `try_force_from_dep_node` fails to recover a query - it marks the node as "red" instead of "green" and the second one makes Debug impl for `DepNode` less panicky if it encounters something from the previous compilation that doesn't map to anything in the current one.

I'm not 100% confident that this is the correct approach, but so far I managed to find a bunch of comments suggesting that some things are allowed to fail in a certain way and changes I made are allowing for those things to fail this way and it fixes all the small reproducers I managed to find.

Compilation panic this pull request avoids is caused by an automatically generated code on an associated type and it is not happening if something else marks it as outdated first (or close like that, but scenario is quite obscure).

Fixes https://github.com/rust-lang/rust/issues/107226
Fixes https://github.com/rust-lang/rust/issues/125367
2024-06-20 09:06:16 +00:00
Zalathar ebb3aa0d46 Also test that yes/no must be bare words 2024-06-20 17:11:53 +10:00
Zalathar 388aea471f More status-quo tests for the #[coverage(..)] attribute
These tests reveal some inconsistencies that are tracked by
<https://github.com/rust-lang/rust/issues/126658>.
2024-06-20 17:11:53 +10:00
bors 1208eddaff Auto merge of #126726 - matthiaskrgr:rollup-ppe8ve3, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #126620 (Actually taint InferCtxt when a fulfillment error is emitted)
 - #126649 (Fix `feature = "nightly"` in the new trait solver)
 - #126652 (Clarify that anonymous consts still do introduce a new scope)
 - #126703 (reword the hint::blackbox non-guarantees)
 - #126708 (Minimize `can_begin_literal_maybe_minus` usage)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-20 06:54:19 +00:00
Matthias Krüger 03d558f5b6
Rollup merge of #126652 - Manishearth:anon-const-scope, r=bjorn3,Urgau
Clarify that anonymous consts still do introduce a new scope

See https://github.com/rust-lang/rust/issues/120363#issuecomment-2177064702

This error message is misleading: it's trying to say that `const _ : () = ...` is a workaround for the lint, but by saying that anonymous constants are treated as being in the parent scope, it makes them appear useless for scope-hiding.

They *are* useful for scope-hiding, they are simply treated as part of the parent scope when it comes to this lint.
2024-06-20 07:52:44 +02:00
Matthias Krüger e7be3562b7
Rollup merge of #126620 - oli-obk:taint_errors, r=fee1-dead
Actually taint InferCtxt when a fulfillment error is emitted

And avoid checking the global error counter

fixes #122044
fixes #123255
fixes #123276
fixes #125799
2024-06-20 07:52:43 +02:00
bors 54fcd5bb92 Auto merge of #126534 - Rejyr:comment-section-migration, r=jieyouxu
Migrate `run-make/comment-section` to `rmake.rs`

Part of #121876.

r? `@jieyouxu`

try-job: x86_64-msvc
try-job: aarch64-gnu
try-job: aarch64-apple
2024-06-20 04:40:44 +00:00
Manish Goregaokar e8a9af9ad9 Clarify that anonymous consts still do introduce a new scope 2024-06-19 18:34:15 -07:00
Nicholas Nethercote 19b7192c72 Fix assertion failure for some Expect diagnostics.
In #120699 I moved some code dealing with `has_future_breakage` earlier
in `emit_diagnostic`. Issue #126521 identified a case where that
reordering was invalid (leading to an assertion failure) for some `Expect`
diagnostics.

This commit partially undoes the change, by moving the handling of
unstable `Expect` diagnostics earlier again. This makes
`emit_diagnostic` a bit uglier, but is necessary to fix the problem.

Fixes #126521.
2024-06-20 10:17:40 +10:00
Nicholas Nethercote b5a5647ee0 Move an EMIT_MIR comment.
This belongs on a function, not a `use` declaration.
2024-06-20 09:23:20 +10:00
Nicholas Nethercote b104fbec85 Add blank lines after module-level // comments.
Similar to the previous commit.
2024-06-20 09:23:20 +10:00
bors 3d5d7a24f7 Auto merge of #126308 - scottmcm:ban-some-coercions, r=saethlin
Ban `ArrayToPointer` and `MutToConstPointer` from runtime MIR

Zulip conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/CastKind.3A.3APointerCoercion.20in.20Runtime.20MIR/near/443955195>

Apparently MIR borrowck cares about at least one of these for checking variance.

In runtime MIR, though, there's no need for them as `PtrToPtr` does the same thing.

(Banning them simplifies passes like GVN that no longer need to handle multiple cast possibilities.)

r? mir
2024-06-19 22:34:11 +00:00
Gary Guo bb2716effd Fix wasm_exceptions test 2024-06-19 21:26:48 +01:00
Jerry Wang f44494cb3a
Migrate run-make/comment-section to rmake.rs 2024-06-19 15:55:57 -04:00
bors d8a38b0002 Auto merge of #119127 - joboet:array_repeat, r=scottmcm
Implement `array::repeat`

See rust-lang/libs-team#310.

I've decided to make the function use the input value as last element instead of cloning it to every position and dropping it, and to make this part of the API so that callers are not surprised by this behaviour.

TODO: open a tracking issue. I'll wait for the ACP to be accepted, first.

`@rustbot` label +T-libs-api +T-libs
r? libs
2024-06-19 18:47:04 +00:00
Oneirical e7ea063622 rewrite forced-unwind-terminate-pof to rmake 2024-06-19 14:39:09 -04:00
Scott McMurray 4630d1b23b Ban ArrayToPointer and MutToConstPointer from runtime MIR
Apparently MIR borrowck cares about at least one of these for checking variance.

In runtime MIR, though, there's no need for them as `PtrToPtr` does the same thing.

(Banning them simplifies passes like GVN that no longer need to handle multiple cast possibilities.)
2024-06-19 10:44:01 -07:00
bors 5c8459f1ec Auto merge of #126691 - fee1-dead-contrib:rollup-v4vtowh, r=fee1-dead
Rollup of 5 pull requests

Successful merges:

 - #126668 (Remove now NOP attrs `#[rustc_dump{,_env}_program_clauses]`)
 - #126674 (Allow tracing through item_bounds query invocations on opaques)
 - #126675 (Change a `DefineOpaqueTypes::No` to `Yes` in diagnostics code)
 - #126681 (Rework doc-test attribute documentation example)
 - #126684 (Migrate `run-make/glibc-staticlib-args` to `rmake.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-19 16:10:30 +00:00
Oneirical b3c51323b5 make assert_stderr_contains print its contents on panic 2024-06-19 11:50:22 -04:00
joboet 0aa3310a9a
update codegen test for array::repeat 2024-06-19 17:48:05 +02:00
joboet 1a8b0d7c53
add codegen test for array::repeat 2024-06-19 17:29:54 +02:00
Oli Scherer e4c9a8cf9b Const generic parameters aren't bounds, even if we end up erroring because of the bound that binds the parameter's type 2024-06-19 14:58:29 +00:00
fee1-dead 9e8a7a87e4
Rollup merge of #126684 - GuillaumeGomez:migrate-run-make-glibc-staticlib-args, r=Kobzol
Migrate `run-make/glibc-staticlib-args` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? ``@jieyouxu``
2024-06-19 22:51:06 +08:00
bors 894f7a4ba6 Auto merge of #126678 - nnethercote:fix-duplicated-attrs-on-nt-expr, r=petrochenkov
Fix duplicated attributes on nonterminal expressions

This PR fixes a long-standing bug (#86055) whereby expression attributes can be duplicated when expanded through declarative macros.

First, consider how items are parsed in declarative macros:
```
Items:
- parse_nonterminal
  - parse_item(ForceCollect::Yes)
    - parse_item_
      - attrs = parse_outer_attributes
      - parse_item_common(attrs)
        - maybe_whole!
        - collect_tokens_trailing_token
```
The important thing is that the parsing of outer attributes is outside token collection, so the item's tokens don't include the attributes. This is how it's supposed to be.

Now consider how expression are parsed in declarative macros:
```
Exprs:
- parse_nonterminal
  - parse_expr_force_collect
    - collect_tokens_no_attrs
      - collect_tokens_trailing_token
        - parse_expr
          - parse_expr_res(None)
            - parse_expr_assoc_with
              - parse_expr_prefix
                - parse_or_use_outer_attributes
                - parse_expr_dot_or_call
```
The important thing is that the parsing of outer attributes is inside token collection, so the the expr's tokens do include the attributes, i.e. in `AttributesData::tokens`.

This PR fixes the bug by rearranging expression parsing to that outer attribute parsing happens outside of token collection. This requires a number of small refactorings because expression parsing is somewhat complicated. While doing so the PR makes the code a bit cleaner and simpler, by eliminating `parse_or_use_outer_attributes` and `Option<AttrWrapper>` arguments (in favour of the simpler `parse_outer_attributes` and `AttrWrapper` arguments), and simplifying `LhsExpr`.

r? `@petrochenkov`
2024-06-19 13:58:21 +00:00
Gary Guo 4c4d62d74f Fix non-x86 tests 2024-06-19 13:54:56 +01:00
Gary Guo 9d2b932d71 Fix broken aarch64 unwind test 2024-06-19 13:54:55 +01:00
Gary Guo 5812b1fd12 Remove c_unwind from tests and fix tests 2024-06-19 13:54:55 +01:00
Guillaume Gomez 0c2bfd913e Migrate run-make/glibc-staticlib-args to rmake.rs 2024-06-19 13:57:55 +02:00
Michael Baikov db5ed4bd79 Allow for try_force_from_dep_node to fail
The way it is implemented currently try_force_from_dep_node returns true
as long as there's a function to force the query. It wasn't this way
from the beginning, earlier version was producing forcing result and it
was changed in https://github.com/rust-lang/rust/pull/89978, I couldn't
find any comments addressing this change.

One way it can fail is by failing to recover the query in
DepNodeParams::recover - when we are trying to query something that no
longer exists in the current environment
2024-06-19 07:21:41 -04:00
bors 3186d17d56 Auto merge of #126679 - fmease:rollup-njrv2py, r=fmease
Rollup of 6 pull requests

Successful merges:

 - #125447 (Allow constraining opaque types during subtyping in the trait system)
 - #125766 (MCDC Coverage: instrument last boolean RHS operands from condition coverage)
 - #125880 (Remove `src/tools/rust-demangler`)
 - #126154 (StorageLive: refresh storage (instead of UB) when local is already live)
 - #126572 (override user defined channel when using precompiled rustc)
 - #126662 (Unconditionally warn on usage of `wasm32-wasi`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-19 11:09:31 +00:00
León Orell Valerian Liehr a7cf6ece62
Rollup merge of #125766 - RenjiSann:fresh-mcdc-branch-on-bool, r=nnethercote
MCDC Coverage: instrument last boolean RHS operands from condition coverage

Fresh PR from #124652

--

This PR ensures that the top-level boolean expressions that are not part of the control flow are correctly instrumented thanks to condition coverage.

See discussion on https://github.com/rust-lang/rust/issues/124120.
Depends on `@Zalathar` 's condition coverage implementation #125756.
2024-06-19 13:04:57 +02:00