Commit Graph

31804 Commits

Author SHA1 Message Date
bors
e2273d9456 auto merge of #16081 : luqmana/rust/nr, r=pcwalton
Fixes #15763
2014-08-12 18:16:33 +00:00
Patrick Walton
857ba988f1 libsyntax: Don't strip types and lifetimes from single-segment paths in
patterns.

This breaks code like:

    fn main() {
        match Some("foo") {
            None::<int> => {}
            Some(_) => {}
        }
    }

Change this code to not contain a type error. For example:

    fn main() {
        match Some("foo") {
            None::<&str> => {}
            Some(_) => {}
        }
    }

Closes #16353.

[breaking-change]
2014-08-12 10:33:16 -07:00
Steve Klabnik
5eb4e1a659 ~ -> Box in the manual
Fixes #16439
2014-08-12 07:58:36 -04:00
bors
c7d0b5259d auto merge of #16434 : vadimcn/rust/many-crates-but-no-match, r=alexcrichton 2014-08-12 09:31:17 +00:00
bors
c1eaafe8ab auto merge of #16425 : nham/rust/fix_nan_format, r=alexcrichton
Currently, this:

    println!("{}", std::f64::NAN);

prints "-NaN". This commit is an attempt to change that to "NaN" instead.
2014-08-12 07:31:17 +00:00
Vadim Chugunov
1b2dc760af Replace "ignore-win32" in tests with "ignore-windows" 2014-08-12 00:14:00 -07:00
Bheesham Persaud
a43dadb204 Minor changes to rust.md, and guide-ffi.md.
* `rust.md`: whanges for consistency

  * `guide-ffi.md`: wrapped inline code
2014-08-12 03:13:50 -04:00
Vadim Chugunov
3dfd12967a Replace #[cfg(target_os = "win32")] with #[cfg(target_os = "windows")] 2014-08-12 00:13:43 -07:00
Vadim Chugunov
98332b1a06 Replace all references to "Win32" with "Windows".
For historical reasons, "Win32" has been used in Rust codebase to mean "Windows OS in general".
This is confusing, especially now, that Rust supports Win64 builds.

[breaking-change]
2014-08-12 00:10:26 -07:00
Philipp Gesang
2c7ef330fc
guide-unsafe.md: fix noun 2014-08-12 07:39:57 +02:00
Philipp Gesang
c2bf0ed4dd
guide-testing.md: add auxiliary verb 2014-08-12 07:39:56 +02:00
Philipp Gesang
b8f512d220
guide-runtime.md: remove redundant verb 2014-08-12 07:39:53 +02:00
bors
e8204a84c7 auto merge of #16195 : P1start/rust/more-index, r=aturon
Implement `Index` for `RingBuf`, `HashMap`, `TreeMap`, `SmallIntMap`, and `TrieMap`.

If there’s anything that I missed or should be removed, let me know.
2014-08-12 05:11:18 +00:00
Luqman Aden
71e19d5286 librustc: Don't use an alloca per return if the function doesn't have nested returns. 2014-08-11 21:53:54 -07:00
P1start
8f71cb06bc Implement Index for TrieMap 2014-08-12 15:33:05 +12:00
P1start
11b8f9c3f6 Implement Index for SmallIntMap
This also deprecates SmallIntMap::get. Use indexing instead.
2014-08-12 15:33:05 +12:00
P1start
2dd6bc6887 Implement Index for TreeMap 2014-08-12 15:33:05 +12:00
P1start
32f5898bea Implement Index for HashMap
This also deprecates HashMap::get. Use indexing instead.
2014-08-12 15:33:05 +12:00
P1start
fd10d209cd Implement Index for RingBuf
This also deprecates RingBuf::get. Use indexing instead.
2014-08-12 15:32:56 +12:00
bors
49a970f244 auto merge of #16284 : alexcrichton/rust/issue-16272, r=aturon
There was a bug in both libnative and libuv which prevented child processes from
being spawned correctly on windows when one of the arguments was an empty
string. The libuv bug has since been fixed upstream, and the libnative bug was
fixed as part of this commit.

When updating libuv, this also includes a fix for #15149.

Closes #15149
Closes #16272
2014-08-12 03:31:20 +00:00
nham
04233a1675 Change std::fmt::{Float,LowerExp,UpperExp} to not print '-NaN' for f32::NAN and f64::NAN 2014-08-11 22:24:01 -04:00
Luqman Aden
0ad97c042a librustc: Don't use Load/Store for structural values. 2014-08-11 19:20:11 -07:00
Luqman Aden
5aedcb1e91 librustc: Don't allow return_address intrinsic in functions that don't use an out pointer. 2014-08-11 19:20:10 -07:00
Patrick Walton
9dac85f92d librustc: Add an intrinsic to retrieve the return pointer of a function.
This is needed for some GC stuff in Servo.
2014-08-11 19:20:10 -07:00
Luqman Aden
d302813888 Reenable ignored test and add run-pass test. 2014-08-11 19:20:10 -07:00
Luqman Aden
68cbd6c929 librustc: Use separate stack slot for each return. 2014-08-11 19:20:10 -07:00
Vadim Chugunov
06d44aaad3 Fix many-crates-but-no-match test. (Issue #16348) 2014-08-11 18:41:47 -07:00
bors
9dcf89567e auto merge of #16417 : jasonthompson/rust/docs/slice3, r=alexcrichton
- Moved examples for permutations and next into trait definition as
   comments on pull request #16244.
- Fixed (hopefully) issue with erronious commit of changes to src/llvm.
2014-08-12 00:26:13 +00:00
bors
9e191cdf3c auto merge of #16427 : brson/rust/https, r=thestinger 2014-08-11 22:46:16 +00:00
bors
15833d91ac auto merge of #16429 : steveklabnik/rust/guide_vectors, r=cmr
Since https://github.com/rust-lang/rust/pull/16380 didn't get pulled in yet, I added it in here too.

This covers the very, very, very basics of vectors. I wanted to have a section that mentioned them, but I'm
unsure what else I should cover. So I just did the absolute simplest things. Feedback very welcome.
2014-08-11 20:31:20 +00:00
Steve Klabnik
8175cba597 Guide: vectors 2014-08-11 16:21:41 -04:00
Brian Anderson
4e0a992845 Download snapshots using HTTPS
cc #16123
2014-08-11 12:31:24 -07:00
Brian Anderson
21a70b38ba Update docs to use HTTPS for static.rust-lang.org addresses
cc #16123
2014-08-11 12:31:16 -07:00
mdinger
2867d1f24a Sort most attributes alphabetically 2014-08-11 15:29:44 -04:00
bors
6faad3ec3a auto merge of #16416 : nick29581/rust/log, r=pnkfelix
Previously we would accept an empty log level without an equals sign, but not with one. This addresses that minor nit. E.g., `RUST_LOG=rustc::middle::trans=` will work the same as `RUST_LOG=rustc::middle::trans`.
2014-08-11 11:06:08 +00:00
Jason Thompson
371e8cf273 API docs/examples for std::slice
- API doc/example for next() in Permutations
 - API doc/example for permutations() in ImmutableCloneableVector
 - Moved examples for permutations and next into trait definition as
   comments on pull request #16244.
 - Fix erroneus inclusion of src/llvm in older commit.
2014-08-11 06:49:00 -04:00
Nick Cameron
81241dce80 Accept empty log level 2014-08-11 11:13:27 +01:00
bors
5e720f0e54 auto merge of #16196 : huonw/rust/fail-dead-code, r=alexcrichton
The fail macro defines some function/static items internally, which got
a dead_code warning when `fail!()` is used inside a dead function. This
is ugly and unnecessarily reveals implementation details, so the
warnings can be squashed.

Fixes #16192.
2014-08-11 09:01:06 +00:00
Huon Wilson
07aadc2e8b core/std: squash dead_code warnings from fail! invocations.
The fail macro defines some function/static items internally, which got
a dead_code warning when `fail!()` is used inside a dead function. This
is ugly and unnecessarily reveals implementation details, so the
warnings can be squashed.

Fixes #16192.
2014-08-11 18:26:31 +10:00
bors
9c772cd391 auto merge of #16379 : parir/rust/guide-typos, r=kballard
This PR fixes some minor grammar and spelling issues in the guide.
2014-08-11 07:11:07 +00:00
bors
e7a5e8ff3b auto merge of #16399 : superlogical/rust/patch-2, r=steveklabnik 2014-08-11 05:21:10 +00:00
Peer Aramillo Irizar
9151599ec8 Fix some minor issues in the guide. 2014-08-11 07:12:22 +02:00
bors
4d27b4875e auto merge of #15410 : LemmingAvalanche/rust/patch-1, r=alexcrichton
People reading the tutorial may not be familiar with the convention of naming lists, vectors and the like as xs, ys, etc. Without some explanation of the reasoning behind it, it might come off as just throwaway non-descriptive names. Languages like Haskell gets flak from using short, non-descriptive names, while in reality, there are clear conventions and reasons for using certain terse variable names. 

This is just a proposed explanation of this convention, as I've interpreted it - I assumed that the convention came from a language like Haskell, so I tailored it according to that. So beware that I might have misjudged how it is used in the Rust language, or at least how it is used in the Rust tutorial.
2014-08-11 03:36:11 +00:00
bors
c4a63fabe3 auto merge of #16182 : jbcrail/rust/fix-test-comments, r=sfackler 2014-08-10 21:56:11 +00:00
LemmingAvalanche
14e245bd47 Note naming convention of lists (xs, ys, ...)
People reading the tutorial may not be familiar with the convention of naming lists, vectors and the like as xs, ys, etc. Without some explanation of the reasoning behind it, it might come off as just throwaway non-descriptive names. Languages like Haskell gets flak from using short, non-descriptive names, while in reality, there are clear conventions and reasons for using certain terse variable names.

I assumed that the convention came from a language like Haskell, so I
tailored the explanation according to that.
2014-08-10 22:51:22 +02:00
bors
23276f9dfe auto merge of #16400 : chuckries/rust/patch-1, r=huonw
These are already coded as traits.
2014-08-10 15:46:13 +00:00
bors
69c58bcf6f auto merge of #16185 : luqmana/rust/match-drop, r=pcwalton
Fixes #15571.
Fixes #16151.

r? @pcwalton
2014-08-10 13:56:16 +00:00
Huon Wilson
f3d88c320d lint: dead_code ignores items with leading underscores.
This generalises the behaviour with struct fields (which recieve no
dead_code warning if they have a leading _), and other similar lints, to
all items, e.g. `fn _foo() {} fn main() {}` has no warnings.
2014-08-10 22:49:41 +10:00
Chuck Ries
0e47f9481e remove outdated comment
These are already coded as traits.
2014-08-10 04:11:33 -07:00
bors
d4d608fabd auto merge of #16395 : superlogical/rust/patch-1, r=alexcrichton 2014-08-10 08:56:15 +00:00