Commit Graph

25387 Commits

Author SHA1 Message Date
bors
54a85d4d67 auto merge of #11480 : SiegeLord/rust/float_base, r=cmr
This fixes the incorrect lexing of things like:

~~~rust
let b = 0o2f32;
let d = 0o4e6;
let f = 0o6e6f32;
~~~

and brings the float literal lexer in line with the description of the float literals in the manual.
2014-01-11 16:21:24 -08:00
bors
68ebe8141a auto merge of #11477 : adridu59/rust/bug-report, r=cmr
Mostly cleanups for doc and READMEs. Fixes the bug reporting link.
2014-01-11 15:01:32 -08:00
bors
db9ef28695 auto merge of #11338 : jhasse/rust/patch-rustpkgtarget, r=alexcrichton
#11243
2014-01-11 13:06:27 -08:00
Jan Niklas Hasse
e330d4b8bc Use target libraries instead of host libraries. Fixes #11243 2014-01-11 20:44:39 +01:00
SiegeLord
5ea6d0201d Tighten up float literal lexing.
Specifically, dissallow setting the number base for every type of float
literal, not only those that contain the decimal point. This is in line with
the description in the manual.
2014-01-11 14:21:59 -05:00
Adrien Tétar
72794094a1 Trim src/ README, bring back version_info everywhere 2014-01-11 19:55:24 +01:00
Adrien Tétar
a30d61b05a Various READMEs and docs cleanup
Noticeably closes #11428.
2014-01-11 19:41:31 +01:00
bors
91aec7c8a6 auto merge of #11470 : eminence/rust/rustpkg_help_test, r=alexcrichton
In general, you can run "rustpkg help <cmd>" to see some specific usage information for <cmd>.  However, this was handled in a very ad-hoc and buggy manner.  For example, running "rustpkg help prefer" would actually show you the usage information for the "uninstall" cmd.  Or "rustpkg help test" would show you the usage information for the "build" command.  Or "rustpkg help list" would just run the "list" command (and not show you anything usage information)

This commit attempts to fix this by making a new HelpCmd (and handling it explicitly)
2014-01-11 10:21:22 -08:00
Andrew Chin
dc21ca9833 "rustpkg prefer" should print the help for '"prefer" not "uninstall" 2014-01-11 11:48:54 -05:00
bors
29e82c65b4 auto merge of #11472 : kud1ing/rust/iOS, r=alexcrichton
This fixes #11336

I guess the type sizes are correct for both OS X and iOS, but i am not certain.
In any case, i'd rather have any iOS build at all, so that we have something to improve upon.
2014-01-11 08:46:20 -08:00
bors
4bdda359c3 auto merge of #11252 : eddyb/rust/ty-cleanup, r=pcwalton 2014-01-11 07:31:40 -08:00
Eduard Burtescu
08ac616d37 Use the right type for self in methods and remove obsoleted items.
Fixes #7411, #10615.
2014-01-11 16:40:23 +02:00
Eduard Burtescu
7a305f9e83 Removed free_glue from tydesc (the code is still generated, but inlined in drop_glue). 2014-01-11 16:40:23 +02:00
Eduard Burtescu
5ad2a7825b Removed obsolete 'e' prefix on ty_evec and ty_estr. 2014-01-11 16:40:23 +02:00
bors
99df8a3f15 auto merge of #11463 : brson/rust/envcaps, r=huonw
Death to caps.
2014-01-11 06:11:22 -08:00
bors
e19b1b129b auto merge of #11468 : klutzy/rust/workcache-cleanup, r=alexcrichton 2014-01-11 04:46:21 -08:00
bors
01794cc993 auto merge of #11461 : alexcrichton/rust/rustdoc-fixes, r=brson
See the commits.
2014-01-11 02:41:23 -08:00
Alex Crichton
60880af47d rustdoc: Don't show a fields header if there are none 2014-01-11 01:52:53 -08:00
bors
e57424b5cc auto merge of #11466 : eminence/rust/fix_rustpkg_help, r=brson
It appears --help got lost in aa50ebd03e

Fixes #11423
2014-01-11 01:21:49 -08:00
kud1ing
6bbd2ed98e define arch for iOS/ARM 2014-01-11 10:21:24 +01:00
bors
f0541d5e94 auto merge of #11465 : pcwalton/rust/borrow-check-bug, r=pcwalton
it. r=nikomatsakis
2014-01-11 00:01:31 -08:00
klutzy
d578ecc407 extra::workcache: Remove unused Logger 2014-01-11 15:10:28 +09:00
bors
8de3813d21 auto merge of #11459 : tedhorst/rust/uninstall_rustlib, r=alexcrichton
Update the uninstall target with the configurable rust lib directory name.

cc @jhasse
2014-01-10 21:36:25 -08:00
Andrew Chin
e01abfe432 Fix rustpkg help handling
In general, you could run "rustpkg help <cmd>" to see some specific
usage information for <cmd>.  However, this was handled in a very ad-hoc
and buggy manner.  For example, running "rustpkg help prefer" would
actually show you the usage information for the "uninstall" cmd.

This commit attempts to fix this by making Help a real Command, and
making the handing of it explicit.
2014-01-11 00:34:09 -05:00
Andrew Chin
565de31867 Re-implement --help in rustpkg
Fixes #11423
2014-01-10 22:10:43 -05:00
Patrick Walton
c2e6673a6b librustc: Check restrictions on all subcomponents of a path when moving
it. r=nikomatsakis
2014-01-10 19:01:51 -08:00
bors
a34727f276 auto merge of #11416 : bjz/rust/remove-print-fns, r=alexcrichton
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-10 18:21:21 -08:00
Brian Anderson
cdc44940b7 syntax: Fix capitalization in macro_parser errors 2014-01-10 18:06:35 -08:00
Brian Anderson
60e096a43f rustc: Fix formatting of env! error message
Death to caps.
2014-01-10 17:57:02 -08:00
bors
5a6ca45c8a auto merge of #11415 : nick29581/rust/visit_trait_option, r=alexcrichton
...Therefore, we should not iterate over it.
2014-01-10 17:06:27 -08:00
Brendan Zabarauskas
4fc0452ace Remove re-exports of std::io::stdio::{print, println} in the prelude.
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-11 10:46:00 +11:00
Alex Crichton
594807951f rustdoc: Don't show private modules 2014-01-10 15:12:07 -08:00
Alex Crichton
79e144ed64 rustdoc: Get --version working
Closes #11421
2014-01-10 15:12:06 -08:00
Alex Crichton
b1eaeb5561 doc: build the docs for librustuv
Closes #11444
2014-01-10 15:12:06 -08:00
Alex Crichton
18e7f3b3ec rustdoc: Don't strip empty modules with documentation
Closes #11443
2014-01-10 15:12:06 -08:00
bors
f411b94ce1 auto merge of #11448 : c-a/rust/u64_from_be_bytes, r=alexcrichton
Instead of reading a byte at a time in a loop we hardcode how to read each size.
We also try to do as few reads as possible by reading as big primitive types as
possible. For example if size is eight we do a single read of a u64 value and
if size is seven we read it as [u32|u16|u8].

Timings on a Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz

-- Before --
running 7 tests
test io::extensions::test::test_u64_from_be_bytes ... ok
test io::extensions::bench::u64_from_be_bytes_4_aligned         ... bench:       386 ns/iter (+/- 5)
test io::extensions::bench::u64_from_be_bytes_4_unaligned       ... bench:       387 ns/iter (+/- 2)
test io::extensions::bench::u64_from_be_bytes_7_aligned         ... bench:       628 ns/iter (+/- 1)
test io::extensions::bench::u64_from_be_bytes_7_unaligned       ... bench:       637 ns/iter (+/- 3)
test io::extensions::bench::u64_from_be_bytes_8_aligned         ... bench:       727 ns/iter (+/- 18)
test io::extensions::bench::u64_from_be_bytes_8_unaligned       ... bench:       723 ns/iter (+/- 22)

callgrind rustc -S  rust/src/test/bench/sudoku.rs
    u64_from_be_bytes self: 4.37%

-- After --
running 7 tests
test io::extensions::test::test_u64_from_be_bytes ... ok
test io::extensions::bench::u64_from_be_bytes_4_aligned         ... bench:       162 ns/iter (+/- 7)
test io::extensions::bench::u64_from_be_bytes_4_unaligned       ... bench:       164 ns/iter (+/- 7)
test io::extensions::bench::u64_from_be_bytes_7_aligned         ... bench:       201 ns/iter (+/- 7)
test io::extensions::bench::u64_from_be_bytes_7_unaligned       ... bench:       210 ns/iter (+/- 9)
test io::extensions::bench::u64_from_be_bytes_8_aligned         ... bench:       163 ns/iter (+/- 7)
test io::extensions::bench::u64_from_be_bytes_8_unaligned       ... bench:       163 ns/iter (+/- 10)

callgrind rustc -S  rust/src/test/bench/sudoku.rs
    u64_from_be_bytes self: 1.78%
2014-01-10 14:01:34 -08:00
bors
33e8663391 auto merge of #11449 : rcatolino/rust/assign-binop-handling, r=alexcrichton
So far the following code
```
struct Foo;

fn main() {
  let mut t = Foo;
  let ref b = Foo;
  a += *b;
}
```
errors with 
```
test.rs:15:3: 13:11 error: binary operation + cannot be applied to type `Foo`
test.rs:15   *a += *b;
```
Since assignment-operators are no longer expanded to ```left = left OP right``` but are independents operators it should be 
```
test.rs:15:3: 13:11 error: binary operation += cannot be applied to type `Foo`
test.rs:15   *a += *b;
```
to make it clear that implementing Add for Foo is not gonna work. (cf issues #11143, #11344)

Besides that, we also need to typecheck the rhs expression even if the operator has no implementation, or we end up with unknown types for the nodes of the rhs and an ICE later on while resolving types. (once again cf #11143 and #11344).

This probably would get fixed with #5992, but in the meantime it's a confusing error to stumble upon.
@pcwalton, you wrote the original code, what do you think?
(closes #11143 and #11344)
2014-01-10 11:51:21 -08:00
Raphael Catolino
02d86216f3 Improve invalid operator assignment handling. 2014-01-10 20:46:20 +01:00
Ted Horst
0d4c51e1d1 fix uninstall target with configurable rustlib directory 2014-01-10 13:45:41 -06:00
Carl-Anton Ingmarsson
0b3311c260 std::io: Optimize u64_from_be_bytes()
Instead of reading a byte at a time in a loop we copy the relevant bytes into
a temporary vector of size eight. We can then read the value from the temporary
vector using a single u64 read. LLVM seems to be able to optimize this
almost scarily good.
2014-01-10 20:14:05 +01:00
bors
ff7ecca20e auto merge of #11452 : derekchiang/rust/fix-11421, r=cmr
Closes #11421.  A pretty trivial fix.
2014-01-10 08:26:24 -08:00
bors
7fe8692d33 auto merge of #11451 : kud1ing/rust/patch-1, r=cmr 2014-01-10 07:06:32 -08:00
Derek Chiang
6f875c96b3 Fix #11421 2014-01-10 22:09:59 +08:00
kud1ing
aca705cae9 "As long an iterator" => "As long as an iterator" 2014-01-10 15:05:54 +01:00
Carl-Anton Ingmarsson
326e63187f std::io: Add tests and benchmarks for u64_from_be_bytes() 2014-01-10 13:37:50 +01:00
bors
423dd84300 auto merge of #11441 : jld/rust/enum-nullable-const-null-with-fields, r=alexcrichton
That is, if you have an enum type that is subject to the nullable
pointer optimization, but the null variant has a nonzero number of
fields, and you declare a static whose value is of that variant, then
that used to be an ICE but this change fixes it.
2014-01-10 03:11:17 -08:00
bors
72a52522ca auto merge of #11437 : sfackler/rust/mem-eof, r=alexcrichton
It's easy to figure out and useful as a sanity check sometimes.
2014-01-10 01:56:18 -08:00
bors
587d0f5a32 auto merge of #11436 : alexcrichton/rust/update-forks, r=huonw
We're not moving everything just yet, but it's good to start somewhere!
2014-01-10 00:41:21 -08:00
bors
6ea218d37b auto merge of #11433 : brson/rust/minorstylefixes, r=alexcrichton 2014-01-09 23:26:20 -08:00
Jed Davis
5487f15bbf Fix ICE on const of nullable enum with fields in null case.
That is, if you have an enum type that is subject to the nullable
pointer optimization, but the null variant has a nonzero number of
fields, and you declare a static whose value is of that variant, then
that used to be an ICE but this change fixes it.
2014-01-09 22:24:31 -08:00