Commit Graph

27943 Commits

Author SHA1 Message Date
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
bors
4af69f204e auto merge of #13344 : eddyb/rust/kill-unboxed-vec, r=cmr
Removes the special `ty_unboxed_vec` type from the type system.
It was previously used only during translating `~[T]`/`~str` allocation and drop glue.
2014-04-06 05:46:38 -07:00
Eduard Burtescu
2d22243b0c rustc: remove ty_unboxed_vec. 2014-04-06 14:05:32 +03:00
bors
f1f50565a1 auto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,me
Rebasing of #12526 with a very obscure bug fixed on windows.
2014-04-06 02:56:39 -07:00
bors
667f82a79b auto merge of #13268 : alexcrichton/rust/parse-closure, r=cmr
In summary these are some example transitions this change makes:

    'a ||       => ||: 'a
    proc:Send() => proc():Send

The intended syntax for closures is to put the lifetime bound not at the front
but rather in the list of bounds. Currently there is no official support in the
AST for bounds that are not 'static, so this case is currently specially handled
in the parser to desugar to what the AST is expecting. Additionally, this moves
the bounds on procedures to the correct position, which is after the argument
list.

The current grammar for closures and procedures is:

    procedure := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
                        [ ':' bound-list ] [ '->' type ]
    closure := [ 'unsafe' ] ['<' lifetime-list '>' ] '|' arg-list '|'
                        [ ':' bound-list ] [ '->' type ]
    lifetime-list := lifetime | lifetime ',' lifetime-list
    arg-list := ident ':' type | ident ':' type ',' arg-list
    bound-list := bound | bound '+' bound-list
    bound := path | lifetime

This does not currently handle the << ambiguity in `Option<<'a>||>`, I am
deferring that to a later patch. Additionally, this removes the support for the
obsolete syntaxes of ~fn and &fn.

Closes #10553
Closes #10767 
Closes #11209
Closes #11210
Closes #11211
2014-04-06 01:36:39 -07:00
Alex Crichton
b5ef3afd50 std: Ignore a flaky std::comm test
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-06 00:41:25 -07:00
Alex Crichton
d1c584e41b syntax: Tweak parsing lifetime bounds on closures
In summary these are some example transitions this change makes:

    'a ||       => ||: 'a
    proc:Send() => proc():Send

The intended syntax for closures is to put the lifetime bound not at the front
but rather in the list of bounds. Currently there is no official support in the
AST for bounds that are not 'static, so this case is currently specially handled
in the parser to desugar to what the AST is expecting. Additionally, this moves
the bounds on procedures to the correct position, which is after the argument
list.

The current grammar for closures and procedures is:

    procedure := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')'
                        [ ':' bound-list ] [ '->' type ]
    closure := [ 'unsafe' ] ['<' lifetime-list '>' ] '|' arg-list '|'
                        [ ':' bound-list ] [ '->' type ]
    lifetime-list := lifetime | lifetime ',' lifetime-list
    arg-list := ident ':' type | ident ':' type ',' arg-list
    bound-list := bound | bound '+' bound-list
    bound := path | lifetime

This does not currently handle the << ambiguity in `Option<<'a>||>`, I am
deferring that to a later patch. Additionally, this removes the support for the
obsolete syntaxes of ~fn and &fn.

Closes #10553
Closes #10767
Closes #11209
Closes #11210
Closes #11211
2014-04-06 00:08:21 -07:00
Alex Crichton
137e648edd std: Fix a doc example on io::signal
This also makes the listener struct sendable again by explicitly putting the
Send bound on the relevant Rtio object.

cc #13352
2014-04-05 22:13:32 -07:00
bors
4e9e25907b auto merge of #13319 : alexcrichton/rust/rustdoc-fields, r=brson
The calculation for whether a field is public or private was tweaked in #13184,
but I forgot to update rustdoc.

Closes #13310
2014-04-05 20:21:37 -07:00
Alex Crichton
38f7a1b41b rustc: Pass --enable-long-section-names to gcc
This was quite a curious bug on windows, and the details can be found in the
comment I added to src/librustc/back/link.rs
2014-04-05 17:53:44 -07:00
Benjamin Herr
d4b73a7411 name struct in "field ... is private" error 2014-04-06 02:37:25 +02:00
HeroesGrave
c6e19ae956 fix kate syntax highlighting 2014-04-06 09:52:08 +12:00