Commit Graph

22537 Commits

Author SHA1 Message Date
Tim Chevalier
d84a22addf rustpkg: Register correct dependencies for built and installed files
as per #9112

Closes #9112
2013-09-18 22:48:37 -07:00
blake2-ppc
f0630fdc8b doc: Fix the tutorial's link to rustpkg docs 2013-09-19 01:43:10 -04:00
bors
3c0013134c 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++!
2013-09-18 22:15:59 -07:00
Chris Morgan
e2807a4565 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.
2013-09-19 15:04:03 +10:00
Alex Crichton
c3ad785d83 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
2013-09-18 20:58:56 -07:00
blake2-ppc
bf0e2a6f57 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!`
2013-09-18 23:17:07 -04:00
Brian Anderson
3bd0eb9f63 0.8 release notes 2013-09-18 20:16:02 -07:00
Daniel Micay
d12e0305b1 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).
2013-09-18 22:26:48 -04:00
bors
4dacd73651 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).
2013-09-18 18:30:56 -07:00
bors
36cc41481c 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
2013-09-18 16:20:52 -07:00
Tim Chevalier
e199790bac 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
2013-09-18 15:30:41 -07:00
bors
8f65529627 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
2013-09-18 15:05:56 -07:00
Alex Crichton
cb7756a81d 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).
2013-09-18 13:52:18 -07:00
Alex Crichton
040f1c06bc 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.
2013-09-18 13:51:07 -07:00
bors
d2b0b11aeb auto merge of #9296 : alexcrichton/rust/snapshots, r=cmr
huzzah!
2013-09-18 11:46:37 -07:00
Alex Crichton
817576ee70 Register new snapshots 2013-09-18 11:07:22 -07:00
bors
b43ee6cd2e 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.
2013-09-18 09:15:56 -07:00
Alex Crichton
2f845a5e0a Renumber the lang items correctly
Also add a test to help prevent this from getting out of sync again.
2013-09-18 09:09:54 -07:00
bors
e02313a172 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")
2013-09-18 08:01:00 -07:00
bors
9e636f106d auto merge of #9272 : luqmana/rust/esln, r=catamorphism
Fixes #9270
2013-09-18 06:45:53 -07:00
bors
10d26f8daf 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

```
2013-09-18 05:30:58 -07:00
Jimmy Zelinskie
4757631369 Remove and replace cond! Closes #9282. 2013-09-18 07:34:02 -04:00
bors
b8d3496528 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.
2013-09-18 04:15:56 -07:00
bors
adb638f54d auto merge of #9254 : vadimcn/rust/fix-mingw-v4, r=brson
Fix Rust build on mingw v4.0
See #9246 for details.
2013-09-18 02:25:57 -07:00
bors
7dd9344b03 auto merge of #9248 : DanRosenwasser/rust/master, r=alexcrichton
Since `
2013-09-18 00:15:55 -07:00
bors
cbd1eefbd3 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.
2013-09-17 22:20:57 -07:00
Daniel Micay
c0cc37b963 remove useless rust_main wrapper
the real entry point will now pass the user's main function directly to
the scheduler
2013-09-18 00:57:48 -04:00
Brian Anderson
fd0fcba9f5 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.
2013-09-17 21:25:18 -07:00
blake2-ppc
7024a9d529 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.
2013-09-18 06:05:06 +02:00
Erick Tryzelaar
1a90f24bbd extra: minor cleanup of Zero and Default syntax extension 2013-09-17 21:02:17 -07:00
Daniel Rosenwasser
604667fa82 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.
2013-09-17 23:52:29 -04:00
Alex Crichton
88bc11e646 Document a few undocumented modules in libstd
Hopefull this will make our libstd docs appear a little more "full".
2013-09-17 20:50:23 -07:00
bors
4c6bf48720 auto merge of #9133 : dcrewi/rust/bigint-random-range, r=huonw 2013-09-17 20:35:54 -07:00
Erick Tryzelaar
5ab843fbc3 std: Remove Option.or_{default,zero}
These can be replaced with `Some(option.or_default())`.
2013-09-17 19:50:41 -07:00
Jyun-Yan You
d11f746cc1 fix compilation errors of mips target 2013-09-18 10:10:32 +08:00
blake2-ppc
b5d560a9e0 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")
2013-09-18 04:02:42 +02:00
bors
4dc3a97698 auto merge of #9258 : thestinger/rust/doc, r=catamorphism
Closes #9144
2013-09-17 18:55:48 -07:00
David Creswick
af72e4108d Generate random big integers within a range
Thanks to @huonw for feedback
2013-09-17 20:48:04 -05:00
Luqman Aden
1ce657aa1f librustc: Respect #[link_name] on extern statics. Fixes #9270 2013-09-17 21:03:56 -04:00
Brian Anderson
34ac5b05f6 Add an extra line before the "Additional Help" in rustc's --help output 2013-09-17 17:55:18 -07:00
bors
460021bdf2 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.
2013-09-17 17:15:45 -07:00
Alex Crichton
3b07f1efe5 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.
2013-09-17 17:11:15 -07:00
Daniel Micay
e12c3bfbf9 document what unsafety means
Closes #9144
2013-09-17 19:13:14 -04:00
bors
0efc4822e9 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! ...
2013-09-17 15:20:44 -07:00
Benjamin Herr
823ebb14ba 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.
2013-09-17 23:41:42 +02:00
bors
c135cb2683 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!
2013-09-17 14:05:45 -07:00
Benjamin Herr
aa406c151e pp: typo in comment 2013-09-17 22:27:12 +02:00
bors
9e8fb4ad61 auto merge of #9256 : thestinger/rust/drop, r=alexcrichton 2013-09-17 12:50:46 -07:00
Alex Crichton
9adcbac30d 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! ...
2013-09-17 11:24:05 -07:00
Jeff Olson
70152ff557 std: fix win32 build issue re: multistring parsing 2013-09-17 11:15:33 -07:00