summary refs log tree commit diff
path: root/src/test/compile-fail/lint-dead-code-3.rs
AgeCommit message (Collapse)AuthorLines
2015-03-25Add trivial cast lints.Nick Cameron-1/+1
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-16Fallout in testing.Nick Cameron-1/+1
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-1/+1
2014-10-28Update code with new lint namesAaron Turon-1/+1
2014-09-24Use more descriptive names in dead code messagesJakub Wieczorek-6/+6
2014-08-14libsyntax: Accept `use foo as bar;` in lieu of `use bar as foo;`Patrick Walton-1/+1
The old syntax will be removed after a snapshot. RFC #47. Issue #16461.
2014-07-21privacy: Add publically-reexported foreign item to exported item setKiet Tran-0/+5
Close #15740
2014-06-28Rename all raw pointers as necessaryAlex Crichton-3/+3
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-1/+1
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-04-04Fix fallout from std::libc separationCorey Richardson-1/+3
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-4/+4
Closes #2569
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
2013-12-31Mark provided methods in dead-code passKiet Tran-0/+16
2013-12-14Dead-code pass now marks and warns foreign itemsKiet Tran-3/+19
2013-12-08Add dead-code warning passKiet Tran-0/+50