auto merge of #12861 : huonw/rust/lint-owned-vecs, r=thestinger

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.
This commit is contained in:
bors 2014-03-13 22:26:35 -07:00
commit b35e8fbfcb
34 changed files with 79 additions and 3 deletions

View file

@ -11,6 +11,7 @@
#[deny(unreachable_code)];
#[allow(unused_variable)];
#[allow(dead_code)];
#[allow(deprecated_owned_vector)];
fn fail_len(v: ~[int]) -> uint {
let mut i = 3;

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(deprecated_owned_vector)];
// Verify the compiler fails with an error on infinite function
// recursions.

View file

@ -0,0 +1,17 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deny(deprecated_owned_vector)];
fn main() {
~[1]; //~ ERROR use of deprecated `~[]`
//~^ ERROR use of deprecated `~[]`
std::vec::with_capacity::<int>(10); //~ ERROR use of deprecated `~[]`
}

View file

@ -11,6 +11,7 @@
#[feature(managed_boxes)];
#[forbid(heap_memory)];
#[allow(dead_code)];
#[allow(deprecated_owned_vector)];
struct Foo {
x: @int //~ ERROR type uses managed

View file

@ -11,6 +11,7 @@
#[feature(globs)];
#[deny(unused_imports)];
#[allow(dead_code)];
#[allow(deprecated_owned_vector)];
use cal = bar::c::cc;

View file

@ -13,6 +13,7 @@
#[allow(dead_assignment)];
#[allow(unused_variable)];
#[allow(dead_code)];
#[allow(deprecated_owned_vector)];
#[deny(unused_mut)];
fn main() {

View file

@ -12,6 +12,7 @@
#[allow(dead_code)];
#[deny(unused_unsafe)];
#[allow(deprecated_owned_vector)];
mod foo {
extern {

View file

@ -13,6 +13,7 @@
#[feature(macro_rules)];
#[deny(warnings)];
#[allow(unused_must_use)];
#[allow(deprecated_owned_vector)];
use std::fmt;
use std::io::MemWriter;