]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #9371 : thestinger/rust/text, r=pnkfelix
bors [Fri, 20 Sep 2013 23:11:04 +0000 (16:11 -0700)]
auto merge of #9371 : thestinger/rust/text, r=pnkfelix

We force the usage of LF line endings, but *only* in text files.

10 years agoauto merge of #9276 : alexcrichton/rust/dox, r=brson
bors [Fri, 20 Sep 2013 21:11:08 +0000 (14:11 -0700)]
auto merge of #9276 : alexcrichton/rust/dox, r=brson

Hopefull this will make our libstd docs appear a little more "full".

10 years agoauto merge of #9278 : alexcrichton/rust/ndebug, r=brson
bors [Fri, 20 Sep 2013 19:46:05 +0000 (12:46 -0700)]
auto merge of #9278 : alexcrichton/rust/ndebug, r=brson

Many people will be very confused that their debug! statements aren't working
when they first use rust only to learn that they should have been building with
`--cfg debug` the entire time. This inverts the meaning of the flag to instead
of enabling debug statements, now it disables debug statements.

This way the default behavior is a bit more reasonable, and requires less
end-user configuration. Furthermore, this turns on debug by default when
building the rustc compiler.

10 years agoInvert --cfg debug to --cfg ndebug
Alex Crichton [Wed, 18 Sep 2013 04:02:11 +0000 (21:02 -0700)]
Invert --cfg debug to --cfg ndebug

Many people will be very confused that their debug! statements aren't working
when they first use rust only to learn that they should have been building with
`--cfg debug` the entire time. This inverts the meaning of the flag to instead
of enabling debug statements, now it disables debug statements.

This way the default behavior is a bit more reasonable, and requires less
end-user configuration. Furthermore, this turns on debug by default when
building the rustc compiler.

10 years agoauto merge of #9338 : steveklabnik/rust/rustpkg_update_manpage, r=catamorphism
bors [Fri, 20 Sep 2013 18:21:07 +0000 (11:21 -0700)]
auto merge of #9338 : steveklabnik/rust/rustpkg_update_manpage, r=catamorphism

I didn't update the manpage when I added the init command. Whoops.

10 years agoauto merge of #9327 : larsbergstrom/rust/tutorial_installation_tweak, r=catamorphism
bors [Fri, 20 Sep 2013 16:56:09 +0000 (09:56 -0700)]
auto merge of #9327 : larsbergstrom/rust/tutorial_installation_tweak, r=catamorphism

I've had multiple people whom I pointed at the Rust tutorial ask me where to download the snapshot compiler, so I made the text more explicit.

10 years agoauto merge of #9337 : steveklabnik/rust/rustpkg_usage, r=catamorphism
bors [Fri, 20 Sep 2013 15:31:12 +0000 (08:31 -0700)]
auto merge of #9337 : steveklabnik/rust/rustpkg_usage, r=catamorphism

When I took out the ability to make a new project by name, I forgot to
update the usage to reflect the changes.

10 years agoauto merge of #9332 : eugals/rust/master, r=alexcrichton
bors [Fri, 20 Sep 2013 14:06:13 +0000 (07:06 -0700)]
auto merge of #9332 : eugals/rust/master, r=alexcrichton

It is intended to optimize/beautify the code generated in a few trivial trait operations.
Let's take the following code as an example:
```
trait Stuff {
    fn bar(&self);
}

fn callBar(s: &Stuff) {
    s.bar();
}

struct Foo;

impl Stuff for Foo {
    fn bar(&self) {
    }
}

pub fn main() {
    let o = Foo;
    callBar(&o as &Stuff);
}
```

At present it is translated into something like:
```
define void @_ZN7callBar_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }*, { %tydesc*, i8* }*) #4 {
"function top level":
  %__trait_callee = alloca { %tydesc*, i8* }
  %__auto_borrow_obj = alloca { %tydesc*, i8* }
  %2 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0
  %3 = load %tydesc** %2
  %4 = getelementptr inbounds { %tydesc*, i8* }* %__auto_borrow_obj, i32 0, i32 0
  store %tydesc* %3, %tydesc** %4
  %5 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1
  %6 = load i8** %5
  %7 = getelementptr inbounds { %tydesc*, i8* }* %__auto_borrow_obj, i32 0, i32 1
  store i8* %6, i8** %7
  %8 = bitcast { %tydesc*, i8* }* %__auto_borrow_obj to i8*
  %9 = bitcast { %tydesc*, i8* }* %__trait_callee to i8*
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %9, i8* %8, i32 8, i32 4, i1 false)
  %10 = getelementptr inbounds { %tydesc*, i8* }* %__trait_callee, i32 0, i32 1
  %11 = load i8** %10
  %12 = bitcast i8* %11 to { i32, %tydesc*, i8*, i8*, i8 }*
  %13 = getelementptr inbounds { %tydesc*, i8* }* %__trait_callee, i32 0, i32 0
  %14 = bitcast %tydesc** %13 to [1 x i8*]**
  %15 = load [1 x i8*]** %14
  %16 = getelementptr inbounds [1 x i8*]* %15, i32 0, i32 1
  %17 = load i8** %16
  %18 = bitcast i8* %17 to void ({ i32, %tydesc*, i8*, i8*, i8 }*)*
  call void %18({ i32, %tydesc*, i8*, i8*, i8 }* %12)
  ret void
}

...

define void @_ZN4main_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }*) #4 {
"function top level":
  %o = alloca %struct.Foo
  %1 = alloca { %tydesc*, i8* }
  %__auto_borrow_obj = alloca { %tydesc*, i8* }
  %2 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1
  %3 = bitcast i8** %2 to %struct.Foo**
  store %struct.Foo* %o, %struct.Foo** %3
  %4 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0
  %5 = bitcast %tydesc** %4 to { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }**
  store { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }* @vtable1081, { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }** %5
  %6 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0
  %7 = load %tydesc** %6
  %8 = getelementptr inbounds { %tydesc*, i8* }* %__auto_borrow_obj, i32 0, i32 0
  store %tydesc* %7, %tydesc** %8
  %9 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1
  %10 = load i8** %9
  %11 = getelementptr inbounds { %tydesc*, i8* }* %__auto_borrow_obj, i32 0, i32 1
  store i8* %10, i8** %11
  call void @_ZN7callBar_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }* undef, { %tydesc*, i8* }* %__auto_borrow_obj)
  ret void
}
```

If you apply my patch, it would become way shorter and cleaner:
```
define void @_ZN7callBar_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }*, { %tydesc*, i8* }*) #4 {
"function top level":
  %2 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1
  %3 = load i8** %2
  %4 = bitcast i8* %3 to { i32, %tydesc*, i8*, i8*, i8 }*
  %5 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0
  %6 = bitcast %tydesc** %5 to [1 x i8*]**
  %7 = load [1 x i8*]** %6
  %8 = getelementptr inbounds [1 x i8*]* %7, i32 0, i32 1
  %9 = load i8** %8
  %10 = bitcast i8* %9 to void ({ i32, %tydesc*, i8*, i8*, i8 }*)*
  call void %10({ i32, %tydesc*, i8*, i8*, i8 }* %4)
  ret void
}

...

define void @_ZN4main_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }*) #4 {
"function top level":
  %o = alloca %struct.Foo
  %1 = alloca { %tydesc*, i8* }
  %2 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 1
  %3 = bitcast i8** %2 to %struct.Foo**
  store %struct.Foo* %o, %struct.Foo** %3
  %4 = getelementptr inbounds { %tydesc*, i8* }* %1, i32 0, i32 0
  %5 = bitcast %tydesc** %4 to { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }**
  store { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }* @vtable1081, { %tydesc*, void ({ i32, %tydesc*, i8*, i8*, i8 }*)* }** %5
  call void @_ZN7callBar_UUID.0E({ i32, %tydesc*, i8*, i8*, i8 }* undef, { %tydesc*, i8* }* %1)
  ret void
}
```

Although this change doesn't increase the compilation speed much (I mentioned only about 1-2% boost on "rustc -O -Z time-passes syntax.rs"), but I still think it's a good thing to do as it greatly simplifies/clarifies LL generated in some cases which would definitely help in the future code generation investigations.

I don't provide any new test cases in this patch as it is merely an optimization.

Sorry guys, I somehow messed my previous PR and I don't see any better way to fix as to recreate it here.

10 years agoauto merge of #9326 : NiccosSystem/rust/master, r=bstrie
bors [Fri, 20 Sep 2013 11:56:09 +0000 (04:56 -0700)]
auto merge of #9326 : NiccosSystem/rust/master, r=bstrie

10 years agoauto merge of #9322 : catamorphism/rust/rustpkg-discovered-outputs, r=brson
bors [Fri, 20 Sep 2013 10:26:10 +0000 (03:26 -0700)]
auto merge of #9322 : catamorphism/rust/rustpkg-discovered-outputs, r=brson

r? @brson as per #9112

Closes #9112

10 years agoauto merge of #9321 : chris-morgan/rust/lowercase-nan-methods, r=brson
bors [Fri, 20 Sep 2013 09:01:13 +0000 (02:01 -0700)]
auto merge of #9321 : chris-morgan/rust/lowercase-nan-methods, r=brson

This is for consistency in naming conventions.

- ``std::num::Float::NaN()`` is changed to ``nan()``;
- ``std::num::Float.is_NaN()`` is changed to ``is_nan()``; and
- ``std::num::strconv::NumStrConv::NaN()`` is changed to ``nan()``.

Fixes #9319.

10 years agoauto merge of #9320 : chris-morgan/rust/unreachable-macro-part-two-of-two-containing...
bors [Fri, 20 Sep 2013 07:36:11 +0000 (00:36 -0700)]
auto merge of #9320 : chris-morgan/rust/unreachable-macro-part-two-of-two-containing-the-destruction-of-the-unreachable-function, r=alexcrichton

This is the second of two parts of #8991, now possible as a new snapshot
has been made. (The first part implemented the unreachable!() macro; it
was #8992, 6b7b8f2682.)

``std::util::unreachable()`` is removed summarily; any code which used
it should now use the ``unreachable!()`` macro.

Closes #9312.

Closes #8991.

10 years agoauto merge of #9315 : thestinger/rust/doc, r=alexcrichton
bors [Fri, 20 Sep 2013 06:11:19 +0000 (23:11 -0700)]
auto merge of #9315 : thestinger/rust/doc, r=alexcrichton

This also renames the section, as managed vectors cannot be resized
(since it would invalidate the other references).

10 years agoauto merge of #9308 : ben0x539/rust/lexer-error-spans, r=alexcrichton
bors [Fri, 20 Sep 2013 04:46:45 +0000 (21:46 -0700)]
auto merge of #9308 : ben0x539/rust/lexer-error-spans, r=alexcrichton

Previously, the lexer calling `rdr.fatal(...)` would report the span of
the last complete token, instead of a span within the erroneous token
(besides one span fixed in 1ac90bb).

This branch adds wrappers around `rdr.fatal(...)` that sets the span
explicilty, so that all fatal errors in `libsyntax/parse/lexer.rs` now
report the offending code more precisely. A number of tests try to
verify that, though the `compile-fail` testing setup can only check that
the spans are on the right lines, and the "unterminated string/block
comment" errors can't have the line marked at all, so that's incomplete.

This closes #9149.

Also, the lexer errors now report the offending code in the error message,
not just via the span, just like other errors do.

10 years agoauto merge of #9285 : sfackler/rust/future, r=alexcrichton
bors [Fri, 20 Sep 2013 02:31:13 +0000 (19:31 -0700)]
auto merge of #9285 : sfackler/rust/future, r=alexcrichton

The `Drop` implementation was used to prevent `Future` from being implicitly copyable. Since `~fn`s are no longer copyable, this is no longer needed. I added a cfail test to make sure that this is actually the case.

I method-ized all of the `Future` creation methods and added a new one, `spawn_with`, which is similar to `task::spawn_with`.

I also got rid of some unused imports in tests.

10 years agorestore auto-detection of text files
Daniel Micay [Thu, 19 Sep 2013 23:06:05 +0000 (19:06 -0400)]
restore auto-detection of text files

We force the usage of LF line endings, but *only* in text files.

10 years agoauto merge of #9342 : alexcrichton/rust/ignore-libuv-signal-tests, r=brson
bors [Thu, 19 Sep 2013 22:56:04 +0000 (15:56 -0700)]
auto merge of #9342 : alexcrichton/rust/ignore-libuv-signal-tests, r=brson

They're causing syscalls to get interrupted, and std::io doesn't correctly
handle EINTR

10 years agoClean up unused imports
Steven Fackler [Wed, 18 Sep 2013 07:12:22 +0000 (00:12 -0700)]
Clean up unused imports

10 years agoAdd Future::spawn_with
Steven Fackler [Wed, 18 Sep 2013 06:56:02 +0000 (23:56 -0700)]
Add Future::spawn_with

10 years agoModernize extra::future API
Steven Fackler [Wed, 18 Sep 2013 06:48:56 +0000 (23:48 -0700)]
Modernize extra::future API

10 years agoIgnore io::process tests
Alex Crichton [Thu, 19 Sep 2013 22:17:29 +0000 (15:17 -0700)]
Ignore io::process tests

They're causing syscalls to get interrupted, and std::io doesn't correctly
handle EINTR

10 years agolexer: further slight improvements to lexer errors
Benjamin Herr [Thu, 19 Sep 2013 20:34:31 +0000 (22:34 +0200)]
lexer: further slight improvements to lexer errors

10 years agoUpdate rustpkg manpage to add init.
Steve Klabnik [Thu, 19 Sep 2013 19:58:29 +0000 (12:58 -0700)]
Update rustpkg manpage to add init.

I didn't update the manpage when I added the init command. Whoops.

10 years agoFix usage for rustpkg init
Steve Klabnik [Thu, 19 Sep 2013 19:53:38 +0000 (12:53 -0700)]
Fix usage for rustpkg init

When I took out the ability to make a new project by name, I forgot to
update the usage to reflect the changes.

10 years agoauto merge of #9295 : alexcrichton/rust/fix-lang-items, r=thestinger
bors [Thu, 19 Sep 2013 18:11:01 +0000 (11:11 -0700)]
auto merge of #9295 : alexcrichton/rust/fix-lang-items, r=thestinger

Also add a test to help prevent this from getting out of sync again.

10 years agopacified test/run-pass/core-run-destroy on Win7x64
Evgeny Sologubov [Thu, 19 Sep 2013 17:23:04 +0000 (21:23 +0400)]
pacified test/run-pass/core-run-destroy on Win7x64

10 years agoauto merge of #9279 : erickt/rust/master, r=alexcrichton
bors [Thu, 19 Sep 2013 16:55:59 +0000 (09:55 -0700)]
auto merge of #9279 : erickt/rust/master, r=alexcrichton

`Some(5).or_{default,zero}` can be easily replaced with `Some(Some(5).unwrap_or_default())`.

10 years agoRemoved future's destructor
Steven Fackler [Wed, 18 Sep 2013 06:23:20 +0000 (23:23 -0700)]
Removed future's destructor

It was only there to prevent Future from being copyable, but it's
noncopyable anyways since it contains a ~fn.

10 years agoClarify that snapshots are automatically retrieved.
Lars Bergstrom [Thu, 19 Sep 2013 15:58:26 +0000 (10:58 -0500)]
Clarify that snapshots are automatically retrieved.

10 years agoauto merge of #9313 : brson/rust/relnotes, r=thestinger
bors [Thu, 19 Sep 2013 15:40:59 +0000 (08:40 -0700)]
auto merge of #9313 : brson/rust/relnotes, r=thestinger

10 years agoFix broken tutorial link
NiccosSystem [Thu, 19 Sep 2013 15:18:40 +0000 (17:18 +0200)]
Fix broken tutorial link

10 years agolexer: report problematic chars verbatim or as escape sequence
Benjamin Herr [Thu, 19 Sep 2013 14:21:29 +0000 (16:21 +0200)]
lexer: report problematic chars verbatim or as escape sequence

... instead of giving their numeric codepoint, following the lead of
fdaae34. So the error message for, say, '\_' mentions _ instead of 95,
and '\●' now mentions \u25cf.

10 years agolexer: show correct span on lexical errors
Benjamin Herr [Thu, 19 Sep 2013 14:11:23 +0000 (16:11 +0200)]
lexer: show correct span on lexical errors

Previously, the lexer calling `rdr.fatal(...)` would report the span of
the last complete token, instead of a span within the erroneous token
(besides one span fixed in 1ac90bb).

This commit adds a wrapper around `rdr.fatal(...)` that sets the span
explicilty, so that all fatal errors in `libsyntax/parse/lexer.rs` now
report the offending code more precisely. A number of tests try to
verify that, though the `compile-fail` testing setup can only check that
the spans are on the right lines, and the "unterminated string/block
comment" errors can't have the line marked at all, so that's incomplete.

Closes #9149.

10 years agowill not copy trait_callee on stack if it's source expr is a plain borrowed ref
U-NOV2010\eugals [Wed, 18 Sep 2013 12:55:39 +0000 (16:55 +0400)]
will not copy trait_callee on stack if it's source expr is a plain borrowed ref

10 years agominor Type::opaque_trait code cleanup
U-NOV2010\eugals [Tue, 17 Sep 2013 09:36:47 +0000 (13:36 +0400)]
minor Type::opaque_trait code cleanup

10 years agooptimized trans_to_datum::auto_borrow_obj code generation in case some trivial cases...
U-NOV2010\eugals [Tue, 17 Sep 2013 09:33:36 +0000 (13:33 +0400)]
optimized trans_to_datum::auto_borrow_obj code generation in case some trivial cases where simple copying can be applied

10 years agoauto merge of #9299 : alexcrichton/rust/fmt-trailing-comma, r=huonw
bors [Thu, 19 Sep 2013 14:06:04 +0000 (07:06 -0700)]
auto merge of #9299 : alexcrichton/rust/fmt-trailing-comma, r=huonw

This is more consistent with other parts of the language and it also makes it
easier to use in situations where format string is massive.

10 years agoRename the NaN and is_NaN methods to lowercase.
Chris Morgan [Thu, 19 Sep 2013 05:37:34 +0000 (15:37 +1000)]
Rename the NaN and is_NaN methods to lowercase.

This is for consistency in naming conventions.

- ``std::num::Float::NaN()`` is changed to ``nan()``;
- ``std::num::Float.is_NaN()`` is changed to ``is_nan()``; and
- ``std::num::strconv::NumStrConv::NaN()`` is changed to ``nan()``.

Fixes #9319.

10 years agoauto merge of #9267 : Kimundi/rust/master, r=huonw
bors [Thu, 19 Sep 2013 12:06:00 +0000 (05:06 -0700)]
auto merge of #9267 : Kimundi/rust/master, r=huonw

10 years agoTurned extra::getopts functions into methods
Marvin Löbel [Wed, 18 Sep 2013 01:42:23 +0000 (03:42 +0200)]
Turned extra::getopts functions into methods
Some minor api and doc adjustments

10 years agoauto merge of #9292 : blake2-ppc/rust/borrow-ref-eq, r=huonw
bors [Thu, 19 Sep 2013 10:01:05 +0000 (03:01 -0700)]
auto merge of #9292 : blake2-ppc/rust/borrow-ref-eq, r=huonw

std::borrow: Use raw pointer comparison for `ref_eq`

Compare as `*T` in `ref_eq` instead of casting to uint, to match what
std::ptr does.

10 years agoauto merge of #9291 : jzelinskie/rust/remove-cond, r=alexcrichton
bors [Thu, 19 Sep 2013 07:31:05 +0000 (00:31 -0700)]
auto merge of #9291 : jzelinskie/rust/remove-cond, r=alexcrichton

This is my first contribution, so please point out anything that I may have missed.

I consulted IRC and settled on `match () { ... }` for most of the replacements.

10 years agorustpkg: Register correct dependencies for built and installed files
Tim Chevalier [Wed, 18 Sep 2013 01:23:34 +0000 (18:23 -0700)]
rustpkg: Register correct dependencies for built and installed files

as per #9112

Closes #9112

10 years agodoc: Fix the tutorial's link to rustpkg docs
blake2-ppc [Thu, 19 Sep 2013 05:38:30 +0000 (07:38 +0200)]
doc: Fix the tutorial's link to rustpkg docs

10 years agoauto merge of #9280 : alexcrichton/rust/less-c++, r=brson
bors [Thu, 19 Sep 2013 05:15:59 +0000 (22:15 -0700)]
auto merge of #9280 : alexcrichton/rust/less-c++, r=brson

Some of the functions could be converted to rust, but the functions dealing with
signals were moved to rust_builtin.cpp instead (no reason to keep the original
file around for one function).

Closes #2674

Because less C++ is better C++!

10 years agoReplace unreachable() calls with unreachable!().
Chris Morgan [Thu, 19 Sep 2013 05:04:03 +0000 (15:04 +1000)]
Replace unreachable() calls with unreachable!().

This is the second of two parts of #8991, now possible as a new snapshot
has been made. (The first part implemented the unreachable!() macro; it
was #8992, 6b7b8f2682.)

``std::util::unreachable()`` is removed summarily; any code which used
it should now use the ``unreachable!()`` macro.

Closes #9312.

Closes #8991.

10 years agoRemove rust_run_program.cpp
Alex Crichton [Tue, 17 Sep 2013 21:45:50 +0000 (14:45 -0700)]
Remove rust_run_program.cpp

Some of the functions could be converted to rust, but the functions dealing with
signals were moved to rust_builtin.cpp instead (no reason to keep the original
file around for one function).

Closes #2674

10 years agodoc: Update container tutorial with new names of methods and macros
blake2-ppc [Thu, 19 Sep 2013 03:06:03 +0000 (05:06 +0200)]
doc: Update container tutorial with new names of methods and macros

`deque` -> `ringbuf`, mention `extra::dlist`.

fix reference to vector method `bsearch`. Also convert all output
in example code to use `print!`/`println!`

10 years ago0.8 release notes
Brian Anderson [Thu, 19 Sep 2013 01:51:48 +0000 (18:51 -0700)]
0.8 release notes

10 years agoclarify vector stub in the container tutorial
Daniel Micay [Thu, 19 Sep 2013 02:26:48 +0000 (22:26 -0400)]
clarify vector stub in the container tutorial

This also renames the section, as managed vectors cannot be resized
(since it would invalidate the other references).

10 years agoauto merge of #9260 : alexcrichton/rust/libuv-processes, r=brson
bors [Thu, 19 Sep 2013 01:30:56 +0000 (18:30 -0700)]
auto merge of #9260 : alexcrichton/rust/libuv-processes, r=brson

This is a re-landing of #8645, except that the bindings are *not* being used to
power std::run just yet. Instead, this adds the bindings as standalone bindings
inside the rt::io::process module.

I made one major change from before, having to do with how pipes are
created/bound. It's much clearer now when you can read/write to a pipe, as
there's an explicit difference (different types) between an unbound and a bound
pipe. The process configuration now takes unbound pipes (and consumes ownership
of them), and will return corresponding pipe structures back if spawning is
successful (otherwise everything is destroyed normally).

10 years agoauto merge of #9263 : catamorphism/rust/rustpkg-issue-7879, r=brson
bors [Wed, 18 Sep 2013 23:20:52 +0000 (16:20 -0700)]
auto merge of #9263 : catamorphism/rust/rustpkg-issue-7879, r=brson

r? @brson Treating a package as the thing that can have other packages depend on it,
and depends on other packages, was wrong if a package has more than one
crate. Now, rustpkg knows about dependencies between crates in the same
package. This solves the problem reported in #7879 where rustpkg wrongly
discovered a circular dependency between thhe package and itself, and
recursed infinitely.

Closes #7879

10 years agorustpkg: Make crates, not packages, the unit of rustpkg dependencies
Tim Chevalier [Tue, 17 Sep 2013 02:27:09 +0000 (19:27 -0700)]
rustpkg: Make crates, not packages, the unit of rustpkg dependencies

Treating a package as the thing that can have other packages depend on it,
and depends on other packages, was wrong if a package has more than one
crate. Now, rustpkg knows about dependencies between crates in the same
package. This solves the problem reported in #7879 where rustpkg wrongly
discovered a circular dependency between thhe package and itself, and
recursed infinitely.

Closes #7879

10 years agoauto merge of #9284 : thestinger/rust/main, r=luqmana
bors [Wed, 18 Sep 2013 22:05:56 +0000 (15:05 -0700)]
auto merge of #9284 : thestinger/rust/main, r=luqmana

the real entry point will now pass the user's main function directly to
the scheduler

10 years agoImplement process bindings to libuv
Alex Crichton [Mon, 16 Sep 2013 22:28:56 +0000 (15:28 -0700)]
Implement process bindings to libuv

This is a re-landing of #8645, except that the bindings are *not* being used to
power std::run just yet. Instead, this adds the bindings as standalone bindings
inside the rt::io::process module.

I made one major change from before, having to do with how pipes are
created/bound. It's much clearer now when you can read/write to a pipe, as
there's an explicit difference (different types) between an unbound and a bound
pipe. The process configuration now takes unbound pipes (and consumes ownership
of them), and will return corresponding pipe structures back if spawning is
successful (otherwise everything is destroyed normally).

10 years agoAllow trailing commas in format!
Alex Crichton [Wed, 18 Sep 2013 20:51:07 +0000 (13:51 -0700)]
Allow trailing commas in format!

This is more consistent with other parts of the language and it also makes it
easier to use in situations where format string is massive.

10 years agoauto merge of #9296 : alexcrichton/rust/snapshots, r=cmr
bors [Wed, 18 Sep 2013 18:46:37 +0000 (11:46 -0700)]
auto merge of #9296 : alexcrichton/rust/snapshots, r=cmr

huzzah!

10 years agoRegister new snapshots
Alex Crichton [Tue, 17 Sep 2013 06:34:40 +0000 (23:34 -0700)]
Register new snapshots

10 years agoauto merge of #9277 : crabtw/rust/mips, r=brson
bors [Wed, 18 Sep 2013 16:15:56 +0000 (09:15 -0700)]
auto merge of #9277 : crabtw/rust/mips, r=brson

This patch fixes some errors of MIPS target, however, MIPS C ABI is still broken. I will send another PR to fix the problem.

Because MIPS target has no "generic" CPU name, I add --target-cpu and --target-feature to RUST_FLAGS. In order to workaround the "compact frame descriptions incompatible with DWARF2 .eh_frame" problem, the linker I used is CXX but not CC.

10 years agoRenumber the lang items correctly
Alex Crichton [Wed, 18 Sep 2013 08:37:34 +0000 (01:37 -0700)]
Renumber the lang items correctly

Also add a test to help prevent this from getting out of sync again.

10 years agoauto merge of #9275 : blake2-ppc/rust/float-from-str, r=thestinger
bors [Wed, 18 Sep 2013 15:01:00 +0000 (08:01 -0700)]
auto merge of #9275 : blake2-ppc/rust/float-from-str, r=thestinger

std: Remove {float,f64,f32}::from_str in favor of from_str in the prelude

Like issue #9209, remove float::{from_str, from_str_radix} in favor of
the two corresponding traits. The same for modules f64 and f32.

New usage is:

    from_str::<float>("1.2e34")

10 years agoauto merge of #9272 : luqmana/rust/esln, r=catamorphism
bors [Wed, 18 Sep 2013 13:45:53 +0000 (06:45 -0700)]
auto merge of #9272 : luqmana/rust/esln, r=catamorphism

Fixes #9270

10 years agoauto merge of #9271 : brson/rust/extra-help, r=catamorphism
bors [Wed, 18 Sep 2013 12:30:58 +0000 (05:30 -0700)]
auto merge of #9271 : brson/rust/extra-help, r=catamorphism

Look like this now

```
    -Z FLAG             Set internal debugging options
    -v --version        Print version info and exit

Additional help:
    -W help             Print 'lint' options and default settings
    -Z help             Print internal options for debugging rustc

```

10 years agoRemove and replace cond! Closes #9282.
Jimmy Zelinskie [Wed, 18 Sep 2013 11:21:57 +0000 (07:21 -0400)]
Remove and replace cond! Closes #9282.

10 years agoauto merge of #9264 : ben0x539/rust/pp-work, r=alexcrichton
bors [Wed, 18 Sep 2013 11:15:56 +0000 (04:15 -0700)]
auto merge of #9264 : ben0x539/rust/pp-work, r=alexcrichton

Since 3b6314c the pretty printer seems to only print trait bounds for `ast::ty_path(...)`s that have a generics arguments list. That seems wrong, so let's always print them.

Closes #9253, un-xfails test for #7673.

10 years agoauto merge of #9254 : vadimcn/rust/fix-mingw-v4, r=brson
bors [Wed, 18 Sep 2013 09:25:57 +0000 (02:25 -0700)]
auto merge of #9254 : vadimcn/rust/fix-mingw-v4, r=brson

Fix Rust build on mingw v4.0
See #9246 for details.

10 years agoauto merge of #9248 : DanRosenwasser/rust/master, r=alexcrichton
bors [Wed, 18 Sep 2013 07:15:55 +0000 (00:15 -0700)]
auto merge of #9248 : DanRosenwasser/rust/master, r=alexcrichton

Since `

10 years agoauto merge of #9281 : brson/rust/multistring, r=alexcrichton
bors [Wed, 18 Sep 2013 05:20:57 +0000 (22:20 -0700)]
auto merge of #9281 : brson/rust/multistring, r=alexcrichton

When `count` is `Some` this function was reading a byte past the end
of the buffer.

10 years agoremove useless `rust_main` wrapper
Daniel Micay [Wed, 18 Sep 2013 04:54:08 +0000 (00:54 -0400)]
remove useless `rust_main` wrapper

the real entry point will now pass the user's main function directly to
the scheduler

10 years agostd: Fix an invalid read in from_c_multistring
Brian Anderson [Wed, 18 Sep 2013 04:25:18 +0000 (21:25 -0700)]
std: Fix an invalid read in from_c_multistring

When `count` is `Some` this function was reading a byte past the end
of the buffer.

10 years agostd::borrow: Use raw pointer comparison for `ref_eq`
blake2-ppc [Wed, 18 Sep 2013 04:03:22 +0000 (06:03 +0200)]
std::borrow: Use raw pointer comparison for `ref_eq`

Compare as `*T` in `ref_eq` instead of casting to uint, to match what
std::ptr does.

10 years agoextra: minor cleanup of Zero and Default syntax extension
Erick Tryzelaar [Wed, 18 Sep 2013 04:02:17 +0000 (21:02 -0700)]
extra: minor cleanup of Zero and Default syntax extension

10 years agoAdded support for a `\0` escape sequence.
Daniel Rosenwasser [Tue, 17 Sep 2013 02:38:53 +0000 (22:38 -0400)]
Added support for a `\0` escape sequence.

This commit adds support for `\0` escapes in character and string literals.

Since `\0` is equivalent to `\x00`, this is a direct translation to the latter
escape sequence. Future builds will be able to compile using `\0` directly.

Also updated the grammar specification and added a test for NUL characters.

10 years agoDocument a few undocumented modules in libstd
Alex Crichton [Wed, 18 Sep 2013 02:42:07 +0000 (19:42 -0700)]
Document a few undocumented modules in libstd

Hopefull this will make our libstd docs appear a little more "full".

10 years agoauto merge of #9133 : dcrewi/rust/bigint-random-range, r=huonw
bors [Wed, 18 Sep 2013 03:35:54 +0000 (20:35 -0700)]
auto merge of #9133 : dcrewi/rust/bigint-random-range, r=huonw

10 years agostd: Remove Option.or_{default,zero}
Erick Tryzelaar [Fri, 13 Sep 2013 23:38:36 +0000 (16:38 -0700)]
std: Remove Option.or_{default,zero}

These can be replaced with `Some(option.or_default())`.

10 years agofix compilation errors of mips target
Jyun-Yan You [Tue, 17 Sep 2013 17:58:07 +0000 (01:58 +0800)]
fix compilation errors of mips target

10 years agostd: Remove {float,f64,f32}::from_str in favor of from_str
blake2-ppc [Wed, 18 Sep 2013 00:17:47 +0000 (02:17 +0200)]
std: Remove {float,f64,f32}::from_str in favor of from_str

Like issue #9209, remove float::{from_str, from_str_radix} in favor of
the two corresponding traits. The same for modules f64 and f32.

New usage is

from_str::<float>("1.2e34")

10 years agoauto merge of #9258 : thestinger/rust/doc, r=catamorphism
bors [Wed, 18 Sep 2013 01:55:48 +0000 (18:55 -0700)]
auto merge of #9258 : thestinger/rust/doc, r=catamorphism

Closes #9144

10 years agoGenerate random big integers within a range
David Creswick [Thu, 12 Sep 2013 01:49:46 +0000 (20:49 -0500)]
Generate random big integers within a range

Thanks to @huonw for feedback

10 years agolibrustc: Respect #[link_name] on extern statics. Fixes #9270
Luqman Aden [Wed, 18 Sep 2013 01:03:56 +0000 (21:03 -0400)]
librustc: Respect #[link_name] on extern statics. Fixes #9270

10 years agoAdd an extra line before the "Additional Help" in rustc's --help output
Brian Anderson [Wed, 18 Sep 2013 00:55:18 +0000 (17:55 -0700)]
Add an extra line before the "Additional Help" in rustc's --help output

10 years agoauto merge of #9269 : alexcrichton/rust/ignore-rustpkg-test, r=brson
bors [Wed, 18 Sep 2013 00:15:45 +0000 (17:15 -0700)]
auto merge of #9269 : alexcrichton/rust/ignore-rustpkg-test, r=brson

@catamorphism says he has a fix coming soon, so I didn't allocate an issue for
it. If it festers for more than a few days I'll open something up though.

10 years agoIgnore a test which is blocking a snapshot
Alex Crichton [Wed, 18 Sep 2013 00:11:15 +0000 (17:11 -0700)]
Ignore a test which is blocking a snapshot

@catamorphism says he has a fix coming soon, so I didn't allocate an issue for
it. If it festers for more than a few days I'll open something up though.

10 years agodocument what unsafety means
Daniel Micay [Tue, 17 Sep 2013 18:38:27 +0000 (14:38 -0400)]
document what unsafety means

Closes #9144

10 years agoauto merge of #9257 : alexcrichton/rust/better-address-insignificant, r=thestinger
bors [Tue, 17 Sep 2013 22:20:44 +0000 (15:20 -0700)]
auto merge of #9257 : alexcrichton/rust/better-address-insignificant, r=thestinger

If a static is flagged as address_insignificant, then for LLVM to actually
perform the relevant optimization it must have an internal linkage type. What
this means, though, is that the static will not be available to other crates.
Hence, if you have a generic function with an inner static, it will fail to link
when built as a library because other crates will attempt to use the inner
static externally.

This gets around the issue by inlining the static into the metadata. The same
relevant optimization is then applied separately in the external crate. What
this ends up meaning is that all statics tagged with #[address_insignificant]
will appear at most once per crate (by value), but they could appear in multiple
crates.

This should be the last blocker for using format! ...

10 years agopp: also print bounds in paths with no generic params
Benjamin Herr [Tue, 17 Sep 2013 20:13:47 +0000 (22:13 +0200)]
pp: also print bounds in paths with no generic params

Since 3b6314c3 the pretty printer seems to only print trait bounds for
`ast::ty_path(...)`s that have a generics arguments list. That seems
wrong, so let's always print them.

Closes #9253, un-xfails test for #7673.

10 years agoauto merge of #9235 : olsonjeffery/rust/newrt_file_io_1, r=thestinger
bors [Tue, 17 Sep 2013 21:05:45 +0000 (14:05 -0700)]
auto merge of #9235 : olsonjeffery/rust/newrt_file_io_1, r=thestinger

A quick rundown:

- added `file::{readdir, stat, mkdir, rmdir}`
- Added access-constrained versions of `FileStream`; `FileReader` and `FileWriter` respectively
- big rework in `uv::file` .. most actions are by-val-self methods on `FsRequest`; `FileDescriptor` has gone the way of the dinosaurs
- playing nice w/ homing IO (I just copied ecr's work, hehe), etc
- added `FileInfo` trait, with an impl for `Path`
  - wrapper for file-specific actions, with the file path always implied by self's value
  - has the means to create `FileReader` & `FileWriter` (this isn't exposed in the top-level free function API)
  - has "safe" wrappers for `stat()` that won't throw in the event of non-existence/error (in this case, I mean `is_file` and `exists`)
  - actions should fail if done on non-regular-files, as appropriate
- added `DirectoryInfo` trait, with an impl for `Path`
  - pretty much ditto above, but for directories
  - added `readdir` (!!) to iterate over entries in a dir as a `~[Path]` (this was *brutal* to get working)

...<del>and lots of other stuff</del>not really. Do your worst!

10 years agopp: typo in comment
Benjamin Herr [Tue, 17 Sep 2013 17:45:14 +0000 (19:45 +0200)]
pp: typo in comment

10 years agoauto merge of #9256 : thestinger/rust/drop, r=alexcrichton
bors [Tue, 17 Sep 2013 19:50:46 +0000 (12:50 -0700)]
auto merge of #9256 : thestinger/rust/drop, r=alexcrichton

10 years agoPrevent a rare linkage issue with an xcrate static
Alex Crichton [Tue, 17 Sep 2013 18:24:05 +0000 (11:24 -0700)]
Prevent a rare linkage issue with an xcrate static

If a static is flagged as address_insignificant, then for LLVM to actually
perform the relevant optimization it must have an internal linkage type. What
this means, though, is that the static will not be available to other crates.
Hence, if you have a generic function with an inner static, it will fail to link
when built as a library because other crates will attempt to use the inner
static externally.

This gets around the issue by inlining the static into the metadata. The same
relevant optimization is then applied separately in the external crate. What
this ends up meaning is that all statics tagged with #[address_insignificant]
will appear at most once per crate (by value), but they could appear in multiple
crates.

This should be the last blocker for using format! ...

10 years agostd: fix win32 build issue re: multistring parsing
Jeff Olson [Tue, 17 Sep 2013 18:15:33 +0000 (11:15 -0700)]
std: fix win32 build issue re: multistring parsing

10 years agoauto merge of #9236 : steveklabnik/rust/rustpkg_init, r=catamorphism
bors [Tue, 17 Sep 2013 18:00:46 +0000 (11:00 -0700)]
auto merge of #9236 : steveklabnik/rust/rustpkg_init, r=catamorphism

Closes #9045

Built on top of #9235, which isn't strictly needed for now, but I imagine I will use part of. Unsure.

I mostly wanted to start this off to get some feedback from @catamorphism and others. These are the directories that actually need made, but I was thinking about adding a few other things:

1. an `examples` directory, since it seems like that's a common pattern
2. a `.gitignore` file that ignores `build`. And anything else that makes sense
3. a sample module that'd actually compile

Feedback?

10 years agoImplementing 'rustpkg init'.
Steve Klabnik [Mon, 16 Sep 2013 21:59:34 +0000 (14:59 -0700)]
Implementing 'rustpkg init'.

This will initialize a new workspace.

10 years agostd: whitespace clean up io::file docs
Jeff Olson [Tue, 17 Sep 2013 17:14:15 +0000 (10:14 -0700)]
std: whitespace clean up io::file docs

10 years agoremove unnecessary transmutes
Daniel Micay [Tue, 17 Sep 2013 15:44:59 +0000 (11:44 -0400)]
remove unnecessary transmutes

10 years agoauto merge of #9245 : kballard/rust/bytes-span, r=catamorphism
bors [Tue, 17 Sep 2013 15:45:44 +0000 (08:45 -0700)]
auto merge of #9245 : kballard/rust/bytes-span, r=catamorphism

This constrains the span to the appropriate argument, so you know which
one caused the problem. Instead of

    foo.rs:2:4: 2:21 error: Too large integer literal in bytes!
    foo.rs:2    bytes!(1, 256, 2)
                ^~~~~~~~~~~~~~~~~

it will say

    foo.rs:2:14 2:17 error: Too large integer literal in bytes!
    foo.rs:2    bytes!(1, 256, 2)
                          ^~~

10 years agostd: fix win32 build error in os::env()
Jeff Olson [Tue, 17 Sep 2013 15:40:31 +0000 (08:40 -0700)]
std: fix win32 build error in os::env()

10 years agostd: remove RtioStream
Jeff Olson [Tue, 17 Sep 2013 15:01:44 +0000 (08:01 -0700)]
std: remove RtioStream

10 years agoauto merge of #9244 : thestinger/rust/drop, r=catamorphism
bors [Tue, 17 Sep 2013 14:15:42 +0000 (07:15 -0700)]
auto merge of #9244 : thestinger/rust/drop, r=catamorphism

This doesn't close any bugs as the goal is to convert the parameter to by-value, but this is a step towards being able to make guarantees about `&T` pointers (where T is Freeze) to LLVM.