about summary refs log tree commit diff
path: root/src/librustc/lint
AgeCommit message (Collapse)AuthorLines
2014-11-26Remove special casing for some meta attributesSteven Fackler-9/+0
Descriptions and licenses are handled by Cargo now, so there's no reason to keep these attributes around.
2014-11-26Rote changes due to the fact that ast paths no longer carry this extraneous ↵Niko Matsakis-1/+1
bounds.
2014-11-25/** -> ///Steve Klabnik-5/+3
This is considered good convention.
2014-11-23Rename unwrap functions to into_innerAlex Crichton-1/+1
This change applies the conventions to unwrap listed in [RFC 430][rfc] to rename non-failing `unwrap` methods to `into_inner`. This is a breaking change, but all `unwrap` methods are retained as `#[deprecated]` for the near future. To update code rename `unwrap` method calls to `into_inner`. [rfc]: https://github.com/rust-lang/rfcs/pull/430 [breaking-change] Closes #13159 cc #19091
2014-11-23Remove type parameters from ExprField and ExprTupFieldAdolfo Ochagavía-11/+7
2014-11-21unicode: Rename UnicodeChar::is_digit to is_numericBrian Anderson-1/+1
'Numeric' is the proper name of the unicode character class, and this frees up the word 'digit' for ascii use in libcore. Since I'm going to rename `Char::is_digit_radix` to `is_digit`, I am not leaving a deprecated method in place, because that would just cause name clashes, as both `Char` and `UnicodeChar` are in the prelude. [breaking-change]
2014-11-19rollup merge of #19073: jakub-/issue-19069Jakub Bukaj-4/+4
Fixes #19069. These were never intended not to be feature-gated but this PR is nonetheless a... [breaking-change]
2014-11-19rustc: middle: remove obsolete ty::get.Eduard Burtescu-8/+8
2014-11-19rustc: fix fallout of adding the `'tcx` lifetime to `Ty`.Eduard Burtescu-7/+8
2014-11-19rustc: middle: rename `ty::t` to `Ty` and use it unqualified everywhere.Eduard Burtescu-8/+9
2014-11-18Feature gate non-ASCII lifetime identifiersJakub Bukaj-4/+4
Fixes #19069.
2014-11-18Move trans, back, driver, and back into a new crate, rustc_trans. Reduces ↵Niko Matsakis-2/+1
memory usage significantly and opens opportunities for more parallel compilation.
2014-11-18rollup merge of #18910: aturon/borrow-traitsJakub Bukaj-4/+4
Following [the collections reform RFC](https://github.com/rust-lang/rfcs/pull/235), this PR: * Adds a new `borrow` module to libcore. The module contains traits for borrowing data (`BorrowFrom` and `BorrowFromMut`), generalized cloning (`ToOwned`), and a clone-on-write smartpointer (`Cow`). * Deprecates the `_equiv` family of methods on `HashMap` and `HashSet` by instead generalizing the "normal" methods like `get` and `remove` to use the new `std::borrow` infrastructure. * Generalizes `TreeMap`, `TreeSet`, `BTreeMap` and `BTreeSet` to use the new `std::borrow` infrastructure for lookups. [breaking-change]
2014-11-18rollup merge of #18890: luqmana/tfJakub Bukaj-0/+1
This is especially useful for declaring a static with external linkage in an executable. There isn't any way to do that currently since we mark everything in an executable as internal by default. Also, a quick fix to have the no-compiler-rt target option respected when building staticlibs as well.
2014-11-17librustc: Whitelist linkage attribute for unused attribute lint since it's ↵Luqman Aden-0/+1
processed during trans.
2014-11-17Fallout from deprecationAaron Turon-4/+4
This commit handles the fallout from deprecating `_with` and `_equiv` methods.
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+5
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-11-17auto merge of #18914 : Gankro/rust/cloned, r=aturonbors-2/+2
Part of #18424. r? @aturon [breaking-change]
2014-11-16auto merge of #18994 : sfackler/rust/struct-variants-pt2, r=jakub-bors-1/+14
Struct variant field visibility is now inherited. Remove `pub` keywords from declarations. Closes #18641 [breaking-change] r? @alexcrichton
2014-11-16fallout from deprecating find_copy and get_copyAlexis Beingessner-2/+2
2014-11-16Complete the removal of ty_nil, ast::LitNil, ast::TyBot and ast::TyUniqJakub Bukaj-1/+4
[breaking-change] This will break any uses of macros that assumed () being a valid literal.
2014-11-16Try to remove ty_nil, some kind of error in exhaustiveness checkingNiko Matsakis-1/+1
2014-11-15Un-feature gate struct variantsSteven Fackler-1/+14
Struct variant field visibility is now inherited. Remove `pub` keywords from declarations. Closes #18641 [breaking-change]
2014-11-14auto merge of #18827 : bjz/rust/rfc369-numerics, r=alexcrichtonbors-0/+1
This implements a considerable portion of rust-lang/rfcs#369 (tracked in #18640). Some interpretations had to be made in order to get this to work. The breaking changes are listed below: [breaking-change] - `core::num::{Num, Unsigned, Primitive}` have been deprecated and their re-exports removed from the `{std, core}::prelude`. - `core::num::{Zero, One, Bounded}` have been deprecated. Use the static methods on `core::num::{Float, Int}` instead. There is no equivalent to `Zero::is_zero`. Use `(==)` with `{Float, Int}::zero` instead. - `Signed::abs_sub` has been moved to `std::num::FloatMath`, and is no longer implemented for signed integers. - `core::num::Signed` has been removed, and its methods have been moved to `core::num::Float` and a new trait, `core::num::SignedInt`. The methods now take the `self` parameter by value. - `core::num::{Saturating, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv}` have been removed, and their methods moved to `core::num::Int`. Their parameters are now taken by value. This means that - `std::time::Duration` no longer implements `core::num::{Zero, CheckedAdd, CheckedSub}` instead defining the required methods non-polymorphically. - `core::num::{zero, one, abs, signum}` have been deprecated. Use their respective methods instead. - The `core::num::{next_power_of_two, is_power_of_two, checked_next_power_of_two}` functions have been deprecated in favor of methods defined a new trait, `core::num::UnsignedInt` - `core::iter::{AdditiveIterator, MultiplicativeIterator}` are now only implemented for the built-in numeric types. - `core::iter::{range, range_inclusive, range_step, range_step_inclusive}` now require `core::num::Int` to be implemented for the type they a re parametrized over.
2014-11-13auto merge of #18872 : hirschenberger/rust/master, r=thestingerbors-1/+1
Discussed in #18587
2014-11-13Remove Signed trait and add SignedInt traitBrendan Zabarauskas-0/+1
The methods have been moved into Float and SignedInt
2014-11-11Set exceeding bitshifts lint to denyFalco Hirschenberger-1/+1
Discussed in #18587
2014-11-10Use FnvHashMap instead of HashMap in rustcAriel Ben-Yehuda-13/+13
2014-11-07Update parser with `for` syntaxNiko Matsakis-2/+2
2014-11-06rollup merge of #18679 : brson/lint-traitAlex Crichton-27/+54
2014-11-06Fallout from collection conventionsAlexis Beingessner-13/+13
2014-11-06auto merge of #18608 : alexcrichton/rust/lint-some-crates, r=aturonbors-27/+48
This commit adds support for linting `extern crate` statements for stability attributes attached to the crate itself. This is likely to be the mechanism used to deny access to experimental crates that are part of the standard distribution. cc #18585 r? @aturon
2014-11-05rustc: Add some more checks to the stability lintBrian Anderson-27/+54
This catches uses of unstable traits in ``` trait Foo: UnstableTrait { } ``` and ``` impl UnstableTrait for Foo { } ```
2014-11-04rustc: Support stability attributes on cratesAlex Crichton-27/+48
This commit adds support for linting `extern crate` statements for stability attributes attached to the crate itself. This is likely to be the mechanism used to deny access to experimental crates that are part of the standard distribution. cc #18585
2014-11-04Update some new use of the old targ_cfgCorey Richardson-2/+2
2014-11-04Implement flexible target specificationCorey Richardson-2/+2
Removes all target-specific knowledge from rustc. Some targets have changed during this, but none of these should be very visible outside of cross-compilation. The changes make our targets more consistent. iX86-unknown-linux-gnu is now only available as i686-unknown-linux-gnu. We used to accept any value of X greater than 1. i686 was released in 1995, and should encompass the bare minimum of what Rust supports on x86 CPUs. The only two windows targets are now i686-pc-windows-gnu and x86_64-pc-windows-gnu. The iOS target has been renamed from arm-apple-ios to arm-apple-darwin. A complete list of the targets we accept now: arm-apple-darwin arm-linux-androideabi arm-unknown-linux-gnueabi arm-unknown-linux-gnueabihf i686-apple-darwin i686-pc-windows-gnu i686-unknown-freebsd i686-unknown-linux-gnu mips-unknown-linux-gnu mipsel-unknown-linux-gnu x86_64-apple-darwin x86_64-unknown-freebsd x86_64-unknown-linux-gnu x86_64-pc-windows-gnu Closes #16093 [breaking-change]
2014-11-04auto merge of #18596 : alexcrichton/rust/rollup, r=alexcrichtonbors-12/+12
Let's see if we can clear out the queue entirely today!
2014-11-03rollup merge of #18593 : hirschenberger/issue-18587Alex Crichton-7/+7
Conflicts: src/test/compile-fail/lint-exceeding-bitshifts.rs
2014-11-03rollup merge of #18580 : hirschenberger/issue-17713Alex Crichton-3/+3
2014-11-04Fix for bitshift errors lint on cross compilation #18587Falco Hirschenberger-7/+7
2014-11-03rollup merge of #18318 : arielb1/transmute-cleanupAlex Crichton-2/+2
2014-11-03auto merge of #18589 : alexcrichton/rust/issue-18587-warn, r=jakub-bors-1/+1
There's currently a bug in it which fires erroneously on cross compiles, preventing new nightlies from being generated. This can be reset back to Deny once it's been fixed. cc #18587
2014-11-03rustc: Set the exceeding_bitshifts lint to AllowAlex Crichton-1/+1
There's currently a bug in it which fires erroneously on cross compiles, preventing new nightlies from being generated. This can be reset back to Deny once it's been fixed. cc #18587
2014-11-03Clean-up transmutes in librustcAriel Ben-Yehuda-2/+2
None of them would break by implementation-defined struct layout, but one would break with strict lifetime aliasing, and the rest are just ugly code.
2014-11-03Also fix undefined behaviour when shift equals the number of bitsFalco Hirschenberger-3/+3
LLVM states: "If op2 is (statically or dynamically) negative or equal to or larger than the number of bits in op1, the result is undefined."
2014-11-03rollup merge of #18519 : Gankro/collect-smashAlex Crichton-1/+1
2014-11-02refactor libcollections as part of collection reformAlexis Beingessner-1/+1
* Moves multi-collection files into their own directory, and splits them into seperate files * Changes exports so that each collection has its own module * Adds underscores to public modules and filenames to match standard naming conventions (that is, treemap::{TreeMap, TreeSet} => tree_map::TreeMap, tree_set::TreeSet) * Renames PriorityQueue to BinaryHeap * Renames SmallIntMap to VecMap * Miscellanious fallout fixes [breaking-change]
2014-11-01Add lint for checking exceeding bitshifts #17713Falco Hirschenberger-2/+54
2014-10-31DSTify HashJorge Aparicio-4/+4
- The signature of the `*_equiv` methods of `HashMap` and similar structures have changed, and now require one less level of indirection. Change your code from: ``` hashmap.find_equiv(&"Hello"); hashmap.find_equiv(&&[0u8, 1, 2]); ``` to: ``` hashmap.find_equiv("Hello"); hashmap.find_equiv(&[0u8, 1, 2]); ``` - The generic parameter `T` of the `Hasher::hash<T>` method have become `Sized?`. Downstream code must add `Sized?` to that method in their implementations. For example: ``` impl Hasher<FnvState> for FnvHasher { fn hash<T: Hash<FnvState>>(&self, t: &T) -> u64 { /* .. */ } } ``` must be changed to: ``` impl Hasher<FnvState> for FnvHasher { fn hash<Sized? T: Hash<FnvState>>(&self, t: &T) -> u64 { /* .. */ } // ^^^^^^ } ``` [breaking-change]
2014-10-30Test fixes and rebase conflictsAlex Crichton-1/+1