summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2015-06-03configure: Fix LLVM output dir on MSVCAlex Crichton-10/+15
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-04Rollup merge of #26000 - heejongahn:master, r=alexcrichtonManish Goregaokar-1/+1
Added missing '>' at the end of my email address :)
2015-06-04Rollup merge of #25994 - marcusklaas:issue-25969, r=huonwManish Goregaokar-2/+1
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-04Rollup merge of #25990 - carols10cents:try-docs, r=nikomatsakisManish Goregaokar-2/+31
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 :) :sparkling_heart:
2015-06-04Rollup merge of #25988 - webmobster:master, r=alexcrichtonManish Goregaokar-0/+4
The priority policy of RWLock is not specified, and the fact there is no policy should probably be specified.
2015-06-04Rollup merge of #25987 - pnkfelix:fix-dropck-doc-formatto, r=ManishearthManish Goregaokar-7/+5
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-04Rollup merge of #25900 - lorenzb:more_about_types, r=nikomatsakisManish Goregaokar-0/+140
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-04Typo fixed in AUTHORS.txtHeejong Ahn-1/+1
Added '>' at the end of my email address
2015-06-04Auto merge of #25743 - michaelsproul:match-diagnostics, r=nrcbors-71/+147
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-04Fix span for ExprPath variantsMarcus Klaas-2/+1
2015-06-03mk: Compile C code on MSVC with /MDAlex Crichton-2/+2
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-03Auto merge of #25959 - pnkfelix:fsk-hack-move-val-init, r=nikomatsakisbors-16/+236
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-04Use a plain Vec instead of VecPerParamSpace in trait selection.Ariel Ben-Yehuda-154/+62
2015-06-03Auto merge of #24910 - steveklabnik:remove_static_assert, r=alexcrichtonbors-130/+0
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-03Add priority policy to RWLock API Documentationwebmobster-0/+4
2015-06-03Indent 4 spaces instead of 2Carol Nichols-2/+2
2015-06-03Return Ok(()) instead of Ok()Carol Nichols-2/+2
2015-06-03Use write_all instead of write_lineCarol Nichols-2/+2
2015-06-03Add prelude to get WriteCarol Nichols-0/+1
2015-06-03Remove unused get_enum_variant_defs functions.Ms2ger-25/+0
2015-06-03Update linked_list.rsJexell-5/+3
Removed an unnecessary `transmute` and replaced some code with an equivalent method.
2015-06-03Auto merge of #25966 - pelmers:save-api, r=nrcbors-81/+98
Move EnumData into the API, and change a few spots where we use &String[..] when it is equivalent to &String. r? @nrc
2015-06-03Improve `try!` docs to make clearer it returns `Result`.Carol Nichols-2/+30
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.
2015-06-03Remove #[static_assert]Steve Klabnik-130/+0
This was always a weird feature, and isn't being used in the compiler. Static assertions should be done better than this. This implements RFC #1096. Fixes #13951 Fixes #23008 Fixes #6676 This is behind a feature gate, but that's still a [breaking-change]
2015-06-03Fix the dropck doc formatting to avoid hitting four-space indent.Felix S. Klock II-7/+5
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-03Auto merge of #25984 - Manishearth:rollup, r=Manishearthbors-23/+12
- Successful merges: #25939, #25963, #25970, #25971, #25974 - Failed merges:
2015-06-03Rollup merge of #25974 - richo:stack-msg, r=alexcrichtonManish Goregaokar-8/+4
These are implemented in asm, they're just not inlined. Open questions are: * Should I just inline them? They're.. big, but it seems as though this needs violates the #[inline(always)] gaurantees the others make. * Does something (llvm?) provide these as intrinsics? The structure of this code suggests that we could be hoisting off something else, instead of flagrantly ignoring it like we do for power and mips.
2015-06-03Rollup merge of #25971 - richo:configurable-python, r=alexcrichtonManish Goregaokar-1/+4
r? @alexcrichton
2015-06-03Rollup merge of #25970 - gkoz:make_compiler_docs, r=brsonManish Goregaokar-1/+1
2015-06-03Rollup merge of #25963 - steveklabnik:link_to_cell, r=alexcrichtonManish Goregaokar-1/+3
2015-06-03Rollup merge of #25939 - wca:fix-freebsd-configure, r=alexcrichtonManish Goregaokar-12/+0
Bug fixes for configure on FreeBSD: - Don't ban using gcc; newer versions can be installed and other checks should enforce its suitability. - Don't force Rust to link itself with /usr/local/lib{,gcc4[46]}, which causes builds to fail if Rust is already installed. I've not been able to find an use case where this is actually necessary.
2015-06-03Make E0201 detect when duplicate function is a method.Nick Hamann-5/+9
2015-06-03Improve diagnostic messages for range patterns.Michael Sproul-71/+147
2015-06-03Auto merge of #25938 - wca:fix-clang-check-compatibility, r=alexcrichtonbors-4/+6
Not all /bin/sh have [[ available, so for compatibility using case..esac for pattern matching is better.
2015-06-02s/method/associated function/ in E0201Nick Hamann-10/+20
2015-06-03Auto merge of #25935 - wesleywiser:fix_libcollection_build_warnings, ↵bors-4/+11
r=alexcrichton Fixes a bunch of warnings that are generated during the stage0 build of libcollections.
2015-06-02std: clarify comments about sp* implementationsRicho Healey-8/+4
2015-06-02Auto merge of #25867 - petrochenkov:ucellv, r=alexcrichtonbors-1/+8
Now when const functions are implemented and used, the `value` field of `UnsafeCell` can be made deprecated (and then private as intended).
2015-06-02configure: Allow specifying your python with --pythonRicho Healey-1/+4
2015-06-03mk: fix the CFG_ENABLE_COMPILER_DOCS spellingGleb Kozyrev-1/+1
2015-06-02Add note about expression vs. statement to dining philosphers problem,ben fleis-1/+3
to address https://github.com/rust-lang/rust/issues/25488 .
2015-06-02Auto merge of #25926 - Ms2ger:enum_variant_ids, r=alexcrichtonbors-8/+26
2015-06-02Change &String[..] to just &String, since it coerces to &str automatically.Peter Elmers-26/+26
2015-06-02Move EnumData to the API.Peter Elmers-55/+72
2015-06-02Auto merge of #25868 - alexcrichton:issue-25505, r=brsonbors-12/+29
The compiler already has special support for fixing up verbatim paths with disks on Windows to something that can be correctly passed down to gcc, and this commit adds support for verbatim UNC paths as well. Closes #25505
2015-06-02Link to cell in TRPL: mutabilitySteve Klabnik-1/+3
2015-06-02Auto merge of #25905 - michaelwoerister:lldb-pp-strings, r=brsonbors-421/+737
GDB and LLDB pretty printers have some common functionality and also access some common information, such as the layout of standard library types. So far, this information has been duplicated in the two pretty printing python modules. This PR introduces a common module used by both debuggers. This PR also implements proper rendering of `String` and `&str` values in LLDB.
2015-06-02Extend dead code lint to detect more unused enum variantsSeo Sanghyeon-7/+73
2015-06-02added test to ensure move_val_init still handles cleanups properly.Felix S. Klock II-0/+194
2015-06-02Hack the move_val_init intrinsic to trans directly into the destination address.Felix S. Klock II-16/+42
remove dead code further down for intrinsic.