Commit Graph

50324 Commits

Author SHA1 Message Date
Manish Goregaokar
be6b73f19d Rollup merge of #35013 - tamird:coerce-match-valgrind, r=alexcrichton
move coerce-match{,-calls} into run-pass-valgrind

Closes #21696.
2016-07-28 20:33:07 +05:30
Manish Goregaokar
f540f5d453 Rollup merge of #34969 - jseyfried:fix_cfg_feature, r=nrc
Avoid processing `feature`s on unconfigured crates

Fixes #34932, a regression caused by #34272.
r? @nrc
2016-07-28 20:33:06 +05:30
Manish Goregaokar
43bcada397 Rollup merge of #34963 - petrochenkov:useerr, r=jseyfried
resolve: Fix ICE and extra diagnostics happening when unresolved imports are used in patterns

Closes https://github.com/rust-lang/rust/issues/34933

r? @jseyfried
2016-07-28 20:33:06 +05:30
Manish Goregaokar
80c998d0f1 Rollup merge of #34951 - tomgarcia:covariant-vec, r=brson
Make vec::Drain and binary_heap::Drain covariant

I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?
2016-07-28 20:33:06 +05:30
bors
1895bf760d Auto merge of #34908 - jseyfried:improve_tt_matchers, r=nrc
macros: Improve `tt` matchers

Fixes #5846, fixes #22819.
r? @nrc
2016-07-28 00:01:54 -07:00
Jeffrey Seyfried
448550223b Add regression test 2016-07-28 02:16:11 +00:00
bors
f5d79521ae Auto merge of #34946 - alexcrichton:fix-cfg, r=brson
std: Fix usage of SOCK_CLOEXEC

This code path was intended to only get executed on Linux, but unfortunately the
`cfg!` was malformed so it actually never got executed.
2016-07-27 18:58:04 -07:00
bors
f2e59cc6aa Auto merge of #34907 - arielb1:found-parse-error, r=nikomatsakis
Centralize and clean type error reporting

Refactors the code that handles type errors to be cleaner and fixes various edge cases.

This made the already-bad "type mismatch resolving" error message somewhat uglier. I want to fix that in another commit before this PR is merged.

Fixes #31173

r? @jonathandturner, cc @nikomatsakis
2016-07-27 14:28:06 -07:00
bors
29abe5ec71 Auto merge of #34856 - jseyfried:refactor_reset_tls, r=nrc
Avoid reseting the thread local interner at the beginning of `phase_1_parse_input`

The thread local interner is used before `phase_1_parse_input` to create `InternedString`s, which currently wrap `Rc<String>`s. Once `InternedString` is refactored to be an interned string id (like `Name`), resetting will invalidate everything that was interned before `phase_1_parse_input`.

The resets were only useful for the `rusti` project, which can now use `driver::reset_thread_local_state`.

r? @nrc
2016-07-27 10:16:36 -07:00
bors
a373b8437b Auto merge of #33363 - japaric:target, r=japaric
fix built-in target detection

previously the logic was accepting wrong triples (like
`x86_64_unknown-linux-musl`) as valid ones (like `x86_64-unknown-linux-musl`) if
they contained an underscore instead of a dash.

fixes #33329

---

r? @brson

I wanted to use a compile-fail test at first. But, you can't pass an extra `--target` flag to `rustc` for those because they already call `rustc --target $HOST` so you get a `error: Option 'target' given more than once.`. The run-make test used here works fine though.
2016-07-27 05:50:27 -07:00
bors
422ebd5328 Auto merge of #33312 - Byron:double-ended-iterator-for-args, r=alexcrichton
DoubleEndedIterator for Args

This PR implements the DoubleEndedIterator trait for the `std::env::Args[Os]` structure, as well
as the internal implementations.

It is primarily motivated by me, as I happened to implement a simple `reversor` program many times
now, which so far had to use code like this:

```Rust
for arg in std::env::args().skip(1).collect::<Vec<_>>().iter().rev() {}
```

... even though I would have loved to do this instead:

```Rust
for arg in std::env::args().skip(1).rev() {}
```

The latter is more natural, and I did not find a reason for not implementing it.
After all, on every system, the number of arguments passed to the program are known
at runtime.

To my mind, it follows KISS, and does not try to be smart at all. Also, there are no unit-tests,
primarily as I did not find any existing tests for the `Args` struct either.

The windows implementation is basically a copy-pasted variant of the `next()` method implementation,
and I could imagine sharing most of the code instead. Actually I would be happy if the reviewer would
ask for it.
2016-07-27 02:26:37 -07:00
bors
edecc57cbf Auto merge of #35053 - steveklabnik:rollup, r=steveklabnik
Rollup of 15 pull requests

- Successful merges: #34461, #34609, #34732, #34850, #34935, #34974, #34990, #34995, #35001, #35009, #35010, #35019, #35028, #35029, #35043
- Failed merges:
2016-07-26 20:52:24 -07:00
bors
b541f5f0cc Auto merge of #35014 - vadimcn:travis-test, r=alexcrichton
Fix Travis tests

r? @vadimcn
2016-07-26 17:07:08 -07:00
Steve Klabnik
d64de045c9 Rollup merge of #35043 - rahiel:patch-1, r=nikomatsakis
doc/book/trait-objects: remove empty lines at start of examples

I think it looks better without them.
2016-07-26 17:21:14 -04:00
Steve Klabnik
326444dea6 Rollup merge of #35029 - eulerdisk:fix_missing_comma_in_csv_dumper, r=nrc
Fixed missing comma in the csv dumper.

Added missing comma before `file_line_end`.

r? @nrc
2016-07-26 17:21:14 -04:00
Steve Klabnik
a47ffc0117 Rollup merge of #35028 - abhijeetbhagat:patch-6, r=alexcrichton
Remove no_stack_check tests (#34915)

Part of fixes for #34915
2016-07-26 17:21:13 -04:00
Steve Klabnik
1a3c46fdec Rollup merge of #35019 - frewsxcv:slice-split, r=GuillaumeGomez
Rewrite/expansion of `slice::split` doc examples.

None
2016-07-26 17:21:13 -04:00
Steve Klabnik
8de36f1423 Rollup merge of #35010 - GuillaumeGomez:file_doc, r=steveklabnik
Improve Open doc

Part of #29356.

r? @steveklabnik
2016-07-26 17:21:13 -04:00
Steve Klabnik
57d50299a7 Rollup merge of #35009 - GuillaumeGomez:dir_entry_doc, r=steveklabnik
Dir entry doc

Part of #29356.

r? @steveklabnik
2016-07-26 17:21:13 -04:00
Steve Klabnik
905e35f30b Rollup merge of #35001 - rdwilliamson:patch-1, r=alexcrichton
Fix HashMap's values_mut example to use println!

Fix HashMap's values_mut example to use println!
2016-07-26 17:21:13 -04:00
Steve Klabnik
ae05e62ede Rollup merge of #34995 - GuillaumeGomez:dir_builder_doc, r=steveklabnik
Add DirBuilder doc examples

r? @steveklabnik

Part of #29329 and of #29356.
2016-07-26 17:21:12 -04:00
Steve Klabnik
96108bbb94 Rollup merge of #34990 - abhijeetbhagat:patch-3, r=steveklabnik
Update underscore usage (#34903)
2016-07-26 17:21:12 -04:00
Steve Klabnik
c54fc13f93 Rollup merge of #34974 - abhijeetbhagat:patch-2, r=GuillaumeGomez
Update VecDeque documentation to specify direction of index 0 (#34920)

I mentioned the direction for all the methods that work with an index
2016-07-26 17:21:12 -04:00
Steve Klabnik
69d282ab50 Rollup merge of #34935 - GuillaumeGomez:hash_map_doc, r=steveklabnik
Add HashMap Entry enums examples

Part of #29348.

r? @steveklabnik
2016-07-26 17:21:12 -04:00
Steve Klabnik
a56741f832 Rollup merge of #34850 - tshepang:patch-3, r=steveklabnik
doc: add missing pause
2016-07-26 17:21:11 -04:00
Steve Klabnik
f57388844d Rollup merge of #34732 - durka:patch-27, r=steveklabnik
document DoubleEndedIterator::next_back

document DoubleEndedIterator::next_back

fixes #34726
2016-07-26 17:21:11 -04:00
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
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
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
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
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