about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2016-07-28Auto merge of #34956 - nikomatsakis:incr-comp-o-files, r=mwbors-2/+262
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-28Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichtonbors-4/+4
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-0/+63
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-10/+0
2016-07-28Add a testing mechanism and a simple spike testNiko Matsakis-0/+197
2016-07-28Modify trans to skip generating `.o` filesNiko Matsakis-2/+12
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-28Rollup merge of #35037 - ollie27:rustdoc_tuple_struct_where, r=alexcrichtonManish Goregaokar-1/+17
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-0/+23
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-0/+27
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-28Auto merge of #34908 - jseyfried:improve_tt_matchers, r=nrcbors-0/+20
macros: Improve `tt` matchers Fixes #5846, fixes #22819. r? @nrc
2016-07-28Add regression testJeffrey Seyfried-0/+20
2016-07-28Rename `char::escape` to `char::escape_debug` and add tracking issueTobias Bucher-1/+1
2016-07-27Auto merge of #34907 - arielb1:found-parse-error, r=nikomatsakisbors-153/+300
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-27Auto merge of #34856 - jseyfried:refactor_reset_tls, r=nrcbors-1/+2
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-0/+16
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-0/+44
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-26DoubleEndedIterator for ArgsSebastian Thiel-0/+44
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-25Weaken test `compile-fail/lifetime-inference-give-expl-lifetime-param`.Jeffrey Seyfried-1/+2
2016-07-25rustdoc: Fix tuple struct where clause renderingOliver Middleton-1/+17
For tuple structs the where clause comes after the definition.
2016-07-25Remove no_stack_check tests (#34915)abhi-369/+0
Part of fixes for #34915
2016-07-25add include ../tools.mk to the MakefileJorge Aparicio-0/+2
2016-07-24move coerce-match{,-calls} into run-pass-valgrindTamir Duberstein-0/+0
Closes #21696.
2016-07-24Rollup merge of #34972 - oli-obk:cant_cast_str_to_const_ptr, r=eddybManish Goregaokar-1/+4
improve const eval error reporting on "" and b"" casts r? @eddyb cc @ubsan
2016-07-23Auto merge of #34925 - jseyfried:nested_macros, r=eddybbors-0/+9
Support nested `macro_rules!` Fixes #6994. r? @eddyb
2016-07-23Fix run-pass/ifmt testTobias Bucher-3/+3
2016-07-23address review commentsAriel Ben-Yehuda-32/+28
I split the RFC1592 commit out
2016-07-22Add regression test.Jeffrey Seyfried-0/+23
2016-07-22Auto merge of #34917 - michaelwoerister:fix-internalize-symbols, r=eddybbors-0/+20
Fix wrong condition in base::internalize_symbols(). Fix a typo that snuck into https://github.com/rust-lang/rust/pull/34899 (and completely broke `internalize_symbols()`).
2016-07-22try to recover the non-matching types in projection errorsAriel Ben-Yehuda-1/+40
The type equation in projection takes place under a binder and a snapshot, which we can't easily take types out of. Instead, when encountering a projection error, try to re-do the projection and find the type error then. This fails to produce a sane type error when the failure was a "leak_check" failure. I can't think of a sane way to show *these*, so I just left them use the old crappy representation, and added a test to make sure we don't break them.
2016-07-22refactor constant evaluation error reportingAriel Ben-Yehuda-119/+209
Refactor constant evaluation to use a single error reporting function that reports a type-error-like message. Also, unify all error codes with the "constant evaluation error" message to just E0080, and similarly for a few other duplicate codes. The old situation was a total mess, and now that we have *something* we can further iterate on the UX.
2016-07-22switch projection errors to use the new type error messagesAriel Ben-Yehuda-4/+28
Unfortunately, projection errors do not come with a nice set of mismatched types. This is because the type equality check occurs within a higher-ranked context. Therefore, only the type error is reported. This is ugly but was always the situation. I will introduce better errors for the lower-ranked case in another commit. Fixes the last known occurence of #31173
2016-07-22switch compare_method to new-style trait error reportingAriel Ben-Yehuda-15/+12
2016-07-22remove rustc_typeck::same_type_errAriel Ben-Yehuda-6/+7
2016-07-22improve const eval error reporting on "" and b"" castsOliver Schneider-1/+4
2016-07-21Auto merge of #34715 - scottcarr:mir-test, r=nikomatsakisbors-0/+89
Add MIR Optimization Tests I've starting working on the infrastructure for testing MIR optimizations. The plan now is to have a set of test cases (written in Rust), compile them with -Z dump-mir, and check the MIR before and after each pass.
2016-07-21Auto merge of #34544 - ↵bors-1/+2
3Hren:issue/xx/reinterpret-format-precision-for-strings, r=alexcrichton feat: reinterpret `precision` field for strings This commit changes the behavior of formatting string arguments with both width and precision fields set. Documentation says that the `width` field is the "minimum width" that the format should take up. If the value's string does not fill up this many characters, then the padding specified by fill/alignment will be used to take up the required space. This is true for all formatted types except string, which is truncated down to `precision` number of chars and then all of `fill`, `align` and `width` fields are completely ignored. For example: `format!("{:/^10.8}", "1234567890);` emits "12345678". In the contrast Python version works as the expected: ```python >>> '{:/^10.8}'.format('1234567890') '/12345678/' ``` This commit gives back the `Python` behavior by changing the `precision` field meaning to the truncation and nothing more. The result string *will* be prepended/appended up to the `width` field with the proper `fill` char. __However, this is the breaking change, I admit.__ Feel free to close it, but otherwise it should be mentioned in the `std::fmt` documentation somewhere near of `fill/align/width` fields description.
2016-07-21Fix ICE happening when unresolved imports are used in patternsVadim Petrochenkov-0/+27
2016-07-20add mir optimization tests, dump-mir-dir optionScott A Carr-0/+89
2016-07-19Add regression test.Jeffrey Seyfried-0/+9
2016-07-19Auto merge of #34898 - sanxiyn:rollup, r=sanxiynbors-0/+2
Rollup of 5 pull requests - Successful merges: #34807, #34853, #34875, #34884, #34889 - Failed merges:
2016-07-19Add codegen test to make sure that closures are 'internalized' properly.Michael Woerister-0/+20
2016-07-18Auto merge of #34357 - tbu-:pr_exact_size_is_empty, r=brsonbors-3/+4
Add `is_empty` function to `ExactSizeIterator` All other types implementing a `len` functions have `is_empty` already.
2016-07-18Rollup merge of #34889 - infinity0:master, r=sanxiynSeo Sanghyeon-0/+2
Test fixes for ARM64 When these changes are applied, rustc 1.10.0 tests pass successfully on [asachi.debian.org](https://db.debian.org/machines.cgi?host=asachi).
2016-07-18Auto merge of #34886 - jseyfried:improve_stmt_matchers, r=eddybbors-0/+17
macros: fix bug in `stmt` matchers Today, `stmt` matchers stop too early when parsing expression statements that begin with non-braced macro invocations. For example, ```rust fn main() { macro_rules! m { ($s:stmt;) => { $s } } id!(vec![].push(0);); //^ Before this PR, the `stmt` matcher only consumes "vec![]", so this is an error. //| After this PR, the `stmt` matcher consumes "vec![].push(0)", so this compiles. } ``` This change is backwards compatible due to the follow set for `stmt`. r? @eddyb
2016-07-17test: disable more stdcall tests for ARM arches. temp workaround for #24958Ximin Luo-0/+2
2016-07-17Add regression testJeffrey Seyfried-0/+17
2016-07-17Auto merge of #34871 - petrochenkov:inherent, r=jseyfriedbors-1/+1
Do not resolve inherent static methods from other crates prematurely Under some specific circumstances paths like `Type::method` can be resolved early in rustc_resolve instead of type checker. `Type` must be defined in another crate, it should be an enum or a trait object (i.e. a type that acts as a "module" in resolve), and `method` should be an inherent static method. As a result, such paths don't go through `resolve_ufcs`, may be resolved incorrectly and break some invariants in type checker. This patch removes special treatment of such methods. The removed code was introduced in https://github.com/rust-lang/rust/commit/2bd46e767c0fe5b6188df61cb9daf8f2e65a3ed0 to fix a problem that no longer exists. r? @jseyfried
2016-07-17Auto merge of #34789 - jonathandturner:simplify_liberror, r=alexcrichtonbors-15/+431
Simplify librustc_errors This is part 2 of the error crate refactor, starting with #34403. In this refactor, I focused on slimming down the error crate to fewer moving parts. As such, I've removed quite a few parts and replaced the with simpler, straight-line code. Specifically, this PR: * Removes BasicEmitter * Remove emit from emitter, leaving emit_struct * Renames emit_struct to emit * Removes CoreEmitter and focuses on a single Emitter * Implements the latest changes to error format RFC (#1644) * Removes (now-unused) code in emitter.rs and snippet.rs * Moves more tests to the UI tester, removing some duplicate tests in the process There is probably more that could be done with some additional refactoring, but this felt like it was getting to a good state. r? @alexcrichton cc: @Manishearth (as there may be breaking changes in stuff I removed/changed)
2016-07-17Do not resolve inherent static methods from other crates prematurelyVadim Petrochenkov-1/+1