]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoauto merge of #15864 : alexcrichton/rust/rollup, r=alexcrichton
bors [Mon, 21 Jul 2014 18:46:46 +0000 (18:46 +0000)]
auto merge of #15864 : alexcrichton/rust/rollup, r=alexcrichton

9 years agoTest fixes from the rollup
Alex Crichton [Mon, 21 Jul 2014 17:18:17 +0000 (10:18 -0700)]
Test fixes from the rollup

Closes #15690 (Guide: improve error handling)
Closes #15729 (Guide: guessing game)
Closes #15751 (repair macro docs)
Closes #15766 (rustc: Print a smaller hash on -v)
Closes #15815 (Add unit test for rlibc)
Closes #15820 (Minor refactoring and features in rustc driver for embedders)
Closes #15822 (rustdoc: Add an --extern flag analagous to rustc's)
Closes #15824 (Document Deque trait and bitv.)
Closes #15832 (syntax: Join consecutive string literals in format strings together)
Closes #15837 (Update LLVM to include NullCheckElimination pass)
Closes #15841 (Rename to_str to to_string)
Closes #15847 (Purge #[!resolve_unexported] from the compiler)
Closes #15848 (privacy: Add publically-reexported foreign item to exported item set)
Closes #15849 (fix string in from_utf8_lossy_100_multibyte benchmark)
Closes #15850 (Get rid of few warnings in tests)
Closes #15852 (Clarify the std::vec::Vec::with_capacity docs)

9 years agoClarify the std::vec::Vec docs regarding capacity
P1start [Mon, 21 Jul 2014 08:33:20 +0000 (20:33 +1200)]
Clarify the std::vec::Vec docs regarding capacity

9 years agoGet rid of few warnings in tests
Piotr Jawniak [Sun, 20 Jul 2014 15:20:37 +0000 (17:20 +0200)]
Get rid of few warnings in tests

9 years agofix string in from_utf8_lossy_100_multibyte benchmark
Ted Horst [Mon, 21 Jul 2014 05:43:08 +0000 (00:43 -0500)]
fix string in from_utf8_lossy_100_multibyte benchmark

9 years agoprivacy: Add publically-reexported foreign item to exported item set
Kiet Tran [Mon, 21 Jul 2014 05:11:43 +0000 (22:11 -0700)]
privacy: Add publically-reexported foreign item to exported item set

Close #15740

9 years agoDon't create reexport module if there are none
Steven Fackler [Mon, 21 Jul 2014 05:34:09 +0000 (22:34 -0700)]
Don't create reexport module if there are none

9 years agoPurge !resolve_unexported
Steven Fackler [Mon, 21 Jul 2014 05:11:43 +0000 (22:11 -0700)]
Purge !resolve_unexported

9 years agoRestructure test harness
Steven Fackler [Mon, 21 Jul 2014 05:10:11 +0000 (22:10 -0700)]
Restructure test harness

We now build up a set of modules that reexport everything the test
framework needs, instead of turning off privacy.

9 years agoRemove useless RefCells
Steven Fackler [Mon, 21 Jul 2014 01:05:59 +0000 (18:05 -0700)]
Remove useless RefCells

9 years agoRename to_str to to_string
Steven Fackler [Mon, 21 Jul 2014 00:12:40 +0000 (17:12 -0700)]
Rename to_str to to_string

Closes #15796.

[breaking-change]

9 years agoUpdate LLVM to include NullCheckElimination pass
Björn Steinbrink [Sun, 20 Jul 2014 20:19:17 +0000 (22:19 +0200)]
Update LLVM to include NullCheckElimination pass

Fixes #11751

9 years agosyntax: Join consecutive string literals in format strings together
root [Sun, 20 Jul 2014 14:31:43 +0000 (16:31 +0200)]
syntax: Join consecutive string literals in format strings together

Emit a single rt::Piece per consecutive string literals. String literals
are split on {{ or }} escapes.

Saves a small amount of static storage and emitted code size.

9 years agoSimplify and cleanup bitv examples.
Jonas Hietala [Sun, 20 Jul 2014 15:09:53 +0000 (17:09 +0200)]
Simplify and cleanup bitv examples.

9 years agoDescribe BitPositions and TwoBitPositions.
Jonas Hietala [Sun, 20 Jul 2014 13:15:48 +0000 (15:15 +0200)]
Describe BitPositions and TwoBitPositions.

9 years agoPolish bitv docs.
Jonas Hietala [Sun, 20 Jul 2014 12:59:13 +0000 (14:59 +0200)]
Polish bitv docs.

9 years agoEnclose None as `None`.
Jonas Hietala [Sun, 20 Jul 2014 12:47:13 +0000 (14:47 +0200)]
Enclose None as `None`.

9 years agoMain bitv example: prime sieve.
Jonas Hietala [Sun, 20 Jul 2014 12:45:33 +0000 (14:45 +0200)]
Main bitv example: prime sieve.

9 years agoMove intersection above difference and symmetric_differance.
Jonas Hietala [Sun, 20 Jul 2014 12:33:27 +0000 (14:33 +0200)]
Move intersection above difference and symmetric_differance.

So all comes in the order union, intersection, difference and
symmetric_difference.

9 years agoDocument BitvSet.
Jonas Hietala [Sun, 20 Jul 2014 12:32:18 +0000 (14:32 +0200)]
Document BitvSet.

9 years agoDocument Bitv.
Jonas Hietala [Sun, 20 Jul 2014 12:28:40 +0000 (14:28 +0200)]
Document Bitv.

9 years agoGroup union, intersect and difference in Bitv.
Jonas Hietala [Sun, 20 Jul 2014 12:21:47 +0000 (14:21 +0200)]
Group union, intersect and difference in Bitv.

9 years agoPlace union as the first function, for consistency.
Jonas Hietala [Sun, 20 Jul 2014 12:18:04 +0000 (14:18 +0200)]
Place union as the first function, for consistency.

9 years agoMove in-place functions below their iterator variants.
Jonas Hietala [Sun, 20 Jul 2014 12:16:47 +0000 (14:16 +0200)]
Move in-place functions below their iterator variants.

9 years agoDocument Deque.
Jonas Hietala [Sun, 20 Jul 2014 12:12:26 +0000 (14:12 +0200)]
Document Deque.

9 years agorustdoc: Add an --extern flag analagous to rustc's
Tom Jakubowski [Sun, 20 Jul 2014 06:02:14 +0000 (23:02 -0700)]
rustdoc: Add an --extern flag analagous to rustc's

This adds an `--extern` flag to `rustdoc` much like the compiler's to
specify the path where a given crate can be found.

9 years agoAddress review feedback
Brian Anderson [Sun, 20 Jul 2014 23:32:46 +0000 (16:32 -0700)]
Address review feedback

9 years agorustc: Allow the crate linked to as 'std' to be customized
Brian Anderson [Sun, 20 Jul 2014 05:40:39 +0000 (22:40 -0700)]
rustc: Allow the crate linked to as 'std' to be customized

This adds the alt_std_name field to the Session's Options type.
I'm using this in an external tool to control which libraries
a crate links to.

9 years agorustc: Pass optional additional plugins to compile_input
Brian Anderson [Sun, 20 Jul 2014 04:54:37 +0000 (21:54 -0700)]
rustc: Pass optional additional plugins to compile_input

This provides a way for clients of the rustc library to add
their own features to the pipeline.

9 years agorustc: Extract --crate-type parsing to its own function
Brian Anderson [Sun, 20 Jul 2014 04:11:26 +0000 (21:11 -0700)]
rustc: Extract --crate-type parsing to its own function

Helpful for users of rustc as a library.

9 years agorustc: Make `monitor` public.
Brian Anderson [Sat, 19 Jul 2014 08:29:57 +0000 (01:29 -0700)]
rustc: Make `monitor` public.

It's harder to run rustc correctly without it.

9 years agorlibc: add unit tests
Ilya Dmitrichenko [Sun, 20 Jul 2014 13:05:53 +0000 (14:05 +0100)]
rlibc: add unit tests

9 years agorlibc: fix bug in `memcmp()`
Ilya Dmitrichenko [Sun, 20 Jul 2014 13:05:28 +0000 (14:05 +0100)]
rlibc: fix bug in `memcmp()`

9 years agorustc: Print a smaller hash on -v
Alex Crichton [Fri, 18 Jul 2014 04:34:41 +0000 (21:34 -0700)]
rustc: Print a smaller hash on -v

The long hash just takes up space and you can discover the main hash through the
`rustc --version verbose` command.

9 years agorepair macro docs
John Clements [Thu, 17 Jul 2014 16:45:31 +0000 (09:45 -0700)]
repair macro docs

In f1ad425199b0d89dab275a8c8f6f29a73d316f70, I changed the handling
of macros, to prevent macro invocations from occurring in fully expanded
source. Instead, I added a side table. It contained only the
spans of the macros, because this was the only information required
in order to make macro export work.

However, librustdoc was also affected by this change, since it
extracts macro information in a similar way. As a result of the earlier
change, exported macros were no longer documented.

In order to repair this, I've adjusted the side table to contain whole
items, rather than just the spans.

9 years agoGuessing game explanation
Steve Klabnik [Tue, 15 Jul 2014 20:21:51 +0000 (16:21 -0400)]
Guessing game explanation

We now build the game at the end of the first section.

I wanted to do it as we went along, but it's too hard with these fundamentals
not in place. The rest will do the 'as we go' approach, but I think this is
better.

9 years agoGuide: improve error handling
Steve Klabnik [Tue, 15 Jul 2014 20:05:27 +0000 (16:05 -0400)]
Guide: improve error handling

9 years agoauto merge of #15450 : chris-morgan/rust/vim-misc-2014-07-04, r=kballard
bors [Mon, 21 Jul 2014 16:51:37 +0000 (16:51 +0000)]
auto merge of #15450 : chris-morgan/rust/vim-misc-2014-07-04, r=kballard

9 years agoFix :syn-include usage of Vim filetype.
Chris Morgan [Fri, 4 Jul 2014 00:47:13 +0000 (10:47 +1000)]
Fix :syn-include usage of Vim filetype.

Here’s what the Vim manual says in *:syn-include*:

    :sy[ntax] include [@{grouplist-name}] {file-name}

All syntax items declared in the included file will have the
"contained" flag added.  In addition, if a group list is
specified, all top-level syntax items in the included file will
be added to that list.

We had two rules for `rustModPath`, one `contained` and the other not.
The effect was that the second (now renamed to `rustModPathInUse`) was
being included in the group list, and thus that all identifiers were
being highlighted as `Include`, which is definitely not what we wanted.

9 years agoHighlight $(…)* and $foo in Vim.
Chris Morgan [Fri, 4 Jul 2014 00:45:36 +0000 (10:45 +1000)]
Highlight $(…)* and $foo in Vim.

9 years agoauto merge of #15810 : SimonSapin/rust/base64-from-bytes, r=alexcrichton
bors [Sun, 20 Jul 2014 22:46:29 +0000 (22:46 +0000)]
auto merge of #15810 : SimonSapin/rust/base64-from-bytes, r=alexcrichton

The algorithm was already based on bytes internally.

Also use byte literals instead of casting u8 to char for matching.

[breaking-change] The `InvalidBase64Character` variant of the `FromBase64Error` enum was renamed to `InvalidBase64Byte`, and contains a `u8` instead of a `char`.

r? @alexcrichton

9 years agoauto merge of #15808 : jakub-/rust/use-mod, r=alexcrichton
bors [Sun, 20 Jul 2014 21:06:32 +0000 (21:06 +0000)]
auto merge of #15808 : jakub-/rust/use-mod, r=alexcrichton

Implements RFC #168.

9 years agoauto merge of #15805 : Sawyer47/rust/issue-8709, r=alexcrichton
bors [Sun, 20 Jul 2014 19:26:31 +0000 (19:26 +0000)]
auto merge of #15805 : Sawyer47/rust/issue-8709, r=alexcrichton

Closes #8709

9 years agoauto merge of #15806 : treeman/rust/std-doc, r=alexcrichton
bors [Sun, 20 Jul 2014 17:46:32 +0000 (17:46 +0000)]
auto merge of #15806 : treeman/rust/std-doc, r=alexcrichton

Used `HashMap` and `HashSet` as the base of most examples. Could change it up with different containers, but I don't think it's a big deal.

9 years agoauto merge of #15814 : kvark/rust/ast, r=huonw
bors [Sun, 20 Jul 2014 16:01:32 +0000 (16:01 +0000)]
auto merge of #15814 : kvark/rust/ast, r=huonw

Makes working with syntax deriving a bit more pleasuring. For instance, once can use local (non-static) strings anywhere inside `TraitDef` now.

9 years agoauto merge of #15803 : omp/rust/master, r=alexcrichton
bors [Sun, 20 Jul 2014 14:21:32 +0000 (14:21 +0000)]
auto merge of #15803 : omp/rust/master, r=alexcrichton

Fix small typo in guide.

9 years agoauto merge of #15797 : brson/rust/taskstab, r=alexcrichton
bors [Sun, 20 Jul 2014 12:01:31 +0000 (12:01 +0000)]
auto merge of #15797 : brson/rust/taskstab, r=alexcrichton

Summary:

* alloc::rc module stable
* Rc type stable
* Functions relating to weak references experimental
* core::cmp module stable
* PartialEq/Eq/PartialOrd/Ord unstable because trait reform will make them change again
* Equiv experimental because there may be better sol'ns
* lexical_ordering deprecated because it can be done trivially with the Ord trait
* min/max stable
* std::task module stable
* TaskBuilder::stdout/stderr experimental because we aren't certain we want to configure the environment this way
* try_future experimental because Future is experimental
* try unstable because the error type might change
* deschedule/failing unstable

The major thing I did differently than previously-discussed is that I made `try` experimental: there's been discussion that the error type `Box<Any + Send>` is not sufficient.

Per https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-07-16.md.

9 years agosmall typo
Steve Klabnik [Sun, 20 Jul 2014 11:57:49 +0000 (04:57 -0700)]
small typo

9 years agoImplement new mod import sugar
Jakub Wieczorek [Thu, 17 Jul 2014 22:56:56 +0000 (00:56 +0200)]
Implement new mod import sugar

Implements RFC #168.

9 years agoauto merge of #15785 : treeman/rust/fix-15780, r=alexcrichton
bors [Sun, 20 Jul 2014 09:31:29 +0000 (09:31 +0000)]
auto merge of #15785 : treeman/rust/fix-15780, r=alexcrichton

Fix for #15780.

9 years agoauto merge of #15784 : dotdash/rust/unreach, r=luqmana
bors [Sun, 20 Jul 2014 07:51:32 +0000 (07:51 +0000)]
auto merge of #15784 : dotdash/rust/unreach, r=luqmana

`call_visit_glue` is only ever called from trans_intrinsic, and the
block won't be unreachable there. Also, the comment doesn't make sense
anymore. When the code was introduced in 38fee9526a the function was
also responsible for the cleanup glue, which is no longer the case.

While we're at it, also fixed the debug message to output the right
function name.

9 years agoCorrectly stringify! types and paths inside macros
Piotr Jawniak [Sat, 19 Jul 2014 09:59:44 +0000 (11:59 +0200)]
Correctly stringify! types and paths inside macros

Closes #8709

9 years agoauto merge of #15745 : treeman/rust/tutorial-fixup, r=steveklabnik
bors [Sun, 20 Jul 2014 06:11:32 +0000 (06:11 +0000)]
auto merge of #15745 : treeman/rust/tutorial-fixup, r=steveklabnik

Simplify example in 5.2 to remove hidden `#[deriving(Show)]`. Traits haven't been introduced yet and now it's easier to just type in the code and expect it to work. Add in some examples for constructing the enum types. Explicitly expose `#![feature(struct_variant)]` in the code to make it more transparent, this bit me when I worked through the tutorial.

Add references in chapter 8 to later chapters describing `Rc`, `Gc` and `Send`. This is a simple fix for #15293.

Simplify vector indexing example in chapter 13 and removed hidden, unnecessary, code. Gave an example usage of the derived `Rand` trait in chapter 17.

Removed references to removed 'extra' crate.

9 years agoauto merge of #15776 : alexcrichton/rust/snapshots, r=huonw
bors [Sun, 20 Jul 2014 04:31:33 +0000 (04:31 +0000)]
auto merge of #15776 : alexcrichton/rust/snapshots, r=huonw

9 years agoRegister new snapshots
Alex Crichton [Wed, 16 Jul 2014 17:28:42 +0000 (10:28 -0700)]
Register new snapshots

9 years agoauto merge of #15767 : pcwalton/rust/lifetime-elision, r=nick29581
bors [Sun, 20 Jul 2014 02:46:34 +0000 (02:46 +0000)]
auto merge of #15767 : pcwalton/rust/lifetime-elision, r=nick29581

This implements RFC 39. Omitted lifetimes in return values will now be
inferred to more useful defaults, and an error is reported if a lifetime
in a return type is omitted and one of the two lifetime elision rules
does not specify what it should be.

This primarily breaks two uncommon code patterns. The first is this:

    unsafe fn get_foo_out_of_thin_air() -> &Foo {
        ...
    }

This should be changed to:

    unsafe fn get_foo_out_of_thin_air() -> &'static Foo {
        ...
    }

The second pattern that needs to be changed is this:

    enum MaybeBorrowed<'a> {
        Borrowed(&'a str),
        Owned(String),
    }

    fn foo() -> MaybeBorrowed {
        Owned(format!("hello world"))
    }

Change code like this to:

    enum MaybeBorrowed<'a> {
        Borrowed(&'a str),
        Owned(String),
    }

    fn foo() -> MaybeBorrowed<'static> {
        Owned(format!("hello world"))
    }

Closes #15552.

[breaking-change]

r? @nick29581

9 years agoauto merge of #15764 : alexcrichton/rust/issue-15761, r=kballard
bors [Sun, 20 Jul 2014 01:06:36 +0000 (01:06 +0000)]
auto merge of #15764 : alexcrichton/rust/issue-15761, r=kballard

This branch of try_send() just forgot to wake up any receiver waiting for data.

Closes #15761

9 years agoauto merge of #15746 : steveklabnik/rust/docs_random, r=alexcrichton
bors [Sat, 19 Jul 2014 23:26:37 +0000 (23:26 +0000)]
auto merge of #15746 : steveklabnik/rust/docs_random, r=alexcrichton

This is now linked to in the guide, so I want to make sure it's good. This
adds a bit more explanation, and brings usage in line with current good style.

9 years agoauto merge of #15650 : jakub-/rust/patterns-statics, r=pcwalton
bors [Sat, 19 Jul 2014 21:46:37 +0000 (21:46 +0000)]
auto merge of #15650 : jakub-/rust/patterns-statics, r=pcwalton

This is accomplished by rewriting static expressions into equivalent patterns.
This way, patterns referencing static variables can both participate
in exhaustiveness analysis as well as be compiled down into the appropriate
branch of the decision trees that match expressions are codegened to.

Fixes #6533.
Fixes #13626.
Fixes #13731.
Fixes #14576.
Fixes #15393.

9 years agoFixed lifetimes on syntax deriving structs, implemented Clone
Dzmitry Malyshau [Sat, 19 Jul 2014 21:33:17 +0000 (17:33 -0400)]
Fixed lifetimes on syntax deriving structs, implemented Clone

9 years agolibrustc: Implement lifetime elision.
Patrick Walton [Fri, 18 Jul 2014 04:44:59 +0000 (21:44 -0700)]
librustc: Implement lifetime elision.

This implements RFC 39. Omitted lifetimes in return values will now be
inferred to more useful defaults, and an error is reported if a lifetime
in a return type is omitted and one of the two lifetime elision rules
does not specify what it should be.

This primarily breaks two uncommon code patterns. The first is this:

    unsafe fn get_foo_out_of_thin_air() -> &Foo {
        ...
    }

This should be changed to:

    unsafe fn get_foo_out_of_thin_air() -> &'static Foo {
        ...
    }

The second pattern that needs to be changed is this:

    enum MaybeBorrowed<'a> {
        Borrowed(&'a str),
        Owned(String),
    }

    fn foo() -> MaybeBorrowed {
        Owned(format!("hello world"))
    }

Change code like this to:

    enum MaybeBorrowed<'a> {
        Borrowed(&'a str),
        Owned(String),
    }

    fn foo() -> MaybeBorrowed<'static> {
        Owned(format!("hello world"))
    }

Closes #15552.

[breaking-change]

9 years agoauto merge of #15782 : steveklabnik/rust/string_guide_link, r=cmr
bors [Sat, 19 Jul 2014 18:36:37 +0000 (18:36 +0000)]
auto merge of #15782 : steveklabnik/rust/string_guide_link, r=cmr

Three small changes:

1. Re-organize headers in the Strings guide so they show up correctly.
2. build the strings guide with the other docs
3. include the strings guide in the list of guides

9 years agoauto merge of #15772 : treeman/rust/hashset-doc, r=alexcrichton
bors [Sat, 19 Jul 2014 16:01:43 +0000 (16:01 +0000)]
auto merge of #15772 : treeman/rust/hashset-doc, r=alexcrichton

Example how to use the set with a custom type. Fill in examples for the missing methods. Also group implemented traits below `HashSet` method impl.

9 years agoImplement FromBase64 for &[u8].
Simon Sapin [Sat, 19 Jul 2014 15:46:14 +0000 (16:46 +0100)]
Implement FromBase64 for &[u8].

The algorithm was already based on bytes internally.

Also use byte literals instead of casting u8 to char for matching.

9 years agoauto merge of #15638 : blake2-ppc/rust/ptr-arithmetic-chars, r=huonw
bors [Sat, 19 Jul 2014 14:06:39 +0000 (14:06 +0000)]
auto merge of #15638 : blake2-ppc/rust/ptr-arithmetic-chars, r=huonw

Reimplement the string slice's `Iterator<char>` by wrapping the already efficient
slice iterator.

The iterator uses our guarantee that the string contains valid UTF-8, but its only unsafe
code is transmuting the decoded `u32` into `char`.

Benchmarks suggest that the runtime of `Chars` benchmarks are reduced by up to 30%,
runtime of `Chars` reversed reduced by up to 60%.

```
BEFORE
test str::bench::char_indicesator                          ... bench:       124 ns/iter (+/- 1)
test str::bench::char_indicesator_rev                      ... bench:       188 ns/iter (+/- 9)
test str::bench::char_iterator                             ... bench:       122 ns/iter (+/- 2)
test str::bench::char_iterator_ascii                       ... bench:       302 ns/iter (+/- 41)
test str::bench::char_iterator_for                         ... bench:       123 ns/iter (+/- 4)
test str::bench::char_iterator_rev                         ... bench:       189 ns/iter (+/- 14)
test str::bench::char_iterator_rev_for                     ... bench:       177 ns/iter (+/- 4)

AFTER
test str::bench::char_indicesator                          ... bench:        85 ns/iter (+/- 3)
test str::bench::char_indicesator_rev                      ... bench:        82 ns/iter (+/- 2)
test str::bench::char_iterator                             ... bench:       100 ns/iter (+/- 3)
test str::bench::char_iterator_ascii                       ... bench:       317 ns/iter (+/- 3)
test str::bench::char_iterator_for                         ... bench:        86 ns/iter (+/- 2)
test str::bench::char_iterator_rev                         ... bench:        80 ns/iter (+/- 6)
test str::bench::char_iterator_rev_for                     ... bench:        68 ns/iter (+/- 0)
```

Note: Branch name is no longer indicative of the implementation.

9 years agoSimplify str CharOffsets iterator
root [Sat, 19 Jul 2014 13:39:02 +0000 (15:39 +0200)]
Simplify str CharOffsets iterator

Only one uint is needed to keep track of the offset from the original
full string.

9 years agoauto merge of #15765 : luqmana/rust/iec, r=pcwalton
bors [Sat, 19 Jul 2014 12:26:39 +0000 (12:26 +0000)]
auto merge of #15765 : luqmana/rust/iec, r=pcwalton

Fixes #15400.

9 years agoDocument some trait methods.
Jonas Hietala [Sat, 19 Jul 2014 10:10:09 +0000 (12:10 +0200)]
Document some trait methods.

9 years agoauto merge of #15754 : jakub-/rust/diagnostics, r=alexcrichton
bors [Sat, 19 Jul 2014 08:51:34 +0000 (08:51 +0000)]
auto merge of #15754 : jakub-/rust/diagnostics, r=alexcrichton

9 years agoauto merge of #15752 : nham/rust/dlist_docs, r=alexcrichton
bors [Sat, 19 Jul 2014 07:11:33 +0000 (07:11 +0000)]
auto merge of #15752 : nham/rust/dlist_docs, r=alexcrichton

Someone rightfully complained in IRC that DList was lacking examples. Here are some.

9 years agoFix typo.
David Vazgenovich Shakaryan [Sat, 19 Jul 2014 06:11:25 +0000 (23:11 -0700)]
Fix typo.

9 years agoauto merge of #15686 : alexcrichton/rust/same-crate-name, r=kballard
bors [Sat, 19 Jul 2014 03:11:34 +0000 (03:11 +0000)]
auto merge of #15686 : alexcrichton/rust/same-crate-name, r=kballard

The first is to require that `#[crate_name]` and `--crate-name` always match (if both are specified). The second is to fix parallel compilation in cargo by mixing in `-C extra-filename` into the temporary outputs of the compiler.

9 years agostd: Stabilize task module.
Brian Anderson [Fri, 18 Jul 2014 23:02:39 +0000 (16:02 -0700)]
std: Stabilize task module.

Most stable. deschedule/failing experimental because of concerns about
naming and desirability.

Adds task::name() to replace deprecated task::with_name().

9 years agoalloc: Stabilize rc module.
Brian Anderson [Fri, 18 Jul 2014 23:02:14 +0000 (16:02 -0700)]
alloc: Stabilize rc module.

Weak pointers experimental. Most everything else stable.

9 years agostd: Stabilize default
Brian Anderson [Fri, 18 Jul 2014 23:01:55 +0000 (16:01 -0700)]
std: Stabilize default

All stable.

9 years agoImprove documentation for rand::random
Steve Klabnik [Thu, 17 Jul 2014 15:59:45 +0000 (11:59 -0400)]
Improve documentation for rand::random

This is now linked to in the guide, so I want to make sure it's good. This
adds a bit more explanation, and brings usage in line with current good style.

9 years agorustc: Mix extra-filename in temp outputs
Alex Crichton [Tue, 15 Jul 2014 16:13:58 +0000 (09:13 -0700)]
rustc: Mix extra-filename in temp outputs

When invoking the compiler in parallel, the intermediate output of the object
files and bytecode can stomp over one another if two crates with the same name
are being compiled.

The output file is already being disambiguated with `-C extra-filename`, so this
commit alters the naming of the temporary files to also mix in the extra
filename to ensure that file names don't clash.

9 years agoAdd support for patterns referencing non-trivial statics
Jakub Wieczorek [Sun, 13 Jul 2014 13:12:47 +0000 (15:12 +0200)]
Add support for patterns referencing non-trivial statics

This is accomplished by rewriting static expressions into equivalent patterns.
This way, patterns referencing static variables can both participate
in exhaustiveness analysis as well as be compiled down into the appropriate
branch of the decision trees that match expressions are codegened to.

Fixes #6533.
Fixes #13626.
Fixes #13731.
Fixes #14576.
Fixes #15393.

9 years agocore: Stabliize core::cmp
Brian Anderson [Fri, 18 Jul 2014 22:59:54 +0000 (15:59 -0700)]
core: Stabliize core::cmp

Mark Eq, PartialEq, Ord, PartialOrd as unstable: they will change
slightly after trait reform. Equiv as experimental: better solutions
are desired. min/max stable.

9 years agoWrite multibyte case for str Chars iterator in-line
root [Fri, 18 Jul 2014 22:02:30 +0000 (00:02 +0200)]
Write multibyte case for str Chars iterator in-line

Thanks to comments from @alexcrichton, write the next/next_back function
bodies without nested functions in a more top-to-bottom flow style.

Also improve comment style and motivate the unsafe blocks with comments.

9 years agoClarify str Chars iterator implementation
root [Thu, 17 Jul 2014 22:59:49 +0000 (00:59 +0200)]
Clarify str Chars iterator implementation

Thanks to comments from @huonw, clarify decoding details and use
statics for important constants for UTF-8 decoding. Convert some magic
numbers scattered in the same file to use the statics too.

9 years agoauto merge of #15743 : Ryman/rust/mandelbrot_fix, r=alexcrichton
bors [Fri, 18 Jul 2014 21:46:32 +0000 (21:46 +0000)]
auto merge of #15743 : Ryman/rust/mandelbrot_fix, r=alexcrichton

Matches the official sample output (N=200) again.

cc #15408

9 years agoRemove the unneeded final parameter from call_visit_glue
Björn Steinbrink [Fri, 18 Jul 2014 19:56:36 +0000 (21:56 +0200)]
Remove the unneeded final parameter from call_visit_glue

call_visit_glue() is only ever called with None as its last argument, so
we can remove it as well.

9 years agoIgnore one test.
Luqman Aden [Fri, 18 Jul 2014 00:17:27 +0000 (17:17 -0700)]
Ignore one test.

9 years agolibrustc: Set enum discriminant only after field translation.
Luqman Aden [Thu, 10 Jul 2014 22:09:21 +0000 (15:09 -0700)]
librustc: Set enum discriminant only after field translation.

9 years agolibrustc: Only emit constructor functions as necessary.
Luqman Aden [Thu, 10 Jul 2014 17:59:52 +0000 (10:59 -0700)]
librustc: Only emit constructor functions as necessary.

9 years agolibrustc: Emit tuple struct constructor at callsite instead of via a call to a function.
Luqman Aden [Thu, 10 Jul 2014 07:20:28 +0000 (00:20 -0700)]
librustc: Emit tuple struct constructor at callsite instead of via a call to a function.

9 years agolibrustc: Emit enum variant constructor at callsite instead of via a call to a function.
Luqman Aden [Thu, 10 Jul 2014 06:42:08 +0000 (23:42 -0700)]
librustc: Emit enum variant constructor at callsite instead of via a call to a function.

9 years agoSpecial case for 0 arguments given in format!
Jonas Hietala [Fri, 18 Jul 2014 18:39:38 +0000 (20:39 +0200)]
Special case for 0 arguments given in format!

9 years agoauto merge of #15742 : pnkfelix/rust/fsk-fix-15019, r=pcwalton
bors [Fri, 18 Jul 2014 18:26:34 +0000 (18:26 +0000)]
auto merge of #15742 : pnkfelix/rust/fsk-fix-15019, r=pcwalton

Removed `index_to_bitset` field and `_frozen` methods.

Drive-by: Added some missing docs on the `each_bit` method.
Drive-by: Put in a regular pattern: when calling `compute_id_range`, ensure `words_per_id > 0` by either asserting it or checking and returning early. (The prior code did the latter in a few cases where necessary, but debugging is much aided by the asserts.)
Fix #15019.

9 years agoAssign more diagnostic codes
Jakub Wieczorek [Thu, 17 Jul 2014 17:56:37 +0000 (19:56 +0200)]
Assign more diagnostic codes

9 years agoCorrect plural of arguments in format_args!
Jonas Hietala [Fri, 18 Jul 2014 16:34:49 +0000 (18:34 +0200)]
Correct plural of arguments in format_args!

9 years agoauto merge of #14539 : pcwalton/rust/unboxed-closures, r=pnkfelix
bors [Fri, 18 Jul 2014 16:46:33 +0000 (16:46 +0000)]
auto merge of #14539 : pcwalton/rust/unboxed-closures, r=pnkfelix

@nikomatsakis r?

9 years agoRemove outdated unreachable check from `call_visit_glue`
Björn Steinbrink [Sun, 6 Jul 2014 10:02:40 +0000 (12:02 +0200)]
Remove outdated unreachable check from `call_visit_glue`

`call_visit_glue` is only ever called from trans_intrinsic, and the
block won't be unreachable there. Also, the comment doesn't make sense
anymore. When the code was introduced in 38fee9526a the function was
also responsible for the cleanup glue, which is no longer the case.

While we're at it, also fixed the debug message to output the right
function name.

9 years agolibrustc: Implement unboxed closures with mutable receivers
Patrick Walton [Thu, 29 May 2014 05:26:56 +0000 (22:26 -0700)]
librustc: Implement unboxed closures with mutable receivers

9 years agorustc: #[crate_name] and --crate-name must match
Alex Crichton [Tue, 15 Jul 2014 16:13:40 +0000 (09:13 -0700)]
rustc: #[crate_name] and --crate-name must match

Part of the original discussions around the `--crate-name` flag brought up that
mass confusion can arise when the flag specifies a different name than is
contained in the crate.

The current primary use case of the `--crate-name` flag is through cargo and
not requiring a `#[crate_name]` attribute, but if the `#[crate_name]` attribute
is specified it will likely go awry when the two names deviate from one another.
This commit requires that if both are provided they both match to prevent this
confusion.

9 years agoInclude Strings guide with the others.
Steve Klabnik [Fri, 18 Jul 2014 14:48:24 +0000 (10:48 -0400)]
Include Strings guide with the others.

Three small changes:

1. Re-organize headers in the Strings guide so they show up correctly.
2. build the strings guide with the other docs
3. include the strings guide in the list of guides

9 years agoRemove examples from trait implementations. Unhide imports.
Jonas Hietala [Fri, 18 Jul 2014 14:34:07 +0000 (16:34 +0200)]
Remove examples from trait implementations. Unhide imports.

9 years agoauto merge of #15737 : huonw/rust/lint-level-here, r=pnkfelix
bors [Fri, 18 Jul 2014 13:31:22 +0000 (13:31 +0000)]
auto merge of #15737 : huonw/rust/lint-level-here, r=pnkfelix

This allows lint traversals to emit more information (when a lint is
non-allow), or avoid doing expensive computations (when a lint is
allow).

9 years agoFill in documentation for HashSet.
Jonas Hietala [Thu, 17 Jul 2014 18:40:39 +0000 (20:40 +0200)]
Fill in documentation for HashSet.

Example how to use the set with a custom type. Fill in examples for the missing methods.