Skip to content

Instantly share code, notes, and snippets.

@orenbenkiki
Created August 11, 2013 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orenbenkiki/6205631 to your computer and use it in GitHub Desktop.
Save orenbenkiki/6205631 to your computer and use it in GitHub Desktop.
mod atom {
pub struct Atom {
priv id: int,
}
impl TotalEq for Atom {
fn equals(&self, other: &Atom) -> bool {
self.id == other.id
}
}
impl Eq for Atom {
fn eq(&self, other: &Atom) -> bool {
self.id == other.id
}
fn ne(&self, other: &Atom) -> bool {
self.id != other.id
}
}
}
#[link(name = "atom", vers = "0.0")]
#[comment = "Atom crate"]
#[crate_type = "lib"]
#[warn(missing_doc)]
#[warn(non_camel_case_types)]
#[warn(non_uppercase_statics)]
#[warn(unnecessary_qualification)]
pub mod atom;
$ rustc --lib src/atom/crate.rs
src/anthill/atom.rs:3:4: 5:5 warning: missing documentation for a struct
src/anthill/atom.rs:3 pub struct Atom {
src/anthill/atom.rs:4 priv id: int,
src/anthill/atom.rs:5 }
src/anthill/crate.rs:4:7: 4:18 note: lint level defined here
src/anthill/crate.rs:4 #[warn(missing_doc)]
^~~~~~~~~~~
warning: missing crate link meta `name`, using `crate` as default
warning: missing crate link meta `vers`, using `0.0` as default
So: the crate file is being read, but the link meta data isn't?
@orenbenkiki
Copy link
Author

The problem was missing ";" after the attributes. The error messages could be clearer...

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