about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2015-01-24Auto merge of #21452 - bleibig:bison-grammar, r=nikomatsakisbors-0/+2613
This adds a new lexer/parser combo for the entire Rust language can be generated with with flex and bison, taken from my project at https://github.com/bleibig/rust-grammar. There is also a testing script that runs the generated parser with all *.rs files in the repository (except for tests in compile-fail or ones that marked as "ignore-test" or "ignore-lexer-test"). If you have flex and bison installed, you can run these tests using the new "check-grammar" make target. This does not depend on or interact with the existing testing code in the grammar, which only provides and tests a lexer specification. OS X users should take note that the version of bison that comes with the Xcode toolchain (2.3) is too old to work with this grammar, they need to download and install version 3.0 or later. The parser builds up an S-expression-based AST, which can be displayed by giving the "-v" argument to parser-lalr (normally it only gives output on error). It is only a rough approximation of what is parsed and doesn't capture every detail and nuance of the program. Hopefully this should be sufficient for issue #2234, or at least a good starting point.
2015-01-24Auto merge of #21488 - aturon:os-str, r=alexcrichtonbors-92/+1850
Per [RFC 517](https://github.com/rust-lang/rfcs/pull/575/), this commit introduces platform-native strings. The API is essentially as described in the RFC. The WTF-8 implementation is adapted from @SimonSapin's [implementation](https://github.com/SimonSapin/rust-wtf8). To make this work, some encodign and decoding functionality in `libcore` is now exported in a "raw" fashion reusable for WTF-8. These exports are *not* reexported in `std`, nor are they stable.
2015-01-24Add ffi::OsString and OsStrAaron Turon-92/+1850
Per [RFC 517](https://github.com/rust-lang/rfcs/pull/575/), this commit introduces platform-native strings. The API is essentially as described in the RFC. The WTF-8 implementation is adapted from @SimonSapin's [implementation](https://github.com/SimonSapin/rust-wtf8). To make this work, some encodign and decoding functionality in `libcore` is now exported in a "raw" fashion reusable for WTF-8. These exports are *not* reexported in `std`, nor are they stable.
2015-01-24Auto merge of #21079 - huonw:chained-cmp-tweaks, r=pnkfelixbors-74/+79
First commit is mindless groundwork for the second one, to make the spans (arguably) nicer. ### before ``` require-parens-for-chained-comparison.rs:14:20: 14:22 error: Chained comparison operators require parentheses require-parens-for-chained-comparison.rs:14 false == false == false; ^~ require-parens-for-chained-comparison.rs:17:16: 17:17 error: Chained comparison operators require parentheses require-parens-for-chained-comparison.rs:17 false == 0 < 2; ^ require-parens-for-chained-comparison.rs:20:8: 20:9 error: Chained comparison operators require parentheses require-parens-for-chained-comparison.rs:20 f<X>(); ^ require-parens-for-chained-comparison.rs:20:8: 20:9 help: Use ::< instead of < if you meant to specify type arguments. require-parens-for-chained-comparison.rs:20 f<X>(); ^ ``` ### after ``` require-parens-for-chained-comparison.rs:14:11: 14:22 error: chained comparison operators require parentheses require-parens-for-chained-comparison.rs:14 false == false == false; ^~~~~~~~~~~ require-parens-for-chained-comparison.rs:17:11: 17:17 error: chained comparison operators require parentheses require-parens-for-chained-comparison.rs:17 false == 0 < 2; ^~~~~~ require-parens-for-chained-comparison.rs:20:6: 20:9 error: chained comparison operators require parentheses require-parens-for-chained-comparison.rs:20 f<X>(); ^~~ require-parens-for-chained-comparison.rs:20:6: 20:9 help: use `::<...>` instead of `<...>` if you meant to specify type arguments require-parens-for-chained-comparison.rs:20 f<X>(); ^~~ ```
2015-01-25Tweak chained comparison errors.Huon Wilson-9/+10
Lower case and give a more precise span: from operator to operator, not just the last one.
2015-01-25Add the span of the operator itself to ast::BinOp.Huon Wilson-65/+69
2015-01-24Auto merge of #21542 - vadimcn:fix-exported-macro-paths, r=alexcrichtonbors-1/+56
... so that `super::foo` gets serialized as `super:: foo`, rather than `super :: foo`.
2015-01-24Auto merge of #21537 - tbu-:pr_coretest_fmt, r=alexcrichtonbors-70/+72
r? @alexcrichton Part of #20792 that wasn't done in your commit.
2015-01-23regex: Remove in-tree versionAlex Crichton-4443/+182
The regex library was largely used for non-critical aspects of the compiler and various external tooling. The library at this point is duplicated with its out-of-tree counterpart and as such imposes a bit of a maintenance overhead as well as compile time hit for the compiler itself. The last major user of the regex library is the libtest library, using regexes for filters when running tests. This removal means that the filtering has gone back to substring matching rather than using regexes.
2015-01-23serialize: Remove base64 supportAlex Crichton-425/+0
This is not used in-tree and is available out-of-tree
2015-01-23Fix tidy.Vadim Chugunov-2/+2
2015-01-23Auto merge of #21503 - ahmedcharles:remove-test-features, r=alexcrichtonbors-222/+18
I think this is all of the remaining code to be removed. Let me know if I've missed anything. Closes #19145
2015-01-23Auto merge of #21453 - Stebalien:exactsize, r=alexcrichtonbors-4/+72
Specifically: * Peekable * ByRef * Skip * Take * Fuse Fixes #20547
2015-01-23Clean up `isize`, `usize`. Don't bench allocation but formatting.Tobias Bucher-70/+72
2015-01-23Auto merge of #21382 - tshepang:improve-iter-docs, r=alexcrichtonbors-236/+263
2015-01-22Added test.Vadim Chugunov-0/+46
2015-01-23Auto merge of #21374 - dgrunwald:range-notation-fixes, r=nikomatsakisbors-23/+80
This PR is intended as alternative to #20958. It fixes the same grammar inconsistencies, but does not increase the operator precedence of `..`, leaving it at the same level as the assignment operator. For previous discussion, see #20811 and #20958. Grammar changes: * allow `for _ in 1..i {}` (fixes #20241) * allow `for _ in 1.. {}` as infinite loop * prevent use of range notation in contexts where only operators of high precedence are expected (fixes #20811) Parser code cleanup: * remove `RESTRICTION_NO_DOTS` * make `AS_PREC` const and follow naming convention * make `min_prec` inclusive r? nikomatsakis
2015-01-23Auto merge of #20221 - liigo:rustdoc-sidebar-tooltips-v3, r=alexcrichtonbors-15/+130
This pull request add tooltips to most links of sidebar. The tooltips display "summary line" of items' document. Some lengthy/annoying raw markdown code are eliminated, such as links and headers. - `[Rust](http://rust-lang.org)` displays as `Rust` (no URLs) - `# header` displays as `header` (no `#`s) Some inline spans, e.g. ``` `code` ``` and ```*emphasis*```, are kept as they are, for better readable. I've make sure `&` `'` `"` `<` and `>` are properly displayed in tooltips, for example, `&'a Option<T>`. Online preview: http://liigo.com/tmp/tooltips/std/index.html @alexcrichton @steveklabnik since you have reviewed my previous ([v1](https://github.com/rust-lang/rust/pull/13014),[v2](https://github.com/rust-lang/rust/pull/16448)) PRs of this serise, which have been closed for technical reasons. Thank you.
2015-01-22Suppress space after idents with "ModName" style in serialization of ↵Vadim Chugunov-1/+10
exported macros. Fixes issue #20701
2015-01-23iter: miscellaneous improvementsTshepang Lekhonkhobe-236/+263
There are doc improvements as well as these conversions: - int/uint -> isize/usize - u/i -> us/is
2015-01-22Rollup merge of #21517 - SeanTAllen:master, r=steveklabnikSteve Klabnik-8/+8
Lifetime elision documentation was reference a previously existing function that doesn't exist. After talking with Steve Klabnik, I confirmed the correct function to be referenced and updated documentation accordingly.
2015-01-22Rollup merge of #21516 - steveklabnik:document_box, r=alexcrichtonSteve Klabnik-11/+68
2015-01-22Rollup merge of #21500 - richo:power-fixups, r=alexcrichtonSteve Klabnik-12/+12
When I wrote this code, my janky shim to verify the constants didn't work as intended. This fixes everything I've run into since merge, which is hopefully everything.
2015-01-22Rollup merge of #21496 - ColonelJ:paatch, r=alexcrichtonSteve Klabnik-0/+3
Make compiletest set an environment variable so that on Windows 32-bit test executables containing certain substrings (e.g. 'install', 'setup', 'update', 'patch') are not blocked by UAC's Installer Detection Technology.
2015-01-22Rollup merge of #21484 - steveklabnik:connect_docs, r=alexcrichtonSteve Klabnik-2/+21
2015-01-22Rollup merge of #21479 - steveklabnik:rustdoc_to_book, r=alexcrichtonSteve Klabnik-294/+298
Fixes #21430
2015-01-22Rollup merge of #21477 - steveklabnik:gh21440, r=alexcrichtonSteve Klabnik-1/+9
Fixes #21440"
2015-01-22Rollup merge of #21472 - steveklabnik:gh21469, r=huonwSteve Klabnik-0/+4
Fixes #21469.
2015-01-22Rollup merge of #21471 - michaelwoerister:associated-types, r=alexcrichtonSteve Klabnik-1/+159
This should fix issue #20797 (but I don't want to close it automatically). As the actual fix is very small this would be a perfect candidate for a rollup.
2015-01-22Rollup merge of #21450 - alfie:book2, r=steveklabnikSteve Klabnik-2/+1
Compiling won't produce an executable just yet because (as stated in the next paragraph) there are errors. By removing this sentance, the reader won't get confused when they expect a successful compile i.e. if they don't read ahead one paragraph, they are going to be checking their code and wondering why it's not compiling.
2015-01-22Rollup merge of #21373 - angst7:pointer_doc_1, r=steveklabnikSteve Klabnik-4/+4
Updated incorrect error messages, and removed explicit return statements from example code.
2015-01-22Rollup merge of #21325 - nagisa:thread-panicking, r=steveklabnikSteve Klabnik-2/+2
Previous wording wasn’t clear about its actual behaviour. It could be interpreted as answering either: * Can current thread panic? * Is current thread unwinding because of panic? r? @steveklabnik
2015-01-22Rollup merge of #21217 - Gankro:docadoca, r=steveklabnikSteve Klabnik-2/+52
Not sure on what *exactly* should be said here, but I think this is the most important bit. This PR also establishes conventions for describing performance minimally. I suggest to describe preformance for individual methods we use a `# Performance` heading. Not sure if we should have ``` # Performance: O(1) details details ``` or ``` # Performance: O(1) details details ``` Since I think most methods don't need discussion, the former seems more resonable. But it's kind of weird to have info "in" the heading. r? @steveklabnik
2015-01-22Rollup merge of #21091 - steveklabnik:add_attribute_docs, r=huonwSteve Klabnik-0/+12
Fixes #6444 I need some help with the macro docs here, as I couldn't figure it out. @kmcallister @eddyb or someone else?
2015-01-22Rollup merge of #21056 - steveklabnik:return_strings, r=sfacklerSteve Klabnik-0/+284
When we moved over to the book, we lost this.
2015-01-22Document remaining attributes and macrosSteve Klabnik-0/+12
Fixes #6444
2015-01-22Beef up docs for Box<T>Steve Klabnik-11/+68
2015-01-22Fix some grammar inconsistencies for the '..' range notation.Daniel Grunwald-23/+80
Grammar changes: * allow 'for _ in 1..i {}' (fixes #20241) * allow 'for _ in 1.. {}' as infinite loop * prevent use of range notation in contexts where only operators of high precedence are expected (fixes #20811) Parser code cleanup: * remove RESTRICTION_NO_DOTS * make AS_PREC const and follow naming convention * make min_prec inclusive
2015-01-22Return the String guide to its former glory.Steve Klabnik-0/+284
When we moved over to the book, we lost this.
2015-01-22Reference correct fn during lifetime ellisionSean T Allen-8/+8
2015-01-22Auto merge of #21078 - js-ojus:master, r=steveklabnikbors-8/+35
* Include an illustration of a function that accepts two closures.
2015-01-22Auto merge of #21187 - oli-obk:feature/hint_struct_field_access, r=alexcrichtonbors-1/+112
rebase and fix of #19267
2015-01-22Remove remaining stats and boxplot code.Ahmed Charles-161/+2
2015-01-22Make fmt_metrics() part of the impl.Ahmed Charles-11/+11
2015-01-22Remove save() and load().Ahmed Charles-26/+1
2015-01-22Cleanup write_run_finish().Ahmed Charles-24/+4
2015-01-21powerpc: Fix liblibcRicho Healey-12/+12
When I wrote this code, my janky shim to verify the constants didn't work as intended. This fixes everything I've run into since merge, which is hopefully everything.
2015-01-21Make diagnostic ordering deterministicAlex Crichton-9/+11
2015-01-22Make compiletest set an environment variable so that on Windows 32-bit test ↵KernelJ-0/+3
executables containing certain substrings (e.g. 'install', 'setup', 'update', 'patch') are not blocked by UAC's Installer Detection Technology.
2015-01-21Add test cases for ExactSizeIterator implsSteven Allen-4/+57
ByRef is not tested included because it is a trivial pass through.