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
$ rustc -L /tmp/ ././tests/function_arg_run.rs -o /tmp/main
tests/function_arg_run.rs:7:26: 7:36 error: unresolved name `foo::apply`.
tests/function_arg_run.rs:7 unsafe { println!("{}", foo::apply(double, 2)) }
^~~~~~~~~~
note: in expansion of format_args!
<std macros>:2:23: 2:77 note: expansion site
<std macros>:1:1: 3:2 note: in expansion of println!
tests/function_arg_run.rs:7:11: 7:50 note: expansion site
But sometimes the code compiles just fine.
The reason seems to lie in the rustc -o /tmp/libfoo.rlib function_arg.rs command.
When I run into the "unresolved name" error, the /tmp/libfoo.rlib has a size of 11012 bytes and does not contain the string "apply".
In the case where everything just compiles fine, /tmp/libfoo.rlib is 4828 bytes and contains "apply" three times:
@manuels This bug is extremely old, and nobody has reported anything similar since you've opened it. With some minor updates, your sample compiles fine for me every time, but so much has changed since you filed this bug that I think I'm going to give it a close.
If you're still seeing this, please let me know and we can try to get something that reproduces. Thanks!
I have two rust source files and one c source code file (see this gist).
I compile the code like this:
Most of the times I get this error:
But sometimes the code compiles just fine.
The reason seems to lie in the
rustc -o /tmp/libfoo.rlib function_arg.rs
command.When I run into the "unresolved name" error, the
/tmp/libfoo.rlib
has a size of 11012 bytes and does not contain the string "apply".In the case where everything just compiles fine,
/tmp/libfoo.rlib
is 4828 bytes and contains "apply" three times:I do not change a single line in the source code but the compiler sometimes results in different output files, which is really strange.
I use these versions:
The text was updated successfully, but these errors were encountered: