Commit Graph

31191 Commits

Author SHA1 Message Date
Erick Tryzelaar
e27b88d5bd remove seek from std::io::MemWriter, add SeekableMemWriter to librustc
Not all users of MemWriter need to seek, but having MemWriter
seekable adds between 3-29% in overhead in certain circumstances.
This fixes that performance gap by making a non-seekable MemWriter,
and creating a new SeekableMemWriter for those circumstances when
that functionality is actually needed.

```
test io::mem::test::bench_buf_reader                        ... bench:       682 ns/iter (+/- 85)
test io::mem::test::bench_buf_writer                        ... bench:       580 ns/iter (+/- 57)
test io::mem::test::bench_mem_reader                        ... bench:       793 ns/iter (+/- 99)
test io::mem::test::bench_mem_writer_001_0000               ... bench:        48 ns/iter (+/- 27)
test io::mem::test::bench_mem_writer_001_0010               ... bench:        65 ns/iter (+/- 27) = 153 MB/s
test io::mem::test::bench_mem_writer_001_0100               ... bench:       132 ns/iter (+/- 12) = 757 MB/s
test io::mem::test::bench_mem_writer_001_1000               ... bench:       802 ns/iter (+/- 151) = 1246 MB/s
test io::mem::test::bench_mem_writer_100_0000               ... bench:       481 ns/iter (+/- 28)
test io::mem::test::bench_mem_writer_100_0010               ... bench:      1957 ns/iter (+/- 126) = 510 MB/s
test io::mem::test::bench_mem_writer_100_0100               ... bench:      8222 ns/iter (+/- 434) = 1216 MB/s
test io::mem::test::bench_mem_writer_100_1000               ... bench:     82496 ns/iter (+/- 11191) = 1212 MB/s
test io::mem::test::bench_seekable_mem_writer_001_0000      ... bench:        48 ns/iter (+/- 2)
test io::mem::test::bench_seekable_mem_writer_001_0010      ... bench:        64 ns/iter (+/- 2) = 156 MB/s
test io::mem::test::bench_seekable_mem_writer_001_0100      ... bench:       129 ns/iter (+/- 7) = 775 MB/s
test io::mem::test::bench_seekable_mem_writer_001_1000      ... bench:       801 ns/iter (+/- 159) = 1248 MB/s
test io::mem::test::bench_seekable_mem_writer_100_0000      ... bench:       711 ns/iter (+/- 51)
test io::mem::test::bench_seekable_mem_writer_100_0010      ... bench:      2532 ns/iter (+/- 227) = 394 MB/s
test io::mem::test::bench_seekable_mem_writer_100_0100      ... bench:      8962 ns/iter (+/- 947) = 1115 MB/s
test io::mem::test::bench_seekable_mem_writer_100_1000      ... bench:     85086 ns/iter (+/- 11555) = 1175 MB/s
```

[breaking-change]
2014-07-29 16:31:39 -07:00
Alex Crichton
f91a964ef1 Test fixes from the rollup
Closes #15296 (Update disclaimer to improve clarity and intent)
Closes #15804 (Don't ICE when dealing with the count expr for fixed array types in various places.)
Closes #15893 (lint: Improve ffi-unsafe enum lint warning)
Closes #16045 (Rename Integer divides to is_multiple_of.)
Closes #16055 (manual: update list of feature gates, add phase attribute)
Closes #16056 (Improve documentation of rounding functions)
Closes #16061 (Remove references to non-existant functions in the std::path documentation)
Closes #16062 (Fix documentation error in MutableVectorAllocating::move_from)
Closes #16063 (adding discuss.rust-lang to community)
Closes #16064 (rustc: Switch dsymutil status => output)
Closes #16066 (making raw source display better)
Closes #16079 (doc: add missing word)
Closes #16080 (Update LLVM to fix miscompilations due to wrongfully removed lifetime intrinsics)
Closes #16084 (Elide lifetimes around Arc<T>.)
Closes #16085 (Gedit/gtksourceview language spec: add raw strings)
Closes #16086 (Implement Hash for DList)
2014-07-29 16:28:46 -07:00
Erick Tryzelaar
e841a88b92 syntax: add support for quoting arms 2014-07-29 16:01:36 -07:00
Simon Sapin
235bb3fb1f Add deprecated aliases for the old {Owned,}StrAsciiExt trait names.
The deprecation warning does not seem to be emitted right now, but hopefully that’ll be fixed.
2014-07-29 23:59:19 +01:00
Simon Sapin
b86574bfff Rename the std::ascii::{Owned,}StrAsciiExt traits to {Owned,}AsciiExt
… and implement them on Vec<u8> / &[u8].

[breaking-change]
2014-07-29 23:59:19 +01:00
Simon Sapin
ee8365ad81 Make std::ascii::ASCII_{UPPER,LOWER}_MAP public. 2014-07-29 23:56:44 +01:00
Simon Sapin
29cb9594d1 Use byte literals in std::ascii::ASCII_{UPPER,LOWER}_MAP for readability. 2014-07-29 23:56:44 +01:00
Erick Tryzelaar
1200ad0f06 Fix a bug pretty printing match { 5i } { _ => { } }
This also always puts a trailing comma on the last non-block expr.
2014-07-29 15:51:03 -07:00
Erick Tryzelaar
a46463d179 syntax: promote a comment on PatEnum into a docstring 2014-07-29 15:51:03 -07:00
Erick Tryzelaar
4d472ff1be syntax: allow quasiquoter to inline Vec<Stmt>s 2014-07-29 15:51:03 -07:00
Erick Tryzelaar
3b7c25ce5b syntax: add some more extension helper methods 2014-07-29 15:51:03 -07:00
Erick Tryzelaar
ce2824dafe serialize: fix a warning 2014-07-29 15:50:45 -07:00
Erick Tryzelaar
a011b2273e Fix a whitespace typo 2014-07-29 15:50:44 -07:00
nham
f7bcb736ad Implement Hash for DList 2014-07-29 15:44:37 -07:00
Simon Sapin
3c453b36ce Gedit/gtksourceview language spec: add raw strings
… and color (raw) strings as such in attributes.
This fixes cases where a string contains ] inside an attribute:
that ] used to incorrectly end the attribute coloring.

For large (many lines) doc comments, I’ve found preferable to use
`#![doc = r#"..."#]` to avoid prefixing every line with `//!`.
2014-07-29 15:44:35 -07:00
OGINO Masanori
02d12e5f71 Elide lifetimes around Arc<T>.
It's a small step forward in application of RFC 39 to the code base
itself.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-07-29 15:44:31 -07:00
Björn Steinbrink
04fa906648 Update LLVM to fix miscompilations due to wrongfully removed lifetime intrinsics
Fixes #15972 and #16011.
2014-07-29 15:44:26 -07:00
Tshepang Lekhonkhobe
f1e14cc10d doc: add missing word 2014-07-29 15:44:21 -07:00
Alexis Beingessner
7669f04fb0 making raw source display better
* Make the code fill up the full width of the page (no massive whitespace on the left)
* Move the code down to make it not intersect the logo
* Set a min-width and remove the max-width so that the code doesn't scroll internally, but instead scrolls the page, meaning horizontal scroll bars are always available
* Set overflow to actually overflow, just to be sure

Fixes #15891
2014-07-29 15:44:14 -07:00
Alex Crichton
9cffd7faea rustc: Switch dsymutil status => output
Sometimes dsymutil writes to stdout/stderr which rust isn't reading, which may
cause a deadlock.

Closes #16060
2014-07-29 15:44:10 -07:00
Alexis Beingessner
56f957f463 adding discuss.rust-lang to community 2014-07-29 15:44:08 -07:00
donkopotamus
57fef0f708 Fix documentation error in MutableVectorAllocating::move_from
Correct `str` to `src`
2014-07-29 15:44:05 -07:00
nham
16bc72040a Remove references to non-existant functions in the std::path documentation 2014-07-29 15:44:03 -07:00
Piotr Jawniak
f399d30802 Improve documentation of rounding functions 2014-07-29 15:43:59 -07:00
Corey Richardson
2a3c0d91cf manual: update list of feature gates, add phase attribute 2014-07-29 15:43:57 -07:00
Jonas Hietala
59a9128008 Rename Integer trait divides to is_multiple_of.
It is being changed because the previous wording was ambiguous.
`a.divides(b)` implied `a % b == 0` but it sounds like the other way
around. `9.divides(&3) == true` but we might read that as
"does 9 divide 3?".  It has been renamed to sidestep the ambiguity.

Work around the change by using `is_multiple_of` instead.

[breaking-change]
2014-07-29 15:43:52 -07:00
Anton Lofgren
ef7d3e13e2 lint: Improve ffi-unsafe enum lint warning
I think this is an improvement of the previous warning message, which
- like the comment that I removed implies - is in need of some
improvement.
I've opted to point the user in the right direction w.r.t how to fix the
problem, which I think is good form.

Not being familiar with the repr(...) attribute, I personally had to
check the lint rules myself to figure out what was wrong. Hopefully,
this will save he next person some time and headache.

Signed-off-by: Anton Lofgren <alofgren@op5.com>
2014-07-29 15:43:21 -07:00
Luqman Aden
c2ac7fde0b Add pretty=typed test support to compiletest and add a test for fixed size arrays. 2014-07-29 15:43:12 -07:00
Luqman Aden
445340771d libsyntax: Don't ICE on macro invocation in count expr of fixed array type. 2014-07-29 15:43:12 -07:00
Luqman Aden
779d100541 librustc: Typeck & record the count expr in TyFixedLengthVec. 2014-07-29 15:43:12 -07:00
Hugo Jobling
26ca10d2d7 Update disclaimer to improve clarity and intent 2014-07-29 15:43:02 -07:00
bors
5ebf4813a6 auto merge of #15956 : steveklabnik/rust/guide_crates, r=pcwalton
Also fixes a couple of filesystem references that I forgot to change. 😅
2014-07-29 21:16:50 +00:00
Stuart Pernsteiner
4d8de63fb3 speed up static linking by combining ar invocations 2014-07-29 13:54:40 -07:00
bors
87c78fd7e3 auto merge of #16046 : dotdash/rust/call_ignore_alloca, r=pcwalton 2014-07-29 19:31:44 +00:00
bors
6635fe7db4 auto merge of #15989 : pcwalton/rust/borrowck-pattern-guards, r=pnkfelix
the CFG for match statements.

There were two bugs in issue #14684. One was simply that the borrow
check didn't know about the correct CFG for match statements: the
pattern must be a predecessor of the guard. This disallows the bad
behavior if there are bindings in the pattern. But it isn't enough to
prevent the memory safety problem, because of wildcards; thus, this
patch introduces a more restrictive rule, which disallows assignments
and mutable borrows inside guards outright.

I discussed this with Niko and we decided this was the best plan of
action.

This breaks code that performs mutable borrows in pattern guards. Most
commonly, the code looks like this:

    impl Foo {
        fn f(&mut self, ...) {}
        fn g(&mut self, ...) {
            match bar {
                Baz if self.f(...) => { ... }
                _ => { ... }
            }
        }
    }

Change this code to not use a guard. For example:

    impl Foo {
        fn f(&mut self, ...) {}
        fn g(&mut self, ...) {
            match bar {
                Baz => {
                    if self.f(...) {
                        ...
                    } else {
                        ...
                    }
                }
                _ => { ... }
            }
        }
    }

Sometimes this can result in code duplication, but often it illustrates
a hidden memory safety problem.

Closes #14684.

[breaking-change]

r? @pnkfelix
2014-07-29 17:41:41 +00:00
Steve Klabnik
456c4494b8 New Guide: crates and modules 2014-07-29 12:50:25 -04:00
bors
b92536ff2f auto merge of #16054 : tshepang/rust/patch-1, r=brson 2014-07-29 15:57:01 +00:00
Michael Neumann
2e2f53fad2 Port Rust to DragonFlyBSD
Not included are two required patches:

* LLVM: segmented stack support for DragonFly [1]

* jemalloc: simple configure patches

[1]: http://reviews.llvm.org/D4705
2014-07-29 16:44:39 +02:00
bors
1c0493919f auto merge of #16052 : nham/rust/fs_docs, r=brson
Some of the fixes include:

 - fixing mismatch between the documentation and the function parameters. (i.e. documentation references `path` parameter, but it's actually called `from`, or vice versa)
 - A few Error sections were missing an "if" on the middle clause. For example, they used to be: "This function will return an error if [Thing], [Another Thing], or if [Yet Another Thing]." I added an "if" so it becomes "This function will return an error if [Thing], if [Another Thing], or if [Yet Another Thing]"
 - The error sections previously started off with 3 different phrases: 

     - "This function will return an error if ..."
     - "Will return an error if ..."
     - "This call will return an error if ..."

  I've standardized on the first phrase.
2014-07-29 14:11:37 +00:00
bors
72e2c7dec3 auto merge of #16050 : jxs/rust/master, r=alexcrichton
getopts returns Matches not Opt
2014-07-29 12:26:38 +00:00
bors
1ec6d17f23 auto merge of #16049 : aturon/rust/stability-dashboard-improvements, r=alexcrichton
* Makes dashboard width dynamic.
* Colors unmarked items.
* Gives overall crate percentages.
2014-07-29 10:41:41 +00:00
Marvin Löbel
da6070dbef Add a few more derivings to AST types 2014-07-29 12:32:32 +02:00
Marvin Löbel
26a39f23ce Refactored syntax::fold.
Prior to this, the code there had a few issues:

- Default implementations inconsistently either had the prefix `noop_` or
  not.
- Some default methods where implemented in terms of a public noop function
  for user code to call, others where implemented directly on the trait
  and did not allow users of the trait to reuse the code.
- Some of the default implementations where private, and thus not reusable
  for other implementors.
- There where some bugs where default implementations called other default
  implementations directly, rather than to the underlying Folder, with the
  result of some AST nodes never being visited even if the user implemented that
  method. (For example, the current Folder never folded struct fields)

This commit solves this situation somewhat radically by making _all_
`fold_...` functions in the module into Folder methods, and implementing
them all in terms of public `noop_...` functions for other implementors to
call out to.

Some public functions had to be renamed to fit the new system, so this is a
breaking change.

[breaking-change]
2014-07-29 12:31:53 +02:00
bors
7375f4d842 auto merge of #16038 : nham/rust/collections_partialord, r=alexcrichton
cc #15294
2014-07-29 07:56:41 +00:00
bors
23466b04f9 auto merge of #16034 : sfackler/rust/test-reexport-fix, r=alexcrichton
We previously reexported entire modules, which caused private things to
become reachable and trip the dead code and private items in public API
lints.

Closes #15912
2014-07-29 06:11:41 +00:00
bors
f653d9f9bf auto merge of #16033 : nham/rust/hash_tuple_impl, r=alexcrichton
Previously the implementation of Hash was limited to tuples of up to arity 8. This increases it to tuples of up to arity 12. 

Also, the implementation macro for `Hash` used to expand to something like this:

    impl Hash for (a7,)
    impl Hash for (a6, a7)
    impl Hash for (a5, a6, a7)
    ...

This style is inconsistent with the implementations in core::tuple, which look like this:

    impl Trait for (A,)
    impl Trait for (A, B)
    impl Trait for (A, B, C)
    ...

This is perhaps a minor point, but it does mean the documentation pages are inconsistent. Compare the tuple implementations in the documentation for [Hash](http://static.rust-lang.org/doc/master/std/hash/trait.Hash.html) and [PartialOrd](http://static.rust-lang.org/doc/master/core/cmp/trait.PartialOrd.html)

This changes the Hash implementation to be consistent with `core::tuple`.
2014-07-29 04:26:42 +00:00
bors
9e250109f9 auto merge of #16032 : treeman/rust/doc-treecollection, r=alexcrichton 2014-07-29 02:41:41 +00:00
bors
b2bd998607 auto merge of #16027 : treeman/rust/doc-string, r=alexcrichton 2014-07-28 22:36:39 +00:00
Stuart Pernsteiner
36872d581b remove unused field CrateContext::uses_gc 2014-07-28 15:31:42 -07:00
Tshepang Lekhonkhobe
886c501ca3 doc: reduce overlong sentence 2014-07-28 23:22:47 +02:00