Skip to content

Catch undeclared (unimported) absolute paths #12002

Answered by flip1995
dcecile asked this question in Q&A
Discussion options

You must be logged in to vote

The Ruby on Rails thing is not a pattern that works in Rust. If you don't import something, you can only access it through the full path, which is crate::[modules::]*Item.

Back in Rust 2015, if you want to use something from an extern crate A, you had to write extern crate A;. Rust 2018 got rid of this restriction and made it more convenient to use something from an extern crate. What you're asking is pretty much a lint that adds this back with use statements.

I don't think this lint would get a lot of use. But I'd accept it as an restriction lint, if you were to open a PR for it :)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dcecile
Comment options

@flip1995
Comment options

Answer selected by dcecile
@dcecile
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants