Skip to content

Unrelated changes make multiple-definitions test fail spuriously #87084

Closed

Description

The test was originally added in #86419, see the comments under that for more discussion.

#86922 and #86857 fails with this diff:

10 error: multiple definitions of external function `f` from library `foo.dll` have different calling conventions
-   --> $DIR/multiple-definitions.rs:8:5
12    |
12    |
- LL |     fn f(x: i32);
-    |     ^^^^^^^^^^^^^
+ LL |         fn f(x: i32);

#87075 was opened, removing the ^^^ and adding indentation (I did not see that it suggested removing --> $DIR/...). It fails with this diff:

10 error: multiple definitions of external function `f` from library `foo.dll` have different calling conventions
12    |
12    |
- LL |         fn f(x: i32);
+ LL |     fn f(x: i32);
14 
15 error: aborting due to previous error; 1 warning emitted

I just want to say that I don't think there was some nondeterministic code causing the span to be different (at least in the file that emitted the diagnostic), as shown on these lines, where they get sorted, deterministically:

imports.sort_unstable_by_key(|x: &DllImport| x.name.as_str());
(lib_name, imports)
})
.collect::<Vec<_>>();
result.sort_unstable_by(|a: &(String, Vec<DllImport>), b: &(String, Vec<DllImport>)| {

@rustbot label A-spurious C-bug T-compiler

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

Metadata

Assignees

Labels

A-spuriousArea: Spurious failures in builds (spuriously == for no apparent reason)C-bugCategory: This is a bug.F-raw_dylib`#![feature(raw_dylib)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions