Commit Graph

16809 Commits

Author SHA1 Message Date
bors
412a07055c auto merge of #5769 : gifnksm/rust/range_step, r=bstrie
`uint::range_step` or `int::range_step` causes overflow or underflow as following.
code:
```rust
fn main() {
    for uint::range_step(3, 0, -2) |n| {
        println(fmt!("%u", n));
    }
}
```
output:
```
3
1
18446744073709551615
18446744073709551613
...
```
This commit fixes this behavior as follows.
```
3
1
```
2013-04-09 07:52:04 -07:00
bors
e56a17879a auto merge of #5788 : danluu/rust/rusti_clear, r=bstrie
The old help text reads "clear the screen", but :clear seems intended to do something completely different. I'm not sure what the intent is. If it's really supposed to clear the screen, not only does it not clear the screen, it does something completely different.

```
rusti> fn foo() { println("called foo!") }
()
rusti> foo();
called foo!
()
rusti> :clear
rusti> foo();
<anon>:34:0: 34:3 error: unresolved name: `foo`.
<anon>:34 foo();
```

Per the contributor guidelines, here's the reason there's no testcase: it's a comment string.
2013-04-09 06:10:01 -07:00
bors
c6a4ba9791 auto merge of #5800 : vivekgalatage/rust/master, r=bstrie
Currently submodules are using the git protocol. Git protocol is blocked
by certain corporate networks which makes it difficult to sync the submodules.

Replacing the git protocol with https in order to sync the submodules.
2013-04-09 05:18:59 -07:00
Vivek Galatage
f9f8a3e72c Support https protocol for git submodules for rust
Currently submodules are using the git protocol. Git protocol is blocked
by certain corporate networks which makes it difficult to sync the submodules.

Replacing the git protocol with https in order to sync the submodules.
2013-04-09 15:45:22 +05:30
Dan Luu
eaa8bbbb2e Fix comment to match style of surrounding text 2013-04-08 23:58:29 -04:00
bors
30dbbe17c9 auto merge of #5787 : alexcrichton/rust/less-mut-fields, r=catamorphism
This removes some of the easier instances of mutable fields where the explicit self can just become `&mut self` along with removing some unsafe blocks which aren't necessary any more now that purity is gone.

Most of #4568 is done, except for [one case](https://github.com/alexcrichton/rust/blob/less-mut-fields/src/libcore/vec.rs#L1754) where it looks like it has to do with it being a `const` vector. Removing the unsafe block yields:

```
/Users/alex/code/rust2/src/libcore/vec.rs:1755:12: 1755:16 error: illegal borrow unless pure: creating immutable alias to const vec content
/Users/alex/code/rust2/src/libcore/vec.rs:1755         for self.each |e| {
                                                           ^~~~
/Users/alex/code/rust2/src/libcore/vec.rs:1757:8: 1757:9 note: impure due to access to impure function
/Users/alex/code/rust2/src/libcore/vec.rs:1757         }
                                                       ^
error: aborting due to previous error
```

