Commit Graph

22646 Commits

Author SHA1 Message Date
Steven Fackler
3c30ecb706 Add fractional second support to str{p,f}time
The ISO 8601 standard does not mandate any specific precision for
fractional seconds, so this accepts input of any length, ignoring the
part after the nanoseconds place. It may be more correct to round with
the tenths of nanoseconds digit, but then we'd have to deal with
carrying the round through the entire Tm struct (e.g. for a time like
Dec 31 11:59.999999999999).

%f is the format specifier that Python's datetime library uses for
0-padded microseconds so it seemed appropriate here.

cc #2350
2013-09-05 23:19:41 -07:00
Brian Anderson
807408b708 std::rt: Fix addrinfo definition on BSD 2013-09-05 22:15:02 -07:00
Micah Chalmer
fcf18786b4 Add ERT tests 2013-09-06 01:02:20 -04:00
Micah Chalmer
377b2c77e4 Add paragraph fill and auto-fill for multi-line comments 2013-09-06 01:02:20 -04:00
Micah Chalmer
1ac7c5cc5a Add custom group for rust-mode 2013-09-06 01:02:20 -04:00
Micah Chalmer
76e95a0264 Indent return type to align with arguments 2013-09-06 01:02:19 -04:00
Micah Chalmer
9ef0b9c0d6 Allow indenting to align struct fields after curly brace 2013-09-06 01:02:19 -04:00
Micah Chalmer
1c527dfcd4 Indent correctly after opening square bracket 2013-09-06 01:02:19 -04:00
bors
5efe1e5365 auto merge of #8914 : Dretch/rust/native-glob, r=alexcrichton
This is #8201 with a bunch of amendments to address the comments (and re-based).
2013-09-05 22:00:58 -07:00
David Creswick
dfb04d9953 Convert between BigInts and BigUints 2013-09-05 23:15:33 -05:00
bors
f051196731 auto merge of #8909 : lkuper/rust/default-methods-refactor, r=alexcrichton
(cc: #3227)

Parts I'm unsure about and would like a reviewer to look at are:

  * `pub trait GenericPath : Clone + Eq + ToStr` -- is this the done thing?  I've never done trait inheritance before, let alone from multiple traits, but it seemed to be necessary to be able to call all the methods we have to be able to call on `self`.

  * changing the argument of `components` from `self` to `&self`, and having it return `self.components.clone()` instead of `self.components`; this was necessary to avoid move errors, but I'm not sure if it's the right thing.  (The default methods impls now all have to call `self.components()` instead of just referencing the field `self.components`.)
2013-09-05 20:50:53 -07:00
bors
a980f28028 auto merge of #9011 : alexcrichton/rust/fix-lint, r=thestinger 2013-09-05 19:40:54 -07:00
David Creswick
4339952934 test the correct function (oops) 2013-09-05 21:39:14 -05:00
Alex Crichton
1f044893b1 Don't run lint over gyp files (they just fail anyway) 2013-09-05 19:20:30 -07:00
Micah Chalmer
e7d5af8ec7 Fix glitches with struct field aligned indents 2013-09-05 22:18:29 -04:00
David Creswick
3d735e4a63 Generate random BigUints and BigInts 2013-09-05 19:40:07 -05:00
bors
992b558d3c auto merge of #9004 : brson/rust/issue-8660, r=thestinger
The new scheduler makes better use of threads than the old.
2013-09-05 16:40:48 -07:00
Brian Anderson
738ec516f5 extra: Don't overcommit test tasks. Closes #8660
The new scheduler makes better use of threads than the old.
2013-09-05 16:37:10 -07:00
Brian Anderson
fec6716eec std: Remove push_fast from OwnedVector. Closes #8769
This is an unsafe implementation detail of `push`.
2013-09-05 15:56:22 -07:00
bors
6f9ce0948a auto merge of #8997 : fhahn/rust/issue_8985, r=catamorphism,brson
Patch for #8985
2013-09-05 15:00:49 -07:00
Brian Anderson
0948f54e65 std::rt: Add get_host_addresses function
This is a very simplistic method for host name resolution. It converts
a host name to a vector of IP addresses. Should be enough to get started.
2013-09-05 14:22:16 -07:00
Brian Anderson
c218694cec std::rt: Add libuv bindings for getaddrinfo 2013-09-05 14:22:15 -07:00
Brian Anderson
b3f7f758b1 std::rt: Some I/O cleanup 2013-09-05 14:21:57 -07:00
bors
d1dde99e4b auto merge of #8992 : chris-morgan/rust/unreachable-macro, r=brson
Rationale: having a function which fails means that the location of
failure which is output is that of the unreachable() function, rather
than the caller.

This is part of #8991 but is not all of it; current usage of
``std::util::unreachable()`` must remain so for the moment, until a new
snapshot is made; then I will remove that function entirely in favour of
using this macro.
2013-09-05 13:50:46 -07:00
Gareth Smith
193a1c8af6 Replace os::glob with extra::glob, which is written in rust,
fixing issue #6100.
2013-09-05 21:19:47 +01:00
bors
d84a7b5ae3 auto merge of #8984 : chris-morgan/rust/auto-stream-impl, r=huonw
This is consistent with the existing documentation but was not the
actual behaviour, which I've found to be rather a nuisance, actually.
2013-09-05 12:10:46 -07:00
Florian Hahn
de39874801 Rename str::from_bytes to str::from_utf8, closes #8985 2013-09-05 14:17:24 +02:00
bors
510c4d8dcf auto merge of #8993 : pnkfelix/rust/fsk-fix-7740-dont-recur-on-items-during-gather-loans-of-block, r=nikomatsakis
Fix #7740

r? anyone, @nikomatsakis especially.
2013-09-05 04:55:44 -07:00
Lindsey Kuper
59291eb197 Minor doc cleanup. 2013-09-05 06:25:23 -04:00
Lindsey Kuper
8651011b6f Factor shared code out into default GenericPath methods. 2013-09-05 06:25:23 -04:00
bors
6f176a17f6 auto merge of #8990 : thestinger/rust/str, r=alexcrichton
mapping a function against the elements should not require allocating a
new container, but `collect` still provides the functionality as-needed
2013-09-05 03:00:49 -07:00
Alex Crichton
8a966183fe Remove the __log function for __log_level
Also redefine all of the standard logging macros to use more rust code instead
of custom LLVM translation code. This makes them a bit easier to understand, but
also more flexibile for future types of logging.

Additionally, this commit removes the LogType language item in preparation for
changing how logging is performed.
2013-09-05 01:48:20 -07:00
bors
422dcbd56d auto merge of #8975 : alexcrichton/rust/reorganize, r=pnkfelix
Closes #2302
2013-09-05 01:05:47 -07:00
Felix S. Klock II
c7352e6403 regression test for #7740. 2013-09-05 09:25:29 +02:00
bors
3c3ae1d0e2 auto merge of #8875 : alexcrichton/rust/fix-inner-static-library-bug, r=huonw
These commits fix bugs related to identically named statics in functions of implementations in various situations. The commit messages have most of the information about what bugs are being fixed and why.

As a bonus, while I was messing around with name mangling, I improved the backtraces we'll get in gdb by removing `__extensions__` for the trait/type being implemented and by adding the method name as well. Yay!
2013-09-04 23:55:46 -07:00
Chris Morgan
6b7b8f2682 Add an `unreachable!()` macro.
Rationale: having a function which fails means that the location of
failure which is output is that of the unreachable() function, rather
than the caller.

This is part of #8991 but is not all of it; current usage of
``std::util::unreachable()`` must remain so for the moment, until a new
snapshot is made; then I will remove that function entirely in favour of
using this macro.
2013-09-05 16:41:27 +10:00
Alex Crichton
7b3dd32797 Move the rt build directory under $target
Closes #2302
2013-09-04 23:34:09 -07:00
Alex Crichton
7baff57f26 Improve name mangling for gdb
Remove __extensions__ from method symbols as well as the meth_XXX. The XXX is
now used to append a few characters at the end of the name of the symbol.

Closes #6602
2013-09-04 23:28:23 -07:00
Daniel Micay
fcc7aff62b str: rm map_chars, replaced by iterators
mapping a function against the elements should not require allocating a
new container, but `collect` still provides the functionality as-needed
2013-09-05 02:02:27 -04:00
bors
2bd628eafa auto merge of #8944 : alexcrichton/rust/issue-8938, r=huonw
Otherwise extra stuff after a lone '}' character is simply ignored, which is
very bad.

Closes #8938
2013-09-04 22:25:42 -07:00
Corey Richardson
c1c5c8b725 Add from_str docs 2013-09-05 00:58:12 -04:00
Corey Richardson
be43625082 Add a from_str function that calls out to the associated method on the trait 2013-09-05 00:48:48 -04:00
bors
d285ea7910 auto merge of #8980 : thestinger/rust/bool, r=thestinger
This is currently unsound since `bool` is represented as `i8`. It will
become sound when `bool` is stored as `i8` but always used as `i1`.

However, the current behaviour will always be identical to `x & 1 != 0`,
so there's no need for it. It's also surprising, since `x != 0` is the
expected behaviour.

Closes #7311

d0a1176 r=huonw
e4a76e6 r=thestinger
2013-09-04 21:15:43 -07:00
blake2-ppc
b153219556 std::str: Deny surrogates in is_utf8
Reject codepoints \uD800 to \uDFFF which are the surrogates
(reserved/unused codepoints that are invalid to encode into UTF-8)

The surrogates is the only hole of invalid codepoints in the range from
\u0 to \u10FFFF.
2013-09-04 23:09:51 -04:00
Daniel Micay
b49e9fa794 forbid cast as bool
This is currently unsound since `bool` is represented as `i8`. It will
become sound when `bool` is stored as `i8` but always used as `i1`.

However, the current behaviour will always be identical to `x & 1 != 0`,
so there's no need for it. It's also surprising, since `x != 0` is the
expected behaviour.

Closes #7311
2013-09-04 23:09:51 -04:00
bors
b6d825ee56 auto merge of #8986 : metajack/rust/rem-1866-xfail-comment, r=huonw
It's no longer xfailed.
2013-09-04 20:05:44 -07:00
Jack Moffitt
4c375373a6 Remove spurious comment in test for #1866.
It's no longer xfailed.
2013-09-04 19:19:20 -06:00
bors
8827b94e5b auto merge of #8978 : pnkfelix/rust/make-path-api-less-allocation-happy, r=huonw
A [dialogue](https://github.com/mozilla/rust/pull/8909#discussion-diff-6102725) on PR #8909 inspired me to make this change.

r? anyone

(It is possible that `std::path` itself will soon be replaced with a new implementation that kballard's working on, as mentioned in the dialogue linked above, but this revision is simple enough that I figured I'd offer it up.)
2013-09-04 18:10:45 -07:00
Chris Morgan
da042ce46a Implement Stream automatically for Reader + Writer
This is consistent with the existing documentation but was not the
actual behaviour, which I've found to be rather a nuisance, actually.
2013-09-05 10:52:18 +10:00
Felix S. Klock II
41e7924670 Fix #7740: gather_loans should not recur into the items of the block.
gather_loans does not need to recurse into any items declared in the
current block.  Rather than special-case `fk_item_fn` and `fk_method`,
just make the GatherLoanVisitor's visit_item method a no-op.

This indirectly implies that the example of #7740 is fixed:

    fn f() {
        static A: &'static char = &'A';
    }

Since we do not recurse into items, we no longer encounter `&'A'`.
2013-09-05 02:32:36 +02:00