about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2016-07-30Add doc example for StdinGuillaume Gomez-0/+15
2016-07-30Add doc example for io::StderrGuillaume Gomez-0/+15
2016-07-29Add io::Error doc examplesGuillaume Gomez-0/+145
2016-07-28Auto merge of #34980 - cardoe:expose-target-options, r=alexcrichtonbors-218/+368
Convert built-in targets to JSON Convert the built-in targets to JSON to ensure that the JSON parser is always fully featured. This follows on #32988 and #32847. The PR includes a number of extra commits that are just intermediate changes necessary for bisectibility and the ability to prove correctness of the change.
2016-07-28Auto merge of #34967 - TimNN:mipsel-musl-soft-float, r=alexcrichtonbors-1/+1
switch mipsel-musl to soft float Closes #34922. r? @alexcrichton
2016-07-28Auto merge of #34956 - nikomatsakis:incr-comp-o-files, r=mwbors-197/+1245
Enable reuse of `.o` files if nothing has changed This PR completes a first "spike" for incremental compilation by enabling us to reuse `.o` files when nothing has changed. When in incr. mode, we will save `.o` files into the temporary directory, then copy them back out again if they are still valid. The code is still a bit rough but it does seem to work. =) r? @michaelwoerister Fixes #34036 Fixes #34037 Fixes #34038
2016-07-28make it possible to track where hash divergesNiko Matsakis-0/+23
2016-07-28hash def-path's betterNiko Matsakis-3/+13
actually we shouldn't even hash nested items at all, but that is addressed in a followup PR
2016-07-28Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichtonbors-29/+1032
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. CC #34422. [PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-28Keep multiple files per work-productNiko Matsakis-92/+202
In the older version, a `.o` and ` .bc` file were separate work-products. This newer version keeps, for each codegen-unit, a set of files of different kinds. We assume that if any kinds are available then all the kinds we need are available, since the precise set of switches will depend on attributes and command-line switches. Should probably test this: the effect of changing attributes in particular might not be successfully tracked?
2016-07-28Address mw nitsNiko Matsakis-57/+54
2016-07-28Add a testing mechanism and a simple spike testNiko Matsakis-0/+360
2016-07-28Modify trans to skip generating `.o` filesNiko Matsakis-98/+385
This checks the `previous_work_products` data from the dep-graph and tries to simply copy a `.o` file if possible. We also add new work-products into the dep-graph, and create edges to/from the dep-node for a work-product.
2016-07-28Code to save/load the work-products map from diskNiko Matsakis-53/+191
Work products are deleted if any of their inputs are dirty.
2016-07-28Store `crate_disambiguator` as an `InternedString`Niko Matsakis-10/+14
We used to use `Name`, but the session outlives the tokenizer, which means that attempts to read this field after trans has complete otherwise panic. All reads want an `InternedString` anyhow.
2016-07-28Extend DepGraph so it can track "work-products"Niko Matsakis-9/+128
A work product right now is just a `.o` file. In the future it probably includes other kinds of files, such as `.bc` files saving the unoptimized LLVM IR. However, because WorkProductIds must be independent of DefIds, so that they don't need translation, this system may not be suitable *as is* for storing fine-grained information (such as the MIR for individual defs), as it was originally intended. We will want to refactor some for that.
2016-07-28Rollup merge of #35040 - soltanmm:couple-is-a-pun, r=nikomatsakisManish Goregaokar-150/+159
Use &mut for `CombineFields` in inference relations Because dropping obligations on the floor makes a mess. r? @nikomatsakis
2016-07-28Rollup merge of #35037 - ollie27:rustdoc_tuple_struct_where, r=alexcrichtonManish Goregaokar-3/+30
rustdoc: Fix tuple struct where clause rendering For tuple structs the where clause comes after the definition. Fixes #34928
2016-07-28Rollup merge of #35013 - tamird:coerce-match-valgrind, r=alexcrichtonManish Goregaokar-0/+0
move coerce-match{,-calls} into run-pass-valgrind Closes #21696.
2016-07-28Rollup merge of #34969 - jseyfried:fix_cfg_feature, r=nrcManish Goregaokar-1/+24
Avoid processing `feature`s on unconfigured crates Fixes #34932, a regression caused by #34272. r? @nrc
2016-07-28Rollup merge of #34963 - petrochenkov:useerr, r=jseyfriedManish Goregaokar-2/+29
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-28Rollup merge of #34951 - tomgarcia:covariant-vec, r=brsonManish Goregaokar-5/+18
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-28Auto merge of #34951 - tomgarcia:covariant-vec, r=brsonbors-5/+18
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-28Auto merge of #34908 - jseyfried:improve_tt_matchers, r=nrcbors-3/+37
macros: Improve `tt` matchers Fixes #5846, fixes #22819. r? @nrc
2016-07-28Add regression testJeffrey Seyfried-0/+20
2016-07-27Auto merge of #34946 - alexcrichton:fix-cfg, r=brsonbors-2/+2
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-28Rename `char::escape` to `char::escape_debug` and add tracking issueTobias Bucher-48/+50
2016-07-27Auto merge of #34907 - arielb1:found-parse-error, r=nikomatsakisbors-844/+1017
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-27librustc_back: filter targets for only valid onesJonathan Creekmore-2/+10
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-27librustc_back: json tests for builtin targetsJonathan Creekmore-2/+28
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-27librustc_back: convert fn target() to return ResultDoug Goldstein-202/+212
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-27librustc_back: add ToJson trait to TargetDoug Goldstein-2/+96
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-27librustc_back: expose all target options via JSONDoug Goldstein-10/+22
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-27Auto merge of #34856 - jseyfried:refactor_reset_tls, r=nrcbors-5/+10
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-27Auto merge of #33363 - japaric:target, r=japaricbors-13/+27
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-27Auto merge of #33312 - Byron:double-ended-iterator-for-args, r=alexcrichtonbors-10/+76
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-26Auto merge of #35053 - steveklabnik:rollup, r=steveklabnikbors-415/+624
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-26Auto merge of #35014 - vadimcn:travis-test, r=alexcrichtonbors-4/+3
Fix Travis tests r? @vadimcn
2016-07-26Rollup merge of #35043 - rahiel:patch-1, r=nikomatsakisSteve Klabnik-2/+0
doc/book/trait-objects: remove empty lines at start of examples I think it looks better without them.
2016-07-26Rollup merge of #35029 - eulerdisk:fix_missing_comma_in_csv_dumper, r=nrcSteve Klabnik-1/+1
Fixed missing comma in the csv dumper. Added missing comma before `file_line_end`. r? @nrc
2016-07-26Rollup merge of #35028 - abhijeetbhagat:patch-6, r=alexcrichtonSteve Klabnik-369/+0
Remove no_stack_check tests (#34915) Part of fixes for #34915
2016-07-26Rollup merge of #35019 - frewsxcv:slice-split, r=GuillaumeGomezSteve Klabnik-6/+31
Rewrite/expansion of `slice::split` doc examples. None
2016-07-26Rollup merge of #35010 - GuillaumeGomez:file_doc, r=steveklabnikSteve Klabnik-5/+23
Improve Open doc Part of #29356. r? @steveklabnik
2016-07-26Rollup merge of #35009 - GuillaumeGomez:dir_entry_doc, r=steveklabnikSteve Klabnik-12/+100
Dir entry doc Part of #29356. r? @steveklabnik
2016-07-26Rollup merge of #35001 - rdwilliamson:patch-1, r=alexcrichtonSteve Klabnik-1/+1
Fix HashMap's values_mut example to use println! Fix HashMap's values_mut example to use println!
2016-07-26Rollup merge of #34995 - GuillaumeGomez:dir_builder_doc, r=steveklabnikSteve Klabnik-1/+28
Add DirBuilder doc examples r? @steveklabnik Part of #29329 and of #29356.
2016-07-26Rollup merge of #34990 - abhijeetbhagat:patch-3, r=steveklabnikSteve Klabnik-1/+2
Update underscore usage (#34903)
2016-07-26Rollup merge of #34974 - abhijeetbhagat:patch-2, r=GuillaumeGomezSteve Klabnik-0/+16
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-26Rollup merge of #34935 - GuillaumeGomez:hash_map_doc, r=steveklabnikSteve Klabnik-5/+198
Add HashMap Entry enums examples Part of #29348. r? @steveklabnik
2016-07-26Rollup merge of #34850 - tshepang:patch-3, r=steveklabnikSteve Klabnik-2/+1
doc: add missing pause