Commit Graph

28154 Commits

Author SHA1 Message Date
bors
8801d891c4 auto merge of #13399 : SimonSapin/rust/patch-8, r=cmr 2014-04-08 15:06:31 -07:00
Alex Crichton
0cc257eb42 rustc: Run destructors when dest=Ignore
Previously, if statements of the form "Foo;" or "let _ = Foo;" were encountered
where Foo had a destructor, the destructors were not run. This changes
the relevant locations in trans to check for ty::type_needs_drop and invokes
trans_to_lvalue instead of trans_into.

Closes #4734
Closes #6892
2014-04-08 08:28:54 -07:00
bors
02f51211ed auto merge of #13397 : alexcrichton/rust/rollup, r=alexcrichton 2014-04-08 08:16:52 -07:00
Simon Sapin
7619b78191 Update an obsolete comment about conditions 2014-04-08 10:56:48 +01:00
Alex Crichton
da8d4fddc6 Test fixes from rollup
Closes #13394 (sync: remove unsafe and add Send+Share to Deref (enabled by autoderef vtables))
Closes #13389 (Made libflate functions return Options instead of outright failing)
Closes #13388 (doc: Document flavorful variations of paths)
Closes #13387 (Register new snapshots)
Closes #13386 (std: Add more docs for ptr mod)
Closes #13384 (Tweak crate loading to load less metadata)
Closes #13382 (fix ~ZeroSizeType rvalues)
Closes #13378 (Update tidy script, replace XXX with FIXME)
Closes #13377 (std: User a smaller stdin buffer on windows)
Closes #13369 (Fix spelling errors in comments.)
Closes #13314 (Made 'make install' include libs for additional targets)
Closes #13278 (std: make vec!() macro handle a trailing comma)
Closes #13276 (Add test for #11881)
2014-04-08 00:03:16 -07:00
JustAPerson
cdf349d442 Add test for #11881
Closes #11881.

This code has been copied from the original issue and updated for
modern Rust APIs.
2014-04-08 00:03:12 -07:00
Kang Seonghoon
7a281718f0 std: make vec!() macro handle a trailing comma
Fixes #12910.
2014-04-08 00:03:12 -07:00
Dmitry Promsky
87334fb05f Made 'make install' include libs for additional targets 2014-04-08 00:03:12 -07:00
Joseph Crail
22b632560f Fix spelling errors in comments. 2014-04-08 00:03:12 -07:00
Alex Crichton
6ac34926a4 std: User a smaller stdin buffer on windows
Apparently windows doesn't like reading from stdin with a large buffer size, and
it also apparently is ok with a smaller buffer size. This changes the reader
returned by stdin() to return an 8k buffered reader for stdin rather than a 64k
buffered reader.

Apparently libuv has run into this before, taking a peek at their code, with a
specific comment in their console code saying that "ReadConsole can't handle big
buffers", which I presume is related to invoking ReadFile as if it were a file
descriptor.

Closes #13304
2014-04-08 00:03:12 -07:00
Boris Egorov
00cbda2d0a Improve searching for XXX in tidy script (#3303)
Few places where previous version of tidy script cannot find XXX:
* inside one-line comment preceding by a few spaces;
* inside multiline comments (now it finds it if multiline comment starts
on the same line with XXX).

Change occurences of XXX found by new tidy script.
2014-04-08 00:03:12 -07:00
Daniel Micay
de2567dec9 fix ~ZeroSizeType rvalues
Closes #13360
2014-04-08 00:03:11 -07:00
Alex Crichton
cced02fcac rustc: Don't read both rlib and dylib metadata
This is an optimization which is quite impactful for compiling small crates.
Reading libstd's metadata takes about 50ms, and a hello world before this change
took about 100ms (this change halves that time).

Recent changes made it such that this optimization wasn't performed, but I think
it's a better idea do to this for now. See #10786 for tracking this issue.
2014-04-08 00:03:11 -07:00
Alex Crichton
5367c32c7d rustc: Never register syntax crates in CStore
When linking, all crates in the local CStore are used to link the final product.
With #[phase(syntax)], crates want to be omitted from this linkage phase, and
this was achieved by dumping the entire CStore after loading crates. This causes
crates like the standard library to get loaded twice. This loading process is a
fairly expensive operation when dealing with decompressing metadata.

This commit alters the loading process to never register syntax crates in
CStore. Instead, only phase(link) crates ever make their way into the map of
crates. The CrateLoader trait was altered to return everything in one method
instead of having separate methods for finding information.
2014-04-08 00:03:11 -07:00
Alex Crichton
31755e2452 rustc: Use CStore, not a separate crate cache
This separate crate cache is one factor which is causing libstd to be loaded
twice during normal compilation. The crates loaded for syntax extensions have a
separate cache than the crates loaded for linking, so all crates are loaded once
per #[phase] they're tagged with.

This removes the cache and instead uses the CStore structure itself as the cache
for loaded crates. This should allow crates loaded during the syntax phase to be
shared with the crates loaded during the link phase.
2014-04-08 00:03:11 -07:00
Brian Anderson
ef37cfdecc std: Add more docs for ptr mod 2014-04-08 00:03:11 -07:00
Alex Crichton
c3ea3e439f Register new snapshots 2014-04-08 00:03:11 -07:00
Alex Crichton
c83afb9719 doc: Document flavorful variations of paths
Closes #4293
2014-04-08 00:03:11 -07:00
Tobba
bc234ae130 Made libflate functions return Options instead of outright failing 2014-04-08 00:03:11 -07:00
Jim Radford
dc49018679 sync: remove unsafe and add Send+Share to Deref (enabled by autoderef vtables) 2014-04-08 00:03:11 -07:00
bors
e415c25bcd auto merge of #13393 : alexcrichton/rust/hopefully-fix-bsd, r=sfackler
This appears to be causing the BSD bots to lock up when looking at the core
dumps I've managed to get. Dropping the `FileDesc` structure triggers the `Arc`
it's contained in to get cleaned up, invoking free(). This instead just closes
the file descriptor (the arc itself is never cleaned up).

I'm still not entirely sure why this is a problem because the pthreads runtime
should register hooks for fork() to prevent this sort of deadlock, but perhaps
that's only done on linux?
2014-04-07 21:21:47 -07:00
Alex Crichton
7da210907e native: Try hard to not malloc on a forked child
This appears to be causing the BSD bots to lock up when looking at the core
dumps I've managed to get. Dropping the `FileDesc` structure triggers the `Arc`
it's contained in to get cleaned up, invoking free(). This instead just closes
the file descriptor (the arc itself is never cleaned up).

I'm still not entirely sure why this is a problem because the pthreads runtime
should register hooks for fork() to prevent this sort of deadlock, but perhaps
that's only done on linux?
2014-04-07 20:27:12 -07:00
Benjamin Herr
1700f359bc libglob: only return dirs for globs ending in /
`foo.txt/` should not return `foo.txt` if `foo.txt` is in fact a text
file and not a directory.
2014-04-08 01:21:37 +02:00
Benjamin Herr
4051bd900a libglob: allow "." and ".." to be matched
... also don't read the whole directory if the glob for that path
component doesn't contain any metacharacters.

Patterns like `../*.jpg` will work now, and `.*` will match both `.` and
`..` to be consistent with shell expansion.

As before: Just `*` still won't match `.` and `..`, while it will still
match dotfiles like `.git` by default.
2014-04-08 01:21:28 +02:00
bors
9a33330caa auto merge of #13288 : alexcrichton/rust/remove-check-fast, r=brson
Rebasing of #12304.
2014-04-07 11:26:37 -07:00
Alex Crichton
2ecae80af2 Fix some windows rpass tests 2014-04-07 09:29:42 -07:00
bors
2db9700332 auto merge of #13363 : free-Runner/rust/patch-1, r=alexcrichton 2014-04-07 08:56:34 -07:00
bors
c7fac44712 auto merge of #13358 : tbu-/rust/pr_doc_equivrel, r=cmr
Add requirements of TotalEq and TotalOrd

Clarify that TotalEq needs an underlying equivalence relation and that TotalOrd
needs a total ordering and specifically named the required (and sufficient)
attributes.
2014-04-07 06:21:35 -07:00
bors
dd3e553120 auto merge of #13356 : alexcrichton/rust/ignore-flaky, r=huonw
This test relies on the parent to be descheduled before the child sends its
data. This has proved to be unreliable on libnative on the bots. It's a fairly
trivial test regardless, so ignoring it for now won't lose much.
2014-04-07 05:01:35 -07:00
bors
8902ed0c65 auto merge of #13354 : alexcrichton/rust/fixup-some-signals, r=sfackler
This also makes the listener struct sendable again by explicitly putting the
Send bound on the relevant Rtio object.

cc #13352
2014-04-07 03:46:37 -07:00
bors
0deb16a54e auto merge of #13347 : HeroesGrave/rust/master, r=alexcrichton
This has to be the most pathetic pull request I've ever made, but the `[` in `#![some_attribute]` was not getting highlighted in KATE.
2014-04-07 02:26:37 -07:00
bors
e4779b5050 auto merge of #13165 : sfackler/rust/io-vec, r=alexcrichton
`Reader`, `Writer`, `MemReader`, `MemWriter`, and `MultiWriter` now work with `Vec<u8>` instead of `~[u8]`. This does introduce some extra copies since `from_utf8_owned` isn't usable anymore, but I think that can't be helped until `~str`'s representation changes.
2014-04-06 23:36:38 -07:00
Alex Crichton
0d9fd8e2a1 rmake: Fix a test on FreeBSD 2014-04-06 15:55:43 -07:00
Alex Crichton
8ded99c0ef Remove ignore-fast that has cropped up 2014-04-06 15:55:43 -07:00
Brian Anderson
42847c8b1e Use ignore-freebsd for tests broken on FreeBSD 2014-04-06 15:55:43 -07:00
Brian Anderson
1ef8b75187 Ignore another test that fails mysteriously on BSD 2014-04-06 15:55:43 -07:00
Brian Anderson
e9108cd7b8 test: Ignore run-make tests that don't work on BSD 2014-04-06 15:55:43 -07:00
Brian Anderson
0e85e599db mk: Pass the name of the make command to maketest.py
This should make BSD use the proper GNU make.
2014-04-06 15:55:43 -07:00
Brian Anderson
a6173e19d0 test: Ignore compile-fail/issue-5806.rs
Broken on BSD. #12460
2014-04-06 15:55:43 -07:00
Brian Anderson
072a920503 Remove check-fast. Closes #4193, #8844, #6330, #7416 2014-04-06 15:55:43 -07:00
Steven Fackler
fcf9b30f42 De-~[] IO utils 2014-04-06 15:40:01 -07:00
Steven Fackler
49a8081095 De-~[] Mem{Reader,Writer} 2014-04-06 15:40:01 -07:00
Steven Fackler
d0e60b72ee De-~[] Reader and Writer
There's a little more allocation here and there now since
from_utf8_owned can't be used with Vec.
2014-04-06 15:39:56 -07:00
free-Runner
14f2464801 Fixed broken tutorial link 2014-04-06 16:06:46 -04:00
bors
31e8f2448c auto merge of #13346 : ben0x539/rust/priv-field-in, r=alexcrichton
In the error message for when a private field is used, include the name of the struct, or if it's a struct-like enum variant, the names of the variant and the enum.

This fixes #13341.
2014-04-06 10:36:33 -07:00
bors
d73bd64f44 auto merge of #13345 : bjz/rust/irc, r=alexcrichton
This adds links to `#rust-gamedev`, `#rust-internals`, and `#rust-osdev`.
2014-04-06 08:26:34 -07:00
Tobias Bucher
85129e2169 Remove use of block comments in src/libstd/cmp.rs 2014-04-06 16:21:36 +02:00
bors
02c81fe2b5 auto merge of #13340 : FlaPer87/rust/code-model, r=cmr
Rust currently defaults to `RelocPIC` regardless. This patch adds a new
codegen option that allows choosing different relocation-model. The
available models are:

    - default (Use the target-specific default model)
    - static
    - pic
    - no-pic

For a more detailed information use `llc --help`
2014-04-06 07:06:36 -07:00
Tobias Bucher
cf83ff8959 Add requirements of TotalEq and TotalOrd
Clarify that TotalEq needs an underlying equivalence relation and that TotalOrd
needs a total ordering and specifically named the required (and sufficient)
attributes.
2014-04-06 15:29:36 +02:00
Flavio Percoco
b78ac5b74a Add support for different relocation models
Rust currently defaults to `RelocPIC` regardless. This patch adds a new
codegen option that allows choosing different relocation-model. The
available models are:

    - default (Use the target-specific default model)
    - static
    - pic
    - no-pic

For a more detailed information use `llc --help`
2014-04-06 15:06:44 +02:00