Commit Graph

43664 Commits

Author SHA1 Message Date
bors
19a39710c4 Auto merge of #26028 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #25925, #26001, #26010, #26011, #26017, #26020
- Failed merges:
2015-06-05 11:59:34 +00:00
Steve Klabnik
eb6a70cbab Rollup merge of #26020 - frewsxcv:patch-24, r=steveklabnik 2015-06-05 11:20:29 +02:00
Steve Klabnik
e0f6ed8595 Rollup merge of #26017 - Stebalien:fix-rustdoc, r=alexcrichton
rust-example-rendered should be a class, not an id.

fixes #26013
2015-06-05 11:20:28 +02:00
Steve Klabnik
c0d8be4094 Rollup merge of #26011 - genodeftest:patch-1, r=steveklabnik 2015-06-05 11:20:28 +02:00
Steve Klabnik
f1dd27524a Rollup merge of #26010 - ranma42:improve-doc, r=steveklabnik
The statement is not completely exact, because it is valid to have
both 0 non-mutable references and 1 mutable reference. Instead, use
the same wording as in mutability.md.
2015-06-05 11:20:28 +02:00
Steve Klabnik
0571726d90 Rollup merge of #26001 - sae-bom:master, r=alexcrichton
fixed build fail on aarch64-android
by support aarch64-android raw type definitions
2015-06-05 11:20:28 +02:00
Steve Klabnik
2bcb07933f Rollup merge of #25925 - azerupi:patch-4, r=steveklabnik
Hi

I added a little section in the for loops about the `enumerate()` function.
I think it's useful for beginners to know this function and how you can use it. 

I used the title loopcounter, but it's probably not the best word to describe it. So let me know if there is a better word :)
2015-06-05 11:20:28 +02:00
bors
ef72938a8b Auto merge of #26008 - Marwes:arc_rc_as_ref, r=alexcrichton
The implementations are straightforward, I only hope I got the stability attributes correct(?).
2015-06-05 08:30:33 +00:00
bors
d95df9a3a9 Auto merge of #26004 - alexcrichton:msvc-llvm-assertions, r=brson
If LLVM assertions are enabled for MSVC, it looks like the output directory is
still just `Release` (or assertions are just always ignored on MSVC).
2015-06-05 05:11:01 +00:00
James Miller
beadbfd194 Mark std::as_bytes as inline
This wasn't marked inline, so wasn't being inlined cross-crate. It's
actually a no-op function, since it's a wrapper around `mem::transmute`.
Marking it inline means that programs calling it can see that it's a
no-op and act accordingly during optimisation.
2015-06-05 13:53:55 +12:00
bors
da0d45243b Auto merge of #26022 - Gankro:fix-linked-list, r=huonw
Still running tests...
2015-06-05 01:10:59 +00:00
Alexis Beingessner
e12d3869e3 properly null out ptr in LinkedList::split_off - fixes #26020 2015-06-04 18:01:27 -07:00
Ariel Ben-Yehuda
595409df06 Introduce a fast-path for type_is_sized/type_moves_by_default
This seems to improve performance by the same 2-3% of my selection
fast-path.
2015-06-05 03:50:49 +03:00
Corey Farwell
536c244be3 Doc-comment fix; trait names are capitalized 2015-06-04 19:45:43 -04:00
Steven Allen
4c5029a600 Fix order of rustdoc arguments.
rust-example-rendered should be a class, not an id.

fixes #26013
2015-06-04 18:03:51 -04:00
bors
e0ca6b1a31 Auto merge of #25975 - arielb1:remove-param-space, r=nikomatsakis
r? @nikomatsakis
2015-06-04 21:48:58 +00:00
bors
20cf4cf62c Auto merge of #25985 - bombless:patch-2, r=alexcrichton
nNumberOfBytesToRead --> nNumberOfBytesToWrite
lpNumberOfBytesRead --> lpNumberOfBytesWritten
LPVOID --> LPCVOID

