]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #13451 : cmr/rust/doc-ffi, r=brson
bors [Fri, 11 Apr 2014 05:51:40 +0000 (22:51 -0700)]
auto merge of #13451 : cmr/rust/doc-ffi, r=brson

Closes #8748

10 years agoauto merge of #13440 : huonw/rust/strbuf, r=alexcrichton
bors [Fri, 11 Apr 2014 04:01:41 +0000 (21:01 -0700)]
auto merge of #13440 : huonw/rust/strbuf, r=alexcrichton

libstd: Implement `StrBuf`, a new string buffer type like `Vec`, and port all code over to use it.

Rebased & tests-fixed version of https://github.com/mozilla/rust/pull/13269

10 years agoFix tests. Add Vec<u8> conversion to StrBuf.
Huon Wilson [Thu, 10 Apr 2014 10:55:34 +0000 (20:55 +1000)]
Fix tests. Add Vec<u8> conversion to StrBuf.

10 years agoDocument the nullable pointer optimization in the FFI guide
Corey Richardson [Fri, 11 Apr 2014 00:29:09 +0000 (20:29 -0400)]
Document the nullable pointer optimization in the FFI guide

Closes #8748

10 years agoauto merge of #13443 : alexcrichton/rust/rollup, r=alexcrichton
bors [Thu, 10 Apr 2014 22:31:55 +0000 (15:31 -0700)]
auto merge of #13443 : alexcrichton/rust/rollup, r=alexcrichton

Closes #13441 (debuginfo: Fixes and improvements for #12840, #12886, and #13213)
Closes #13433 (Remove references to @Trait from a compiler error message)
Closes #13430 (Fix outdated lint warning about inner attribute)
Closes #13425 (Remove a pile of (mainly) internal `~[]` uses)
Closes #13419 (Stop using transmute_mut in RefCell)
Closes #13417 (Remove an unnecessary file `src/libnative/io/p`.)
Closes #13409 (Closing assorted resolve bugs)
Closes #13406 (Generalized the pretty-print entry points to support `-o <file>`.)
Closes #13403 (test: Add a test for #7663)
Closes #13402 (rustdoc: Prune the paths that do not appear in the index.)
Closes #13396 (rustc: Remove absolute rpaths)
Closes #13371 (Rename ast::Purity and ast::Impure Function. Closes #7287)
Closes #13350 (collections: replace all ~[T] with Vec<T>.)

10 years agorustc: Don't allow priv use to shadow pub use
Alex Crichton [Tue, 8 Apr 2014 22:10:41 +0000 (15:10 -0700)]
rustc: Don't allow priv use to shadow pub use

Previously, a private use statement would shadow a public use statement, all of
a sudden publicly exporting the privately used item. The correct behavior here
is to only shadow the use for the module in question, but for now it just
reverts the entire name to private so the pub use doesn't have much effect.

The behavior isn't exactly what we want, but this no longer has backwards
compatibility hazards.

10 years agorustc: Don't succeed on shadowed nonexistent import
Alex Crichton [Tue, 8 Apr 2014 22:03:29 +0000 (15:03 -0700)]
rustc: Don't succeed on shadowed nonexistent import

Previously resolve was checking the "import resolution" for whether an import
had succeeded or not, but this was the same structure filled in by a previous
import if a name is shadowed. Instead, this alters resolve to consult the local
resolve state (as opposed to the shared one) to test whether an import succeeded
or not.

Closes #13404

10 years agorustc: Disallow importing through use statements
Alex Crichton [Tue, 8 Apr 2014 21:31:25 +0000 (14:31 -0700)]
rustc: Disallow importing through use statements

Resolve is currently erroneously allowing imports through private `use`
statements in some circumstances, even across module boundaries. For example,
this code compiles successfully today:

    use std::c_str;
    mod test {
        use c_str::CString;
    }

This should not be allowed because it was explicitly decided that private `use`
statements are purely bringing local names into scope, they are not
participating further in name resolution.

As a consequence of this patch, this code, while valid today, is now invalid:

    mod test {
        use std::c_str;

        unsafe fn foo() {
            ::test::c_str::CString::new(0 as *u8, false);
        }
    }

While plausibly acceptable, I found it to be more consistent if private imports
were only considered candidates to resolve the first component in a path, and no
others.

Closes #12612

10 years agoRenamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and updated...
Kasey Carrothers [Mon, 7 Apr 2014 01:04:40 +0000 (18:04 -0700)]
Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and updated associated variable and function names.

10 years agorustc: Use realpath() for sysroot/rpath
Alex Crichton [Tue, 8 Apr 2014 17:15:46 +0000 (10:15 -0700)]
rustc: Use realpath() for sysroot/rpath

When calculating the sysroot, it's more accurate to use realpath() rather than
just one readlink() to account for any intermediate symlinks that the rustc
binary resolves itself to.

For rpath, realpath() is necessary because the rpath must dictate a relative
rpath from the destination back to the originally linked library, which works
more robustly if there are no symlinks involved.

Concretely, any binary generated on OSX into $TMPDIR requires an absolute rpath
because the temporary directory is behind a symlink with one layer of
indirection. This symlink causes all relative rpaths to fail to resolve.

cc #11734
cc #11857

10 years agorustc: Add a realpath utility function
Alex Crichton [Tue, 8 Apr 2014 17:06:11 +0000 (10:06 -0700)]
rustc: Add a realpath utility function

This is required in rustc to resolve symlinks for utilities such as the sysroot
and the rpath values which are encoded into binaries.

10 years agorustc: Don't rpath to librustrt.dylib
Alex Crichton [Tue, 8 Apr 2014 17:05:18 +0000 (10:05 -0700)]
rustc: Don't rpath to librustrt.dylib

This library no longer exists, there's no reason for this rpath to exist any
more.

10 years agorustc: Remove absolute rpaths
Alex Crichton [Mon, 7 Apr 2014 22:40:58 +0000 (15:40 -0700)]
rustc: Remove absolute rpaths

Concerns have been raised about using absolute rpaths in #11746, and this is the
first step towards not relying on rpaths at all. The only current use case for
an absolute rpath is when a non-installed rust builds an executable that then
moves from is built location. The relative rpath back to libstd and absolute
rpath to the installation directory still remain (CFG_PREFIX).

Closes #11746
Rebasing of #12754

10 years agorustdoc: Prune the paths that do not appear in the index.
Kang Seonghoon [Tue, 8 Apr 2014 18:25:54 +0000 (03:25 +0900)]
rustdoc: Prune the paths that do not appear in the index.

For the full library and compiler docs, the size of
`search-index.js` decreases by 13% (18.5% after gzip -9)
which is a substantial gain.

10 years agorustdoc: Clean the `initSearch` routine up.
Kang Seonghoon [Tue, 8 Apr 2014 17:47:52 +0000 (02:47 +0900)]
rustdoc: Clean the `initSearch` routine up.

10 years agomk: Add a dummy CFG_COMPILER_HOST_TRIPLE to rustdoc invocation.
Kang Seonghoon [Tue, 8 Apr 2014 17:45:53 +0000 (02:45 +0900)]
mk: Add a dummy CFG_COMPILER_HOST_TRIPLE to rustdoc invocation.

Otherwise it will prohibit `make compiler-docs` on Windows.

10 years agotest: Add a test for #7663
Alex Crichton [Tue, 8 Apr 2014 18:38:18 +0000 (11:38 -0700)]
test: Add a test for #7663

I think that the test case from this issue has become out of date with resolve
changes in the past 9 months, and it's not entirely clear to me what the
original bug was.

Regardless, it seems like tricky resolve behavior, so tests were added to make
sure things resolved correctly and warnings were correctly reported.

Closes #7663

10 years agoGeneralized the pretty-print entry points to support `-o <file>`.
Felix S. Klock II [Tue, 8 Apr 2014 20:07:15 +0000 (22:07 +0200)]
Generalized the pretty-print entry points to support `-o <file>`.

10 years agoRemove an unnecessary file.
OGINO Masanori [Wed, 9 Apr 2014 04:42:44 +0000 (13:42 +0900)]
Remove an unnecessary file.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoStop using transmute_mut in RefCell
Steven Fackler [Wed, 9 Apr 2014 05:54:06 +0000 (22:54 -0700)]
Stop using transmute_mut in RefCell

This is supposedly undefined behavior now that Unsafe exists, so we'll
use Cell instead.

10 years agoRemove some internal ~[] from several libraries.
Huon Wilson [Wed, 9 Apr 2014 10:02:26 +0000 (20:02 +1000)]
Remove some internal ~[] from several libraries.

Some straggling instances of `~[]` across a few different libs. Also,
remove some public ones from workcache.

10 years agonative: remove some internal ~[].
Huon Wilson [Wed, 9 Apr 2014 09:41:44 +0000 (19:41 +1000)]
native: remove some internal ~[].

10 years agogreen: de-~[].
Huon Wilson [Wed, 9 Apr 2014 08:36:19 +0000 (18:36 +1000)]
green: de-~[].

10 years agostd,syntax: make std::fmt::parse use `Vec`s.
Huon Wilson [Wed, 9 Apr 2014 01:46:49 +0000 (11:46 +1000)]
std,syntax: make std::fmt::parse use `Vec`s.

10 years agostd,native,green,rustuv: make readdir return `Vec`.
Huon Wilson [Wed, 9 Apr 2014 01:45:20 +0000 (11:45 +1000)]
std,native,green,rustuv: make readdir return `Vec`.

Replacing `~[]`. This also makes the `walk_dir` iterator use a `Vec`
internally.

10 years agostd,serialize: remove some internal uses of ~[].
Huon Wilson [Wed, 9 Apr 2014 01:43:33 +0000 (11:43 +1000)]
std,serialize: remove some internal uses of ~[].

These are all private uses of ~[], so can easily & non-controversially
be replaced with Vec.

10 years agoFix outdated lint warning about inner attribute
Eduard Bopp [Wed, 9 Apr 2014 18:16:44 +0000 (20:16 +0200)]
Fix outdated lint warning about inner attribute

It suggested adding a semicolon instead of the new syntax using an exclamation
mark.

10 years agoRemove references to @Trait from a compiler error message
Kevin Ballard [Wed, 9 Apr 2014 19:24:12 +0000 (12:24 -0700)]
Remove references to @Trait from a compiler error message

10 years agodebuginfo: Don't create debuginfo for statics inlined from other crates.
Michael Woerister [Thu, 10 Apr 2014 08:25:13 +0000 (10:25 +0200)]
debuginfo: Don't create debuginfo for statics inlined from other crates.

Fixes issue #13213, that is linker errors when the inlined static has been optimized out of the exporting crate.

10 years agodebuginfo: Implement discriminator type metadata re-use.
Michael Woerister [Thu, 27 Mar 2014 14:47:13 +0000 (15:47 +0100)]
debuginfo: Implement discriminator type metadata re-use.

An optimization for sharing the type metadata of generic enum discriminators between monomorphized instances (fixes issue #12840)

10 years agodebuginfo: Improve source code position assignment for inlined functions.
Michael Woerister [Thu, 27 Mar 2014 12:43:01 +0000 (13:43 +0100)]
debuginfo: Improve source code position assignment for inlined functions.

This commit makes sure that code inlined from other functions isn't assigned the source position of the call site, since this leads to undesired behavior when setting line breakpoints (issue #12886)

10 years agoauto merge of #13350 : huonw/rust/devec-collections, r=alexcrichton
bors [Thu, 10 Apr 2014 20:11:54 +0000 (13:11 -0700)]
auto merge of #13350 : huonw/rust/devec-collections, r=alexcrichton

collections: replace all ~[T] with Vec<T>.

10 years agoauto merge of #13437 : kaseyc/rust/remove_unnecessary_struct, r=sanxiyn
bors [Thu, 10 Apr 2014 14:21:56 +0000 (07:21 -0700)]
auto merge of #13437 : kaseyc/rust/remove_unnecessary_struct, r=sanxiyn

Removes the unused Point struct from assert-eq-macro-fail.rs.

10 years agoauto merge of #13436 : pongad/rust/lazyemit, r=thestinger
bors [Thu, 10 Apr 2014 12:56:55 +0000 (05:56 -0700)]
auto merge of #13436 : pongad/rust/lazyemit, r=thestinger

Fixes #11926

10 years agolibstd: Implement `StrBuf`, a new string buffer type like `Vec`, and
Patrick Walton [Wed, 2 Apr 2014 23:54:22 +0000 (16:54 -0700)]
libstd: Implement `StrBuf`, a new string buffer type like `Vec`, and
port all code over to use it.

10 years agoRemove the unused Point struct in the assert-eq-macro-fail.rs test.
Kasey Carrothers [Thu, 10 Apr 2014 02:31:20 +0000 (19:31 -0700)]
Remove the unused Point struct in the assert-eq-macro-fail.rs test.

10 years agoauto merge of #13413 : alexcrichton/rust/once-fn-move, r=brson
bors [Thu, 10 Apr 2014 01:31:58 +0000 (18:31 -0700)]
auto merge of #13413 : alexcrichton/rust/once-fn-move, r=brson

This fixes the categorization of the upvars of procs (represented internally
as once fns) to consider usage to require a loan. In doing so, upvars are no
longer allowed to be moved out of repeatedly in loops and such.

Closes #10398
Closes #12041
Closes #12127

10 years agoEmit intrinsic lazily
Michael Darakananda [Wed, 9 Apr 2014 23:56:31 +0000 (19:56 -0400)]
Emit intrinsic lazily

10 years agoauto merge of #13383 : ben0x539/rust/glob-dots, r=brson
bors [Wed, 9 Apr 2014 21:11:56 +0000 (14:11 -0700)]
auto merge of #13383 : ben0x539/rust/glob-dots, r=brson

Fixes #12930.

10 years agorustc: Prevent repeated moves out of proc upvars
Alex Crichton [Tue, 8 Apr 2014 23:59:18 +0000 (16:59 -0700)]
rustc: Prevent repeated moves out of proc upvars

This fixes the categorization of the upvars of procs (represented internally
as once fns) to consider usage to require a loan. In doing so, upvars are no
longer allowed to be moved out of repeatedly in loops and such.

Closes #10398
Closes #12041
Closes #12127

10 years agocollections: replace all ~[T] with Vec<T>.
Huon Wilson [Sat, 5 Apr 2014 05:45:42 +0000 (16:45 +1100)]
collections: replace all ~[T] with Vec<T>.

10 years agostd: use a `match` in `assert_eq!` to extend the lifetime of the args.
Huon Wilson [Mon, 7 Apr 2014 12:32:49 +0000 (22:32 +1000)]
std: use a `match` in `assert_eq!` to extend the lifetime of the args.

This enables

    assert_eq!(foo.collect::<Vec<...>>().as_slice(), &[1,2,3,4]);

to work, by extending the lifetime of the .as_slice() rvalue.

10 years agoauto merge of #13399 : SimonSapin/rust/patch-8, r=cmr
bors [Tue, 8 Apr 2014 22:06:31 +0000 (15:06 -0700)]
auto merge of #13399 : SimonSapin/rust/patch-8, r=cmr

10 years agoauto merge of #13397 : alexcrichton/rust/rollup, r=alexcrichton
bors [Tue, 8 Apr 2014 15:16:52 +0000 (08:16 -0700)]
auto merge of #13397 : alexcrichton/rust/rollup, r=alexcrichton

10 years agoUpdate an obsolete comment about conditions
Simon Sapin [Tue, 8 Apr 2014 09:56:48 +0000 (10:56 +0100)]
Update an obsolete comment about conditions

10 years agoTest fixes from rollup
Alex Crichton [Tue, 8 Apr 2014 05:28:08 +0000 (22:28 -0700)]
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)

10 years agoAdd test for #11881
JustAPerson [Thu, 3 Apr 2014 04:31:00 +0000 (23:31 -0500)]
Add test for #11881

Closes #11881.

This code has been copied from the original issue and updated for
modern Rust APIs.

10 years agostd: make vec!() macro handle a trailing comma
Kang Seonghoon [Thu, 3 Apr 2014 07:40:56 +0000 (16:40 +0900)]
std: make vec!() macro handle a trailing comma

Fixes #12910.

10 years agoMade 'make install' include libs for additional targets
Dmitry Promsky [Fri, 4 Apr 2014 16:17:30 +0000 (20:17 +0400)]
Made 'make install' include libs for additional targets

10 years agoFix spelling errors in comments.
Joseph Crail [Mon, 7 Apr 2014 02:51:59 +0000 (22:51 -0400)]
Fix spelling errors in comments.

10 years agostd: User a smaller stdin buffer on windows
Alex Crichton [Mon, 7 Apr 2014 08:11:31 +0000 (01:11 -0700)]
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

10 years agoImprove searching for XXX in tidy script (#3303)
Boris Egorov [Mon, 7 Apr 2014 12:01:10 +0000 (19:01 +0700)]
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.

10 years agofix ~ZeroSizeType rvalues
Daniel Micay [Mon, 7 Apr 2014 16:36:36 +0000 (12:36 -0400)]
fix ~ZeroSizeType rvalues

Closes #13360

10 years agorustc: Don't read both rlib and dylib metadata
Alex Crichton [Mon, 7 Apr 2014 20:13:21 +0000 (13:13 -0700)]
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.

10 years agorustc: Never register syntax crates in CStore
Alex Crichton [Mon, 7 Apr 2014 19:16:43 +0000 (12:16 -0700)]
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.

10 years agorustc: Use CStore, not a separate crate cache
Alex Crichton [Mon, 7 Apr 2014 19:14:33 +0000 (12:14 -0700)]
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.

10 years agostd: Add more docs for ptr mod
Brian Anderson [Mon, 7 Apr 2014 21:00:19 +0000 (14:00 -0700)]
std: Add more docs for ptr mod

10 years agoRegister new snapshots
Alex Crichton [Mon, 7 Apr 2014 20:30:48 +0000 (13:30 -0700)]
Register new snapshots

10 years agodoc: Document flavorful variations of paths
Alex Crichton [Mon, 7 Apr 2014 21:34:56 +0000 (14:34 -0700)]
doc: Document flavorful variations of paths

Closes #4293

10 years agoMade libflate functions return Options instead of outright failing
Tobba [Mon, 7 Apr 2014 23:08:49 +0000 (01:08 +0200)]
Made libflate functions return Options instead of outright failing

10 years agosync: remove unsafe and add Send+Share to Deref (enabled by autoderef vtables)
Jim Radford [Tue, 8 Apr 2014 00:55:14 +0000 (17:55 -0700)]
sync: remove unsafe and add Send+Share to Deref (enabled by autoderef vtables)

10 years agoauto merge of #13393 : alexcrichton/rust/hopefully-fix-bsd, r=sfackler
bors [Tue, 8 Apr 2014 04:21:47 +0000 (21:21 -0700)]
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?

10 years agonative: Try hard to not malloc on a forked child
Alex Crichton [Mon, 7 Apr 2014 22:52:51 +0000 (15:52 -0700)]
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?

10 years agolibglob: only return dirs for globs ending in /
Benjamin Herr [Mon, 7 Apr 2014 16:24:06 +0000 (18:24 +0200)]
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.

10 years agolibglob: allow "." and ".." to be matched
Benjamin Herr [Mon, 7 Apr 2014 12:47:04 +0000 (14:47 +0200)]
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.

10 years agoauto merge of #13288 : alexcrichton/rust/remove-check-fast, r=brson
bors [Mon, 7 Apr 2014 18:26:37 +0000 (11:26 -0700)]
auto merge of #13288 : alexcrichton/rust/remove-check-fast, r=brson

Rebasing of #12304.

10 years agoFix some windows rpass tests
Alex Crichton [Sun, 6 Apr 2014 05:18:52 +0000 (22:18 -0700)]
Fix some windows rpass tests

10 years agoauto merge of #13363 : free-Runner/rust/patch-1, r=alexcrichton
bors [Mon, 7 Apr 2014 15:56:34 +0000 (08:56 -0700)]
auto merge of #13363 : free-Runner/rust/patch-1, r=alexcrichton

10 years agoauto merge of #13358 : tbu-/rust/pr_doc_equivrel, r=cmr
bors [Mon, 7 Apr 2014 13:21:35 +0000 (06:21 -0700)]
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.

10 years agoauto merge of #13356 : alexcrichton/rust/ignore-flaky, r=huonw
bors [Mon, 7 Apr 2014 12:01:35 +0000 (05:01 -0700)]
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.

10 years agoauto merge of #13354 : alexcrichton/rust/fixup-some-signals, r=sfackler
bors [Mon, 7 Apr 2014 10:46:37 +0000 (03:46 -0700)]
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

10 years agoauto merge of #13347 : HeroesGrave/rust/master, r=alexcrichton
bors [Mon, 7 Apr 2014 09:26:37 +0000 (02:26 -0700)]
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.

10 years agoauto merge of #13165 : sfackler/rust/io-vec, r=alexcrichton
bors [Mon, 7 Apr 2014 06:36:38 +0000 (23:36 -0700)]
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.

10 years agormake: Fix a test on FreeBSD
Alex Crichton [Thu, 3 Apr 2014 20:12:19 +0000 (13:12 -0700)]
rmake: Fix a test on FreeBSD

10 years agoRemove ignore-fast that has cropped up
Alex Crichton [Thu, 3 Apr 2014 20:02:50 +0000 (13:02 -0700)]
Remove ignore-fast that has cropped up

10 years agoUse ignore-freebsd for tests broken on FreeBSD
Brian Anderson [Fri, 14 Mar 2014 00:30:33 +0000 (17:30 -0700)]
Use ignore-freebsd for tests broken on FreeBSD

10 years agoIgnore another test that fails mysteriously on BSD
Brian Anderson [Mon, 10 Mar 2014 03:57:29 +0000 (20:57 -0700)]
Ignore another test that fails mysteriously on BSD

10 years agotest: Ignore run-make tests that don't work on BSD
Brian Anderson [Sat, 1 Mar 2014 03:32:43 +0000 (19:32 -0800)]
test: Ignore run-make tests that don't work on BSD

10 years agomk: Pass the name of the make command to maketest.py
Brian Anderson [Thu, 27 Feb 2014 04:13:08 +0000 (20:13 -0800)]
mk: Pass the name of the make command to maketest.py

This should make BSD use the proper GNU make.

10 years agotest: Ignore compile-fail/issue-5806.rs
Brian Anderson [Tue, 25 Feb 2014 02:36:35 +0000 (18:36 -0800)]
test: Ignore compile-fail/issue-5806.rs

Broken on BSD. #12460

10 years agoRemove check-fast. Closes #4193, #8844, #6330, #7416
Brian Anderson [Sat, 15 Feb 2014 03:21:17 +0000 (19:21 -0800)]
Remove check-fast. Closes #4193, #8844, #6330, #7416

10 years agoDe-~[] IO utils
Steven Fackler [Thu, 27 Mar 2014 05:53:30 +0000 (22:53 -0700)]
De-~[] IO utils

10 years agoDe-~[] Mem{Reader,Writer}
Steven Fackler [Thu, 27 Mar 2014 05:46:25 +0000 (22:46 -0700)]
De-~[] Mem{Reader,Writer}

10 years agoDe-~[] Reader and Writer
Steven Fackler [Wed, 26 Mar 2014 16:24:16 +0000 (09:24 -0700)]
De-~[] Reader and Writer

There's a little more allocation here and there now since
from_utf8_owned can't be used with Vec.

10 years agoFixed broken tutorial link
free-Runner [Sun, 6 Apr 2014 20:06:46 +0000 (16:06 -0400)]
Fixed broken tutorial link

10 years agoauto merge of #13346 : ben0x539/rust/priv-field-in, r=alexcrichton
bors [Sun, 6 Apr 2014 17:36:33 +0000 (10:36 -0700)]
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.

10 years agoauto merge of #13345 : bjz/rust/irc, r=alexcrichton
bors [Sun, 6 Apr 2014 15:26:34 +0000 (08:26 -0700)]
auto merge of #13345 : bjz/rust/irc, r=alexcrichton

This adds links to `#rust-gamedev`, `#rust-internals`, and `#rust-osdev`.

10 years agoRemove use of block comments in src/libstd/cmp.rs
Tobias Bucher [Sun, 6 Apr 2014 14:20:53 +0000 (16:20 +0200)]
Remove use of block comments in src/libstd/cmp.rs

10 years agoauto merge of #13340 : FlaPer87/rust/code-model, r=cmr
bors [Sun, 6 Apr 2014 14:06:36 +0000 (07:06 -0700)]
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`

10 years agoAdd requirements of TotalEq and TotalOrd
Tobias Bucher [Sun, 6 Apr 2014 12:14:41 +0000 (14:14 +0200)]
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.

10 years agoAdd support for different relocation models
Flavio Percoco [Sat, 5 Apr 2014 12:10:13 +0000 (14:10 +0200)]
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`

10 years agoauto merge of #13344 : eddyb/rust/kill-unboxed-vec, r=cmr
bors [Sun, 6 Apr 2014 12:46:38 +0000 (05:46 -0700)]
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.

10 years agorustc: remove ty_unboxed_vec.
Eduard Burtescu [Sun, 6 Apr 2014 10:54:41 +0000 (13:54 +0300)]
rustc: remove ty_unboxed_vec.

10 years agoauto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,me
bors [Sun, 6 Apr 2014 09:56:39 +0000 (02:56 -0700)]
auto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,me

Rebasing of #12526 with a very obscure bug fixed on windows.

10 years agoauto merge of #13268 : alexcrichton/rust/parse-closure, r=cmr
bors [Sun, 6 Apr 2014 08:36:39 +0000 (01:36 -0700)]
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

10 years agostd: Ignore a flaky std::comm test
Alex Crichton [Sun, 6 Apr 2014 07:41:25 +0000 (00:41 -0700)]
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.

10 years agosyntax: Tweak parsing lifetime bounds on closures
Alex Crichton [Wed, 2 Apr 2014 16:47:11 +0000 (09:47 -0700)]
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

10 years agostd: Fix a doc example on io::signal
Alex Crichton [Sun, 6 Apr 2014 04:02:35 +0000 (21:02 -0700)]
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

10 years agoauto merge of #13319 : alexcrichton/rust/rustdoc-fields, r=brson
bors [Sun, 6 Apr 2014 03:21:37 +0000 (20:21 -0700)]
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

10 years agorustc: Pass --enable-long-section-names to gcc
Alex Crichton [Thu, 3 Apr 2014 01:27:12 +0000 (18:27 -0700)]
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