I also didn't delve too much into removing mutable fields with `Cell` or `transmute` and friends.
2013-04-08 18:36:57 -07:00
bors
22f65e9852 auto merge of #5786 : JensNockert/rust/u16-debuginfo-typo, r=catamorphism
A small typo in debuginfo.rs related to the u16 type.
2013-04-08 17:34:01 -07:00
bors
786ae0114b auto merge of #5782 : zofrex/rust/doc-1-tuples, r=thestinger
As per [the 0.6 release notes](https://github.com/mozilla/rust/wiki/Doc-detailed-release-notes#06-april-2013) single-element tuples are legal. I spotted a couple of places in the documentation that said otherwise, and propose these changes to them.
2013-04-08 16:22:03 -07:00
Dan Luu
37f17d7204 Update help text to match behavior 2013-04-08 18:25:15 -04:00
Jens Nockert
e06b9827ef Fix typo in u16 debug info 2013-04-08 23:59:00 +02:00
Alex Crichton
255193cc1a Removing no longer needed unsafe blocks 2013-04-08 17:50:25 -04:00
Alex Crichton
3136fba5ae Removing some mutable fields in libstd 2013-04-08 17:50:14 -04:00
bors
1968130885 auto merge of #5763 : thestinger/rust/clone, r=nikomatsakis
Performing a deep copy isn't ever desired for a persistent data
structure, and it requires a more complex implementation to do
correctly. A deep copy needs to check for cycles to avoid an infinite
loop.
2013-04-08 14:12:55 -07:00
Daniel Micay
68d17bca4b clone: managed boxes need to clone by shallow copy
Performing a deep copy isn't ever desired for a persistent data
structure, and it requires a more complex implementation to do
correctly. A deep copy needs to check for cycles to avoid an infinite
loop.
2013-04-08 16:19:12 -04:00
bors
5a0f628501 auto merge of #5777 : lucab/rust/lucab/doc/misc, r=thestinger
A non-code PR to put the AUTHORS.txt file in the released tarball and to update the copyright terms in the rustc manpage as per post-dual-licensing.
2013-04-08 13:09:55 -07:00
bors
913ca088fc auto merge of #5776 : dbaupp/rust/syntax-parse-large-number, r=thestinger
Addresses #5544 and #5770, as well as a comment left in the documentation of `from_str_bytes_common`, so that there is now an option to ignore underscores.
2013-04-08 12:06:58 -07:00
bors
c92936395c auto merge of #5775 : pavpanchekha/rust/patch-1, r=thestinger
Change wrong field name in "Trait Inheritance" section.
2013-04-08 11:10:00 -07:00
bors
2255587f23 auto merge of #5760 : klutzy/rust/vim, r=thestinger
1. disable nested comment which is not supported now
2. add syntax highlight for rustCommentDoc e.g. `/** doc */` or `/// doc`.
2013-04-08 09:34:01 -07:00
Luca Bruno
a5c931cc61 Update license terms in manpage 2013-04-08 10:19:16 +02:00
Luca Bruno
2190efb3ca Put AUTHORS.txt file in the release tarball 2013-04-08 10:15:12 +02:00
Huon Wilson
0c2ceb1a2e libsyntax: fail lexing with an error message on an int literal larger than 2^64.
Stops an ICE.

Closes #5544.
2013-04-08 16:40:40 +10:00
Huon Wilson
41c6f67109 libcore: from_str_common: provide option to ignore underscores.
Implement the possible improvement listed in the comment on
from_str_bytes_common.
2013-04-08 16:35:39 +10:00
Huon Wilson
49cdf36d2b libcore: from_str_common: correctly signal failure on repeating base 2^n numbers.
A number like 0b1_1111_1111 == 511 would be parsed to Some(255u8) rather than None
by from_str_common, since 255 * 2 + 1 == 255 (mod 256) so the overflow wasn't detected.

Only applied to conversions where the radix was a power of 2, and where all digits
repeated.

Closes #5770.
2013-04-08 16:35:39 +10:00
Pavel Panchekha
c6d6782906 Fixed typo
Change wrong field name in "Trait Inheritance" section.
2013-04-07 23:19:31 -03:00
zofrex
ac9e694d59 Update manual for single-element tuple types 2013-04-07 22:08:40 +01:00
zofrex
d1e2d295f8 Update manual for single-element tuples 2013-04-07 22:08:34 +01:00
zofrex
621d45b341 Update tutorial: 1-tuples now exist 2013-04-07 22:08:23 +01:00
gifnksm
89676d6a59 libcore: fix overflow/underflow in range_step 2013-04-07 19:55:58 +09:00
klutzy
fc26911b49 vim: fix comment highlighting bug
Previous commit had a bug that a line which ends with "//" or "/*"
is not correctly highlighted.
2013-04-07 14:30:50 +09:00
bors
5641777318 auto merge of #5756 : gifnksm/rust/bigint-impl, r=thestinger
Implements TotalEq, TotalOrd, FromStrRadix, ToStrRadix for BigUint, BigInt.
2013-04-06 22:12:51 -07:00
gifnksm
eebf29ed37 Impl cmp/num traits for BigUint, BigInt
TotalEq, TotalOrd, FromStrRadix, ToStrRadix.
2013-04-07 13:28:17 +09:00
klutzy
7c2a8c4ac2 vim: add rustCommentDoc 2013-04-07 04:32:05 +09:00
klutzy
38fe5aa070 vim: disable nested comment
Since comment nesting does not work from 0.4.
2013-04-07 04:25:54 +09:00
bors
44d4d6de76 auto merge of #5757 : dbaupp/rust/rustc-fixed-vector-pprint, r=thestinger
Currently error messages say ``mismatched types: expected `uint` but found `[uint * 10]` (expected uint but found vector)`` rather than `[uint, .. 10]`.
2013-04-06 02:12:45 -07:00
bors
77eadc0653 auto merge of #5755 : catamorphism/rust/rustllvm-cmdline, r=brson
r? @brson In my WIP on rustpkg, I was calling driver code that calls
LLVMRustWriteOutputFile more than once. This was making LLVM
unhappy, since that function has code that initializes the
command-line options for LLVM, and I guess you can't do that more
than once. So, check if they've already been initialized.
2013-04-06 01:09:48 -07:00
bors
d09835d2e3 auto merge of #5751 : metajack/rust/at-clones, r=thestinger
The borrowck-borrow-from-expr-block test had to be updated. I'm not sure why
it compiled before since ~int was already clonable.
2013-04-06 00:06:47 -07:00
bors
28527ce8a2 auto merge of #5740 : nikomatsakis/rust/issue-5739-reborrowed-slices, r=catamorphism
r? @catamorphism (just the last commit)

This is a minor patch to #3184 (which you also reviewed), needed for #5656
2013-04-05 22:54:49 -07:00
bors
bdd2439529 auto merge of #5733 : dbaupp/rust/std-complex-rational, r=thestinger
This adds two generic data types, `Ratio` and `Cmplx` (and some aliases for useful instances, e.g. `Ratio<int>` and `Cmplx<f64>`), and basic arithmetic support, as well as `.to_str` (for both) and `.from_str` (for rational).

The complex number implementation doesn't solve #1284 other than getting something into the libraries, specifically it doesn't even try to address C interop. If the complex part of this gets merged, maybe it's worth closing that issue and reopening more specific issue(s) about the failings.

The implementations can be fleshed out when the numeric traits stabilise (and trait inheritance works).
2013-04-05 22:00:50 -07:00
bors
f678d63507 auto merge of #5732 : Zhann/rust/master, r=catamorphism
an executable vs a executable
2013-04-05 20:33:51 -07:00
Huon Wilson
28f0782260 librustc: use new [ty, .. len] syntax for fixed vector errors. 2013-04-06 13:27:27 +11:00
bors
614d6da828 auto merge of #5721 : dhardy/rust/master, r=graydon
This is some stuff which seemed to be missing to me (though I haven't read everything yet so hope I haven't missed the relevant section).

A similar addition for borrowing handles is needed, but #5720 stumped me.

Comments welcome.
2013-04-05 18:54:52 -07:00
bors
08e2cf846a auto merge of #5676 : nikomatsakis/rust/issue-4183-trait_ref, r=nikomatsakis
These are a number of incremental steps towards #4183 and #4646.
2013-04-05 18:00:52 -07:00
Tim Chevalier
d6f455ebca rustllvm: Only initialize command-line arguments once
In my WIP on rustpkg, I was calling driver code that calls
LLVMRustWriteOutputFile more than once. This was making LLVM
unhappy, since that function has code that initializes the
command-line options for LLVM, and I guess you can't do that more
than once. So, check if they've already been initialized.
2013-04-05 17:18:26 -07:00
Jack Moffitt
d375171fd4 Move tests inside clone.rs and fixed copyright headers. 2013-04-05 17:51:43 -06:00
Jack Moffitt
b22a06000d Implement Clone for @ and @mut types.
The borrowck-borrow-from-expr-block test had to be updated. I'm not sure why
it compiled before since ~int was already clonable.
2013-04-05 16:41:47 -06:00
Diggory Hardy
e2a6feb8fe Tutorial: spelling correction and move a failing test to an xfail-test marked code block. 2013-04-05 12:26:47 +02:00
Niko Matsakis
fd8f56efab Link lifetimes of autoslice'd vectors (Issue #3184)
Fixes #5739.
2013-04-05 06:00:54 -04:00
Niko Matsakis
13801f60b2 rustc: Be careful about calls to fn types that contain nested errors 2013-04-05 05:36:03 -04:00
Niko Matsakis
d7163985b8 Add comment explaining method visibility 2013-04-05 05:36:03 -04:00
Niko Matsakis
2a44a1bd97 Fix various warnings, NOTEs, etc 2013-04-05 05:36:03 -04:00