-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
lint: add lint for use of a ~[T]
.
#12861
Conversation
r? @pcwalton I don't know how far you are along with your de-vecing. This is probably pointless if it's going to being landing very soon. |
@@ -1107,6 +1116,17 @@ fn check_unused_result(cx: &Context, s: &ast::Stmt) { | |||
} | |||
} | |||
|
|||
fn check_deprecated_owned_vector(cx: &Context, e: &ast::Expr) { | |||
let t = ty::expr_ty(cx.tcx, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this be expressed with just:
match e.node {
ast::ExprVstore(_, ast::ExprVstoreUniq) => {...}
_ => {}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matching on the AST itself doesn't handle using functions like with_capacity
, from_elem
or .collect()
. This actually checks the type of such expressions.
(See the test case... which I just added ;P )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, that makes sense! Thanks 👍
Just added a commit that makes the (It is a really good candidate for the doc sprint: most of the docs can be written by copying over from |
This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
These are wildly incomplete, but having something there is better than nothing, e.g. so that people know it exists, and many of the functions behaviour can be guessed from the name or by checking the source: it's knowing they exist at all that's the hard part.
lint: add lint for use of a `~[T]`. This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
…, r=DorianListens fix: Autocomplete for struct fields includes receiver fixes rust-lang#12857
lint: add lint for use of a
~[T]
.This is useless at the moment (since pretty much every crate uses
~[]
), but should help avoid regressions once completely removed from acrate.