We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
In this test num::Num2::from_int2 can't be resolved. If all defined in the same crate then it's fine.
num::Num2::from_int2
static_fn_num_aux.rs
pub mod num { pub trait Num2 { static pure fn from_int2(n: int) -> self; } } pub mod float { impl float: num::Num2 { static pure fn from_int2(n: int) -> float { return n as float; } } }
static-fn-num.rs
// aux-build:static_fn_num_aux.rs extern mod mycore(name ="static_fn_num_aux"); use mycore::num; fn main() { let _1:float = num::Num2::from_int2(1i); }
/home/brian/dev/rust/src/test/run-pass/static-fn-num.rs:35:19: 35:39 error: not a module: Num2 /home/brian/dev/rust/src/test/run-pass/static-fn-num.rs:35 let _1:float = num::Num2::from_int2(1i); ^~~~~~~~~~~~~~~~~~~~ /home/brian/dev/rust/src/test/run-pass/static-fn-num.rs:35:19: 35:39 error: use of undeclared module `num::Num2` /home/brian/dev/rust/src/test/run-pass/static-fn-num.rs:35 let _1:float = num::Num2::from_int2(1i); ^~~~~~~~~~~~~~~~~~~~ /home/brian/dev/rust/src/test/run-pass/static-fn-num.rs:35:19: 35:39 error: unresolved name: num::Num2::from_int2 /home/brian/dev/rust/src/test/run-pass/static-fn-num.rs:35 let _1:float = num::Num2::from_int2(1i); ^~~~~~~~~~~~~~~~~~~~ error: aborting due to 3 previous errors
The text was updated successfully, but these errors were encountered:
Yes, this is a bit of a pain.
foo.rs
#[link(name = "foo", vers = "0.1")]; #[crate_type = "lib"]; pub trait Foo { static pub fn foo() -> self; } pub impl int: Foo { static pub fn foo() -> int { 42 } }
bar.rs
extern mod foo; use foo::Foo; fn main() { assert 42 == Foo::foo(); }
error
$ rustc foo.rs warning: no debug symbols in executable (-arch x86_64) $ rustc bar.rs -L . bar.rs:5:17: 5:25 error: unresolved name bar.rs:5 assert 42 == Foo::foo(); ^~~~~~~~ bar.rs:5:17: 5:25 error: use of undeclared module `Foo` bar.rs:5 assert 42 == Foo::foo(); ^~~~~~~~ bar.rs:5:17: 5:25 error: unresolved name: Foo::foo bar.rs:5 assert 42 == Foo::foo(); ^~~~~~~~ error: aborting due to 3 previous errors
Sorry, something went wrong.
7ca9436
Merge pull request rust-lang#4097 from rust-lang/rustup-2024-12-18
955ef09
Automatic Rustup
No branches or pull requests
In this test
num::Num2::from_int2
can't be resolved. If all defined in the same crate then it's fine.static_fn_num_aux.rs
static-fn-num.rs
The text was updated successfully, but these errors were encountered: