Skip to content

Add contracts for all functions in Alignment #136578

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adjust test as contracts mean we no longer always get a constant
  • Loading branch information
tautschnig committed Apr 16, 2025
commit b56c78f5e348ef4c063b10a195b2a7e269e825e0
2 changes: 1 addition & 1 deletion tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ fn main() {
// CHECK: debug a => [[a:_.*]];
// We may check other inlined functions as well...

// CHECK: {{_.*}} = const Box::<[bool]>(
// CHECK: {{_.*}} = {{(const )?}}Box::<[bool]>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having to change this is problematic, since apparently the intent of the test was to ensure that this indeed turns into a constant.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I entirely agree with that. I feel like at this point we are rather exploring the impact of adding those contracts than producing final solutions.

let a: A = A { foo: Box::default() };
}