]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoprefer "FIXME" to "TODO".
Aidan Cully [Fri, 5 Dec 2014 23:39:58 +0000 (18:39 -0500)]
prefer "FIXME" to "TODO".

9 years agowork around portability issue on FreeBSD, in which the key returned from
Aidan Cully [Fri, 5 Dec 2014 22:20:44 +0000 (17:20 -0500)]
work around portability issue on FreeBSD, in which the key returned from
pthread_key_create can be 0.

9 years agoauto merge of #19233 : erickt/rust/bench-stats, r=erickt
bors [Fri, 5 Dec 2014 17:33:00 +0000 (17:33 +0000)]
auto merge of #19233 : erickt/rust/bench-stats, r=erickt

There are a bunch stats that libtest keeps track of that we don't expose. This adds `--error-bar` and `--stats` to expose this to the users.

9 years agotest: expose boxplot and the extra stats test keeps track of
Erick Tryzelaar [Fri, 5 Dec 2014 17:04:55 +0000 (09:04 -0800)]
test: expose boxplot and the extra stats test keeps track of

[breaking-change]

9 years agoauto merge of #19334 : alexcrichton/rust/issue-19333, r=aturon
bors [Fri, 5 Dec 2014 15:03:18 +0000 (15:03 +0000)]
auto merge of #19334 : alexcrichton/rust/issue-19333, r=aturon

This may have inadvertently switched during the runtime overhaul, so this
switches TcpListener back to using sockets instead of file descriptors. This
also renames a bunch of variables called `fd` to `socket` to clearly show that
it's not a file descriptor.

Closes #19333

9 years agoauto merge of #19362 : nikomatsakis/rust/crateification, r=nikomatsakis
bors [Fri, 5 Dec 2014 09:23:09 +0000 (09:23 +0000)]
auto merge of #19362 : nikomatsakis/rust/crateification, r=nikomatsakis

This has the goal of further reducing peak memory usage and enabling more parallelism. This patch should allow trans/typeck to build in parallel. The plan is to proceed by moving as many additional passes as possible into distinct crates that lay alongside typeck/trans. Basically, the idea is that there is the `rustc` crate which defines the common data structures shared between passes. Individual passes then go into their own crates. Finally, the `rustc_driver` crate knits it all together.

cc @jakub-: One wrinkle is the diagnostics plugin. Currently, it assumes all diagnostics are defined and used within one crate in order to track what is used and what is duplicated. I had to disable this. We'll have to find an alternate strategy, but I wasn't sure what was best so decided to just disable the duplicate checking for now.

9 years agostd: Close TcpListener with closesocket()
Alex Crichton [Wed, 26 Nov 2014 05:53:08 +0000 (21:53 -0800)]
std: Close TcpListener with closesocket()

This may have inadvertently switched during the runtime overhaul, so this
switches TcpListener back to using sockets instead of file descriptors. This
also renames a bunch of variables called `fd` to `socket` to clearly show that
it's not a file descriptor.

Closes #19333

9 years agoRemove crates from test list so that we don't waste time building them.
Niko Matsakis [Fri, 5 Dec 2014 07:01:57 +0000 (02:01 -0500)]
Remove crates from test list so that we don't waste time building them.

9 years agoFix various references in late-running tests and things
Niko Matsakis [Fri, 5 Dec 2014 05:00:06 +0000 (00:00 -0500)]
Fix various references in late-running tests and things

9 years agoauto merge of #19303 : nodakai/rust/libsyntax-reject-dirs, r=alexcrichton
bors [Fri, 5 Dec 2014 00:22:58 +0000 (00:22 +0000)]
auto merge of #19303 : nodakai/rust/libsyntax-reject-dirs, r=alexcrichton

On *BSD systems, we can `open(2)` a directory and directly `read(2)` from it due to an old tradition.  We should avoid doing so by explicitly calling `fstat(2)` to check the type of the opened file.

Opening a directory as a module file can't always be avoided.  Even when there's no "path" attribute trick involved, there can always be a *directory* named `my_module.rs`.

Incidentally, remove unnecessary mutability of `&self` from `io::fs::File::stat()`.

9 years agoDelete diagnostics tests because that model doesn't scale to multiple crates
Niko Matsakis [Thu, 4 Dec 2014 21:34:13 +0000 (16:34 -0500)]
Delete diagnostics tests because that model doesn't scale to multiple crates

9 years agoauto merge of #18980 : erickt/rust/reader, r=erickt
bors [Thu, 4 Dec 2014 21:33:07 +0000 (21:33 +0000)]
auto merge of #18980 : erickt/rust/reader, r=erickt

This continues the work @thestinger started in #18885 (which hasn't landed yet, so wait for that to land before landing this one). Instead of adding more methods to `BufReader`, this just allows a `&[u8]` to be used directly as a `Reader`. It also adds an impl of `Writer` for `&mut [u8]`.

9 years agocore: fix a doctest
Erick Tryzelaar [Thu, 4 Dec 2014 15:57:13 +0000 (07:57 -0800)]
core: fix a doctest

9 years agoFIXME(#19497) -- Stop messing around and just give rustc 32MB of stack unconditionall...
Niko Matsakis [Wed, 3 Dec 2014 13:33:45 +0000 (08:33 -0500)]
FIXME(#19497) -- Stop messing around and just give rustc 32MB of stack unconditionally. This is prompted by some sort of bug in trans that causes a stack overflow when the modules in trans are made private. (In particular, the overflow can also be avoided by making `controlflow` and `callee` public, but that seems strictly worse than just using more stack.)

9 years agoSeparate the driver into its own crate that uses trans, typeck.
Niko Matsakis [Thu, 27 Nov 2014 14:57:47 +0000 (09:57 -0500)]
Separate the driver into its own crate that uses trans, typeck.

9 years agoMove typeck into its own crate.
Niko Matsakis [Wed, 26 Nov 2014 11:11:29 +0000 (06:11 -0500)]
Move typeck into its own crate.

9 years agoRemove dependencies on driver from trans et al. by moving various
Niko Matsakis [Thu, 27 Nov 2014 12:21:26 +0000 (07:21 -0500)]
Remove dependencies on driver from trans et al. by moving various
structs out from driver and into other places.

9 years agoModify libsyntax/diagnostics to not be so persnickety. The scheme
Niko Matsakis [Thu, 27 Nov 2014 01:49:36 +0000 (20:49 -0500)]
Modify libsyntax/diagnostics to not be so persnickety. The scheme
doesn't work in a multi-crate context. We'll need to come up with
something better.

9 years agoMove `typeck` logically in the module tree out to the root and clamp
Niko Matsakis [Wed, 26 Nov 2014 10:48:57 +0000 (05:48 -0500)]
Move `typeck` logically in the module tree out to the root and clamp
down on its exports. Remove some dead code that is revealed.

9 years agoRemove one dependence on typeck from const_eval.
Niko Matsakis [Wed, 26 Nov 2014 09:52:02 +0000 (04:52 -0500)]
Remove one dependence on typeck from const_eval.

9 years agoRemove "dependence" on typeck from comment in substs.
Niko Matsakis [Wed, 26 Nov 2014 01:16:28 +0000 (20:16 -0500)]
Remove "dependence" on typeck from comment in substs.

9 years agoRemove dependence on typeck from ppaux.
Niko Matsakis [Wed, 26 Nov 2014 01:15:58 +0000 (20:15 -0500)]
Remove dependence on typeck from ppaux.

9 years agoRemove dependency on typeck from lint.
Niko Matsakis [Wed, 26 Nov 2014 00:48:49 +0000 (19:48 -0500)]
Remove dependency on typeck from lint.

9 years agoMove infer out of `middle::typeck` and into just `middle`.
Niko Matsakis [Tue, 25 Nov 2014 21:59:02 +0000 (16:59 -0500)]
Move infer out of `middle::typeck` and into just `middle`.

9 years agoMove various data structures out of typeck and into ty.
Niko Matsakis [Tue, 25 Nov 2014 19:21:20 +0000 (14:21 -0500)]
Move various data structures out of typeck and into ty.

9 years agoauto merge of #19170 : erickt/rust/rustup, r=erickt
bors [Thu, 4 Dec 2014 15:03:39 +0000 (15:03 +0000)]
auto merge of #19170 : erickt/rust/rustup, r=erickt

This closes #19168.

Please be careful reviewing this since this gets used all over the place. I've tested all the options and everything appears to be working though.

9 years agoauto merge of #19167 : japaric/rust/rhs-cmp, r=aturon
bors [Thu, 4 Dec 2014 12:02:56 +0000 (12:02 +0000)]
auto merge of #19167 : japaric/rust/rhs-cmp, r=aturon

Comparison traits have gained an `Rhs` input parameter that defaults to `Self`. And now the comparison operators can be overloaded to work between different types. In particular, this PR allows the following operations (and their commutative versions):

- `&str` == `String` == `CowString`
- `&[A]` == `&mut [B]` == `Vec<C>` == `CowVec<D>` == `[E, ..N]` (for `N` up to 32)
- `&mut A` == `&B` (for `Sized` `A` and `B`)

Where `A`, `B`, `C`, `D`, `E` may be different types that implement `PartialEq`. For example, these comparisons are now valid: `string == "foo"`, and `vec_of_strings == ["Hello", "world"]`.

[breaking-change]s

Since the `==` may now work on different types, operations that relied on the old "same type restriction" to drive type inference, will need to be type annotated. These are the most common fallout cases:

- `some_vec == some_iter.collect()`: `collect` needs to be type annotated: `collect::<Vec<_>>()`
- `slice == &[a, b, c]`: RHS doesn't get coerced to an slice, use an array instead `[a, b, c]`
- `lhs == []`: Change expression to `lhs.is_empty()`
- `lhs == some_generic_function()`: Type annotate the RHS as necessary

cc #19148

r? @aturon

9 years agoauto merge of #19449 : nikomatsakis/rust/unboxed-closure-fn-impl, r=pcwalton
bors [Thu, 4 Dec 2014 08:52:47 +0000 (08:52 +0000)]
auto merge of #19449 : nikomatsakis/rust/unboxed-closure-fn-impl, r=pcwalton

Implement the `Fn` trait for bare fn pointers in the compiler rather
than doing it using hard-coded impls. This means that it works also
for more complex fn types involving bound regions.

9 years agoAdjust nits from pcwalton.
Niko Matsakis [Thu, 4 Dec 2014 05:57:38 +0000 (00:57 -0500)]
Adjust nits from pcwalton.

9 years agoAdd a cache so we don't create so many shims.
Niko Matsakis [Thu, 4 Dec 2014 01:23:15 +0000 (20:23 -0500)]
Add a cache so we don't create so many shims.

9 years agoImplement the `Fn` trait for bare fn pointers in the compiler rather than doing it...
Niko Matsakis [Mon, 1 Dec 2014 14:23:40 +0000 (09:23 -0500)]
Implement the `Fn` trait for bare fn pointers in the compiler rather than doing it using hard-coded impls. This means that it works also for more complex fn types involving bound regions. Fixes #19126.

9 years agoauto merge of #18613 : steveklabnik/rust/ownership_guide, r=huonw
bors [Thu, 4 Dec 2014 04:52:37 +0000 (04:52 +0000)]
auto merge of #18613 : steveklabnik/rust/ownership_guide, r=huonw

This is a work in progress, but this should get *extensive* review, so I'm putting it up early and often.

This is the start of a draft of the new 'ownership guide,' which explains ownership, borrowing, etc. I'm feeling better about this framing than last time's, but we'll see.

9 years agolibstd: explicitly disallow io::fs::File to open a directory.
NODA, Kai [Tue, 2 Dec 2014 22:06:59 +0000 (06:06 +0800)]
libstd: explicitly disallow io::fs::File to open a directory.

On *BSD systems, we can open(2) a directory and directly read(2) from
it due to an old tradition.  We should avoid doing so by explicitly
calling fstat(2) to check the type of the opened file.

Opening a directory as a module file can't always be avoided.
Even when there's no "path" attribute trick involved, there can always
be a *directory* named "my_module.rs".

Fix #12460

Signed-off-by: NODA, Kai <nodakai@gmail.com>
9 years agolibstd: io::fs::File::stat() need not to take &mut self.
NODA, Kai [Tue, 25 Nov 2014 14:12:24 +0000 (22:12 +0800)]
libstd: io::fs::File::stat() need not to take &mut self.

The same goes for sys::fs::FileDesc::fstat() on Windows.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
9 years agoauto merge of #18770 : pczarn/rust/hash_map-explicit-shrinking, r=Gankro
bors [Thu, 4 Dec 2014 01:07:48 +0000 (01:07 +0000)]
auto merge of #18770 : pczarn/rust/hash_map-explicit-shrinking, r=Gankro

Part of enforcing capacity-related conventions, for #18424, the collections reform.

Implements `fn shrink_to_fit` for HashMap.
The `reserve` method now takes as an argument the *extra* space to reserve.

9 years agorustup: simplify downloading packages
Erick Tryzelaar [Wed, 3 Dec 2014 23:14:30 +0000 (15:14 -0800)]
rustup: simplify downloading packages

9 years agorustup: extract the tarballs as part of installation
Erick Tryzelaar [Mon, 1 Dec 2014 08:00:43 +0000 (00:00 -0800)]
rustup: extract the tarballs as part of installation

9 years agorustup: rewrite to protect against truncation
Erick Tryzelaar [Mon, 1 Dec 2014 07:34:19 +0000 (23:34 -0800)]
rustup: rewrite to protect against truncation

This closes #19168. It's possible that if the downloading of `rustup.sh`
is interrupted, bad things could happen, such as running a naked
"rm -rf /" instead of "rm -rf /path/to/tmpdir". This wraps rustup.sh's
functionality in a function that gets called at the last time that should
protect us from these truncation errors.

9 years agorustup: factor out installing packages into a function
Erick Tryzelaar [Mon, 1 Dec 2014 04:44:03 +0000 (20:44 -0800)]
rustup: factor out installing packages into a function

9 years agorustup: factor out downloading and extracting the snapshot tarballs
Erick Tryzelaar [Wed, 3 Dec 2014 23:17:32 +0000 (15:17 -0800)]
rustup: factor out downloading and extracting the snapshot tarballs

9 years agoauto merge of #18749 : nikomatsakis/rust/builtin-bounds-like-other-traits, r=pcwalton
bors [Wed, 3 Dec 2014 22:57:40 +0000 (22:57 +0000)]
auto merge of #18749 : nikomatsakis/rust/builtin-bounds-like-other-traits, r=pcwalton

Treat builtin bounds like all other kinds of trait matches. Introduce a simple hashset in the fulfillment context to catch cases where we register the exact same obligation twice. This helps prevent duplicate error reports but also handles the recursive obligations created by builtin bounds.

r? @pcwalton
cc @FlaPer87

9 years agorustup: factor out the install flags into a CFG_INSTALL_FLAGS variable
Erick Tryzelaar [Mon, 1 Dec 2014 04:13:31 +0000 (20:13 -0800)]
rustup: factor out the install flags into a CFG_INSTALL_FLAGS variable

9 years agorustup: rename TMP_DIR to CFG_TMP_DIR
Erick Tryzelaar [Mon, 1 Dec 2014 04:08:06 +0000 (20:08 -0800)]
rustup: rename TMP_DIR to CFG_TMP_DIR

9 years agorustup: add a RUST_ prefix to the rust-specific variables
Erick Tryzelaar [Mon, 1 Dec 2014 04:06:24 +0000 (20:06 -0800)]
rustup: add a RUST_ prefix to the rust-specific variables

9 years agorustup: probe for the existance of tar
Erick Tryzelaar [Mon, 1 Dec 2014 03:51:52 +0000 (19:51 -0800)]
rustup: probe for the existance of tar

9 years agorustup: make rustup executable
Erick Tryzelaar [Mon, 1 Dec 2014 05:17:08 +0000 (21:17 -0800)]
rustup: make rustup executable

9 years agowhitespace cleanup
Erick Tryzelaar [Mon, 1 Dec 2014 03:39:26 +0000 (19:39 -0800)]
whitespace cleanup

9 years agoauto merge of #19502 : alexcrichton/rust/issue-19501, r=sfackler
bors [Wed, 3 Dec 2014 18:52:48 +0000 (18:52 +0000)]
auto merge of #19502 : alexcrichton/rust/issue-19501, r=sfackler

I don't have enough time to investigate this thoroughly, so for now let's get
the queue moving by ignoring this test.

cc #19501

9 years agotest: Ignore issue-19501 pretty for now
Alex Crichton [Wed, 3 Dec 2014 17:22:13 +0000 (09:22 -0800)]
test: Ignore issue-19501 pretty for now

I don't have enough time to investigate this thoroughly, so for now let's get
the queue moving by ignoring this test.

cc #19501

9 years agoDeprecate Equiv
Jorge Aparicio [Thu, 27 Nov 2014 04:50:12 +0000 (23:50 -0500)]
Deprecate Equiv

9 years agoFix fallout
Jorge Aparicio [Fri, 21 Nov 2014 06:20:04 +0000 (01:20 -0500)]
Fix fallout

9 years agoRemove unused transmutes from tests
Jorge Aparicio [Sun, 23 Nov 2014 00:45:35 +0000 (19:45 -0500)]
Remove unused transmutes from tests

9 years agoReplace `equiv` method calls with `==` operator sugar
Jorge Aparicio [Fri, 21 Nov 2014 01:25:27 +0000 (20:25 -0500)]
Replace `equiv` method calls with `==` operator sugar

9 years agoOverload the `==` operator
Jorge Aparicio [Fri, 21 Nov 2014 05:14:05 +0000 (00:14 -0500)]
Overload the `==` operator

- String == &str == CowString
- Vec ==  &[T] ==  &mut [T] == [T, ..N] == CowVec
- InternedString == &str

9 years agoNew Guide: Ownership
Steve Klabnik [Tue, 4 Nov 2014 07:52:36 +0000 (02:52 -0500)]
New Guide: Ownership

This replaces the previous "Lifetimes guide," since we are discussing
things from an owernship perspective now.

9 years agoFIXME(#19481) -- workaround valgrind cleanup failure (but the code is nicer this...
Niko Matsakis [Tue, 25 Nov 2014 12:54:24 +0000 (07:54 -0500)]
FIXME(#19481) -- workaround valgrind cleanup failure (but the code is nicer this way anyhow)

9 years agoCorrect various compile-fail tests. Most of the changes are because we
Niko Matsakis [Sat, 8 Nov 2014 01:23:33 +0000 (20:23 -0500)]
Correct various compile-fail tests. Most of the changes are because we
now don't print duplicate errors within one context, so I sometimes
had to break functions into two functions.

9 years agoTreat builtin bounds like all other kinds of trait matches. Introduce a simple hashse...
Niko Matsakis [Fri, 7 Nov 2014 21:14:32 +0000 (16:14 -0500)]
Treat builtin bounds like all other kinds of trait matches. Introduce a simple hashset in the fulfillment context to catch cases where we register the exact same obligation twice. This helps prevent duplicate error reports but also handles the recursive obligations created by builtin bounds.

9 years agoTest PartialEq multidispatch
Jorge Aparicio [Fri, 21 Nov 2014 00:32:04 +0000 (19:32 -0500)]
Test PartialEq multidispatch

9 years agolibcore: add `Rhs` input parameter to comparison traits
Jorge Aparicio [Thu, 20 Nov 2014 23:17:37 +0000 (18:17 -0500)]
libcore: add `Rhs` input parameter to comparison traits

9 years agoauto merge of #19460 : steveklabnik/rust/conf_fixes, r=alexcrichton
bors [Tue, 2 Dec 2014 17:47:14 +0000 (17:47 +0000)]
auto merge of #19460 : steveklabnik/rust/conf_fixes, r=alexcrichton

9 years agoremove two unneccesary directories from configure
Steve Klabnik [Tue, 2 Dec 2014 14:21:28 +0000 (09:21 -0500)]
remove two unneccesary directories from configure

9 years agoauto merge of #19443 : nodakai/rust/another-missing-extracflags, r=alexcrichton
bors [Tue, 2 Dec 2014 12:02:06 +0000 (12:02 +0000)]
auto merge of #19443 : nodakai/rust/another-missing-extracflags, r=alexcrichton

rust-lang/rust@102b1a5bf1a60eeafb752844e5c98fe5f4e3b992 was not enough!

9 years agoauto merge of #19357 : michaelwoerister/rust/fix-issue-18791, r=alexcrichton
bors [Tue, 2 Dec 2014 10:06:58 +0000 (10:06 +0000)]
auto merge of #19357 : michaelwoerister/rust/fix-issue-18791, r=alexcrichton

One negative side-effect of this change is that there might be quite a bit of copying strings out of the codemap, i.e. one copy for every block that gets translated, just for taking a look at the last character of the block. If this turns out to cause a performance problem then `CodeMap::span_to_snippet()` could be changed return `Option<&str>` instead of `Option<String>`.

Fixes #18791

9 years agoauto merge of #19427 : scialex/rust/doc-attr-macros, r=sfackler
bors [Tue, 2 Dec 2014 07:22:02 +0000 (07:22 +0000)]
auto merge of #19427 : scialex/rust/doc-attr-macros, r=sfackler

this allows one to, for example, use #[doc = $macro_var ] in macros.

9 years agoauto merge of #19450 : jbapple/rust/pq-pop-time, r=Gankro
bors [Tue, 2 Dec 2014 02:52:15 +0000 (02:52 +0000)]
auto merge of #19450 : jbapple/rust/pq-pop-time, r=Gankro

pop calls siftdown, siftdown calls siftdown_range, and siftdown_range
loops on an index that can start as low as 0 and approximately doubles
each iteration.

9 years agoPop on binary heaps does not have constant time complexity.
Jim Apple [Tue, 2 Dec 2014 02:12:48 +0000 (18:12 -0800)]
Pop on binary heaps does not have constant time complexity.

pop calls siftdown, siftdown calls siftdown_range, and siftdown_range
loops on an index that can start as low as 0 and approximately doubles
each iteration.

9 years agodebuginfo: Fix multi-byte character related bug in cleanup scope handling.
Michael Woerister [Thu, 27 Nov 2014 12:54:01 +0000 (13:54 +0100)]
debuginfo: Fix multi-byte character related bug in cleanup scope handling.

Also see issue #18791.

9 years agoauto merge of #19439 : nodakai/rust/liblibc-getsid, r=acrichto
bors [Tue, 2 Dec 2014 00:22:00 +0000 (00:22 +0000)]
auto merge of #19439 : nodakai/rust/liblibc-getsid, r=acrichto

```
#include <unistd.h>

pid_t getsid(pid_t pid);

CONFORMING TO
       SVr4, POSIX.1-2001.
```

9 years agoauto merge of #19405 : jfager/rust/de-match-pyramid, r=bstrie
bors [Mon, 1 Dec 2014 21:56:53 +0000 (21:56 +0000)]
auto merge of #19405 : jfager/rust/de-match-pyramid, r=bstrie

No semantic changes, no enabling `if let` where it wasn't already enabled.

9 years agotest/run-make: another missing $(EXTRACFLAGS).
NODA, Kai [Sun, 23 Nov 2014 13:36:42 +0000 (21:36 +0800)]
test/run-make: another missing $(EXTRACFLAGS).

rust-lang/rust@102b1a5bf1a60eeafb752844e5c98fe5f4e3b992 was not enough!

Signed-off-by: NODA, Kai <nodakai@gmail.com>
9 years agoliblibc: getsid() was missing though setsid() was already there.
NODA, Kai [Mon, 1 Dec 2014 18:39:40 +0000 (02:39 +0800)]
liblibc: getsid() was missing though setsid() was already there.

include <unistd.h>

pid_t getsid(pid_t pid);

CONFORMING TO
       SVr4, POSIX.1-2001.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
9 years agoauto merge of #19436 : lifthrasiir/rust/rustdoc-short-src-paths, r=alexcrichton
bors [Mon, 1 Dec 2014 17:51:55 +0000 (17:51 +0000)]
auto merge of #19436 : lifthrasiir/rust/rustdoc-short-src-paths, r=alexcrichton

Before: `doc/src/collections/home/lifthrasiir/git/rust/src/libcollections/vec.rs.html`
After: `doc/src/collections/vec.rs.html`

If the source code is in the parent dirs relative to the crate root, `..` is replaced with `up` as expected. Any other error like non-UTF-8 paths or drive-relative paths falls back to the absolute path.

There might be a way to improve on false negatives, but this alone should be enough for fixing #18370.

9 years agoadded negative test for macro expansion in attributes
Alexander Light [Mon, 1 Dec 2014 16:08:29 +0000 (11:08 -0500)]
added negative test for macro expansion in attributes

9 years agorustdoc: Use relative paths in source renders.
Kang Seonghoon [Mon, 1 Dec 2014 11:46:51 +0000 (20:46 +0900)]
rustdoc: Use relative paths in source renders.

Before: doc/src/collections/home/lifthrasiir/git/rust/src/libcollections/vec.rs.html
After: doc/src/collections/vec.rs.html

If the source code is in the parent dirs relative to the crate root,
`..` is replaced with `up` as expected. Any other error like non-UTF-8
paths or drive-relative paths falls back to the absolute path.

There might be a way to improve on false negatives, but this alone
should be enough for fixing #18370.

9 years agoauto merge of #19417 : alexcrichton/rust/issue-19383, r=huonw
bors [Mon, 1 Dec 2014 07:11:53 +0000 (07:11 +0000)]
auto merge of #19417 : alexcrichton/rust/issue-19383, r=huonw

We only build LLVM for the host architecture, not the target architecture, so
this was just a minor typo in the parameters uses.

Closes #19383

9 years agoauto merge of #19425 : frewsxcv/rust/patch-1, r=steveklabnik
bors [Mon, 1 Dec 2014 05:11:50 +0000 (05:11 +0000)]
auto merge of #19425 : frewsxcv/rust/patch-1, r=steveklabnik

![](http://img2.wikia.nocookie.net/__cb20140809223829/disney/images/5/56/Darkwing_Duck_Poster_Promo.jpg)

9 years agoAdd test for expanding doc strings in macros.
Alexander Light [Mon, 1 Dec 2014 02:05:32 +0000 (21:05 -0500)]
Add test for expanding doc strings in macros.

9 years agoauto merge of #19418 : P1start/rust/unsafe-extern-trait, r=alexcrichton
bors [Mon, 1 Dec 2014 01:56:52 +0000 (01:56 +0000)]
auto merge of #19418 : P1start/rust/unsafe-extern-trait, r=alexcrichton

Fixes #19398.

9 years agostd: add Reader impl for &[u8]
Erick Tryzelaar [Mon, 1 Dec 2014 00:55:53 +0000 (16:55 -0800)]
std: add Reader impl for &[u8]

9 years agostd: add tests for the Vec<u8> Writer impl
Erick Tryzelaar [Sat, 15 Nov 2014 06:50:47 +0000 (22:50 -0800)]
std: add tests for the Vec<u8> Writer impl

9 years agofix missed switch pointed out in review plus a few others
jfager [Sun, 30 Nov 2014 23:11:40 +0000 (18:11 -0500)]
fix missed switch pointed out in review plus a few others

9 years agostd: Change the behavior of `reserve` for HashMap.
Piotr Czarnecki [Sat, 8 Nov 2014 16:26:52 +0000 (17:26 +0100)]
std: Change the behavior of `reserve` for HashMap.

HashMap's `reserve` method now takes as an argument the *extra* space
to reserve.

[breaking-change]

9 years agostd: Remove implicit shrinking from hash_map.
Piotr Czarnecki [Mon, 17 Nov 2014 13:23:21 +0000 (14:23 +0100)]
std: Remove implicit shrinking from hash_map.

Implements fn shrink_to_fit for HashMap.

9 years agoauto merge of #19415 : P1start/rust/error-message-fixes, r=alexcrichton
bors [Sun, 30 Nov 2014 19:46:53 +0000 (19:46 +0000)]
auto merge of #19415 : P1start/rust/error-message-fixes, r=alexcrichton

This is the style followed by most other error messages.

9 years agoauto merge of #19411 : lifthrasiir/rust/asm-clobbers-expanded, r=alexcrichton
bors [Sun, 30 Nov 2014 17:21:48 +0000 (17:21 +0000)]
auto merge of #19411 : lifthrasiir/rust/asm-clobbers-expanded, r=alexcrichton

I.e. we should not prematurely build operand constraints at the expansion time. Otherwise `--pretty expanded` diverges:

```
$ cat t.rs
#![feature(asm)]

pub fn main() { unsafe { asm!("" : : : "hello", "world") }; }

$ rustc t.rs --pretty
#![feature(asm)]

pub fn main() { unsafe { asm!("" : : : "hello" , "world") }; }

$ rustc t.rs --pretty expanded
#![feature(asm)]
#![feature(phase)]
#![no_std]
#![feature(globs)]
#[phase(plugin, link)]
extern crate "std" as std;
#[prelude_import]
use std::prelude::*;

pub fn main() { unsafe { asm!("":  :  : "~{hello},~{world}") }; }
```

(The last code *does* compile, but won't do the expected thing.)

9 years agoallow macro expansions in attributes
Alexander Light [Sun, 30 Nov 2014 14:51:15 +0000 (09:51 -0500)]
allow macro expansions in attributes

9 years agoFix typo in tests makefile
Corey Farwell [Sun, 30 Nov 2014 14:07:36 +0000 (09:07 -0500)]
Fix typo in tests makefile

9 years agoauto merge of #19369 : seanmonstar/rust/cow-str, r=alexcrichton
bors [Sun, 30 Nov 2014 10:21:49 +0000 (10:21 +0000)]
auto merge of #19369 : seanmonstar/rust/cow-str, r=alexcrichton

This implementation existed on MaybeOwned, but has been lost in the
transition to Cows. Let's put it back.

@aturon r?

9 years agotrans: Eliminated redundant allocations.
Kang Seonghoon [Sun, 30 Nov 2014 09:52:44 +0000 (18:52 +0900)]
trans: Eliminated redundant allocations.

9 years agoFix the ordering of `unsafe` and `extern` in methods
P1start [Sun, 30 Nov 2014 08:33:04 +0000 (21:33 +1300)]
Fix the ordering of `unsafe` and `extern` in methods

This breaks code that looks like this:

    trait Foo {
        extern "C" unsafe fn foo();
    }

    impl Foo for Bar {
        extern "C" unsafe fn foo() { ... }
    }

Change such code to look like this:

    trait Foo {
        unsafe extern "C" fn foo();
    }

    impl Foo for Bar {
        unsafe extern "C" fn foo() { ... }
    }

Fixes #19398.

[breaking-change]

9 years agomk: Use host llvm linkage paths, not target ones
Alex Crichton [Sun, 30 Nov 2014 08:01:19 +0000 (00:01 -0800)]
mk: Use host llvm linkage paths, not target ones

We only build LLVM for the host architecture, not the target architecture, so
this was just a minor typo in the parameters uses.

Closes #19383

9 years agoAdjust some error messages to start with a lowercase letter and not finish with a...
P1start [Fri, 28 Nov 2014 06:01:41 +0000 (19:01 +1300)]
Adjust some error messages to start with a lowercase letter and not finish with a full stop

9 years agoauto merge of #19365 : frewsxcv/rust/getopts-cleanup, r=alexcrichton
bors [Sun, 30 Nov 2014 06:56:41 +0000 (06:56 +0000)]
auto merge of #19365 : frewsxcv/rust/getopts-cleanup, r=alexcrichton

* Remove public reexports, as a part of #19253
* Rename getopts::Fail_ to getopts::Fail
 * Didn't see a reason for the suffixed '_'
* Removed getopts::FailType
 * Looked like it was only beings used for tests; refactored the tests
   to stop requiring it
* A few other non-breaking trivial refactoring changes

[breaking-change]

9 years agosyntax: Make `asm!` clobbers a proper vector.
Kang Seonghoon [Sun, 30 Nov 2014 02:56:31 +0000 (11:56 +0900)]
syntax: Make `asm!` clobbers a proper vector.

Otherwise `--pretty expanded` diverges.

9 years agoauto merge of #19392 : murarth/rust/rustc-compile-twice, r=nick29581
bors [Sat, 29 Nov 2014 21:51:34 +0000 (21:51 +0000)]
auto merge of #19392 : murarth/rust/rustc-compile-twice, r=nick29581

Closes #19371

9 years agoReplace some verbose match statements with their `if let` equivalent.
jfager [Sat, 29 Nov 2014 21:41:21 +0000 (16:41 -0500)]
Replace some verbose match statements with their `if let` equivalent.

No semantic changes, no enabling `if let` where it wasn't already enabled.

9 years agoauto merge of #19401 : MatejLach/rust/guide_are_fix, r=steveklabnik
bors [Sat, 29 Nov 2014 17:31:32 +0000 (17:31 +0000)]
auto merge of #19401 : MatejLach/rust/guide_are_fix, r=steveklabnik

Fixes a small omission of `are` in the sentence:
`There also a few things you can do with a tuple as a whole, without...`
r @steveklabnik?

9 years agoFix rustc panic on second compile_input
Murarth [Sat, 29 Nov 2014 04:56:09 +0000 (21:56 -0700)]
Fix rustc panic on second compile_input

9 years agoFix a simple typo
Matej Lach [Sat, 29 Nov 2014 13:26:32 +0000 (13:26 +0000)]
Fix a simple typo