Commit Graph

22926 Commits

Author SHA1 Message Date
Felix S. Klock II
c0599b1bbb Fix typo in comment. 2013-10-01 01:55:37 +02:00
Felix S. Klock II
924674202e Throwing in another interesting test case: There is no need to warn
about constants that are (non-trivial) paths rather than just
identifiers, regardless of what case their characters are.
2013-10-01 01:51:21 +02:00
Felix S. Klock II
a076fef2b6 Add new lint: non_uppercase_pattern_statics, for #7526.
This tries to warn about code like:
    ```rust
    match (0,0) {
        (0, aha) => { ... },
        ...
    }
    ```
where `aha` is actually a static constant, not a binding.
2013-10-01 01:44:25 +02:00
Daniel Micay
11b7109b7b rm only use of type_is_immediate outside of trans 2013-09-30 18:16:35 -04:00
bors
7ddcd2a745 auto merge of #9628 : alexcrichton/rust/tidy-binaries, r=thestinger
Closes #9621
2013-09-30 15:06:23 -07:00
bors
5c016857b7 auto merge of #9635 : catamorphism/rust/issue-7999, r=catamorphism
Closes #7999
2013-09-30 13:36:32 -07:00
Tim Chevalier
60eb04aea9 testsuite: Un-xfail unit-like-struct-drop-run on Windows
Closes #7999
2013-09-30 13:30:19 -07:00
Alex Crichton
a3ccbdc904 rustdoc: Generate valid code for struct-variants
Closes #9587
2013-09-30 12:32:04 -07:00
bors
5011bbfbb6 auto merge of #9630 : blake2-ppc/rust/de-at-smaller, r=huonw
This is mostly an incremental change, picking off some uses of
@- or @mut-pointers that can be replaced by references.

Almost all of the builder functions in trans::build are updated,
mostly using `&Block` arguments instead of `@mut Block`.
2013-09-30 10:41:20 -07:00
blake2-ppc
f4d8d8c122 trans::build: Change @mut Block to &Block or &mut Block
Use &mut Block and &Block references where possible in the builder
functions in trans::build.

@mut Block remains in a few functions where I could not (not yet at
least) track down the runtime borrowck failures.
2013-09-30 19:37:22 +02:00
blake2-ppc
b88517ec93 trans: Change @ast::Pat and @mut CrateContext in a few places
Use borrowed references in a few locations that were encountered when
working on other changes.
2013-09-30 19:37:17 +02:00
blake2-ppc
948b5ab87a trans: Change @ast::Expr -> &ast::Expr where possible 2013-09-30 19:37:17 +02:00
Alex Crichton
d29b3ac8a7 Expand tidy to prevent binaries from being checked
Closes #9621
2013-09-30 10:15:47 -07:00
bors
8174618a05 auto merge of #9619 : toffaletti/rust/mmap, r=huonw 2013-09-30 05:01:23 -07:00
bors
aafad43ae9 auto merge of #9616 : klutzy/rust/win32-uv-test, r=huonw
Closes #8815.
2013-09-30 03:41:19 -07:00
bors
ca2d5965d1 auto merge of #9614 : blake2-ppc/rust/lang-item-iter, r=alexcrichton
Cleanup in middle::lang_items

Use static string keys in the lang item hashmap, and convert
the traversal function to be an iterator.
2013-09-30 01:56:23 -07:00
Jason Toffaletti
b617569583 reduce heap allocations for MemoryMap 2013-09-29 23:05:40 -07:00
klutzy
f4f6b951d7 std::rt::uv::net: Enable tests on Win32
Closes #8815.
2013-09-30 13:56:55 +09:00
blake2-ppc
abcca1c7d1 rustc: Convert lang_item to use an iterator 2013-09-30 05:13:04 +02:00
blake2-ppc
8e69c05b7c rustc: Convert lang_items hashmap to use &'static str keys 2013-09-30 05:13:04 +02:00
bors
80b6056f5d auto merge of #9612 : alexcrichton/rust/rc-crate2, r=huonw
This patch exposes actual ownership of an `ast::Crate` structure so it's not implicitly copied and reference counted via `@`.

The main purpose for this patch was to get rid of the massive spike in memory during the start of the compiler (this can be seen on isrustfastyet). The reason that this spike exists is that during `phase_2` we're creating many copies of the crate by folding. Because these are reference counted, all instances of the old crates aren't dropped until the end of the function, which is why so much memory is accumulated.

This patch exposes true ownership of the crate, meaning that it will be destroyed ASAP when requested. There are no code changes except for dealing with actual ownership of the crate. The large spike is then avoided: http://i.imgur.com/IO3NENy.png

This shouldn't help our overall memory usage (that still is the highest at the end), but if we ever manage to bring that down it should help us not have a 1GB spike at the beginning of compilation.

(This was to un-stuck bors (hopefully).)
2013-09-29 20:06:13 -07:00
bors
0fd8cb07c1 auto merge of #9609 : alexcrichton/rust/fix-logging-newline, r=catamorphism
Forgot to do this when I was refactoring logging :(
2013-09-29 17:56:13 -07:00
Alex Crichton
7b18976f08 Remove all usage of @ast::Crate 2013-09-29 16:21:25 -07:00
Alex Crichton
22ef7e72f4 Require &Crate instead of @Crate
This help enable some later refactorings.
2013-09-29 16:21:25 -07:00
bors
727d4c306c auto merge of #9603 : sfackler/rust/rustpkg-test, r=catamorphism
Previously, if tests failed, you'd only get stderr which isn't very
useful, especially if the failure didn't happen directly in a test
function (e.g None.unwrap()).
2013-09-29 16:21:13 -07:00
Alex Crichton
c687f6fa92 Put a newline after each logging message 2013-09-29 12:39:49 -07:00
Steven Fackler
c685e0879c Don't redirect output in rustpkg test
Previously, if tests failed, you'd only get stderr which isn't very
useful, especially if the failure didn't happen directly in a test
function (e.g None.unwrap()).
2013-09-28 22:12:24 -07:00
bors
9883a6250b auto merge of #9589 : thestinger/rust/tutorial, r=alexcrichton 2013-09-28 16:21:04 -07:00
bors
92e7bb67a8 auto merge of #9542 : pnkfelix/rust/fsk-fix-issue-9531, r=thestinger
r? strcat 

(please double check that it fixes things on your chroot, if possible, before approval)

Fix #9531
2013-09-28 15:01:38 -07:00
Micah Chalmer
5d24a1ae45 Fix single-line-style paragraph fills with code immediately before or after 2013-09-28 17:40:24 -04:00
Daniel Micay
6c8e6aad73 tutorial: rewrite the sections on boxes/moves 2013-09-28 17:01:46 -04:00
bors
9cc11ca6a3 auto merge of #9577 : alexcrichton/rust/rustdoc, r=cmr
They're getting smaller each time though!

The highlight of this round is source files in documentation. Still trying to figure out the best syntax-highlighting solution.
2013-09-28 13:46:11 -07:00
Alex Crichton
88866a4c20 rustdoc: Show type parameters on external paths
This removes the internal type representation of an `External` type and instead
relies on passing around DefId structures and interpreting them accordingly.

Progress on #9539, but there's still the problem of a crate => url mapping.
2013-09-28 13:43:43 -07:00
bors
c635fba748 auto merge of #9583 : blake2-ppc/rust/connect-vec, r=huonw
std::vec: Sane implementations for connect_vec and concat_vec

Avoid unnecessary copying of subvectors, and calculate the needed space
beforehand. These implementations are simple but better than the
previous.

Also only implement it once, for all `Vector<T>` using:

    impl<'self, T: Clone, V: Vector<T>> VectorVector<T> for &'self [V]

Closes #9581
2013-09-28 07:31:02 -07:00
bors
058a5d97a2 auto merge of #9459 : eliovir/rust/patch-1, r=bstrie
change formula (other solution could be using abs()).
2013-09-28 05:26:04 -07:00
bors
4d81e38512 auto merge of #9574 : FlaPer87/rust/suppress_warnings, r=metajack
Small change that suppresses a warning because of an unused import.
2013-09-27 23:51:03 -07:00
bors
c151d371fc auto merge of #9562 : alexcrichton/rust/snapshots, r=thestinger 2013-09-27 21:56:04 -07:00
blake2-ppc
3709aa78d8 std::vec: Remove functions concat, connect
std::vec::{concat, connect, concat_slices, connect_slices} are replaced
by the already existing trait methods .concat_vec() and .connect_vec().
2013-09-28 05:56:49 +02:00
bors
4a2f8ba8c9 auto merge of #9559 : sfackler/rust/more-visibility, r=alexcrichton 2013-09-27 20:31:05 -07:00
blake2-ppc
24a4d0daf0 std::vec: Sane implementations for connect_vec and concat_vec
Avoid unnecessary copying of subvectors, and calculate the needed space
beforehand. These implementations are simple but better than the
previous.

Also only implement it once, for all `Vector<T>` using:

    impl<'self, T: Clone, V: Vector<T>> VectorVector<T> for &'self [V]

performance improved according to the bench test:

    before
    test vec::bench::concat ... bench: 74818 ns/iter (+/- 408)
    test vec::bench::connect ... bench: 87066 ns/iter (+/- 376)

    after
    test vec::bench::concat ... bench: 17724 ns/iter (+/- 126)
    test vec::bench::connect ... bench: 18353 ns/iter (+/- 691)

Closes #9581
2013-09-28 05:25:18 +02:00
blake2-ppc
5444f601dc std::vec: Add benchmark for .concat_vec and .connect_vec 2013-09-28 04:53:46 +02:00
bors
3ae895360c auto merge of #9557 : blake2-ppc/rust/vec-lifetime-token, r=thestinger
std::vec: Use a valid value as lifetime dummy in iterator

The current implementation uses `&v[0]` for the lifetime struct field,
but that is a dangling pointer for iterators derived from zero-length
slices.

Example:

    let v: [int, ..0] = [];  println!("{:?}", v.iter())

    std::vec::VecIterator<,int>{ptr: (0x7f3768626100 as *()), end: (0x7f3768626100 as *()), lifetime: &139875951207128}

To replace this parameter, use a field of type `Option<&'self ()>`
that is simply initialized with `None`, but still allows the iterator to
have a lifetime parameter.
2013-09-27 19:16:05 -07:00
bors
6828d2e018 auto merge of #9556 : alexcrichton/rust/less-at-mut, r=luqmana
Instead use &mut everywhere as much as possible and then reorganize lots of code
to get past the borrow checker.
2013-09-27 17:56:06 -07:00
Alex Crichton
8973d7c3f5 mk: Don't require pandoc to run rustdoc 2013-09-27 16:54:45 -07:00
Alex Crichton
dd8d565083 rustdoc: Include source files with documentation
All items have source links back to their actual code. Source files can be
omitted with the doc(html_no_source) attribute on the crate. Currently there is
no syntax highlighting, but that will come with syntax highlighting with all
other snippets.

Closes #2072
2013-09-27 16:54:19 -07:00
bors
cde44ea288 auto merge of #9553 : brson/rust/lesscxx, r=thestinger 2013-09-27 16:16:03 -07:00
bors
67394f20eb auto merge of #9552 : brson/rust/0.9-pre, r=alexcrichton 2013-09-27 13:51:07 -07:00
Flavio Percoco
d7e8f4cb03 Suppress warning by removing unused import 2013-09-27 21:36:14 +02:00
bors
e699d914cd auto merge of #9549 : catamorphism/rust/rustpkg-test-command, r=catamorphism,metajack
r? @metajack Towards #7401
2013-09-27 12:31:04 -07:00
bors
76e8f0828a auto merge of #9544 : alexcrichton/rust/clean-docs, r=pnkfelix
This purges doc/{std,extra} entirely during a `make clean` instead of just the
html files in some top level directories. This should help old documentation
from showing up on static.rust-lang.org
2013-09-27 11:11:06 -07:00