summary refs log tree commit diff
path: root/src/test/compile-fail/lint-dead-code-1.rs
AgeCommit message (Collapse)AuthorLines
2015-02-07Feature-gate #![no_std]Keegan McAllister-0/+1
Fixes #21833. [breaking-change]
2015-02-03Switch missing_copy_implementations to default-allowSteven Fackler-1/+0
This was particularly helpful in the time just after OIBIT's implementation to make sure things that were supposed to be Copy continued to be, but it's now creates a lot of noise for types that intentionally don't want to be Copy.
2015-01-31Kill more `isize`sTobias Bucher-1/+1
2015-01-23Set unstable feature names appropriatelyBrian Anderson-1/+1
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Fix up some tests for feature stagingBrian Anderson-0/+1
2015-01-21Tie stability attributes to feature gatesBrian Anderson-1/+0
2015-01-17Add allow(unstable) to tests that need itBrian Anderson-0/+1
2015-01-08Update compile-fail tests to use is/us, not i/u.Huon Wilson-1/+1
2015-01-08Update compile fail tests to use isize.Huon Wilson-15/+15
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+1
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-11-17Switch to purely namespaced enumsSteven Fackler-2/+2
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-10-28Update code with new lint namesAaron Turon-2/+2
2014-10-13rustc: Remove the dummy hack from check_matchAlex Crichton-3/+7
Turns out you can create &'static T quite easily in a constant, I just forgot about this!
2014-10-12rustc: Warn about dead constantsAlex Crichton-0/+7
A few catch-all blocks ended up not having this case for constants. Closes #17925
2014-10-09test: Convert statics to constantsAlex Crichton-11/+5
Additionally, add lots of tests for new functionality around statics and `static mut`.
2014-10-03Set the `non_uppercase_statics` lint to warn by defaultP1start-0/+1
2014-09-25auto merge of #17428 : fhahn/rust/issue-16114-rename-begin-unwind-2, ↵bors-1/+1
r=alexcrichton This is a PR for #16114 and includes to following things: * Rename `begin_unwind` lang item to `fail_fmt` * Rename `core::failure::begin_unwind` to `fail_impl` * Rename `fail_` lang item to `fail`
2014-09-25Rename `fail_` lang item to `fail`, closes #16114Florian Hahn-1/+1
2014-09-24Use more descriptive names in dead code messagesJakub Wieczorek-8/+8
2014-09-24Add detection of unused enum variantsJakub Wieczorek-1/+5
2014-09-22librustc: Forbid private types in public APIs.Patrick Walton-2/+1
This breaks code like: struct Foo { ... } pub fn make_foo() -> Foo { ... } Change this code to: pub struct Foo { // note `pub` ... } pub fn make_foo() -> Foo { ... } The `visible_private_types` lint has been removed, since it is now an error to attempt to expose a private type in a public API. In its place a `#[feature(visible_private_types)]` gate has been added. Closes #16463. RFC #48. [breaking-change]
2014-06-29librustc: Remove the fallback to `int` for integers and `f64` forPatrick Walton-2/+2
floating point numbers for real. This will break code that looks like: let mut x = 0; while ... { x += 1; } println!("{}", x); Change that code to: let mut x = 0i; while ... { x += 1; } println!("{}", x); Closes #15201. [breaking-change]
2014-06-28Rename all raw pointers as necessaryAlex Crichton-4/+4
2014-06-23librustc: Feature gate lang items and intrinsics.Patrick Walton-0/+1
If you define lang items in your crate, add `#[feature(lang_items)]`. If you define intrinsics (`extern "rust-intrinsic"`), add `#[feature(intrinsics)]`. Closes #12858. [breaking-change]
2014-06-22libsyntax: don't allow enum structs with no fieldsBenjamin Herr-1/+1
Unit-like structs are written as `struct Foo;`, but we erroneously accepted `struct Foo();` and took it to mean the same thing. Now we don't, so use the `struct Foo;` form! [breaking-change]
2014-06-08Remove the dead code identified by the new lintJakub Wieczorek-1/+5
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-2/+2
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-23Support unsized types with the `type` keywordNick Cameron-0/+4
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-6/+6
Closes #2569
2014-03-01rustc: implement a lint for publicly visible private types.Huon Wilson-0/+1
These are types that are in exported type signatures, but are not exported themselves, e.g. struct Foo { ... } pub fn bar() -> Foo { ... } will warn about the Foo. Such types are not listed in documentation, and cannot be named outside the crate in which they are declared, which is very user-unfriendly. cc #10573
2014-02-21Changed NonCamelCaseTypes lint to warn by defaultmr.Shu-0/+1
Added allow(non_camel_case_types) to librustc where necesary Tried to fix problems with non_camel_case_types outside rustc fixed failing tests Docs updated Moved #[allow(non_camel_case_types)] a level higher. markdown.rs reverted Fixed timer that was failing tests Fixed another timer
2014-01-12Mark allowed dead code and lang items as liveKiet Tran-0/+11
Dead code pass now explicitly checks for `#[allow(dead_code)]` and `#[lang=".."]` attributes on items and marks them as live if they have those attributes. The former is done so that if we want to suppress warnings for a group of dead functions, we only have to annotate the "root" of the call chain.
2013-12-16Check even more live Path nodes in dead-code passKiet Tran-0/+4
2013-12-16Mark live codes in struct/enum for dead-code passKiet Tran-0/+8
2013-12-14Check more live Path nodes in dead-code passKiet Tran-14/+20
2013-12-08Add dead-code warning passKiet Tran-0/+69