Commit Graph

33181 Commits

Author SHA1 Message Date
Jakub Wieczorek
c2e8f3b481 Add a memoize! macro and use it throughout rustc 2014-10-15 10:47:09 +02:00
bors
5201bf17e6 auto merge of #18031 : huonw/rust/adjust-vec-sort-test, r=alexcrichton
Previously it had some uninituitive conditionals due to the interaction
with the Rand construction and Clone reinitialisation to create
sequential identifying numbers. This replaces all that with just
constructing the DropCounters with the appropriate identifiers.
2014-10-15 06:07:22 +00:00
bors
ea8a5df431 auto merge of #18044 : aturon/rust/lint-conventions, r=pcwalton
[RFC 344](https://github.com/rust-lang/rfcs/pull/344) proposes a set of naming conventions for lints. This PR
renames existing lints to follow the conventions.

Use the following sed script to bring your code up to date:

```
s/unnecessary_typecast/unused_typecasts/g
s/unsigned_negate/unsigned_negation/g
s/type_limits/unused_comparisons/g
s/type_overflow/overflowing_literals/g
s/ctypes/improper_ctypes/g
s/owned_heap_memory/box_pointers/g
s/unused_attribute/unused_attributes/g
s/path_statement/path_statements/g
s/unused_must_use/unused_must_use/g
s/unused_result/unused_results/g
s/non_uppercase_statics/non_upper_case_globals/g
s/unnecessary_parens/unused_parens/g
s/unnecessary_import_braces/unused_import_braces/g
s/unused_unsafe/unused_unsafe/g
s/unsafe_block/unsafe_blocks/g
s/unused_mut/unused_mut/g
s/unnecessary_allocation/unused_allocation/g
s/missing_doc/missing_docs/g
s/unused_imports/unused_imports/g
s/unused_extern_crate/unused_extern_crates/g
s/unnecessary_qualification/unused_qualifications/g
s/unrecognized_lint/unknown_lints/g
s/unused_variable/unused_variables/g
s/dead_assignment/unused_assignments/g
s/unknown_crate_type/unknown_crate_types/g
s/variant_size_difference/variant_size_differences/g
s/transmute_fat_ptr/fat_ptr_transmutes/g
```

Since a large number of lints are being renamed for RFC 344, this PR
adds some basic deprecation/renaming functionality to the pluggable lint
system. It allows a simple mapping of old to new names, and can warn
when old names are being used.

This change needs to be rolled out in stages. In this PR, the
deprecation warning is commented out, but the old name is forwarded to
the new one.

Once the PR lands and we have generated a new snapshot of the
compiler, we can add the deprecation warning and rename all uses of the
lints in the rust codebase. I will file a PR to do so.

Closes #16545
Closes #17932

r? @pcwalton
2014-10-15 04:12:16 +00:00
bors
af99157489 auto merge of #18036 : japaric/rust/add-tests, r=nikomatsakis
Closes #11384
Closes #12909

r? @nikomatsakis
2014-10-15 02:17:19 +00:00
bors
40b2449736 auto merge of #18018 : gamazeps/rust/isuue16736, r=cmr
Closes #16736
linked to #18009
2014-10-14 23:22:20 +00:00
Aaron Turon
31b7d64fdc rustc: Add deprecation/renaming support for lints
Since a large number of lints are being renamed for RFC 344, this commit
adds some basic deprecation/renaming functionality to the pluggable lint
system. It allows a simple mapping of old to new names, and can warn
when old names are being used.

This change needs to be rolled out in stages. In this commit, the
deprecation warning is commented out, but the old name is forwarded to
the new one.

Once the commit lands and we have generated a new snapshot of the
compiler, we can add the deprecation warning and rename all uses of the
lints in the rust codebase.
2014-10-14 16:04:06 -07:00
Aaron Turon
3c0d2a7c90 rustc: Improve lint descriptions
Improves the description of `dead_code` and `unreachable_code` to
clarify the difference between them.
2014-10-14 15:23:09 -07:00
Aaron Turon
d6eb719729 rustc: Add missing lint registration
The pluggable lint changes apparently dropped the fat pointer transmute
lint by accident.

This commit registers the lint.
2014-10-14 15:23:09 -07:00
Aaron Turon
aabb6e72c1 rustc: Rename lints per RFC 344
RFC 344 proposes a set of naming conventions for lints. This commit
renames existing lints to follow the conventions.

Use the following sed script to bring your code up to date:

```
s/unnecessary_typecast/unused_typecasts/g
s/unsigned_negate/unsigned_negation/g
s/type_limits/unused_comparisons/g
s/type_overflow/overflowing_literals/g
s/ctypes/improper_ctypes/g
s/owned_heap_memory/box_pointers/g
s/unused_attribute/unused_attributes/g
s/path_statement/path_statements/g
s/unused_must_use/unused_must_use/g
s/unused_result/unused_results/g
s/non_uppercase_statics/non_upper_case_globals/g
s/unnecessary_parens/unused_parens/g
s/unnecessary_import_braces/unused_import_braces/g
s/unused_unsafe/unused_unsafe/g
s/unsafe_block/unsafe_blocks/g
s/unused_mut/unused_mut/g
s/unnecessary_allocation/unused_allocation/g
s/missing_doc/missing_docs/g
s/unused_imports/unused_imports/g
s/unused_extern_crate/unused_extern_crates/g
s/unnecessary_qualification/unused_qualifications/g
s/unrecognized_lint/unknown_lints/g
s/unused_variable/unused_variables/g
s/dead_assignment/unused_assignments/g
s/unknown_crate_type/unknown_crate_types/g
s/variant_size_difference/variant_size_differences/g
s/transmute_fat_ptr/fat_ptr_transmutes/g
```

Closes #16545
Closes #17932

Due to deprecation, this is a:

[breaking-change]
2014-10-14 15:22:52 -07:00
bors
232f4b3404 auto merge of #17966 : frewsxcv/rust/master, r=nikomatsakis
The document is mentioned, but doesn't link to it, so it's a little confusing
2014-10-14 21:22:23 +00:00
bors
5e1e2456ed auto merge of #18029 : Ms2ger/rust/patch-1, r=huonw 2014-10-14 19:22:22 +00:00
bors
181538a135 auto merge of #18023 : chris-morgan/rust/vim-misc-2014-10-14, r=kballard
- Stop highlighting foo in `use foo;` specially.
- Highlight `extern crate "foo" as bar;` properly.
- Highlight 1..2 according to the current grammar.
2014-10-14 17:22:25 +00:00
Jorge Aparicio
657b16175b Add tests for issues #11384 and #12909
Closes #11384
Closes #12909
2014-10-14 10:24:25 -05:00
bors
1fd8e4cae0 auto merge of #18014 : hirschenberger/rust/issue-17999, r=alexcrichton
Fix issue #17999 (Unused variables inside `for` are not detected)
2014-10-14 15:22:28 +00:00
Felix Raimundo
1ef5e388b9 Switches from uint to u32 in BitV and BitVSet
Closes #16736
linked to #18009
2014-10-14 13:50:50 +02:00
Huon Wilson
32513b0019 test: make the sort failure-safety test unsafeless and more obvious.
Previously it had some uninituitive conditionals due to the interaction
with the Rand construction and Clone reinitialisation to create
sequential identifying numbers. This replaces all that with just
constructing the DropCounters with the appropriate identifiers.
2014-10-14 22:20:59 +11:00
Ms2ger
0e1e9cbb13 Fix the formatting of the documentation for OrdIterator.min_max. 2014-10-14 12:11:07 +02:00
bors
a1e2eb0395 auto merge of #18017 : alexcrichton/rust/rollup, r=alexcrichton 2014-10-14 04:02:48 +00:00
Chris Morgan
a118bd77ad Highlight 1..2 according to the current grammar. 2014-10-14 11:49:48 +11:00
Chris Morgan
81da141b7d Highlight extern crate "foo" as bar; properly. 2014-10-14 11:49:12 +11:00
Chris Morgan
add8a85905 Vim: Stop highlighting foo in use foo; specially
This wasn’t really consistent with other things; the last section of the
import was not highlighted in any other case.

Also `use {foo, bar};` was having the foo and bar not highlighted, where
they would have been as separate statements.
2014-10-14 11:44:34 +11:00
bors
1c3ddd2971 auto merge of #17888 : gmfawcett/rust/patch-1, r=alexcrichton
The Sieve algorithm only requires checking all elements up to and including the square root of the maximum prime you're looking for. After that, the remaining elements are guaranteed to be prime.
2014-10-13 23:27:46 +00:00
Alex Crichton
2e2d681d88 rollup merge of #18013 : stefanbucur/patch-1 2014-10-13 15:10:28 -07:00
Alex Crichton
724bbab577 rollup merge of #18012 : pnkfelix/gate-bors-on-building-compiletest 2014-10-13 15:10:25 -07:00
Alex Crichton
1b19296567 rollup merge of #18007 : dotdash/arg_lifetime_end 2014-10-13 15:10:21 -07:00
Alex Crichton
0eefca6782 rollup merge of #18002 : SimonSapin/unicode-version 2014-10-13 15:10:14 -07:00
Alex Crichton
1263a36a62 rollup merge of #17993 : redcape/fix-ffi-docs 2014-10-13 15:10:10 -07:00
Alex Crichton
f006e86eed rollup merge of #17992 : jkleint/guide-double-borrow 2014-10-13 15:10:08 -07:00
Alex Crichton
030c79c91a rollup merge of #17991 : sfackler/extern-error 2014-10-13 15:10:05 -07:00
Alex Crichton
ad25e560a0 rollup merge of #17986 : gamazeps/docissue 2014-10-13 15:10:01 -07:00
Alex Crichton
02350ac20b rollup merge of #17984 : bkoropoff/issue-17651 2014-10-13 15:09:56 -07:00
Alex Crichton
4509e42349 rollup merge of #17980 : alexcrichton/no-more-exes 2014-10-13 15:09:53 -07:00
Alex Crichton
48d0359273 rollup merge of #17979 : jkleint/guide-guess-counter 2014-10-13 15:09:52 -07:00
Alex Crichton
001814fda2 rollup merge of #17977 : Behemecoatyl/master 2014-10-13 15:09:48 -07:00
Alex Crichton
e860437ab1 rollup merge of #17972 : ebfe/rpass-lang-item 2014-10-13 15:09:41 -07:00
Alex Crichton
986d62e239 rollup merge of #17970 : nodakai/cleanup-warnings 2014-10-13 15:09:38 -07:00
Alex Crichton
0dd4cd57fe rollup merge of #17968 : nodakai/really-fix-kw-table 2014-10-13 15:09:35 -07:00
Alex Crichton
412f4d1fc7 rollup merge of #17927 : alexcrichton/more-const 2014-10-13 15:09:25 -07:00
Alex Crichton
e9f241bc5d rollup merge of #17888 : gmfawcett/patch-1 2014-10-13 15:09:14 -07:00
bors
36d0346dff auto merge of #17876 : ruud-v-a/rust/patch-1, r=alexcrichton
The Windows-specific instruction under 'Quick Start' linked the wiki article on getting started developing Rust itself, but the quick start is just about obtaining a working Rust installation. The actual wiki page with Windows-specific instructions was difficult to find.

The most important thing to note on Windows is that you need mingw-builds, and it is totally not obvious. The only place where I have seen it mentioned is the wiki page, which was difficult to find before.
2014-10-13 21:32:43 +00:00
Falco Hirschenberger
af2f538390 Fix issue #17999 (Unused variables inside for are not detected) 2014-10-13 23:15:07 +02:00
Stefan Bucur
39749a3adc Fix typo in char's from_digit error message 2014-10-13 22:17:48 +02:00
bors
c7e0724274 auto merge of #17733 : jgallagher/rust/while-let, r=alexcrichton
This is *heavily* based on `if let` (#17634) by @jakub- and @kballard

This should close #17687
2014-10-13 19:37:40 +00:00
Felix S. Klock II
b26972e28b Make bors check that compiletest builds from both stage0 and stage1 rustc.
----

To reproduce issue on commit ba246100ca
it does not suffice to add just `check-build-compiletest` to
`check-secondary`; one must also ensure that `check-build-compiletest`
precedes the satisification of the `check` rule.

Otherwise hidden dependencies of `compiletest` would end up getting
satisfied when make builds `rustc` at each stage in order to
eventually run `check-stage2`.

So to handle that I moved `check-secondary` before `check` in the
`check-all` rule that bors uses, and for good measure, I also put
`check-build-compiltest` at the front of the `check-secondary` rule's
dependencies.

My understanding is that running `check-secondary` should be
relatively cheap, and thus such a reordering will not hurt bors.

----

Fix #17883.
2014-10-13 20:58:34 +02:00
Alex Crichton
c56c9fcf08 rustc: Remove the dummy hack from check_match
Turns out you can create &'static T quite easily in a constant, I just forgot
about this!
2014-10-13 11:50:47 -07:00
bors
daa71e40a9 auto merge of #17910 : taylorhutchison/rust/patch-1, r=alexcrichton
Added 64-bit Windows support to the list of platforms. Support for 64-bit Windows was added in Rust 0.12.0. See  https://mail.mozilla.org/pipermail/rust-dev/2014-October/011267.html for the release notes.
2014-10-13 17:42:42 +00:00
Steven Fackler
84d1cbfd25 Don't ICE on bad extern paths
Closes #17990
2014-10-13 09:25:08 -07:00
bors
4a382d7c47 auto merge of #17965 : omasanori/rust/remove, r=sfackler 2014-10-13 14:22:42 +00:00
Björn Steinbrink
fafe136c2d Emit lifetime end markers for function arguments
Function arguments are (hopefully!) the last places where allocas don't
get proper markers for the end of their lifetimes. This means that this
code using 64 bytes of stack for the function arguments:

````rust
std::io::println("1");
std::io::println("2");
std::io::println("3");
std::io::println("4");
````

But with the proper lifetime markers, the slots can be reused, and
the arguments only need 16 bytes of stack.
2014-10-13 16:16:16 +02:00
Simon Sapin
61a8a28f9f Include the Unicode version used to generate src/libunicode/tables.rs. 2014-10-13 14:07:12 +01:00