Skip to content
New issue

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

Unable to find definition of iron::prelude::Request #499

Open
augustl opened this issue Feb 4, 2016 · 1 comment
Open

Unable to find definition of iron::prelude::Request #499

augustl opened this issue Feb 4, 2016 · 1 comment

Comments

@augustl
Copy link

augustl commented Feb 4, 2016

I have the following Cargo.toml:

[package]
name = "myapp"
version = "0.1.0"
authors = ["August Lilleaas <[email protected]>"]

[dependencies]

[dependencies.iron]
version = "*"

This is my src/main.rs

extern crate iron;

use iron::prelude::Request;
use iron::prelude::Response;
use iron::prelude::Iron;
use iron::status;
use std::env;
use std::net::Ipv4Addr;

fn main() {
    let args: Vec<String> = env::args().collect();

    let server_ip = Ipv4Addr::new(127, 0, 0, 1);
    let server_port = args[1].parse::<u16>().unwrap();

    Iron::new(|_: &mut Request| {
        Ok(Response::with((status::Ok, "Hello world!")))
    }).http((server_ip, server_port)).unwrap();
}

This is the value of RUST_SRC_PATH:

RUST_SRC_PATH=$HOME/root/local/src/rustc-1.6.0/src

Here are some examples of the output I get from invoking racer in a terminal:

~> racer find-definition 3 4 $HOME/code/myapp/src/main.rs 
MATCH iron,1,0,/home/augustl/.cargo/registry/src/github.com-88ac128001ac3a9a/iron-0.2.6/src/lib.rs,Module,/home/augustl/.cargo/registry/src/github.com-88ac128001ac3a9a/iron-0.2.6/src/lib.rs
END
~> racer find-definition 3 14 $HOME/code/myapp/src/main.rs 
MATCH prelude,124,8,/home/augustl/.cargo/registry/src/github.com-88ac128001ac3a9a/iron-0.2.6/src/lib.rs,Module,/home/augustl/.cargo/registry/src/github.com-88ac128001ac3a9a/iron-0.2.6/src/lib.rs
END
~> racer find-definition 3 21 $HOME/code/myapp/src/main.rs 
END

In that last invocation, I expected it to find the definition of iron::prelude::Request, but no results are returned.

I noticed this when trying out Atom for rust development, and also trying Eclipse, and noticed that they both had the same issue.

This issue also applies to iron::prelude::Response and iron::prelude::Iron, the two subsequent "use" lines.

@nosideeffects
Copy link

I have this same issue. It appears that Racer does not find anything within a pub sub of a pub mod block.

Let me know if I can provide anything to help fix or implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants