]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #17992 : jkleint/guide-double-borrow
Alex Crichton [Mon, 13 Oct 2014 22:10:08 +0000 (15:10 -0700)]
rollup merge of #17992 : jkleint/guide-double-borrow

9 years agorollup merge of #17991 : sfackler/extern-error
Alex Crichton [Mon, 13 Oct 2014 22:10:05 +0000 (15:10 -0700)]
rollup merge of #17991 : sfackler/extern-error

9 years agorollup merge of #17986 : gamazeps/docissue
Alex Crichton [Mon, 13 Oct 2014 22:10:01 +0000 (15:10 -0700)]
rollup merge of #17986 : gamazeps/docissue

9 years agorollup merge of #17984 : bkoropoff/issue-17651
Alex Crichton [Mon, 13 Oct 2014 22:09:56 +0000 (15:09 -0700)]
rollup merge of #17984 : bkoropoff/issue-17651

9 years agorollup merge of #17980 : alexcrichton/no-more-exes
Alex Crichton [Mon, 13 Oct 2014 22:09:53 +0000 (15:09 -0700)]
rollup merge of #17980 : alexcrichton/no-more-exes

9 years agorollup merge of #17979 : jkleint/guide-guess-counter
Alex Crichton [Mon, 13 Oct 2014 22:09:52 +0000 (15:09 -0700)]
rollup merge of #17979 : jkleint/guide-guess-counter

9 years agorollup merge of #17977 : Behemecoatyl/master
Alex Crichton [Mon, 13 Oct 2014 22:09:48 +0000 (15:09 -0700)]
rollup merge of #17977 : Behemecoatyl/master

9 years agorollup merge of #17972 : ebfe/rpass-lang-item
Alex Crichton [Mon, 13 Oct 2014 22:09:41 +0000 (15:09 -0700)]
rollup merge of #17972 : ebfe/rpass-lang-item

9 years agorollup merge of #17970 : nodakai/cleanup-warnings
Alex Crichton [Mon, 13 Oct 2014 22:09:38 +0000 (15:09 -0700)]
rollup merge of #17970 : nodakai/cleanup-warnings

9 years agorollup merge of #17968 : nodakai/really-fix-kw-table
Alex Crichton [Mon, 13 Oct 2014 22:09:35 +0000 (15:09 -0700)]
rollup merge of #17968 : nodakai/really-fix-kw-table

9 years agorollup merge of #17927 : alexcrichton/more-const
Alex Crichton [Mon, 13 Oct 2014 22:09:25 +0000 (15:09 -0700)]
rollup merge of #17927 : alexcrichton/more-const

9 years agorollup merge of #17888 : gmfawcett/patch-1
Alex Crichton [Mon, 13 Oct 2014 22:09:14 +0000 (15:09 -0700)]
rollup merge of #17888 : gmfawcett/patch-1

9 years agoauto merge of #17733 : jgallagher/rust/while-let, r=alexcrichton
bors [Mon, 13 Oct 2014 19:37:40 +0000 (19:37 +0000)]
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

9 years agorustc: Remove the dummy hack from check_match
Alex Crichton [Fri, 10 Oct 2014 15:49:12 +0000 (08:49 -0700)]
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!

9 years agoauto merge of #17910 : taylorhutchison/rust/patch-1, r=alexcrichton
bors [Mon, 13 Oct 2014 17:42:42 +0000 (17:42 +0000)]
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.

9 years agoDon't ICE on bad extern paths
Steven Fackler [Mon, 13 Oct 2014 03:38:04 +0000 (20:38 -0700)]
Don't ICE on bad extern paths

Closes #17990

9 years agoauto merge of #17965 : omasanori/rust/remove, r=sfackler
bors [Mon, 13 Oct 2014 14:22:42 +0000 (14:22 +0000)]
auto merge of #17965 : omasanori/rust/remove, r=sfackler

9 years agoauto merge of #17963 : sfackler/rust/cfg-error, r=alexcrichton
bors [Mon, 13 Oct 2014 12:27:43 +0000 (12:27 +0000)]
auto merge of #17963 : sfackler/rust/cfg-error, r=alexcrichton

All deprecation warnings have been converted to errors. This includes
the warning for multiple cfgs on one item. We'll leave that as an error
for some period of time to ensure that all uses are updated before the
behavior changes from "or" to "and".

9 years agoauto merge of #17975 : thestinger/rust/fPIE, r=eddyb
bors [Mon, 13 Oct 2014 10:32:43 +0000 (10:32 +0000)]
auto merge of #17975 : thestinger/rust/fPIE, r=eddyb

Position independent code has fewer requirements in executables, so pass
the appropriate flag to LLVM in order to allow more optimization. At the
moment this means faster thread-local storage.

9 years agoauto merge of #17957 : TeXitoi/rust/fix-mandelbrot, r=alexcrichton
bors [Mon, 13 Oct 2014 08:37:41 +0000 (08:37 +0000)]
auto merge of #17957 : TeXitoi/rust/fix-mandelbrot, r=alexcrichton

9 years agoauto merge of #17948 : jakub-/rust/issue-17933, r=alexcrichton
bors [Mon, 13 Oct 2014 06:42:43 +0000 (06:42 +0000)]
auto merge of #17948 : jakub-/rust/issue-17933, r=alexcrichton

Fixes #17933.

9 years agoClean up rustc warnings.
NODA, Kai [Sun, 5 Oct 2014 10:11:17 +0000 (18:11 +0800)]
Clean up rustc warnings.

compiletest: compact "linux" "macos" etc.as "unix".
liballoc: remove a superfluous "use".
libcollections: remove invocations of deprecated methods in favor of
    their suggested replacements and use "_" for a loop counter.
libcoretest: remove invocations of deprecated methods;  also add
    "allow(deprecated)" for testing a deprecated method itself.
libglob: use "cfg_attr".
libgraphviz: add a test for one of data constructors.
libgreen: remove a superfluous "use".
libnum: "allow(type_overflow)" for type cast into u8 in a test code.
librustc: names of static variables should be in upper case.
libserialize: v[i] instead of get().
libstd/ascii: to_lowercase() instead of to_lower().
libstd/bitflags: modify AnotherSetOfFlags to use i8 as its backend.
    It will serve better for testing various aspects of bitflags!.
libstd/collections: "allow(deprecated)" for testing a deprecated
    method itself.
libstd/io: remove invocations of deprecated methods and superfluous "use".
    Also add #[test] where it was missing.
libstd/num: introduce a helper function to effectively remove
    invocations of a deprecated method.
libstd/path and rand: remove invocations of deprecated methods and
    superfluous "use".
libstd/task and libsync/comm: "allow(deprecated)" for testing
    a deprecated method itself.
libsync/deque: remove superfluous "unsafe".
libsync/mutex and once: names of static variables should be in upper case.
libterm: introduce a helper function to effectively remove
    invocations of a deprecated method.

We still see a few warnings about using obsoleted native::task::spawn()
in the test modules for libsync.  I'm not sure how I should replace them
with std::task::TaksBuilder and native::task::NativeTaskBuilder
(dependency to libstd?)

Signed-off-by: NODA, Kai <nodakai@gmail.com>
9 years agoGuide: specify that both shared and mutable borrows can be re-lent.
John Kleint [Mon, 13 Oct 2014 03:50:22 +0000 (23:50 -0400)]
Guide: specify that both shared and mutable borrows can be re-lent.

9 years agoauto merge of #17757 : gamazeps/rust/issue17709, r=alexcrichton
bors [Mon, 13 Oct 2014 02:47:37 +0000 (02:47 +0000)]
auto merge of #17757 : gamazeps/rust/issue17709, r=alexcrichton

I did not put the crate name in the error note, if that's necessary I'll look into it.

Closes #17709

9 years agoauto merge of #17467 : hatahet/rust/mybranch, r=alexcrichton
bors [Mon, 13 Oct 2014 00:22:39 +0000 (00:22 +0000)]
auto merge of #17467 : hatahet/rust/mybranch, r=alexcrichton

[breaking-change]

9 years agoAdd regression test for issue #17651
Brian Koropoff [Sun, 12 Oct 2014 22:14:36 +0000 (15:14 -0700)]
Add regression test for issue #17651

9 years agoFixes small error on the doc (task part)
Felix Raimundo [Sun, 12 Oct 2014 22:13:41 +0000 (00:13 +0200)]
Fixes small error on the doc (task part)

9 years agoUpdate a test error message
Felix Raimundo [Sun, 12 Oct 2014 21:48:22 +0000 (23:48 +0200)]
Update a test error message

 #17709

9 years agoauto merge of #17944 : jakub-/rust/issue-17877, r=alexcrichton
bors [Sun, 12 Oct 2014 21:47:34 +0000 (21:47 +0000)]
auto merge of #17944 : jakub-/rust/issue-17877, r=alexcrichton

Fixes #17877.

9 years agoProperly visit nested functions and closures in check_rvalues
Brian Koropoff [Sun, 12 Oct 2014 21:43:32 +0000 (14:43 -0700)]
Properly visit nested functions and closures in check_rvalues

This correctly catches moves of unsized values in nested
functions and closures.

Closes issue #17651

9 years agolibtime: `strftime` and `strptime` return type changed to `Result<String, ParseError>`.
Ziad Hatahet [Tue, 23 Sep 2014 03:50:25 +0000 (20:50 -0700)]
libtime: `strftime` and `strptime` return type changed to `Result<String, ParseError>`.

`strftime` currently returns a `String`. This does not indicate that
this function may return an error due to to a malformed format string.
This change introduces a `ParseError` enum which indicates the type of
error that occurred. The return type of `strptime` was also changed to
use this new enum instead of returning `Result<String, String>`. Now,
all instances where `strftime` was used need to have their return value
checked to see if it were valid or not.

[breaking-change]

9 years agoFix `find` check for executables
Alex Crichton [Sun, 12 Oct 2014 19:36:32 +0000 (12:36 -0700)]
Fix `find` check for executables

Apparently the fix in d08441b9 didn't catch a recent executable (#17965), but
I've verified that this does indeed catch the executable

9 years agoGuide: remove promise of a counter in the guessing game.
John Kleint [Sun, 12 Oct 2014 19:24:39 +0000 (15:24 -0400)]
Guide: remove promise of a counter in the guessing game.

Issue #17964.

9 years agorustc: Warn about dead constants
Alex Crichton [Fri, 10 Oct 2014 15:31:13 +0000 (08:31 -0700)]
rustc: Warn about dead constants

A few catch-all blocks ended up not having this case for constants.

Closes #17925

9 years agoContinue cfg syntax transition
Steven Fackler [Sun, 12 Oct 2014 01:05:54 +0000 (18:05 -0700)]
Continue cfg syntax transition

All deprecation warnings have been converted to errors. This includes
the warning for multiple cfgs on one item. We'll leave that as an error
for some period of time to ensure that all uses are updated before the
behavior changes from "or" to "and".

9 years agoNever expand specialized columns that only contain wild patterns in them
Jakub Wieczorek [Sat, 11 Oct 2014 12:05:16 +0000 (14:05 +0200)]
Never expand specialized columns that only contain wild patterns in them

Doing so would incur deeply nested expansion of the tree with no useful
side effects. This is problematic for "wide" data types such as structs
with dozens of fields but where only a few are actually being matched or bound.
Most notably, matching a fixed slice would use a number of stack frames that
grows with the number of elements in the slice.

Fixes #17877.

9 years agofix broken link in guide-strings.md
Erwan [Sun, 12 Oct 2014 16:51:11 +0000 (18:51 +0200)]
fix broken link in guide-strings.md

9 years agoFix run-pass/lang-item-public test on FreeBSD
Michael Gehring [Sat, 11 Oct 2014 14:16:38 +0000 (16:16 +0200)]
Fix run-pass/lang-item-public test on FreeBSD

9 years agooptimize position independent code in executables
Daniel Micay [Sat, 9 Aug 2014 16:43:45 +0000 (12:43 -0400)]
optimize position independent code in executables

Position independent code has fewer requirements in executables, so pass
the appropriate flag to LLVM in order to allow more optimization. At the
moment this means faster thread-local storage.

9 years agosrc/doc/README.md: fix a dead link.
NODA, Kai [Thu, 25 Sep 2014 14:11:18 +0000 (22:11 +0800)]
src/doc/README.md: fix a dead link.

Also make some typographical changes.

9 years agoFix HTML version of the keyword table.
NODA, Kai [Sun, 12 Oct 2014 08:16:43 +0000 (16:16 +0800)]
Fix HTML version of the keyword table.

This should really fix rust-lang/rust#17528.

9 years agoMake the diagnostic for static variables in patterns better
Jakub Wieczorek [Sat, 11 Oct 2014 15:46:45 +0000 (17:46 +0200)]
Make the diagnostic for static variables in patterns better

Fixes #17933.

9 years agoauto merge of #17952 : jakub-/rust/remove-virtual-structs, r=eddyb
bors [Sun, 12 Oct 2014 06:17:17 +0000 (06:17 +0000)]
auto merge of #17952 : jakub-/rust/remove-virtual-structs, r=eddyb

Closes #17861.

9 years agoRemove an unnecessary binary file.
OGINO Masanori [Sun, 12 Oct 2014 03:53:09 +0000 (12:53 +0900)]
Remove an unnecessary binary file.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
9 years agoauto merge of #17949 : ebfe/rust/cfg_warn, r=sfackler
bors [Sun, 12 Oct 2014 02:22:14 +0000 (02:22 +0000)]
auto merge of #17949 : ebfe/rust/cfg_warn, r=sfackler

This converts old style cfgs that generate warnings during `make check` to the new syntax.

9 years agoauto merge of #17942 : JIghtuse/rust/master, r=alexcrichton
bors [Sun, 12 Oct 2014 00:07:15 +0000 (00:07 +0000)]
auto merge of #17942 : JIghtuse/rust/master, r=alexcrichton

[breaking-change]
Closes #17916

9 years agoauto merge of #17892 : nodakai/rust/rustdoc-dont-nest-a, r=alexcrichton
bors [Sat, 11 Oct 2014 21:42:17 +0000 (21:42 +0000)]
auto merge of #17892 : nodakai/rust/rustdoc-dont-nest-a, r=alexcrichton

Some examples:

- `std::slice::slice`: [before](http://validator.w3.org/check?uri=http%3A%2F%2Fdoc.rust-lang.org%2Fstd%2Fslice%2Fprimitive.slice.html&charset=%28detect+automatically%29&doctype=Inline&group=0) and [after](http://validator.w3.org/check?uri=http%3A%2F%2Fnodakai.github.io%2Frust-f40b60b-doc%2Fstd%2Fslice%2Fprimitive.slice.html&charset=%28detect+automatically%29&doctype=Inline&group=0)
- `core::char::char`: [before](http://validator.w3.org/check?uri=http%3A%2F%2Fdoc.rust-lang.org%2Fcore%2Fchar%2Fprimitive.char.html&charset=%28detect+automatically%29&doctype=Inline&group=0) and [after](http://validator.w3.org/check?uri=http%3A%2F%2Fnodakai.github.io%2Frust-f40b60b-doc%2Fcore%2Fchar%2Fprimitive.char.html&charset=%28detect+automatically%29&doctype=Inline&group=0)
- `hexfloat::expand_syntax_ext`: [before](http://validator.w3.org/check?uri=http%3A%2F%2Fdoc.rust-lang.org%2Fhexfloat%2Ffn.expand_syntax_ext.html&charset=%28detect+automatically%29&doctype=Inline&group=0) and [after](http://validator.w3.org/check?uri=http%3A%2F%2Fnodakai.github.io%2Frust-f40b60b-doc%2Fhexfloat%2Ffn.expand_syntax_ext.html&charset=%28detect+automatically%29&doctype=Inline&group=0)

TODO: do the same for tuples.

9 years agofix shootout-mandelbrot to make it pass the shootout test
Guillaume Pinot [Sat, 11 Oct 2014 20:29:10 +0000 (22:29 +0200)]
fix shootout-mandelbrot to make it pass the shootout test

9 years agoauto merge of #17801 : Gankro/rust/collections-stuff, r=sfackler
bors [Sat, 11 Oct 2014 18:37:13 +0000 (18:37 +0000)]
auto merge of #17801 : Gankro/rust/collections-stuff, r=sfackler

I previously avoided `#[inline]`ing anything assuming someone would come in and explain to me where this would be appropriate. Apparently no one *really* knows, so I'll just go the opposite way an inline everything assuming someone will come in and yell at me that such-and-such shouldn't be `#[inline]`.

==================

For posterity, iteration comparisons:

```
test btree::map::bench::iter_20                            ... bench:       971 ns/iter (+/- 30)
test btree::map::bench::iter_1000                          ... bench:     29445 ns/iter (+/- 480)
test btree::map::bench::iter_100000                        ... bench:   2929035 ns/iter (+/- 21551)

test treemap::bench::iter_20                               ... bench:       530 ns/iter (+/- 66)
test treemap::bench::iter_1000                             ... bench:     26287 ns/iter (+/- 825)
test treemap::bench::iter_100000                           ... bench:   7650084 ns/iter (+/- 356711)

test trie::bench_map::iter_20                              ... bench:       646 ns/iter (+/- 265)
test trie::bench_map::iter_1000                            ... bench:     43556 ns/iter (+/- 5014)
test trie::bench_map::iter_100000                          ... bench:  12988002 ns/iter (+/- 139676)
```

As you can see `btree` "scales" much better than `treemap`. `triemap` scales quite poorly.

Note that *completely* different results are given if the elements are inserted in order from the range [0, size]. In particular, TrieMap *completely* dominates in the sorted case. This suggests adding benches for both might be worthwhile. However unsorted is *probably* the more "normal" case, so I consider this "good enough" for now.

9 years agoRemove `virtual` structs from the reference
Jakub Wieczorek [Sat, 11 Oct 2014 17:39:33 +0000 (19:39 +0200)]
Remove `virtual` structs from the reference

9 years agoRemove `virtual` struct tests
Jakub Wieczorek [Sat, 11 Oct 2014 17:24:33 +0000 (19:24 +0200)]
Remove `virtual` struct tests

9 years agoRemove `virtual` structs from the language
Jakub Wieczorek [Sat, 11 Oct 2014 17:24:58 +0000 (19:24 +0200)]
Remove `virtual` structs from the language

9 years agoFix cfg warnings in librustc_back
Michael Gehring [Sat, 11 Oct 2014 16:32:57 +0000 (18:32 +0200)]
Fix cfg warnings in librustc_back

9 years agoFix cfg warnings in libcoretest
Michael Gehring [Sat, 11 Oct 2014 16:32:40 +0000 (18:32 +0200)]
Fix cfg warnings in libcoretest

9 years agoUse explicit case rather than catch-all
John Gallagher [Sat, 11 Oct 2014 16:03:15 +0000 (12:03 -0400)]
Use explicit case rather than catch-all

9 years agoauto merge of #17940 : pnkfelix/rust/fix-check-stage1-on-clean-dir, r=huonw
bors [Sat, 11 Oct 2014 15:17:09 +0000 (15:17 +0000)]
auto merge of #17940 : pnkfelix/rust/fix-check-stage1-on-clean-dir, r=huonw

compiletest needs to link to native crate, or at least the `rt` library.

(I tried using a dependency on `rustrt` instead, and that did not resolve the problem.  But this does.)

Partially addresses #17883

9 years agoFix cfg warnings in compiletest
Michael Gehring [Sat, 11 Oct 2014 14:10:43 +0000 (16:10 +0200)]
Fix cfg warnings in compiletest

9 years agoRemove into_vec method from &[T]
Boris Egorov [Sat, 11 Oct 2014 06:03:55 +0000 (13:03 +0700)]
Remove into_vec method from &[T]

[breaking-change]
Closes #17916

9 years agocompiletest needs to link to native crate, or at least the `rt` library.
Felix S. Klock II [Sat, 11 Oct 2014 09:08:15 +0000 (11:08 +0200)]
compiletest needs to link to native crate, or at least the `rt` library.

(I tried using a dependency on `rustrt` instead, and that did not
resolve the problem.  But this does.)

Fix #17883

9 years agoauto merge of #17939 : alexcrichton/rust/snapshots, r=sfackler
bors [Sat, 11 Oct 2014 09:02:01 +0000 (09:02 +0000)]
auto merge of #17939 : alexcrichton/rust/snapshots, r=sfackler

Also convert a number of `static mut` to just a plain old `static` and remove
some unsafe blocks.

9 years agoauto merge of #17928 : steveklabnik/rust/remove_runtime_guide, r=alexcrichton
bors [Sat, 11 Oct 2014 07:12:02 +0000 (07:12 +0000)]
auto merge of #17928 : steveklabnik/rust/remove_runtime_guide, r=alexcrichton

Now that libgreen is gone, this is all wrong.

Fixes #17923

9 years agoRegister new snapshots
Alex Crichton [Sat, 11 Oct 2014 04:59:10 +0000 (21:59 -0700)]
Register new snapshots

Also convert a number of `static mut` to just a plain old `static` and remove
some unsafe blocks.

9 years agoauto merge of #17936 : TeXitoi/rust/remove-shootout-warnings, r=alexcrichton
bors [Sat, 11 Oct 2014 04:37:04 +0000 (04:37 +0000)]
auto merge of #17936 : TeXitoi/rust/remove-shootout-warnings, r=alexcrichton

Only one warning remain, and I can't find a way to remove it without doing more bound checks:

```
shootout-nbody.rs:105:36: 105:51 warning: use of deprecated item: use iter_mut, #[warn(deprecated)] on by default
shootout-nbody.rs:105             let bi = match b_slice.mut_shift_ref() {
```

using `split_at_mut` may be an option, but it will do more bound checking.

If anyone have an idea, I'll update this PR.

9 years agoAdd `while let` to the reference
John Gallagher [Fri, 3 Oct 2014 05:09:01 +0000 (01:09 -0400)]
Add `while let` to the reference

Closes #17687

9 years agoAdd tests for `while let`
John Gallagher [Fri, 3 Oct 2014 04:59:32 +0000 (00:59 -0400)]
Add tests for `while let`

9 years agoHandle `while let` desugaring
John Gallagher [Fri, 3 Oct 2014 04:41:24 +0000 (00:41 -0400)]
Handle `while let` desugaring

9 years agoMove `while let` behind `while_let` feature gate
John Gallagher [Fri, 3 Oct 2014 03:32:32 +0000 (23:32 -0400)]
Move `while let` behind `while_let` feature gate

9 years agoDesugar `while let` into `loop { match { ... } }`
John Gallagher [Fri, 3 Oct 2014 03:28:15 +0000 (23:28 -0400)]
Desugar `while let` into `loop { match { ... } }`

9 years agoTeach libsyntax about `while let`
John Gallagher [Fri, 3 Oct 2014 02:45:46 +0000 (22:45 -0400)]
Teach libsyntax about `while let`

9 years agoremove shootout warnings
Guillaume Pinot [Fri, 10 Oct 2014 23:46:59 +0000 (01:46 +0200)]
remove shootout warnings

9 years agoauto merge of #17920 : thestinger/rust/vec, r=aturon
bors [Fri, 10 Oct 2014 18:47:03 +0000 (18:47 +0000)]
auto merge of #17920 : thestinger/rust/vec, r=aturon

Introduce conversions between `Box<[T]>` and `Vec<T>` and use it to reimplement the `vec![]` macro for efficiency.

9 years agoimprove the performance of the vec![] macro
Daniel Micay [Fri, 10 Oct 2014 10:19:40 +0000 (06:19 -0400)]
improve the performance of the vec![] macro

Closes #17865

9 years agoRemove the runtime guide.
Steve Klabnik [Fri, 10 Oct 2014 17:30:17 +0000 (13:30 -0400)]
Remove the runtime guide.

Now that libgreen is gone, this is all wrong.

Fixes #17923

9 years agoimplement Box<[T]> <-> Vec<T> conversions
Daniel Micay [Fri, 10 Oct 2014 09:18:42 +0000 (05:18 -0400)]
implement Box<[T]> <-> Vec<T> conversions

9 years agoauto merge of #17793 : simias/rust/master, r=huonw
bors [Fri, 10 Oct 2014 14:57:03 +0000 (14:57 +0000)]
auto merge of #17793 : simias/rust/master, r=huonw

The man page stated that the list of features was space-separated when
it's actually comma-separated.

9 years agovec: minor cleanup
Daniel Micay [Sat, 4 Oct 2014 08:06:24 +0000 (04:06 -0400)]
vec: minor cleanup

9 years agoauto merge of #17037 : kmcallister/rust/no-stack-check, r=thestinger
bors [Fri, 10 Oct 2014 07:52:00 +0000 (07:52 +0000)]
auto merge of #17037 : kmcallister/rust/no-stack-check, r=thestinger

r? @brson

Fixes #16980.

9 years agoUpdate README.md
Taylor Hutchison [Fri, 10 Oct 2014 04:41:30 +0000 (23:41 -0500)]
Update README.md

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.

9 years agoDisable no-stack-check test on Windows
Keegan McAllister [Fri, 10 Oct 2014 04:26:51 +0000 (21:26 -0700)]
Disable no-stack-check test on Windows

9 years agoauto merge of #17669 : nikomatsakis/rust/multidispatch, r=pcwalton
bors [Fri, 10 Oct 2014 03:02:02 +0000 (03:02 +0000)]
auto merge of #17669 : nikomatsakis/rust/multidispatch, r=pcwalton

Implement multidispatch and conditional dispatch. Because we do not attempt to preserve crate concatenation, this is a backwards compatible change. This is not yet fully integrated into method dispatch, so "UFCS"-style wrappers must be used to take advantage of the new features (see the run-pass tests).

cc #17307 (multidispatch)
cc #5527 (trait reform -- conditional dispatch)

Because we no longer preserve crate concatenability, this deviates slightly from what was specified in the RFC. The motivation for this change is described in [this blog post](http://smallcultfollowing.com/babysteps/blog/2014/09/30/multi-and-conditional-dispatch-in-traits/). I will post an amendment to the RFC in due course but do not anticipate great controversy on this point -- particularly as the RFCs more important features (e.g., conditional dispatch) just don't work without the change.

9 years agoauto merge of #17853 : alexcrichton/rust/issue-17718, r=pcwalton
bors [Fri, 10 Oct 2014 00:07:08 +0000 (00:07 +0000)]
auto merge of #17853 : alexcrichton/rust/issue-17718, r=pcwalton

This change is an implementation of [RFC 69][rfc] which adds a third kind of
global to the language, `const`. This global is most similar to what the old
`static` was, and if you're unsure about what to use then you should use a
`const`.

The semantics of these three kinds of globals are:

* A `const` does not represent a memory location, but only a value. Constants
  are translated as rvalues, which means that their values are directly inlined
  at usage location (similar to a #define in C/C++). Constant values are, well,
  constant, and can not be modified. Any "modification" is actually a
  modification to a local value on the stack rather than the actual constant
  itself.

  Almost all values are allowed inside constants, whether they have interior
  mutability or not. There are a few minor restrictions listed in the RFC, but
  they should in general not come up too often.

* A `static` now always represents a memory location (unconditionally). Any
  references to the same `static` are actually a reference to the same memory
  location. Only values whose types ascribe to `Sync` are allowed in a `static`.
  This restriction is in place because many threads may access a `static`
  concurrently. Lifting this restriction (and allowing unsafe access) is a
  future extension not implemented at this time.

* A `static mut` continues to always represent a memory location. All references
  to a `static mut` continue to be `unsafe`.

This is a large breaking change, and many programs will need to be updated
accordingly. A summary of the breaking changes is:

* Statics may no longer be used in patterns. Statics now always represent a
  memory location, which can sometimes be modified. To fix code, repurpose the
  matched-on-`static` to a `const`.

      static FOO: uint = 4;
      match n {
          FOO => { /* ... */ }
          _ => { /* ... */ }
      }

  change this code to:

      const FOO: uint = 4;
      match n {
          FOO => { /* ... */ }
          _ => { /* ... */ }
      }

* Statics may no longer refer to other statics by value. Due to statics being
  able to change at runtime, allowing them to reference one another could
  possibly lead to confusing semantics. If you are in this situation, use a
  constant initializer instead. Note, however, that statics may reference other
  statics by address, however.

* Statics may no longer be used in constant expressions, such as array lengths.
  This is due to the same restrictions as listed above. Use a `const` instead.

[breaking-change]
Closes #17718

[rfc]: https://github.com/rust-lang/rfcs/pull/246

9 years agoTest fixes and rebase conflicts
Alex Crichton [Thu, 9 Oct 2014 18:59:03 +0000 (11:59 -0700)]
Test fixes and rebase conflicts

9 years agoAdd tests for no-stack-check attr and codegen option
Keegan McAllister [Sat, 6 Sep 2014 00:57:50 +0000 (17:57 -0700)]
Add tests for no-stack-check attr and codegen option

9 years agoAdd -C no-stack-check
Keegan McAllister [Sat, 6 Sep 2014 00:56:59 +0000 (17:56 -0700)]
Add -C no-stack-check

Fixes #16980.

9 years agoRename the no_split_stack attribute to no_stack_check
Keegan McAllister [Sat, 6 Sep 2014 00:28:24 +0000 (17:28 -0700)]
Rename the no_split_stack attribute to no_stack_check

The old name is misleading as we haven't had segmented stacks in quite some
time. But we still recognize it, with a deprecation warning.

9 years agoAdd a few more debug statements
Niko Matsakis [Thu, 9 Oct 2014 21:17:49 +0000 (17:17 -0400)]
Add a few more debug statements

9 years agoConvert tests to cross-crate, fix a RefCell bug I found in the process.
Niko Matsakis [Wed, 1 Oct 2014 11:51:46 +0000 (07:51 -0400)]
Convert tests to cross-crate, fix a RefCell bug I found in the process.

9 years agoAdd a model for how conditional trait impls might be used to implement
Niko Matsakis [Wed, 1 Oct 2014 09:00:50 +0000 (05:00 -0400)]
Add a model for how conditional trait impls might be used to implement
the Fn-FnMut-FnOnce hierarchy.

9 years agoImplement multidispatch and conditional dispatch. Because we do not
Niko Matsakis [Thu, 9 Oct 2014 21:19:50 +0000 (17:19 -0400)]
Implement multidispatch and conditional dispatch. Because we do not
attempt to preserve crate concatenation, this is a backwards compatible
change.

Conflicts:
src/librustc/middle/traits/select.rs

9 years agoauto merge of #17891 : brson/rust/verbump, r=alexcrichton
bors [Thu, 9 Oct 2014 21:12:03 +0000 (21:12 +0000)]
auto merge of #17891 : brson/rust/verbump, r=alexcrichton

9 years agoauto merge of #17558 : kaseyc/rust/fix_bitvset_union, r=aturon
bors [Thu, 9 Oct 2014 19:02:06 +0000 (19:02 +0000)]
auto merge of #17558 : kaseyc/rust/fix_bitvset_union, r=aturon

Updates the other_op function shared by the union/intersect/difference/symmetric_difference -with functions to fix an issue where certain elements would not be present in the result. To fix this, when other op is called, we resize self's nbits to account for any new elements that may be added to the set.

Example:
```rust
let mut a = BitvSet::new();
let mut b = BitvSet::new();
a.insert(0);
b.insert(5);
a.union_with(&b);
println!("{}", a); //Prints "{0}" instead of "{0, 5}"
```

9 years agoUse the same html_root_url for all docs
Brian Anderson [Thu, 9 Oct 2014 17:47:22 +0000 (10:47 -0700)]
Use the same html_root_url for all docs

9 years agoBump version to 0.13.0
Brian Anderson [Thu, 9 Oct 2014 17:41:23 +0000 (10:41 -0700)]
Bump version to 0.13.0

9 years agoRevert "Update html_root_url for 0.12.0 release"
Brian Anderson [Thu, 9 Oct 2014 17:34:34 +0000 (10:34 -0700)]
Revert "Update html_root_url for 0.12.0 release"

This reverts commit 2288f332301b9e22db2890df256322650a7f3445.

9 years agoauto merge of #17880 : pcwalton/rust/duplicate-bindings-in-parameter-list, r=alexcrichton
bors [Thu, 9 Oct 2014 16:57:03 +0000 (16:57 +0000)]
auto merge of #17880 : pcwalton/rust/duplicate-bindings-in-parameter-list, r=alexcrichton

parameter list.

This breaks code like:

    fn f(a: int, a: int) { ... }
    fn g<T,T>(a: T) { ... }

Change this code to not use the same name for a parameter. For example:

    fn f(a: int, b: int) { ... }
    fn g<T,U>(a: T) { ... }

Code like this is *not* affected, since `_` is not an identifier:

    fn f(_: int, _: int) { ... } // OK

Closes #17568.

r? @alexcrichton
[breaking-change]

9 years agodoc: Document constants in the reference
Alex Crichton [Tue, 7 Oct 2014 15:33:52 +0000 (08:33 -0700)]
doc: Document constants in the reference

9 years agotest: Convert statics to constants
Alex Crichton [Tue, 7 Oct 2014 04:16:35 +0000 (21:16 -0700)]
test: Convert statics to constants

Additionally, add lots of tests for new functionality around statics and
`static mut`.

9 years agosyntax: Tweak the return value of bytes!()
Alex Crichton [Tue, 7 Oct 2014 02:15:08 +0000 (19:15 -0700)]
syntax: Tweak the return value of bytes!()

Instead of returning &'static [u8], an invocation of `bytes!()` now returns
`&'static [u8, ..N]` where `N` is the length of the byte vector. This should
functionally be the same, but there are some cases where an explicit cast may be
needed, so this is a:

[breaking-change]

9 years agorustdoc: Implement constant documentation
Alex Crichton [Tue, 7 Oct 2014 00:41:15 +0000 (17:41 -0700)]
rustdoc: Implement constant documentation

At the same time, migrate statics to constants.

9 years agonum: Convert statics to constants
Alex Crichton [Tue, 7 Oct 2014 00:41:03 +0000 (17:41 -0700)]
num: Convert statics to constants