Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #117125

Closed
wants to merge 44 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

celinval and others added 14 commits October 23, 2023 12:11
Note: We do not expect to provide internalizing methods for all
StableMIR constructs. They exist only to help migrating efforts to allow
users to mix StableMIR and internal constructs.
This flag has to be used in combination with `-Zunstable-options`,
and is added in advance of adding branch coverage instrumentation.
…esleywiser

Introduce `-C instrument-coverage=branch` to gate branch coverage

This was extracted from rust-lang#115061 and can land independently from other coverage related work.

The flag is unused for now, but is added in advance of adding branch coverage support.
It is an unstable, nightly only flag that needs to be used in combination with `-Zunstable-options`, like so: `-Zunstable-options -C instrument-coverage=branch`.

The goal is to develop branch coverage as an unstable opt-in feature first, before it matures and can be turned on by default.
…tics-7, r=oli-obk

Migrate diagnostics in `rustc_hir_analysis/src/coherence/orphan.rs`

r? `@compiler-errors`
Avoid unnecessary renumbering during borrowck

Currently, after renumbering there are always unused `RegionVid`s if the return type contains any regions, this is due to `visit_ty` being called twice on the same `Ty`: once with `TyContext::ReturnTy` and once with `TyContext::LocalDecl { local: _0 }`. This PR skips renumbering the first time around.
Add method to convert internal to stable constructs

This is an alternative implementation to rust-lang#116999. I believe we can still improve the logic a bit here, but I wanted to see which direction we should go first.

In this implementation, the API is simpler and we keep Tables somewhat private. The definition is still public though, since we have to expose the Stable trait. However, there's a cost of keeping another thread-local and using `Rc`, but I'm hoping it will be a small cost.

r? `@oli-obk`
r? `@spastorino`
…tests, r=cjgillot

Add FileCheck annotations to MIR-opt inlining tests

Part of rust-lang#116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`.

I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop.

r? cjgillot
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Oct 24, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Oct 24, 2023

📌 Commit b90e06e has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 24, 2023
@bors
Copy link
Contributor

bors commented Oct 24, 2023

⌛ Testing commit b90e06e with merge 755b52e...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 24, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#116094 (Introduce `-C instrument-coverage=branch` to gate branch coverage)
 - rust-lang#116396 (Migrate diagnostics in `rustc_hir_analysis/src/coherence/orphan.rs`)
 - rust-lang#116792 (Avoid unnecessary renumbering during borrowck)
 - rust-lang#116943 (Add target features for LoongArch)
 - rust-lang#117010 (Add method to convert internal to stable constructs)
 - rust-lang#117029 (Add FileCheck annotations to MIR-opt inlining tests )

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [mir-opt] tests/mir-opt/inline/inline_coroutine.rs stdout ----
4   fn main() -> () {
5       let mut _0: ();
6       let _1: std::ops::CoroutineState<i32, bool>;
-       let mut _2: std::pin::Pin<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}>;
-       let mut _3: &mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8};
-       let mut _4: {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8};
+       let mut _2: std::pin::Pin<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>;
+       let mut _3: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
+       let mut _4: {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
10 +     let mut _5: bool;
11       scope 1 {
12           debug _r => _1;
13       }
13       }
14 +     scope 2 (inlined g) {
15 +     }
- +     scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}>::new) {
+ +     scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) {
17 +         debug pointer => _3;
18 +         scope 4 {
- +             scope 5 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}>::new_unchecked) {
+ +             scope 5 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) {
20 +                 debug pointer => _3;
22 +         }

23 +     }
23 +     }
24 +     scope 6 (inlined g::{closure#0}) {
25 +         debug a => _5;
- +         let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8};
+ +         let mut _6: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8};
27 +         let mut _7: u32;
28 +         let mut _8: i32;

34           StorageLive(_3);
35           StorageLive(_4);
35           StorageLive(_4);
36 -         _4 = g() -> [return: bb1, unwind unreachable];
- +         _4 = {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8 (#0)};
+ +         _4 = {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8 (#0)};
38 +         _3 = &mut _4;
- +         _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}> { pointer: move _3 };
+ +         _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}> { pointer: move _3 };
40 +         StorageDead(_3);
41 +         StorageLive(_5);
42 +         _5 = const false;
43 +         StorageLive(_6);
44 +         StorageLive(_7);
44 +         StorageLive(_7);
- +         _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8});
+ +         _6 = (_2.0: &mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8});
46 +         _7 = discriminant((*_6));
47 +         switchInt(move _7) -> [0: bb3, 1: bb7, 3: bb8, otherwise: bb9];

49   
50       bb1: {
51 -         _3 = &mut _4;
51 -         _3 = &mut _4;
- -         _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:17:5: 17:8}>::new(move _3) -> [return: bb2, unwind unreachable];
+ -         _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new(move _3) -> [return: bb2, unwind unreachable];
53 +         StorageDead(_7);
54 +         StorageDead(_6);
55 +         StorageDead(_5);
59   
60       bb2: {
61 -         StorageDead(_3);
61 -         StorageDead(_3);
- -         _1 = <{coroutine@$DIR/inline_coroutine.rs:17:5: 17:8} as Coroutine<bool>>::resume(move _2, const false) -> [return: bb3, unwind unreachable];
+ -         _1 = <{coroutine@$DIR/inline_coroutine.rs:19:5: 19:8} as Coroutine<bool>>::resume(move _2, const false) -> [return: bb3, unwind unreachable];
63 +         StorageDead(_4);
64 +         _0 = const ();
65 +         StorageDead(_1);
thread '[mir-opt] tests/mir-opt/inline/inline_coroutine.rs' panicked at src/tools/compiletest/src/runtest.rs:4070:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- [mir-opt] tests/mir-opt/inline/inline_retag.rs stdout ----
40           Retag(_9);
41           _7 = &(*_9);
42           _6 = &(*_7);
- -         _0 = move _2(move _3, move _6) -> [return: bb1, unwind continue];
+ -         _0 = move _2(move _3, move _6) -> [return: bb1, unwind unreachable];
45 - 
46 -     bb1: {

thread '[mir-opt] tests/mir-opt/inline/inline_retag.rs' panicked at src/tools/compiletest/src/runtest.rs:4070:21:
thread '[mir-opt] tests/mir-opt/inline/inline_retag.rs' panicked at src/tools/compiletest/src/runtest.rs:4070:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/inline/inline_retag.bar.Inline.diff

failures:
    [mir-opt] tests/mir-opt/inline/inline_coroutine.rs
    [mir-opt] tests/mir-opt/inline/inline_retag.rs

@bors
Copy link
Contributor

bors commented Oct 24, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 24, 2023
@matthiaskrgr matthiaskrgr deleted the rollup-cgreygq branch March 16, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants