Commit Graph

55124 Commits

Author SHA1 Message Date
Steve Klabnik
4c95b66465 Rollup merge of #34609 - ubsan:transmute_docs, r=steveklabnik
Add more docs - mostly warnings - to std::mem::transmute
2016-07-26 17:21:11 -04:00
Steve Klabnik
493cb979c6 Rollup merge of #34461 - ubsan:master, r=steveklabnik
Fix ABI string docs in reference.md
2016-07-26 17:21:10 -04:00
bors
feeca94573 Auto merge of #34983 - alexcrichton:windows-flaky, r=brson
std: Ignore tests where threads outlive main

Long ago we discovered that threads which outlive main and then exit while the
rest of the program is exiting causes Windows to hang (#20704). That's what was
happening in this test so let's just not run this test any more.
2016-07-26 13:51:34 -07:00
Tobias Bucher
68efea08fa Restore char::escape_default and add char::escape instead 2016-07-26 15:15:00 +02:00
Sebastian Thiel
1aa8dad854 DoubleEndedIterator for Args
The number of arguments given to a process is always known, which
makes implementing DoubleEndedIterator possible.

That way, the Iterator::rev() method becomes usable, among others.

Signed-off-by: Sebastian Thiel <byronimo@gmail.com>

Tidy for DoubleEndedIterator

I chose to not create a new feature for it, even though
technically, this makes me lie about the original availability
of the implementation.

Verify with @alexchrichton

Setup feature flag for new std::env::Args iterators

Add test for Args reverse iterator

It's somewhat depending on the input of the test program,
but made in such a way that should be somewhat flexible to changes
to the way it is called.

Deduplicate windows ArgsOS code for DEI

DEI = DoubleEndedIterator

Move env::args().rev() test to run-pass

It must be controlling it's arguments for full isolation.

Remove superfluous feature name

Assert all arguments returned by env::args().rev()

Let's be very sure it works as we expect, why take chances.

Fix rval of os_string_from_ptr

A trait cannot be returned, but only the corresponding object.

Deref pointers to actually operate on the argument

Put unsafe to correct location
2016-07-26 12:12:43 +02:00
Rahiel Kasim
47db8deff6 doc/book/trait-objects: remove empty lines at start of examples 2016-07-26 11:14:46 +02:00
Masood Malekghassemi
4bcf013438 Tidy up 2016-07-25 17:46:01 -07:00
Masood Malekghassemi
e88df943dd Use &mut for CombineFields in inference relations 2016-07-25 17:38:05 -07:00
Masood Malekghassemi
dddaf34cfc Move a_is_expected out of CombineFields 2016-07-25 16:38:43 -07:00
Masood Malekghassemi
5e390322c3 Rename infcx lifetimes in inference relations 2016-07-25 15:08:19 -07:00
Corey Farwell
a139772e77 Rewrite/expansion of slice::split doc examples. 2016-07-25 16:59:33 -04:00
Jeffrey Seyfried
a279f2f62d Weaken test compile-fail/lifetime-inference-give-expl-lifetime-param. 2016-07-25 20:34:43 +00:00
Masood Malekghassemi
cdb0867493 Unpublicize inference relations 2016-07-25 13:08:53 -07:00
Oliver Middleton
5c0ce872fb rustdoc: Fix tuple struct where clause rendering
For tuple structs the where clause comes after the definition.
2016-07-25 18:53:31 +01:00
Vadim Chugunov
5fbcf08dd8 Looser LSDA parsing 2016-07-25 09:37:41 -07:00
Andrea Pretto
f694809a0d Fixed missing comma in the csv dumper. 2016-07-25 11:46:59 +02:00
abhi
96932cf3d0 Remove no_stack_check tests (#34915)
Part of fixes for #34915
2016-07-25 15:00:32 +05:30
Jorge Aparicio
f438801528 add include ../tools.mk to the Makefile 2016-07-25 01:23:10 -05:00
Tamir Duberstein
9aca38e568
move coerce-match{,-calls} into run-pass-valgrind
Closes #21696.
2016-07-24 15:50:10 -04:00
bors
9316ae515e Auto merge of #35006 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #34965, #34972, #34975, #34976, #34977, #34988, #34989
- Failed merges:
2016-07-24 11:42:06 -07:00
Guillaume Gomez
debb2ac76b Improve Open doc 2016-07-24 17:00:49 +02:00
Guillaume Gomez
16699635bc Add DirEntry doc examples 2016-07-24 16:52:28 +02:00
Guillaume Gomez
dad29a6d03 Add missing links 2016-07-24 16:07:06 +02:00
Manish Goregaokar
52c293c2bb Rollup merge of #34989 - frewsxcv:fix-set-len-doc-example, r=nagisa
Fix incorrect 'memory leak' example for `Vec::set_len`.

Example was written in https://github.com/rust-lang/rust/pull/34911

Issue was brought up in this comment:

a005b2cd2a (commitcomment-18346958)
2016-07-24 15:18:48 +05:30
Manish Goregaokar
89b9ddd0dd Rollup merge of #34988 - frewsxcv:vec-windows, r=GuillaumeGomez
Doc example improvements for `slice::windows`.

* Modify existing example to not rely on printing to see results
* Add an example demonstrating when slice is shorter than `size`
2016-07-24 15:18:48 +05:30
Manish Goregaokar
f7df83d115 Rollup merge of #34977 - wettowelreactor:patch-3, r=steveklabnik
Fixed to spelling errors in char.rs

Fixed two small spelling mistakes (interator -> iterator) in the documentation for encode_utf8 and encode_utf16
2016-07-24 15:18:48 +05:30
Manish Goregaokar
10be6e6c9e Rollup merge of #34976 - GuillaumeGomez:build_hasher_doc, r=steveklabnik
Add BuildHasher example

r? @steveklabnik
2016-07-24 15:18:48 +05:30
Manish Goregaokar
33ad70521b Rollup merge of #34975 - GuillaumeGomez:random_state_doc, r=steveklabnik
Add Random state doc

Last part of #29348.

r? @steveklabnik
2016-07-24 15:18:47 +05:30
Manish Goregaokar
87cc1b9330 Rollup merge of #34972 - oli-obk:cant_cast_str_to_const_ptr, r=eddyb
improve const eval error reporting on "" and b"" casts

r? @eddyb

cc @ubsan
2016-07-24 15:18:47 +05:30
Manish Goregaokar
cc620d8819 Rollup merge of #34965 - jonathandturner:multispan_cleanup, r=sanxiyn
Remove unused methods from MultiSpan

Removed a couple of unused methods from MultiSpan.  I thought about batching this with some other changes but wasn't sure when I'd get around to them, so PR for a tiny fix instead.

This can be rollup'd.
2016-07-24 15:18:47 +05:30
Robert Williamson
ccc955c84c Fix HashMap's values_mut example to use println! 2016-07-23 16:13:25 -06:00
Jeffrey Seyfried
41745f30f7 macros: Improve tt fragments 2016-07-23 12:49:01 -07:00
bors
2c50f4e484 Auto merge of #34832 - vadimcn:rusty-personality, r=alexcrichton
Implement rust_eh_personality in Rust, remove rust_eh_personality_catch.

Well, not quite: ARM EHABI platforms still use the old scheme -- for now.

r? @alexcrichton
2016-07-23 09:35:34 -07:00
Corey Farwell
c77f8ce7c3 Doc example improvements for slice::windows.
* Modify existing example to not rely on printing to see results
* Add an example demonstrating when slice is shorter than `size`
2016-07-23 11:59:31 -04:00
Corey Farwell
1e0043eb6c Fix incorrect 'memory leak' example for Vec::set_len.
Example was written in https://github.com/rust-lang/rust/pull/34911

Issue was brought up in this comment:

a005b2cd2a (commitcomment-18346958)
2016-07-23 09:08:45 -04:00
bors
fd1d3603d4 Auto merge of #34925 - jseyfried:nested_macros, r=eddyb
Support nested `macro_rules!`

Fixes #6994.
r? @eddyb
2016-07-23 04:01:05 -07:00
abhi
6ebe6e8f80 Update underscore usage (#34903) 2016-07-23 13:15:09 +05:30
Guillaume Gomez
90bb8d469c Add DirBuilder doc examples 2016-07-23 01:57:21 +02:00
Alex Crichton
8487666241 std: Ignore tests where threads outlive main
Long ago we discovered that threads which outlive main and then exit while the
rest of the program is exiting causes Windows to hang (#20704). That's what was
happening in this test so let's just not run this test any more.
2016-07-22 16:29:36 -07:00
Tobias Bucher
0685900fbd Fix run-pass/ifmt test 2016-07-23 00:18:44 +02:00
Tobias Bucher
34f766e341 Fix indentation in src/libcore/lib.rs 2016-07-23 00:18:44 +02:00
Tobias Bucher
e7d16580f5 Escape fewer Unicode codepoints in Debug impl of str
Use the same procedure as Python to determine whether a character is
printable, described in [PEP 3138]. In particular, this means that the
following character classes are escaped:

- Cc (Other, Control)
- Cf (Other, Format)
- Cs (Other, Surrogate), even though they can't appear in Rust strings
- Co (Other, Private Use)
- Cn (Other, Not Assigned)
- Zl (Separator, Line)
- Zp (Separator, Paragraph)
- Zs (Separator, Space), except for the ASCII space `' '` (`0x20`)

This allows for user-friendly inspection of strings that are not
English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`).

Fixes #34318.

[PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-23 00:18:44 +02:00
Vadim Chugunov
051c2d14fb Implement rust_eh_personality in Rust, remove rust_eh_personality_catch.
Well, not quite: ARM EHABI platforms still use the old scheme -- for now.
2016-07-22 14:58:35 -07:00
Ariel Ben-Yehuda
717e39294f address review comments
I split the RFC1592 commit out
2016-07-23 00:03:19 +03:00
Jeffrey Seyfried
64d36ccf96 Add regression test. 2016-07-22 13:31:26 -07:00
ggomez
23bb1df1e5 Add E0559 error explanation 2016-07-22 22:47:38 +03:00
ggomez
0304850942 Add E0560 error explanation 2016-07-22 22:47:38 +03:00
ggomez
e76a46a10d Add new error codes in librustc_typeck 2016-07-22 22:47:38 +03:00
Ariel Ben-Yehuda
93a96835b0 use diagnostic-mutating style for note_type_err too
that is much cleaner than the `type_err!` style I used earlier.
2016-07-22 22:47:38 +03:00
Ariel Ben-Yehuda
1e4f6d5683 rustc_errors: fix a few bugs 2016-07-22 22:47:38 +03:00