Skip to content

Fix some issues with multi-target extraction#1131

Draft
sonmarcho wants to merge 2 commits intomainfrom
son/multi-target-bug
Draft

Fix some issues with multi-target extraction#1131
sonmarcho wants to merge 2 commits intomainfrom
son/multi-target-bug

Conversation

@sonmarcho
Copy link
Copy Markdown
Member

This PR was AI generated and I'm not asking to merge it: I'm opening it because it is informative.
It solves #1130

Importantly, you will note that attributes, spans and source text led to item duplication, and the agent had to filter them to solve the issue. This is of course not what we want to do, but it seems the fix below is enough to make the deduplication work. About attributes specifically: Aeneas relies on some Unknown attributes (such as verify::test) so we can't just clear them (we need a merge operation, and maybe we need to introduce the notion of target-specific attribute?).

@Nadrieril
Copy link
Copy Markdown
Member

Can you add the test case from #1130 to the test suite?

@sonmarcho
Copy link
Copy Markdown
Member Author

Can you add the test case from #1130 to the test suite?

Does that mean you want to merge this PR? (yes I can do)

@sonmarcho
Copy link
Copy Markdown
Member Author

I added the test

@Nadrieril
Copy link
Copy Markdown
Member

Does that mean you want to merge this PR?

Mostly I wanted to see the new output. If you remove the attribute and source_text stripping, does this PR still fix #1130? (I'd expect it to)

@sonmarcho
Copy link
Copy Markdown
Member Author

When removing the attribute and source_text stripping I get the following diff on the multi-targets-3-dedup.outfile:

-pub fn core::clone::impls::{impl core::clone::Clone for u32}::clone<'_0>(_1: &'_0 u32) -> u32
+pub fn core::clone::impls::{impl core::clone::Clone::aarch64-apple-darwin for u32}::clone::aarch64-apple-darwin<'_0>(_1: &'_0 u32) -> u32
 = <opaque>
 
+pub fn core::clone::impls::{impl core::clone::Clone::x86_64-pc-windows-msvc for u32}::clone::x86_64-pc-windows-msvc<'_0>(_1: &'_0 u32) -> u32
+= <opaque>
+
+pub fn core::clone::impls::{impl core::clone::Clone::i686-pc-windows-msvc for u32}::clone::i686-pc-windows-msvc<'_0>(_1: &'_0 u32) -> u32
+= <opaque>
+
+pub fn core::clone::impls::{impl core::clone::Clone::x86_64-pc-windows-msvc for u32}::clone<'_0>(_1: &'_0 u32) -> u32
+= target_dispatch {
+    x86_64-pc-windows-msvc => core::clone::impls::{impl core::clone::Clone::x86_64-pc-windows-msvc for u32}::clone::x86_64-pc-windows-msvc<'_0>,
+    aarch64-apple-darwin => core::clone::impls::{impl core::clone::Clone::aarch64-apple-darwin for u32}::clone::aarch64-apple-darwin<'_0>,
+    i686-pc-windows-msvc => core::clone::impls::{impl core::clone::Clone::i686-pc-windows-msvc for u32}::clone::i686-pc-windows-msvc<'_0>,
+}
+
 fn test_crate::clone_it<'_0>(x_1: &'_0 u32) -> u32
 {
     let _0: u32; // return
@@ -9,7 +22,7 @@ fn test_crate::clone_it<'_0>(x_1: &'_0 u32) -> u32
 
     storage_live(_2)
     _2 = &(*x_1)
-    _0 = core::clone::impls::{impl core::clone::Clone for u32}::clone<'4>(move _2)
+    _0 = core::clone::impls::{impl core::clone::Clone::x86_64-pc-windows-msvc for u32}::clone<'4>(move _2)
     storage_dead(_2)
     return
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants