hackndev / zinc

The bare metal stack for rust
zinc.rs
Apache License 2.0
1k stars 100 forks source link

Could not compile platformtree and core #339

Closed stefanhoelzl closed 9 years ago

stefanhoelzl commented 9 years ago

I tried to setup a project using zinc I ran into issues compiling core and platformtree

I use this command to build my project

cargo build --release --target=thumbv7em-none-eabi

and I get this error message

/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:256:35: 256:46 error: no method named `downgrade` found for type `&alloc::rc::Rc<node::Node>` in the current scope
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:256   depends_on.deref_mut().push(dep.downgrade());
                                                                                                                                      ^~~~~~~~~~~
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:256:35: 256:46 note: found defined static methods, maybe a `self` is missing?
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:256:35: 256:46 note: candidate #1 is defined in an impl for the type `alloc::rc::Rc<_>`
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:256   depends_on.deref_mut().push(dep.downgrade());
                                                                                                                                      ^~~~~~~~~~~
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:259:28: 259:39 error: no method named `downgrade` found for type `&alloc::rc::Rc<node::Node>` in the current scope
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:259   rev_depends_on.push(node.downgrade());
                                                                                                                               ^~~~~~~~~~~
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:259:28: 259:39 note: found defined static methods, maybe a `self` is missing?
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:259:28: 259:39 note: candidate #1 is defined in an impl for the type `alloc::rc::Rc<_>`
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/builder/mod.rs:259   rev_depends_on.push(node.downgrade());
                                                                                                                               ^~~~~~~~~~~
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/node.rs:109:21: 109:32 error: no method named `downgrade` found for type `alloc::rc::Rc<node::Node>` in the current scope
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/node.rs:109     let weak = node.downgrade();
                                                                                                                 ^~~~~~~~~~~
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/node.rs:109:21: 109:32 note: found defined static methods, maybe a `self` is missing?
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/node.rs:109:21: 109:32 note: candidate #1 is defined in an impl for the type `alloc::rc::Rc<_>`
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/node.rs:109     let weak = node.downgrade();
                                                                                                                 ^~~~~~~~~~~
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:129:40: 129:51 error: no method named `downgrade` found for type `&alloc::rc::Rc<node::Node>` in the current scope
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:129             map.insert(name.clone(), n.downgrade());
                                                                                                                                      ^~~~~~~~~~~
note: in expansion of for loop expansion
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:105:5: 134:6 note: expansion site
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:129:40: 129:51 note: found defined static methods, maybe a `self` is missing?
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:129:40: 129:51 note: candidate #1 is defined in an impl for the type `alloc::rc::Rc<_>`
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:129             map.insert(name.clone(), n.downgrade());
                                                                                                                                      ^~~~~~~~~~~
note: in expansion of for loop expansion
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:105:5: 134:6 note: expansion site
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:208:26: 208:37 error: no method named `downgrade` found for type `alloc::rc::Rc<node::Node>` in the current scope
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:208     let weak_node = node.downgrade();
                                                                                                                        ^~~~~~~~~~~
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:208:26: 208:37 note: found defined static methods, maybe a `self` is missing?
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:208:26: 208:37 note: candidate #1 is defined in an impl for the type `alloc::rc::Rc<_>`
/Users/stefan/.cargo/git/checkouts/zinc-29067562b67e219e/master/platformtree/src/parser.rs:208     let weak_node = node.downgrade();
                                                                                                                        ^~~~~~~~~~~
   Compiling syntaxext_lint v0.1.1
error: aborting due to 5 previous errors
Build failed, waiting for other jobs to finish...
Could not compile `platformtree`.

When I remove platformtree from my dependencies, I get another error compiling core

/Users/stefan/.cargo/git/checkouts/rust-libcore-a3e1d25b35d5cd12/master/rust/src/libcore/lib.rs:125:9: 125:16 error: file for module `prelude` found at both prelude.rs and prelude/mod.rs
/Users/stefan/.cargo/git/checkouts/rust-libcore-a3e1d25b35d5cd12/master/rust/src/libcore/lib.rs:125 pub mod prelude;
                                                                                                            ^~~~~~~
/Users/stefan/.cargo/git/checkouts/rust-libcore-a3e1d25b35d5cd12/master/rust/src/libcore/lib.rs:125:9: 125:16 help: delete or rename one of them to remove the ambiguity

My Cargo.tom looks like this:

[package]
name = "simple_project"
version = "0.0.1"

[dependencies.zinc]
git = "https://github.com/hackndev/zinc.git"
features = ["mcu_stm32f4"]

[dependencies.macro_zinc]
git = "https://github.com/hackndev/zinc.git"
path = "macro_zinc"

[dependencies.core]
git = "https://github.com/hackndev/rust-libcore.git"

[dependencies.platformtree]
git = "https://github.com/hackndev/zinc.git"
path = "platformtree"

and my main.rs like this:

#![feature(plugin, no_std, core, start, core_intrinsics)]
#![no_std]
#![plugin(macro_zinc)]

extern crate zinc;

#[zinc_main]
pub fn main() {
  zinc::hal::mem_init::init_stack();
  zinc::hal::mem_init::init_data();

  loop {}
}

I get the same errors when I try to compile one of the examples

I use the latest rustc nightly build

rustc 1.4.0-nightly (10d69db0a 2015-08-23)
binary: rustc
commit-hash: 10d69db0a8ea5f2825170dfec789b4d4eb4581f9
commit-date: 2015-08-23
host: x86_64-apple-darwin
release: 1.4.0-nightly
farcaller commented 9 years ago

I believe this is fixed as of 3b4c301512b9100e6551bcd8870a1b827231a4eb.