See <https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747(v=vs.85).aspx>
2015-06-04 18:32:43 +00:00
bors
dd81d1ebd9 Auto merge of #26005 - Ms2ger:get_enum_variant_defs, r=Aatch 2015-06-04 14:57:18 +00:00
Christian Stadelmann
2abffd55db [Documentation: Macros] Use some more SSL 2015-06-04 15:53:22 +02:00
York Xiang
dc15a523e5 crate libc: Correct signature of WriteFile 2015-06-04 21:45:35 +08:00
Christian Stadelmann
3c0165d59f [Documentation] Use SSL where possible 2015-06-04 15:44:30 +02:00
Andrea Canciani
2b13b45058 Minor fix to docs of constraints on mut/non-mut references
The statement is not completely exact, because it is valid to have
both 0 non-mutable references and 1 mutable reference. Instead, use
the same wording as in mutability.md.
2015-06-04 15:14:09 +02:00
Markus Westerlind
7f3ae0aa26 Added AsRef implementations for Arc and Rc 2015-06-04 14:35:04 +02:00
bors
52e530af4c Auto merge of #25981 - nham:fix_E0201, r=alexcrichton
It seems better to use "associated function" here. Methods are associated functions that take a `self` parameter.
2015-06-04 11:48:58 +00:00
bors
0aeb9f6f08 Auto merge of #26002 - Manishearth:rollup, r=Manishearth
- Successful merges: #25900, #25987, #25988, #25990, #25994, #26000
- Failed merges:
2015-06-04 08:42:22 +00:00
Ms2ger
f2cca31e3d Inline enum_variant_ids into its only caller. 2015-06-04 10:12:19 +02:00
bors
80d08a37b6 Auto merge of #25991 - Jexell:master, r=alexcrichton
Removed an unnecessary `transmute` and replaced some code with an equivalent method.
2015-06-04 06:08:42 +00:00
Manish Goregaokar
fd3b6ca508 Fix doctest (fixup –#25900) 2015-06-04 11:26:31 +05:30
Sae-bom Kim
62f66a68da support aarch64-android raw type definitions 2015-06-04 14:25:05 +09:00
Alex Crichton
3d74fbd496 configure: Fix LLVM output dir on MSVC
If LLVM assertions are enabled for MSVC, it looks like the output directory is
still just `Release` (or assertions are just always ignored on MSVC).
2015-06-03 22:08:47 -07:00
Manish Goregaokar
5ef7614243 Rollup merge of #26000 - heejongahn:master, r=alexcrichton
Added missing '>' at the end of my email address :)
2015-06-04 10:07:03 +05:30
Manish Goregaokar
71d33cd115 Rollup merge of #25994 - marcusklaas:issue-25969, r=huonw
Issue: https://github.com/rust-lang/rust/issues/25969

Compare the span on the stable branch (correct) with the span on the nightly branch (incorrect) for the following example: http://is.gd/lTAo9c. This pull request fixes the regression.

@Manishearth has been kind enough to pitch some ideas for a regression test, mainly revolving around testing the span in compile-fail test, but this has proven unsuccessful. Other suggestions/ ideas would be much appreciated!
2015-06-04 10:07:03 +05:30
Manish Goregaokar
8b57130e84 Rollup merge of #25990 - carols10cents:try-docs, r=nikomatsakis
The API documentation is not explicit enough that because `try!` returns
`Err` early for you, you can only use it in functions that return
`Result`. The book mentions this, but if you come across `try!` outside
of the book and look it up in the docs, this restriction on the return
type of the function is not particularly clear.

I seriously had this epiphany a few days ago after working with Rust for MONTHS, and after seeing [a friend have to come to the same realization](http://joelmccracken.github.io/entries/a-simple-web-app-in-rust-pt-2a/), I'd like to save more people from this confusion :) 💖
2015-06-04 10:07:02 +05:30
Manish Goregaokar
5421b1fa25 Rollup merge of #25988 - webmobster:master, r=alexcrichton
The priority policy of RWLock is not specified, and the fact there is no policy should probably be specified.
2015-06-04 10:07:02 +05:30
Manish Goregaokar
8a39dffa7f Rollup merge of #25987 - pnkfelix:fix-dropck-doc-formatto, r=Manishearth
Fix the dropck doc formatting to avoid hitting four-space indent.

This was causing `rustdoc` to interpret the part starting with `(A.) ...` as a code block based on its four-space indentation, which then was treated by `rustdoc` as a *Rust* code snippet, and thus was attempting (and failing) to parse my english as Rust code. Thus causing the compiler-docs build to fail.

Independently, we should probably change `rustdoc` to not interpret four-space indents as code that needs to be tested; it seems too perilous to me at least.

(But the formatting here needed to be changed either way.)

cc Issue #25699.
2015-06-04 10:07:02 +05:30
Manish Goregaokar
8c2806caae Rollup merge of #25900 - lorenzb:more_about_types, r=nikomatsakis
My main sources of information are [RFC401](https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md), the rust IRC channel, and a bunch of experiments to figure out what `rustc` currently supports.
Note that the RFC calls for some coercion behaviour that is not implemented yet (see #18469).
The documentation in this PR mostly covers current behaviour of rust and doesn't document the future behaviour. I haven't written about receiver expression coercion.

I would be happy to rewrite/adapt the PR according to feedback.

r? @steveklabnik
2015-06-04 10:07:02 +05:30
Heejong Ahn
bc3d50d684 Typo fixed in AUTHORS.txt
Added '>' at the end of my email address
2015-06-04 13:20:27 +09:00
bors
06c6b3caaf Auto merge of #25743 - michaelsproul:match-diagnostics, r=nrc
Part of #24407.

Currently the diagnostics for range patterns are a bit wrong:

```rust
fn main() {
    match 5u32 {
        0 ... 10 => (),
        'a' ... 10 => (),
        10 ... 'z' => (),
        "what" ... 10 => (),
        "what" ... "well" => (),
        10 ... "what" => ()
    }
}
```

```
range.rs:4:9: 4:19 error: mismatched types in range:
 expected integral variable,
    found char [E0211]
range.rs:4         'a' ... 10 => (),
                   ^~~~~~~~~~
range.rs:4:9: 4:16 error: only char and numeric types are allowed in range [E0029]
range.rs:4         'a' ... 10 => (),
                   ^~~~~~~
range.rs:4:9: 4:19 error: mismatched types:
 expected `u32`,
    found `char`
(expected u32,
    found char) [E0308]
range.rs:4         'a' ... 10 => (),
                   ^~~~~~~~~~
range.rs:5:9: 5:19 error: mismatched types in range:
 expected char,
    found integral variable [E0211]
range.rs:5         10 ... 'z' => (),
                   ^~~~~~~~~~
range.rs:5:9: 5:15 error: only char and numeric types are allowed in range [E0029]
range.rs:5         10 ... 'z' => (),
                   ^~~~~~
range.rs:6:9: 6:22 error: mismatched types in range:
 expected integral variable,
    found &-ptr [E0211]
range.rs:6         "what" ... 10 => (),
                   ^~~~~~~~~~~~~
range.rs:6:9: 6:19 error: only char and numeric types are allowed in range [E0029]
range.rs:6         "what" ... 10 => (),
                   ^~~~~~~~~~
range.rs:6:9: 6:22 error: mismatched types:
 expected `u32`,
    found `&'static str`
(expected u32,
    found &-ptr) [E0308]
range.rs:6         "what" ... 10 => (),
                   ^~~~~~~~~~~~~
range.rs:7:9: 7:19 error: only char and numeric types are allowed in range [E0029]
range.rs:7         "what" ... "well" => (),
                   ^~~~~~~~~~
range.rs:7:9: 7:26 error: mismatched types:
 expected `u32`,
    found `&'static str`
(expected u32,
    found &-ptr) [E0308]
range.rs:7         "what" ... "well" => (),
                   ^~~~~~~~~~~~~~~~~
range.rs:8:9: 8:22 error: mismatched types in range:
 expected &-ptr,
    found integral variable [E0211]
range.rs:8         10 ... "what" => ()
                   ^~~~~~~~~~~~~
range.rs:8:9: 8:15 error: only char and numeric types are allowed in range [E0029]
range.rs:8         10 ... "what" => ()
                   ^~~~~~
error: aborting due to 12 previous errors
```

The problems here are:

1. The type of the end of the range is used to predict the type of the start (only mildly counter intuitive).
2. E0029 is erroneously generated for `char ... num` and `num ... char`.
2. `u32` is mentioned.
3. Errors which are essentially the same are reported multiple times.

I've attempted to fix this by checking the requirements in a different order. The output I've achieved for the above example is:

```
/home/michael/Temp/range.rs:4:17: 4:22 error: mismatched types in range:
 expected char,
    found integral variable [E0211]
/home/michael/Temp/range.rs:4         'a' ... 10 => (),
                                              ^~~~~
/home/michael/Temp/range.rs:5:16: 5:22 error: mismatched types in range:
 expected integral variable,
    found char [E0211]
/home/michael/Temp/range.rs:5         10 ... 'z' => (),
                                             ^~~~~~
/home/michael/Temp/range.rs:6:9: 6:19 error: only char and numeric types are allowed in range [E0029]
/home/michael/Temp/range.rs:6         "what" ... 10 => (),
                                      ^~~~~~~~~~
/home/michael/Temp/range.rs:6:9: 6:19 help: run `rustc --explain E0029` to see a detailed explanation
/home/michael/Temp/range.rs:6:9: 6:19 note: Start type: &'static str
End type: _
/home/michael/Temp/range.rs:6         "what" ... 10 => (),
                                      ^~~~~~~~~~
/home/michael/Temp/range.rs:7:9: 7:26 error: only char and numeric types are allowed in range [E0029]
/home/michael/Temp/range.rs:7         "what" ... "well" => (),
                                      ^~~~~~~~~~~~~~~~~
/home/michael/Temp/range.rs:7:9: 7:26 help: run `rustc --explain E0029` to see a detailed explanation
/home/michael/Temp/range.rs:7:9: 7:26 note: Start type: &'static str
End type: &'static str
/home/michael/Temp/range.rs:7         "what" ... "well" => (),
                                      ^~~~~~~~~~~~~~~~~
/home/michael/Temp/range.rs:8:16: 8:25 error: only char and numeric types are allowed in range [E0029]
/home/michael/Temp/range.rs:8         10 ... "what" => ()
                                             ^~~~~~~~~
/home/michael/Temp/range.rs:8:16: 8:25 help: run `rustc --explain E0029` to see a detailed explanation
/home/michael/Temp/range.rs:8:16: 8:25 note: Start type: _
End type: &'static str
/home/michael/Temp/range.rs:8         10 ... "what" => ()
                                             ^~~~~~~~~
error: aborting due to 5 previous errors
```

I think this is already tonnes better, but the `Start type/End type` stuff could be neater. I don't think there's really any need to start a `note:` block but I wanted to get some feedback on this. I'd also appreciate advice on how to print the integer types as something other than `_`.
2015-06-04 01:02:41 +00:00
Marcus Klaas
0000d4c62a Fix span for ExprPath variants 2015-06-04 02:40:12 +02:00
Alex Crichton
cb7d914880 mk: Compile C code on MSVC with /MD
On MSVC there are two ways that the CRT can be linked, either statically or
dynamically. Each object file produced by the compiler is compiled against
msvcrt (a dll) or libcmt (a static library). When the linker is dealing with
more than one object file, it requires that all object files link to the same
CRT, or else the linker will spit out some errors.

For now, compile code with `-MD` as it seems to appear more often in C libraries
so we'll stick with the same trend.
2015-06-03 15:24:35 -07:00
bors
fe107b360e Auto merge of #25959 - pnkfelix:fsk-hack-move-val-init, r=nikomatsakis
Hack the move_val_init intrinsic to trans directly into the destination address.

This is to remove an intermediate (and unnecessary) alloca on the stack that one otherwise suffers when using this intrinsic.

This is part of the `box` protocol work; in particular, this is meant to address the `ptr::write` codegen issues alluded to at this comment: 

  https://github.com/rust-lang/rust/pull/22086#issuecomment-96168675

cc #22181
2015-06-03 21:46:21 +00:00
Ariel Ben-Yehuda
4b116fe38c Use a plain Vec instead of VecPerParamSpace in trait selection. 2015-06-04 00:19:18 +03:00
bors
b70f49b86f Auto merge of #24910 - steveklabnik:remove_static_assert, r=alexcrichton
This was always a weird feature, and isn't being used in the compiler.
Static assertions should be done better than this.

Fixes #13951
Fixes #23008
Fixes #6676

This is behind a feature gate, but that's still a

[breaking-change]

(It's not entirely clear to me that this should or shouldn't have an RFC, but if it does, I'm fine blocking on such a thing.)
2015-06-03 18:21:09 +00:00
webmobster
24808fa076 Add priority policy to RWLock API Documentation 2015-06-03 18:55:52 +01:00
Carol Nichols
c692d75b5a Indent 4 spaces instead of 2 2015-06-03 13:23:55 -04:00
Carol Nichols
80322e2e97 Return Ok(()) instead of Ok() 2015-06-03 13:23:40 -04:00
Carol Nichols
a41fd590a8 Use write_all instead of write_line 2015-06-03 13:23:20 -04:00
Carol Nichols
d328d6472e Add prelude to get Write 2015-06-03 13:15:50 -04:00
Ms2ger
53897baec8 Remove unused get_enum_variant_defs functions. 2015-06-03 18:58:26 +02:00
Jexell
7972a000e3 Update linked_list.rs
Removed an unnecessary `transmute` and replaced some code with an equivalent method.
2015-06-03 16:14:35 +01:00