You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that libraries re-export the ifaces/impls of libraries they're using, which triggers a duplicate symbol error when libraries are used in a diamond shaped pattern.
The text was updated successfully, but these errors were encountered:
This is no longer a duplicate symbol error, but has progressed to being a type error. The problem is that resolve adds an extra _impl into the iscopes list for b's re-export of to_str. I think this is a resolve bug: resolve shouldn't add an _impl twice in two different scopes for an impl with the same def_id. I was able to fix it by making typeck::check::method::lookup::add_candidates_from_scope remove duplicate entries from the iscopes -- but that was a terrible performance regression, and anyway, resolve shouldn't add the same def_id twice.
I checked in the test case as src/test/run-pass/issue-2242-d.rs. Reassigning to @pcwalton , who can hopefully make sure the resolve rewrite doesn't reproduce this bug :-)
Add rustfmt::skip to some files
Extracted from rust-lang/miri#2097.
Five of the files being skipped here are because rustfmt is buggy (rust-lang/rustfmt#5391; see the error messages below). The other two have clearly preferable manual formatting.
```console
error[internal]: left behind trailing whitespace
--> tests/fail/validity/transmute_through_ptr.rs:18:18:1
|
18 |
| ^^^^
|
warning: rustfmt has failed to format. See previous 1 errors.
error[internal]: left behind trailing whitespace
--> tests/fail/stacked_borrows/illegal_read2.rs:10:10:1
|
10 |
| ^^^^
|
warning: rustfmt has failed to format. See previous 1 errors.
error[internal]: left behind trailing whitespace
--> tests/fail/stacked_borrows/illegal_read5.rs:15:15:1
|
15 |
| ^^^^
|
warning: rustfmt has failed to format. See previous 1 errors.
error[internal]: left behind trailing whitespace
--> tests/fail/stacked_borrows/illegal_read1.rs:10:10:1
|
10 |
| ^^^^
|
warning: rustfmt has failed to format. See previous 1 errors.
error[internal]: left behind trailing whitespace
--> /git/miri/tests/fail/erroneous_const2.rs:9:9:1
|
9 |
| ^^^^
|
warning: rustfmt has failed to format. See previous 1 errors.
```
BoxyUwU
pushed a commit
to BoxyUwU/rust
that referenced
this issue
Feb 11, 2025
Here's an example of the bug:
https://gist.github.com/2421363
It seems that libraries re-export the ifaces/impls of libraries they're using, which triggers a duplicate symbol error when libraries are used in a diamond shaped pattern.
The text was updated successfully, but these errors were encountered: