]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #12284 : brson/rust/install, r=alexcrichton
bors [Mon, 17 Feb 2014 11:26:51 +0000 (03:26 -0800)]
auto merge of #12284 : brson/rust/install, r=alexcrichton

Work toward #9876.

This adds `prepare.mk`, which is simply a more heavily-parameterized `install.mk`, then uses `prepare` to implement both `install` and the windows installer (`dist`). Smoke tested on both Linux and Windows.

10 years agoAddress review feedback
Brian Anderson [Sun, 16 Feb 2014 05:47:28 +0000 (21:47 -0800)]
Address review feedback

10 years agoauto merge of #12085 : alexcrichton/rust/issue-12082, r=brson
bors [Mon, 17 Feb 2014 00:46:39 +0000 (16:46 -0800)]
auto merge of #12085 : alexcrichton/rust/issue-12082, r=brson

This just copies the libuv implementation for libnative which seems reasonable
enough (uid/gid fail on windows).

Closes #12082

10 years agoUpgrade libuv
Alex Crichton [Sun, 16 Feb 2014 20:57:40 +0000 (12:57 -0800)]
Upgrade libuv

This notably includes joyent/libuv@6f62d62c in order to fix when processes fail
to spawn on windows

10 years agoAllow configuration of uid/gid/detach on processes
Alex Crichton [Fri, 7 Feb 2014 06:38:05 +0000 (22:38 -0800)]
Allow configuration of uid/gid/detach on processes

This just copies the libuv implementation for libnative which seems reasonable
enough (uid/gid fail on windows).

Closes #12082

10 years agoauto merge of #12319 : SimonSapin/rust/build-symlink, r=alexcrichton
bors [Sun, 16 Feb 2014 20:51:40 +0000 (12:51 -0800)]
auto merge of #12319 : SimonSapin/rust/build-symlink, r=alexcrichton

10 years agoauto merge of #12312 : brson/rust/doc, r=alexcrichton
bors [Sun, 16 Feb 2014 19:36:40 +0000 (11:36 -0800)]
auto merge of #12312 : brson/rust/doc, r=alexcrichton

Only single out std. Put everything else in a consistent list.

10 years agoauto merge of #12313 : bjz/rust/tuple, r=huonw
bors [Sun, 16 Feb 2014 15:11:34 +0000 (07:11 -0800)]
auto merge of #12313 : bjz/rust/tuple, r=huonw

This renames the `n*` and `n*_ref` tuple getters to `val*` and `ref*` respectively, and adds `mut*` getters. It also removes the `CloneableTuple` and `ImmutableTuple` traits.

10 years agoRemove CloneableTuple and ImmutableTuple traits
Brendan Zabarauskas [Sun, 16 Feb 2014 09:36:43 +0000 (20:36 +1100)]
Remove CloneableTuple and ImmutableTuple traits

These are adequately covered by the Tuple2 trait.

10 years agoImprove naming of tuple getters, and add mutable tuple getter
Brendan Zabarauskas [Sun, 16 Feb 2014 11:19:41 +0000 (22:19 +1100)]
Improve naming of tuple getters, and add mutable tuple getter

Renames the `n*` and `n*_ref` tuple getters to `val*` and `ref*` respectively, and adds `mut*` getters.

10 years agoIgnore /build even if it’s a symlink.
Simon Sapin [Sun, 16 Feb 2014 12:41:41 +0000 (12:41 +0000)]
Ignore /build even if it’s a symlink.

10 years agoMerge ImmutableTuple* traits into their respective Tuple* trait
Brendan Zabarauskas [Sun, 16 Feb 2014 09:25:28 +0000 (20:25 +1100)]
Merge ImmutableTuple* traits into their respective Tuple* trait

10 years agoauto merge of #12310 : brson/rust/mkfilecleanup, r=sfackler
bors [Sun, 16 Feb 2014 08:51:33 +0000 (00:51 -0800)]
auto merge of #12310 : brson/rust/mkfilecleanup, r=sfackler

Two small fixes

10 years agodoc: Reorganize the library index
Brian Anderson [Sun, 16 Feb 2014 08:21:08 +0000 (00:21 -0800)]
doc: Reorganize the library index

Only single out std. Put everything else in a consistent list.

10 years agoDelegate ToStr implementation to Show for tuples
Brendan Zabarauskas [Sun, 16 Feb 2014 07:27:46 +0000 (18:27 +1100)]
Delegate ToStr implementation to Show for tuples

10 years agoImplement Show for 1-12 element tuples
Brendan Zabarauskas [Fri, 14 Feb 2014 14:20:43 +0000 (01:20 +1100)]
Implement Show for 1-12 element tuples

10 years agoauto merge of #12302 : alexcrichton/rust/issue-12295, r=brson
bors [Sun, 16 Feb 2014 07:36:26 +0000 (23:36 -0800)]
auto merge of #12302 : alexcrichton/rust/issue-12295, r=brson

The previous code erroneously assumed that 'steals > cnt' was always true, but
that was a false assumption. The code was altered to decrement steals to a
minimum of 0 instead of taking all of cnt into account.

I didn't include the exact test from #12295 because it could run for quite
awhile, and instead set the threshold for MAX_STEALS to much lower during
testing. I found that this triggered the old bug quite frequently when running
without this fix.

Closes #12295

10 years agomk: Fix typo, NO_MAKEFILE_DEPS -> NO_MKFILE_DEPS
Brian Anderson [Sun, 16 Feb 2014 07:12:56 +0000 (23:12 -0800)]
mk: Fix typo, NO_MAKEFILE_DEPS -> NO_MKFILE_DEPS

10 years agomk: Remove check-notidy, check-full, check-test
Brian Anderson [Sun, 16 Feb 2014 07:11:54 +0000 (23:11 -0800)]
mk: Remove check-notidy, check-full, check-test

Mostly useless

10 years agoauto merge of #12301 : FlaPer87/rust/issue-8893, r=alexcrichton
bors [Sun, 16 Feb 2014 06:06:27 +0000 (22:06 -0800)]
auto merge of #12301 : FlaPer87/rust/issue-8893, r=alexcrichton

10 years agoauto merge of #12305 : luqmana/rust/ub, r=sfackler
bors [Sun, 16 Feb 2014 04:46:26 +0000 (20:46 -0800)]
auto merge of #12305 : luqmana/rust/ub, r=sfackler

These are no longer valid options as of the recent llvm upgrade.

10 years agoauto merge of #12299 : sfackler/rust/limit-return, r=alexcrichton
bors [Sun, 16 Feb 2014 02:56:29 +0000 (18:56 -0800)]
auto merge of #12299 : sfackler/rust/limit-return, r=alexcrichton

This is useful in contexts like this:

```rust
let size = rdr.read_be_i32() as uint;
let mut limit = LimitReader::new(rdr.by_ref(), size);
let thing = read_a_thing(&mut limit);
assert!(limit.limit() == 0);
```

10 years agomk: Remove old flags to llc for arm.
Luqman Aden [Sun, 16 Feb 2014 01:08:33 +0000 (20:08 -0500)]
mk: Remove old flags to llc for arm.

10 years agoauto merge of #12298 : alexcrichton/rust/rustdoc-testing, r=sfackler
bors [Sun, 16 Feb 2014 00:36:27 +0000 (16:36 -0800)]
auto merge of #12298 : alexcrichton/rust/rustdoc-testing, r=sfackler

It's too easy to forget the `rust` tag to test something.

Closes #11698

10 years agoCorrectly reset steals when hitting MAX_STEALS
Alex Crichton [Sat, 15 Feb 2014 23:54:29 +0000 (15:54 -0800)]
Correctly reset steals when hitting MAX_STEALS

The previous code erroneously assumed that 'steals > cnt' was always true, but
that was a false assumption. The code was altered to decrement steals to a
minimum of 0 instead of taking all of cnt into account.

I didn't include the exact test from #12295 because it could run for quite
awhile, and instead set the threshold for MAX_STEALS to much lower during
testing. I found that this triggered the old bug quite frequently when running
without this fix.

Closes #12295

10 years agoSilence some unused import warnings
Alex Crichton [Sat, 15 Feb 2014 23:53:52 +0000 (15:53 -0800)]
Silence some unused import warnings

10 years agoauto merge of #12235 : huonw/rust/raii-lock, r=alexcrichton
bors [Sat, 15 Feb 2014 23:21:28 +0000 (15:21 -0800)]
auto merge of #12235 : huonw/rust/raii-lock, r=alexcrichton

- adds a `LockGuard` type returned by `.lock` and `.trylock` that unlocks the mutex in the destructor
- renames `mutex::Mutex` to `StaticNativeMutex`
- adds a `NativeMutex` type with a destructor
- removes `LittleLock`
- adds `#[must_use]` to `sync::mutex::Guard` to remind people to use it

10 years agoConvert some unnecessary StaticNativeMutexes to NativeMutexes.
Huon Wilson [Sat, 15 Feb 2014 04:01:00 +0000 (15:01 +1100)]
Convert some unnecessary StaticNativeMutexes to NativeMutexes.

10 years agostd::unstable::mutex: streamline & clarify documentation.
Huon Wilson [Sat, 15 Feb 2014 03:24:51 +0000 (14:24 +1100)]
std::unstable::mutex: streamline & clarify documentation.

10 years agosync: Add `#[must_use]` to the Mutex guard.
Huon Wilson [Sat, 15 Feb 2014 01:53:23 +0000 (12:53 +1100)]
sync: Add `#[must_use]` to the Mutex guard.

This helps people remember to save the return value to keep the mutex
locked as appropriate.

10 years agostd: add a NativeMutex type as a wrapper to destroy StaticNativeMutex.
Huon Wilson [Sat, 15 Feb 2014 01:01:52 +0000 (12:01 +1100)]
std: add a NativeMutex type as a wrapper to destroy StaticNativeMutex.

This obsoletes LittleLock, and so it is removed.

10 years agostd: Rename unstable::mutex::Mutex to StaticNativeMutex.
Huon Wilson [Sat, 15 Feb 2014 00:18:49 +0000 (11:18 +1100)]
std: Rename unstable::mutex::Mutex to StaticNativeMutex.

This better reflects its purpose and design.

10 years agostd: add tests for the _noguard lock/signal/wait methods on Mutex.
Huon Wilson [Thu, 13 Feb 2014 08:29:13 +0000 (19:29 +1100)]
std: add tests for the _noguard lock/signal/wait methods on Mutex.

10 years agostd: add an RAII unlocker to Mutex.
Huon Wilson [Thu, 13 Feb 2014 06:17:50 +0000 (17:17 +1100)]
std: add an RAII unlocker to Mutex.

This automatically unlocks its lock when it goes out of scope, and
provides a safe(ish) method to call .wait.

10 years agoAdd test and close #8893
Flavio Percoco [Sat, 15 Feb 2014 23:00:38 +0000 (00:00 +0100)]
Add test and close #8893

10 years agoAdd a method to LimitReader to return the limit
Steven Fackler [Sat, 15 Feb 2014 21:51:37 +0000 (13:51 -0800)]
Add a method to LimitReader to return the limit

This is useful in contexts like this:

let size = rdr.read_be_i32() as uint;
let mut limit = LimitReader::new(rdr.by_ref(), size);
let thing = read_a_thing(&mut limit);
assert!(limit.limit() == 0);

10 years agomk: Base the windows dist target on prepare.mk
Brian Anderson [Thu, 13 Feb 2014 08:22:18 +0000 (00:22 -0800)]
mk: Base the windows dist target on prepare.mk

10 years agomk: Fix a dist bug
Brian Anderson [Sat, 15 Feb 2014 03:36:56 +0000 (19:36 -0800)]
mk: Fix a dist bug

Fallout from moving doc/ to src/doc

10 years agomk: Base the install target on prepare.mk
Brian Anderson [Thu, 13 Feb 2014 07:53:36 +0000 (23:53 -0800)]
mk: Base the install target on prepare.mk

10 years agomk: Add prepare.mk
Brian Anderson [Thu, 13 Feb 2014 01:26:10 +0000 (17:26 -0800)]
mk: Add prepare.mk

This is a slightly more generic rewrite of install.mk. Currently
used for nothing, but we'll base all the binary distributables off it.

10 years agoauto merge of #12272 : alexcrichton/rust/snapshot, r=kballard
bors [Sat, 15 Feb 2014 22:06:26 +0000 (14:06 -0800)]
auto merge of #12272 : alexcrichton/rust/snapshot, r=kballard

This notably contains the `extern mod` => `extern crate` change.

Closes #9880

10 years agoauto merge of #12296 : dotdash/rust/byval_noalias, r=cmr
bors [Sat, 15 Feb 2014 20:46:23 +0000 (12:46 -0800)]
auto merge of #12296 : dotdash/rust/byval_noalias, r=cmr

Function parameters that are to be passed by value but don't fit into a
single register are currently passed by creating a copy on the stack and
passing a pointer to that copy to the callee. Since the copy is made
just for the function call, there are no aliases.

For example, this sometimes allows LLVM to eliminate unnecessary calls
to drop glue. Given

````rust
struct Foo {
    a: int,
    b: Option<~str>,
}

extern {
    fn eat(eat: Option<~str>);
}

pub fn foo(v: Foo) {
    match v {
        Foo { a: _, b } => unsafe { eat(b) }
    }
}
````

LLVM currently can't eliminate the drop call for the string, because it
only sees a _pointer_ to Foo, for which it has to expect an alias. So we
get:

````llvm
; Function Attrs: uwtable
define void @_ZN3foo20h9f32c90ae7201edbxaa4v0.0E(%struct.Foo* nocapture) unnamed_addr #0 {
"_ZN34std..option..Option$LT$$UP$str$GT$9glue_drop17hc39b3015f3b9c69dE.exit":
  %1 = getelementptr inbounds %struct.Foo* %0, i64 0, i32 1, i32 0
  %2 = load { i64, i64, [0 x i8] }** %1, align 8
  store { i64, i64, [0 x i8] }* null, { i64, i64, [0 x i8] }** %1, align 8
  %3 = ptrtoint { i64, i64, [0 x i8] }* %2 to i64
  %.fca.0.insert = insertvalue { i64 } undef, i64 %3, 0
  tail call void @eat({ i64 } %.fca.0.insert)
  %4 = load { i64, i64, [0 x i8] }** %1, align 8
  %5 = icmp eq { i64, i64, [0 x i8] }* %4, null
  br i1 %5, label %_ZN3Foo9glue_drop17hf611996539d3036fE.exit, label %"_ZN8_$UP$str9glue_drop17h15dbdbe2b8897a98E.exit.i.i"

"_ZN8_$UP$str9glue_drop17h15dbdbe2b8897a98E.exit.i.i": ; preds = %"_ZN34std..option..Option$LT$$UP$str$GT$9glue_drop17hc39b3015f3b9c69dE.exit"
  %6 = bitcast { i64, i64, [0 x i8] }* %4 to i8*
  tail call void @free(i8* %6) #1
  br label %_ZN3Foo9glue_drop17hf611996539d3036fE.exit

_ZN3Foo9glue_drop17hf611996539d3036fE.exit:       ; preds = %"_ZN34std..option..Option$LT$$UP$str$GT$9glue_drop17hc39b3015f3b9c69dE.exit", %"_ZN8_$UP$str9glue_drop17h15dbdbe2b8897a98E.exit.i.i"
  ret void
}
````

But with the `noalias` attribute, it can safely optimize that to:

````llvm
define void @_ZN3foo20hd28431f929f0d6c4xaa4v0.0E(%struct.Foo* noalias nocapture) unnamed_addr #0 {
_ZN3Foo9glue_drop17he9afbc09d4e9c851E.exit:
  %1 = getelementptr inbounds %struct.Foo* %0, i64 0, i32 1, i32 0
  %2 = load { i64, i64, [0 x i8] }** %1, align 8
  store { i64, i64, [0 x i8] }* null, { i64, i64, [0 x i8] }** %1, align 8
  %3 = ptrtoint { i64, i64, [0 x i8] }* %2 to i64
  %.fca.0.insert = insertvalue { i64 } undef, i64 %3, 0
  tail call void @eat({ i64 } %.fca.0.insert)
  ret void
}
````

10 years agoDeclare by-value on-stack parameters to be noalias
Björn Steinbrink [Sat, 15 Feb 2014 20:31:20 +0000 (21:31 +0100)]
Declare by-value on-stack parameters to be noalias

Function parameters that are to be passed by value but don't fit into a
single register are currently passed by creating a copy on the stack and
passing a pointer to that copy to the callee. Since the copy is made
just for the function call, there are no aliases.

For example, this sometimes allows LLVM to eliminate unnecessary calls
to drop glue. Given

````rust
struct Foo {
    a: int,
    b: Option<~str>,
}

extern {
    fn eat(eat: Option<~str>);
}

pub fn foo(v: Foo) {
    match v {
        Foo { a: _, b } => unsafe { eat(b) }
    }
}
````

LLVM currently can't eliminate the drop call for the string, because it
only sees a _pointer_ to Foo, for which it has to expect an alias. So we
get:

````llvm
; Function Attrs: uwtable
define void @_ZN3foo20h9f32c90ae7201edbxaa4v0.0E(%struct.Foo* nocapture) unnamed_addr #0 {
"_ZN34std..option..Option$LT$$UP$str$GT$9glue_drop17hc39b3015f3b9c69dE.exit":
  %1 = getelementptr inbounds %struct.Foo* %0, i64 0, i32 1, i32 0
  %2 = load { i64, i64, [0 x i8] }** %1, align 8
  store { i64, i64, [0 x i8] }* null, { i64, i64, [0 x i8] }** %1, align 8
  %3 = ptrtoint { i64, i64, [0 x i8] }* %2 to i64
  %.fca.0.insert = insertvalue { i64 } undef, i64 %3, 0
  tail call void @eat({ i64 } %.fca.0.insert)
  %4 = load { i64, i64, [0 x i8] }** %1, align 8
  %5 = icmp eq { i64, i64, [0 x i8] }* %4, null
  br i1 %5, label %_ZN3Foo9glue_drop17hf611996539d3036fE.exit, label %"_ZN8_$UP$str9glue_drop17h15dbdbe2b8897a98E.exit.i.i"

"_ZN8_$UP$str9glue_drop17h15dbdbe2b8897a98E.exit.i.i": ; preds = %"_ZN34std..option..Option$LT$$UP$str$GT$9glue_drop17hc39b3015f3b9c69dE.exit"
  %6 = bitcast { i64, i64, [0 x i8] }* %4 to i8*
  tail call void @free(i8* %6) #1
  br label %_ZN3Foo9glue_drop17hf611996539d3036fE.exit

_ZN3Foo9glue_drop17hf611996539d3036fE.exit:       ; preds = %"_ZN34std..option..Option$LT$$UP$str$GT$9glue_drop17hc39b3015f3b9c69dE.exit", %"_ZN8_$UP$str9glue_drop17h15dbdbe2b8897a98E.exit.i.i"
  ret void
}
````

But with the `noalias` attribute, it can safely optimize that to:

````llvm
define void @_ZN3foo20hd28431f929f0d6c4xaa4v0.0E(%struct.Foo* noalias nocapture) unnamed_addr #0 {
_ZN3Foo9glue_drop17he9afbc09d4e9c851E.exit:
  %1 = getelementptr inbounds %struct.Foo* %0, i64 0, i32 1, i32 0
  %2 = load { i64, i64, [0 x i8] }** %1, align 8
  store { i64, i64, [0 x i8] }* null, { i64, i64, [0 x i8] }** %1, align 8
  %3 = ptrtoint { i64, i64, [0 x i8] }* %2 to i64
  %.fca.0.insert = insertvalue { i64 } undef, i64 %3, 0
  tail call void @eat({ i64 } %.fca.0.insert)
  ret void
}
````

10 years agoauto merge of #12270 : bstrie/rust/pnoise, r=huonw
bors [Sat, 15 Feb 2014 18:51:26 +0000 (10:51 -0800)]
auto merge of #12270 : bstrie/rust/pnoise, r=huonw

Mostly just style fixes, but also remove a heap allocation and switch to using a buffered writer rather than doing 60,000 `println!`s.

10 years agoClean up the Perlin noise benchmark
Ben Striegel [Fri, 14 Feb 2014 19:03:39 +0000 (14:03 -0500)]
Clean up the Perlin noise benchmark

10 years agoauto merge of #12282 : cmr/rust/cleanup-ptr, r=huonw
bors [Sat, 15 Feb 2014 17:36:26 +0000 (09:36 -0800)]
auto merge of #12282 : cmr/rust/cleanup-ptr, r=huonw

10 years agoimpl fmt::Pointer for &T and &mut T
Corey Richardson [Sat, 15 Feb 2014 05:10:31 +0000 (00:10 -0500)]
impl fmt::Pointer for &T and &mut T

10 years agostd: clean up ptr a bit
Corey Richardson [Fri, 14 Feb 2014 23:42:01 +0000 (18:42 -0500)]
std: clean up ptr a bit

10 years agoauto merge of #12286 : sfackler/rust/no-conditions, r=alexcrichton
bors [Sat, 15 Feb 2014 11:56:27 +0000 (03:56 -0800)]
auto merge of #12286 : sfackler/rust/no-conditions, r=alexcrichton

10 years agomk: Clean up conditions for including dist.mk
Brian Anderson [Wed, 12 Feb 2014 22:23:59 +0000 (14:23 -0800)]
mk: Clean up conditions for including dist.mk

10 years agoauto merge of #12283 : kballard/rust/env-args-bytes, r=erickt
bors [Sat, 15 Feb 2014 10:36:27 +0000 (02:36 -0800)]
auto merge of #12283 : kballard/rust/env-args-bytes, r=erickt

Change `os::args()` and `os::env()` to use `str::from_utf8_lossy()`.
Add new functions `os::args_as_bytes()` and `os::env_as_bytes()` to retrieve the args/env as byte vectors instead.

The existing methods were left returning strings because I expect that the common use-case is to want string handling.

Fixes #7188.

10 years agoFix all code examples
Alex Crichton [Sat, 15 Feb 2014 07:44:22 +0000 (23:44 -0800)]
Fix all code examples

10 years agoauto merge of #12230 : DaGenix/rust/io-decorator-changes, r=sfackler
bors [Sat, 15 Feb 2014 07:46:29 +0000 (23:46 -0800)]
auto merge of #12230 : DaGenix/rust/io-decorator-changes, r=sfackler

I created RefReader and RefWriter structs that wrap a mutable reference to a Reader or Writer value. This works exactly like the ByRef struct in the iter module and allows passing a reference to a Reader or Writer to function expecting a Reader or Writer by value with the caller retaining ownership to the original value.

I also modified LimitReader to take the wrapped Reader by value instead of by reference.

@sfackler

10 years agoRemove broken link to old conditions tutorial
Steven Fackler [Sat, 15 Feb 2014 07:44:31 +0000 (23:44 -0800)]
Remove broken link to old conditions tutorial

10 years agoUpdate rustdoc testing to test all code blocks
Alex Crichton [Sat, 15 Feb 2014 07:30:10 +0000 (23:30 -0800)]
Update rustdoc testing to test all code blocks

It's too easy to forget the `rust` tag to have a code example tested, and it's
far more common to have testable code than untestable code.

This alters rustdoc to have only two directives, `ignore` and `should_fail`. The
`ignore` directive ignores the code block entirely, and the `should_fail`
directive has been fixed to only fail the test if the code execution fails, not
also compilation.

10 years agoextern mod => extern crate
Alex Crichton [Fri, 14 Feb 2014 18:10:06 +0000 (10:10 -0800)]
extern mod => extern crate

This was previously implemented, and it just needed a snapshot to go through

10 years agoRegister new snapshots
Alex Crichton [Fri, 14 Feb 2014 18:03:53 +0000 (10:03 -0800)]
Register new snapshots

This enables the parser error for `extern mod` => `extern crate` transitions.

10 years agoUpdate LimitReader to take the Reader to wrap by value
Palmer Cox [Fri, 14 Feb 2014 04:28:11 +0000 (23:28 -0500)]
Update LimitReader to take the Reader to wrap by value

10 years agoCreate RefReader and RefWriter adaptor structs
Palmer Cox [Fri, 14 Feb 2014 04:27:53 +0000 (23:27 -0500)]
Create RefReader and RefWriter adaptor structs

RefReader and RefWriter allow a caller to pass a Reader or Writer
instance by reference to generic functions that are expecting arguments
by value.

10 years agoUse str::from_utf8_lossy() for os::env() and friends
Kevin Ballard [Fri, 14 Feb 2014 23:18:51 +0000 (15:18 -0800)]
Use str::from_utf8_lossy() for os::env() and friends

Parse the environment by default with from_utf8_lossy. Also provide
byte-vector equivalents (e.g. os::env_as_bytes()).

Unfortunately, setenv() can't have a byte-vector equivalent because of
Windows support, unless we want to define a setenv_bytes() that fails
under Windows for non-UTF8 (or non-UTF16).

10 years agoUse str::from_utf8_lossy() in os::args(), add os::args_as_bytes()
Kevin Ballard [Fri, 14 Feb 2014 22:42:40 +0000 (14:42 -0800)]
Use str::from_utf8_lossy() in os::args(), add os::args_as_bytes()

os::args() was using str::raw::from_c_str(), which would assert if the
C-string wasn't valid UTF-8. Switch to using from_utf8_lossy() instead,
and add a separate function os::args_as_bytes() that returns the ~[u8]
byte-vectors instead.

10 years agoAdd c_str::CString.as_bytes_no_nul()
Kevin Ballard [Fri, 14 Feb 2014 23:42:35 +0000 (15:42 -0800)]
Add c_str::CString.as_bytes_no_nul()

10 years agoauto merge of #12274 : brson/rust/mkfiles, r=alexcrichton
bors [Sat, 15 Feb 2014 04:51:26 +0000 (20:51 -0800)]
auto merge of #12274 : brson/rust/mkfiles, r=alexcrichton

I've been working on binary installers and ended up taking this detour, which does a few things:

* It expands the documentation on the build system with new comments in Makefile.in
* It displays some of that documentation via `make help`
* Removes some unused and broken snapshot code
* Adds `NO_MKFILE_DEPS` to convenience makefile hacking
* Moves almost all of Makefile.in to files in `mk/`

The documentation provided by `make help` and its implementation are somewhat quirky.

10 years agoauto merge of #12276 : alexcrichton/rust/issue-8449, r=kballard
bors [Sat, 15 Feb 2014 03:31:28 +0000 (19:31 -0800)]
auto merge of #12276 : alexcrichton/rust/issue-8449, r=kballard

This was just waiting for compiler-rt support, which was added in #12027

Closes #8449

10 years agoEnable 64-bit checked multiplication on 32-bit
Alex Crichton [Fri, 14 Feb 2014 20:54:15 +0000 (12:54 -0800)]
Enable 64-bit checked multiplication on 32-bit

This was just waiting for compiler-rt support, which was added in #12027

Closes #8449

10 years agomk: Address review feedback
Brian Anderson [Sat, 15 Feb 2014 03:17:50 +0000 (19:17 -0800)]
mk: Address review feedback

10 years agoauto merge of #12277 : alexcrichton/rust/fix-rustdoc-render, r=huonw
bors [Sat, 15 Feb 2014 01:51:29 +0000 (17:51 -0800)]
auto merge of #12277 : alexcrichton/rust/fix-rustdoc-render, r=huonw

The std macros used to be injected with a filename of "<std-macros>", but macros
are now injected with a filename of "<{} macros>" where `{}` is filled in with
the crate name. This updates rustdoc to understand this new system so it'll
render source more frequently.

10 years agomk: Move version info to top of main.mk
Brian Anderson [Fri, 14 Feb 2014 19:24:22 +0000 (11:24 -0800)]
mk: Move version info to top of main.mk

Just so it's easier to find.

10 years agomk: Improve build system help commands
Brian Anderson [Fri, 14 Feb 2014 11:34:18 +0000 (03:34 -0800)]
mk: Improve build system help commands

10 years agomk: Add NO_MKFILE_DEPS for turning off rebuild from makefile changes
Brian Anderson [Fri, 14 Feb 2014 08:10:06 +0000 (00:10 -0800)]
mk: Add NO_MKFILE_DEPS for turning off rebuild from makefile changes

10 years agomk: Move most of Makefile.in to .mk files
Brian Anderson [Fri, 14 Feb 2014 07:55:49 +0000 (23:55 -0800)]
mk: Move most of Makefile.in to .mk files

Because the build system treats Makefile.in and the .mk files slightly
differently (.in is copied, .mk are included), this makes the system
more uniform. Fewer build system changes will require a complete
reconfigure.

10 years agomk: Remove the concept of 'snapshot transitions'
Brian Anderson [Fri, 14 Feb 2014 07:25:07 +0000 (23:25 -0800)]
mk: Remove the concept of 'snapshot transitions'

This way of doing snapshots hasn't been used since 2011.

10 years agomk: Add some serious documentation and 'make help'
Brian Anderson [Fri, 14 Feb 2014 05:22:08 +0000 (21:22 -0800)]
mk: Add some serious documentation and 'make help'

'make help' is implemented in a fairly ridiculous way, using awk
to parse comments out of Makefile.in and displaying them.

10 years agoauto merge of #12271 : kballard/rust/vim-extern-crate, r=huonw
bors [Fri, 14 Feb 2014 23:51:29 +0000 (15:51 -0800)]
auto merge of #12271 : kballard/rust/vim-extern-crate, r=huonw

10 years agoAdd crate keyword to gedit language spec
Kevin Ballard [Fri, 14 Feb 2014 23:37:22 +0000 (15:37 -0800)]
Add crate keyword to gedit language spec

10 years agoAdd crate to emacs and kate modefiles
Kevin Ballard [Fri, 14 Feb 2014 22:36:37 +0000 (14:36 -0800)]
Add crate to emacs and kate modefiles

10 years agoauto merge of #12195 : kballard/rust/rustdoc-strip-impls-of-stripped, r=cmr
bors [Fri, 14 Feb 2014 21:36:35 +0000 (13:36 -0800)]
auto merge of #12195 : kballard/rust/rustdoc-strip-impls-of-stripped, r=cmr

Strip trait impls for types that are stripped either due to the strip-hidden or strip-private passes.

This fixes the search index including trait methods on stripped structs (which breaks searching), and it also removes private types from the implementors list of a trait.

Fixes #9981 and #11439.

10 years agoUpdate restrictions on rustdoc source rendering
Alex Crichton [Fri, 14 Feb 2014 21:11:36 +0000 (13:11 -0800)]
Update restrictions on rustdoc source rendering

The std macros used to be injected with a filename of "<std-macros>", but macros
are now injected with a filename of "<{} macros>" where `{}` is filled in with
the crate name. This updates rustdoc to understand this new system so it'll
render source more frequently.

10 years agoauto merge of #12267 : alexcrichton/rust/rollup, r=alexcrichton
bors [Fri, 14 Feb 2014 20:21:51 +0000 (12:21 -0800)]
auto merge of #12267 : alexcrichton/rust/rollup, r=alexcrichton

The last commit has the closed PRs

10 years agoAdd CheckedDiv to vim syntax
Kevin Ballard [Fri, 14 Feb 2014 20:02:18 +0000 (12:02 -0800)]
Add CheckedDiv to vim syntax

10 years agoUpdate vim syntax for extern crate
Kevin Ballard [Fri, 14 Feb 2014 19:27:53 +0000 (11:27 -0800)]
Update vim syntax for extern crate

10 years agoTest fixes and rebase conflicts from rollups
Alex Crichton [Fri, 14 Feb 2014 16:42:23 +0000 (08:42 -0800)]
Test fixes and rebase conflicts from rollups

PRs closed as part of this:

Closes #12212 r=alexcrichton
Closes #12215 r=brson
Closes #12246 r=pcwalton
Closes #12247 r=cmr
Closes #12251 r=brson
Closes #12255 r=alexcrichton
Closes #12257 r=alexcrichton
Closes #12258 r=huonw
Closes #12259 r=huonw
Closes #12263 r=kballard
Closes #12269 r=alexcrichton

10 years agotutorial: stronger wording in build instructions
Corey Richardson [Fri, 14 Feb 2014 18:55:30 +0000 (13:55 -0500)]
tutorial: stronger wording in build instructions

10 years agorustdoc: Strip impls of traits on #[doc(hidden)] types
Kevin Ballard [Tue, 11 Feb 2014 22:42:23 +0000 (14:42 -0800)]
rustdoc: Strip impls of traits on #[doc(hidden)] types

In the strip-hidden pass, record all types that were stripped, and make
a second pass stripping all impls of traits for these types.

10 years agorustdoc: Strip impls of stripped private types
Kevin Ballard [Tue, 11 Feb 2014 22:29:23 +0000 (14:29 -0800)]
rustdoc: Strip impls of stripped private types

In strip-private, also strip impls of traits for private types. This
fixes the search index so searching for "drop", "eq", etc doesn't throw
an exception.

10 years agoAdd MKFILE_DEPS to compiler-rt target
Alex Crichton [Fri, 14 Feb 2014 16:13:19 +0000 (08:13 -0800)]
Add MKFILE_DEPS to compiler-rt target

Currently when you run `make -jN` it's likely that you'll remove compiler-rt and
then it won't get cp'd back into the right place. I believe the reason for this
is that the compiler-rt library target never got updated so make decided it
never needed to copy the files back into place. The files were all there at the
beginning of `make`, but then we may clean out the stage0 versions if we unzip
the snapshot again.

10 years agoauto merge of #12205 : alexcrichton/rust/nodefaultlibs, r=brson
bors [Fri, 14 Feb 2014 18:41:45 +0000 (10:41 -0800)]
auto merge of #12205 : alexcrichton/rust/nodefaultlibs, r=brson

This will hopefully bring us closer to #11937. We're still using gcc's idea of
"startup files", but this should prevent us from leaking in dependencies that we
don't quite want (libgcc for example once compiler-rt is what we use).

10 years agoInvoke gcc with -nodefaultlibs
Alex Crichton [Tue, 4 Feb 2014 16:37:07 +0000 (08:37 -0800)]
Invoke gcc with -nodefaultlibs

This will hopefully bring us closer to #11937. We're still using gcc's idea of
"startup files", but this should prevent us from leaking in dependencies that we
don't quite want (libgcc for example once compiler-rt is what we use).

10 years agoRemoved the obsolete ast::CallSugar (previously used by `do`).
Eduard Burtescu [Fri, 14 Feb 2014 08:28:32 +0000 (10:28 +0200)]
Removed the obsolete ast::CallSugar (previously used by `do`).

10 years agoExpand ItemDecorator extensions in all contexts
Steven Fackler [Fri, 14 Feb 2014 06:57:43 +0000 (22:57 -0800)]
Expand ItemDecorator extensions in all contexts

Now that fold_item can return multiple items, this is pretty trivial. It
also recursively expands generated items so ItemDecorators can generate
items that are tagged with ItemDecorators!

Closes #4913

10 years agoAdd test for #8860
Edward Wang [Fri, 14 Feb 2014 05:27:05 +0000 (13:27 +0800)]
Add test for #8860

10 years agoRemoved libextra dependency from libsyntax.
HeroesGrave [Fri, 14 Feb 2014 03:51:26 +0000 (16:51 +1300)]
Removed libextra dependency from libsyntax.

10 years agoAdd function doc comments for extra::url::*
Dave Hodder [Thu, 13 Feb 2014 22:28:22 +0000 (22:28 +0000)]
Add function doc comments for extra::url::*

10 years agoEnsure an error is raised on infinite recursion
Flavio Percoco [Thu, 13 Feb 2014 20:19:03 +0000 (21:19 +0100)]
Ensure an error is raised on infinite recursion

10 years agoDon't copy &Trait and &mut Trait to temporaries for every call.
Eduard Burtescu [Thu, 13 Feb 2014 19:52:53 +0000 (21:52 +0200)]
Don't copy &Trait and &mut Trait to temporaries for every call.

10 years agoextra: Capture stdout/stderr of tests by default
Alex Crichton [Wed, 12 Feb 2014 18:25:09 +0000 (10:25 -0800)]
extra: Capture stdout/stderr of tests by default

When tests fail, their stdout and stderr is printed as part of the summary, but
this helps suppress failure messages from #[should_fail] tests and generally
clean up the output of the test runner.

10 years agoreturn value/use extra::test::black_box in benchmarks
lpy [Wed, 12 Feb 2014 15:39:21 +0000 (23:39 +0800)]
return value/use extra::test::black_box in benchmarks

10 years agoauto merge of #12207 : alexcrichton/rust/up-llvm, r=sfackler
bors [Fri, 14 Feb 2014 15:26:40 +0000 (07:26 -0800)]
auto merge of #12207 : alexcrichton/rust/up-llvm, r=sfackler

Includes an upstream commit by pcwalton to improve codegen of our enums getting
moved around.

This also introduces a new commit on top of our stack of patches to fix a mingw32 build issue. I have submitted the patch upstream: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140210/204653.html

I verified that this builds on the try bots, which amazes me because I think that c++11 is turned on now, but I guess we're still lucky!

Closes #10613 (pcwalton's patch landed)
Closes #11992 (llvm has removed these options)

10 years agoUpgrade LLVM
Alex Crichton [Thu, 6 Feb 2014 19:29:28 +0000 (11:29 -0800)]
Upgrade LLVM

Includes an upstream commit by pcwalton to improve codegen of our enums getting
moved around.

10 years agoauto merge of #12234 : sfackler/rust/restructure-item-decorator, r=huonw
bors [Fri, 14 Feb 2014 14:11:43 +0000 (06:11 -0800)]
auto merge of #12234 : sfackler/rust/restructure-item-decorator, r=huonw

The old method of building up a list of items and threading it through
all of the decorators was unwieldy and not really scalable as
non-deriving ItemDecorators become possible. The API is now that the
decorator gets an immutable reference to the item it's attached to, and
a callback that it can pass new items to. If we want to add syntax
extensions that can modify the item they're attached to, we can add that
later, but I think it'll have to be separate from ItemDecorator to avoid
strange ordering issues.

@huonw