Commit Graph

22450 Commits

Author SHA1 Message Date
bors
7f826cb25a 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.
2013-09-19 21:46:45 -07:00
bors
407d179f4e 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.
2013-09-19 19:31:13 -07:00
bors
570431fcac 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
2013-09-19 15:56:04 -07:00
Steven Fackler
963707f45d Clean up unused imports 2013-09-19 15:19:25 -07:00
Steven Fackler
48d5b4b8e1 Add Future::spawn_with 2013-09-19 15:19:25 -07:00
Steven Fackler
ff85389344 Modernize extra::future API 2013-09-19 15:19:20 -07:00
Alex Crichton
5165ecde66 Ignore io::process tests
They're causing syscalls to get interrupted, and std::io doesn't correctly
handle EINTR
2013-09-19 15:17:29 -07:00
Benjamin Herr
567c567b2d lexer: further slight improvements to lexer errors 2013-09-19 23:08:06 +02:00
bors
85c0fb7b8a 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.
2013-09-19 11:11:01 -07:00
bors
755f6229da 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())`.
2013-09-19 09:55:59 -07:00
Steven Fackler
2df5a13334 Removed future's destructor
It was only there to prevent Future from being copyable, but it's
noncopyable anyways since it contains a ~fn.
2013-09-19 09:06:42 -07:00
bors
068e04231d auto merge of #9313 : brson/rust/relnotes, r=thestinger 2013-09-19 08:40:59 -07:00
Benjamin Herr
8009c97a55 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.
2013-09-19 16:58:49 +02:00
Benjamin Herr
1019177958 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.
2013-09-19 16:58:11 +02:00
bors
da29a8e6be 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.
2013-09-19 07:06:04 -07:00
bors
99ec14dbb0 auto merge of #9267 : Kimundi/rust/master, r=huonw 2013-09-19 05:06:00 -07:00
Marvin Löbel
06d1dccf95 Turned extra::getopts functions into methods
Some minor api and doc adjustments
2013-09-19 12:32:18 +02:00
bors
4904bc33cc 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.
2013-09-19 03:01:05 -07:00
bors
a7cf7b7b0b 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.
2013-09-19 00:31:05 -07: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
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
Brian Anderson
3bd0eb9f63 0.8 release notes 2013-09-18 20:16:02 -07: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
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