Commit Graph

55289 Commits

Author SHA1 Message Date
Guillaume Gomez
8d3f20f906 Add doc examples for std::fs::unix::OpenOptionsExt 2016-07-28 12:55:58 +02:00
Stefan Schindler
ca259666a5 Reduce git clone --depth from 50 to 1 2016-07-28 11:48:43 +02:00
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
Aravind Gollakota
4ffbb5dd63 rustbuild: Ensure PATH does not contain invalid character " 2016-07-27 21:19:51 -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
Guillaume Gomez
52c50ba276 Add doc examples for std::fs::Metadata 2016-07-28 02:53:34 +02:00
Tobias Bucher
3d09b4a0d5 Rename char::escape to char::escape_debug and add tracking issue 2016-07-28 02:20:49 +02:00
Knight
6ac83de691 Add test for string AddAssign 2016-07-28 06:08:56 +08: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
Panashe M. Fundira
9a7367b960
Mention debug_assert! in assert! doc 2016-07-27 15:16:11 -04:00
Panashe M. Fundira
8760b1dd26
Revert section about panic! in assert! doc 2016-07-27 15:03:23 -04:00
Panashe M. Fundira
91acc3977b
Correct minor typo in debug_assert doc 2016-07-27 15:01:43 -04:00
Alex Burka
29546dd06d remove claim about searching through nested fields for the nullable type, even though that is how it works 2016-07-27 13:58:51 -04:00
Alex Burka
1319b293c6 fix typo 2016-07-27 13:58:51 -04:00
Alex Burka
8e7abea93e revert libc changes 2016-07-27 13:58:51 -04:00
Alex Burka
54ecc210ec hack to make example compile 2016-07-27 13:58:51 -04:00
Alex Burka
5276b29670 change confusing wording about discriminant 2016-07-27 13:58:51 -04:00
Alex Burka
fae3335272 extern fns require named parameters
Not sure the example is going to stay, but I can try to pass Travis for the bragging rights.
2016-07-27 13:58:51 -04:00
Alex Burka
1cceca8dfd foreign function interface interface 2016-07-27 13:58:51 -04:00
Alex Burka
0016af5f13 not just a single field 2016-07-27 13:58:51 -04:00
Alex Burka
84366b6f28 recursion 2016-07-27 13:58:51 -04:00
Alex Burka
cc2fc48dec expand nullable pointer example 2016-07-27 13:58:51 -04:00
Alex Burka
48ce20653a generics-agnostic description 2016-07-27 13:58:51 -04:00
Alex Burka
032ea41e99 book/ffi: nullable pointer, libc cleanups
Expand the "nullable pointer optimization" section with a code example.

Change examples to use std::os::raw instead of libc, when applicable.
2016-07-27 13:58:51 -04:00
Wesley Wiser
2dbf00e2bb Only export #[no_mangle] extern symbols during LTO
Previously, all extern symbols were exported even when performing LTO.
Now, we only export symbols that are also marked #[no_mangle].

Fixes #34985
2016-07-27 13:58:22 -04:00
Jonathan Creekmore
54c61ff959 librustc_back: filter targets for only valid ones
Since we can know which targets are instantiable on a particular host,
it does not make sense to list invalid targets in the target print code.
Filter the list of targets to only include the targets that can be
instantiated.
2016-07-27 10:29:43 -07:00
Jonathan Creekmore
bd194a77d5 librustc_back: json tests for builtin targets
Expand the supported_targets!() macro to also generate a set of
JSON encode/decode tests to verify that the parser will encode
and decode all of the fields needed for all of the builtin targets.
Additionally, add PartialEq to Target and TargetOptions in support
of the tests.
2016-07-27 10:29:43 -07:00
Doug Goldstein
eafecbf868 librustc_back: convert fn target() to return Result
Change all the target generation functions to return a Result<Target,
String> so that targets that are unable to be instantiated can be
expressed as an Err instead of a panic!(). This should improve #33497 as
well.
2016-07-27 10:28:40 -07:00
Doug Goldstein
c7b6ed27bc librustc_back: add ToJson trait to Target
Target's can already be built up from JSON files as well as built into
librustc_back so this adds the ability to convert any Target back into
JSON.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-07-27 10:24:36 -07:00
Doug Goldstein
9c83fa41b0 librustc_back: expose all target options via JSON
Not all TargetOptions are exposed via the JSON interface to create
different targets. This exposes all the missing items and reorders them
to match the structure so that it is easier in the future to identify
missing items.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-07-27 10:24:36 -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
Panashe M. Fundira
a72767970a
Update docs for assert! and debug_assert! 2016-07-27 13:12:35 -04: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
Jeffrey Seyfried
8205691929 Fix fallout in tests. 2016-07-27 05:17:05 +00:00
Jeffrey Seyfried
132bff9933 If a single import resolves to an inaccessible name in some but not all namespaces,
avoid importing the name in the inaccessible namespaces.

Currently, the inaccessible namespaces are imported but cause a privacy error when used.
2016-07-27 05:17:04 +00: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
Jorge Aparicio
774fbdf40d keep backtraces if using the old build system 2016-07-26 22:33:45 -05:00
Vadim Chugunov
ec8518e4fb Fix typos 2016-07-26 18:53:47 -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