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 5 pull requests #117481

Closed
wants to merge 37 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

rmehri01 and others added 7 commits October 31, 2023 11:58
Currently the parts of session initialization that happen within
`rustc_interface` are split between `run_compiler` and `create_session`.
This split isn't necessary and obscures what's happening.

This commit merges the two functions. I think a single longer function
is much clearer than splitting this code across two functions in
different modules, especially when `create_session` has 13 parameters,
and is misnamed (it also creates the codegen backend). The net result is
43 fewer lines of code.
Clean up unchecked_math, separate out unchecked_shifts

Tracking issue: rust-lang#85122

Changes:

1. Remove `const_inherent_unchecked_arith` flag and make const-stability flags the same as the method feature flags. Given the number of other unsafe const fns already stabilised, it makes sense to just stabilise these in const context when they're stabilised.
2. Move `unchecked_shl` and `unchecked_shr` into a separate `unchecked_shifts` flag, since the semantics for them are unclear and they'll likely be stabilised separately as a result.
3. Add an `unchecked_neg` method exclusively to signed integers, under the `unchecked_neg` flag. This is because it's a new API and probably needs some time to marinate before it's stabilised, and while it *would* make sense to have a similar version for unsigned integers since `checked_neg` also exists for those there is absolutely no case where that would be a good idea, IMQHO.

The longer-term goal here is to prepare the `unchecked_math` methods for an FCP and stabilisation since they've existed for a while, their semantics are clear, and people seem in favour of stabilising them.
…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
…h-on-panic, r=TaKO8Ki

Don't emit delayed good-path bugs on panic

This should fix rust-lang#117381, cc `@RalfJung`

As opposed to delayed bugs, delayed *good path* bugs really don't make sense to show on panics.
…ck-suggestions, r=compiler-errors

Refactor: move suggestion functions from demand to suggestions

follow-up from
rust-lang#116841 (comment)
…li-obk

Inline and remove `create_session`.

Currently the parts of session initialization that happen within `rustc_interface` are split between `run_compiler` and `create_session`. This split isn't necessary and obscures what's happening.

This commit merges the two functions. I think a single longer function is much clearer than splitting this code across two functions in different modules, especially when `create_session` has 13 parameters, and is misnamed (it also creates the codegen backend). The net result is 43 fewer lines of code.

r? `@oli-obk`
@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 1, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Nov 1, 2023

📌 Commit d46dcdf 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 Nov 1, 2023
@bors
Copy link
Contributor

bors commented Nov 1, 2023

⌛ Testing commit d46dcdf with merge 73ecdfb...

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

Rollup of 5 pull requests

Successful merges:

 - rust-lang#115626 (Clean up unchecked_math, separate out unchecked_shifts)
 - rust-lang#117029 (Add FileCheck annotations to MIR-opt inlining tests )
 - rust-lang#117397 (Don't emit delayed good-path bugs on panic)
 - rust-lang#117401 (Refactor: move suggestion functions from demand to suggestions)
 - rust-lang#117475 (Inline and remove `create_session`.)

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:4066: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

@bors
Copy link
Contributor

bors commented Nov 1, 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 Nov 1, 2023
@matthiaskrgr matthiaskrgr deleted the rollup-37t4q30 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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants