about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2016-08-04Update E0124 to the new error formatSamuel Cormier-Iijima-2/+6
2016-08-04Auto merge of #35168 - scottcarr:deaggregation, r=nikomatsakisbors-0/+41
[MIR] Deaggregate structs to enable further optimizations Currently, we generate MIR like: ``` tmp0 = ...; tmp1 = ...; tmp3 = Foo { a: ..., b: ... }; ``` This PR implements "deaggregation," i.e.: ``` tmp3.0 = ... tmp3.1 = ... ``` Currently, the code only deaggregates structs, not enums. My understanding is that we do not have MIR to set the discriminant of an enum.
2016-08-03Auto merge of #35015 - petrochenkov:forearg, r=nikomatsakisbors-0/+30
Properly enforce the "patterns aren't allowed in foreign functions" rule Cases like `arg @ PATTERN` or `mut arg` were missing. Apply the same rule to function pointer types. Closes https://github.com/rust-lang/rust/issues/35203 [breaking-change], no breakage in sane code is expected though r? @nikomatsakis This is somewhat related to https://github.com/rust-lang/rfcs/pull/1685 (cc @matklad). The goal is to eventually support full pattern syntax where it makes sense (function body may present) and to support *only* the following forms - `TYPE`, `ident: TYPE`, `_: TYPE` - where patterns don't make sense (function body doesn't present), i.e. in foreign functions and function pointer types.
2016-08-03Support removed LLVM intrinsics by invoking its AutoUpgrade mechanism.Eduard Burtescu-0/+30
2016-08-02Auto merge of #35159 - michaelwoerister:incr-comp-implies-orbit, r=nikomatsakisbors-0/+20
Automatically enable -Zorbit if -Zincremental is specified. Fixes #34973 r? @nikomatsakis
2016-08-03Properly enforce the "patterns aren't allowed in foreign functions" checkVadim Petrochenkov-0/+30
Apply the same check to function pointer types
2016-08-03rustc_trans: don't lose the cross-crate DefId, MIR trans needs it.Eduard Burtescu-0/+28
2016-08-02Automatically enable -Zorbit if -Zincremental is specified.Michael Woerister-0/+20
2016-08-02fix field type, add testScott A Carr-0/+41
2016-08-02Auto merge of #35145 - jseyfried:avoid_extra_resolve_error, r=arielb1bors-9/+9
resolve: Avoid emitting an unhelpful cascading resolution error Fixes #35142.
2016-08-02tests: mark the inline asm in run-pass/issue-14936 as volatile.Eduard Burtescu-1/+2
2016-08-02tests: don't use -Zorbit on run-pass/issue-28950, it stack overflows.Eduard Burtescu-0/+3
2016-08-01Fix fallout in `ui/codemap_tests`.Jeffrey Seyfried-5/+2
2016-08-01Auto merge of #35163 - sanxiyn:rollup, r=sanxiynbors-171/+22
Rollup of 8 pull requests - Successful merges: #34802, #35033, #35085, #35114, #35134, #35140, #35141, #35157 - Failed merges:
2016-08-02Rollup merge of #35140 - the-kenny:tcp-stress-test-const-thread-count, ↵Seo Sanghyeon-2/+5
r=alexcrichton tcp-stress-test: Pull out thread count as a constant This PR factors out the number of concurrent threads used in `tcp-stress-test.rs` to a constant at the top of the file. We at @NixOS had to lower our thread count as the chrooted-builds don't allow that many threads. This change will make it easier to lower/increase the count in the future (I actually forgot to change the second `1000` when I was working on this). Another benefit is the removal of magic numbers in the test suite. This is related to https://github.com/rust-lang/rust/issues/35107
2016-08-02Rollup merge of #34802 - petrochenkov:call, r=eddybSeo Sanghyeon-169/+17
Methods `Fn(Mut,Once)::call(mut,once)` are gated with two feature gates, remove one of them Methods `Fn::call`, `FnMut::call_mut` and `FnOnce::call_once` are gated with usual library feature `fn_traits` and also hardcoded in the compiler and gated once more with feature `unboxed_closures` This patch removes the `unboxed_closures`feature gate from these methods (`unboxed_closures` is still used for other things though), now they are gated only with `fn_traits`. All unnecessary `#![feature(unboxed_closures)]`s are removed, many of them are old and were already unnecessary before the change this PR does.
2016-08-01Auto merge of #34743 - badboy:llvm-upgrade, r=eddybbors-316/+1
LLVM upgrade As discussed in https://internals.rust-lang.org/t/need-help-with-emscripten-port/3154/46 I'm trying to update the used LLVM checkout in Rust. I basically took @shepmaster's code and applied it on top (though I did the commits manually, the [original commits have better descriptions](https://github.com/rust-lang/rust/compare/master...avr-rust:avr-support). With these changes I was able to build rustc. `make check` throws one last error on `run-pass/issue-28950.rs`. Output: https://gist.github.com/badboy/bcdd3bbde260860b6159aa49070a9052 I took the metadata changes as is and they seem to work, though it now uses the module in another step. I'm not sure if this is the best and correct way. Things to do: * [x] ~~Make `run-pass/issue-28950.rs` pass~~ unrelated * [x] Find out how the `PositionIndependentExecutable` setting is now used * [x] Is the `llvm::legacy` still the right way to do these things? cc @brson @alexcrichton
2016-08-01Auto merge of #34830 - michaelwoerister:internal-closures, r=nikomatsakisbors-0/+48
trans: Avoid weak linkage for closures when linking with MinGW. This PR proposes one possible solution to #34793, the problem that prevents https://github.com/servo/servo/pull/12393 from landing. It applies the same strategy, that we already use for monomorphizations, to closures, that is, instead of emitting symbols with `weak_odr` linkage in order to avoid symbol conflicts, we emit them with `internal` linkage, with the side effect that we have to copy code instead of just linking to it, if more than one codegen unit is involved. With this PR, the compiler will only apply this strategy for targets where we would actually run into a problem when using `weak_odr` linkage, in other words nothing will change for platforms except for MinGW. The solution implemented here has one restriction that could be lifted with some more effort, but it does not seem to be worth the trouble since it will go away once we use only MIR-trans: If someone compiles code 1. on MinGW, 2. with more than one codegen unit, 3. *not* using MIR-trans, 4. and runs into a closure inlined from another crate then the compiler will abort and suggest to compile either with just one codegen unit or `-Zorbit`. What's nice about this is that I lays a foundation for also doing the same for generics: using weak linkage where possible and thus enabling some more space optimizations that the linker can do. ~~This PR also contains a test case for compiling a program that contains more than 2^15 closures. It's a huge, generated file with almost 100K LOCs. I did not commit the script for generating the file but could do so. Alternatively, maybe someone wants to come up with a way of doing this with macros.~~ The test file is implemented via macros now (thanks @alexcrichton!) Opinions? Fixes #34793. cc @rust-lang/compiler
2016-08-01Add test case for large number of closures within one codegen unitMichael Woerister-0/+48
2016-08-01tcp-stress-test.rs: Only spawn 200 threads.Moritz Ulrich-1/+1
2016-07-31Auto merge of #35130 - sanxiyn:unused-type-parameter-error, r=nrcbors-7/+23
Suppress unused type parameter error when type has error field Fix #35075.
2016-07-31Auto merge of #35143 - arielb1:rfc447-regions, r=eddybbors-0/+36
typeck: use a TypeVisitor in ctp Use a TypeVisitor in ctp instead of `ty::walk` This fixes a few cases where a region could be projected out of a trait while not being constrained by the type parameters, violating rust-lang/rfcs#447 and breaking soundness. As such, this is a [breaking-change]. Fixes #35139 r? @eddyb
2016-07-31Make "type aliases cannot be used for traits" a note instead of a span_label.Jeffrey Seyfried-4/+3
2016-07-31Avoid emitting a unhelpful cascading resolution error.Jeffrey Seyfried-0/+4
2016-07-31typeck: use a TypeVisitor in ctpAriel Ben-Yehuda-0/+36
Fixes #35139
2016-07-31Auto merge of #34986 - nikomatsakis:issue-34349, r=arielb1bors-0/+32
Avoid writing a temporary closure kind We used to write a temporary closure kind into the inference table, but this could lead to obligations being incorrectled resolved before inference had completed. This result could then be cached, leading to further trouble. This patch avoids writing any closure kind until the computation is complete. Fixes #34349. r? @arielb1 -- what do you think?
2016-07-31tcp-stress-test: Factor out thread count as constant.Moritz Ulrich-2/+5
2016-07-31Auto merge of #34251 - zackmdavis:forbidden_on_whose_authority, r=Manishearthbors-0/+3
diagnostically note source of overruling outer forbid When we emit E0453 (lint level attribute overruled by outer `forbid` lint level), it could be helpful to note where the `forbid` level was set, for the convenience of users who, e.g., believe that the correct fix is to weaken the `forbid` to `deny`. ![forbidden_on_whose_authority](https://cloud.githubusercontent.com/assets/1076988/15995312/2d847376-30ce-11e6-865e-b68cfebc0291.png)
2016-07-31Don't gate methods `Fn(Mut,Once)::call(mut,once)` with feature ↵Vadim Petrochenkov-169/+17
`unboxed_closures` They are already gated with feature `fn_traits`
2016-07-30Auto merge of #34904 - petrochenkov:rustcall, r=nikomatsakisbors-41/+61
Properly feature gate all unstable ABIs Fixes https://github.com/rust-lang/rust/issues/34900 [breaking-change] r? @pnkfelix --- Function-visiting machinery for AST/HIR is surprisingly error-prone, it's *very* easy to miss some cases or visit something twice while writing a visitor. This is the true problem behind https://github.com/rust-lang/rust/issues/34900. I'll try to restructure these visitors a bit and send one more PR later.
2016-07-30diagnostically note source of overruling outer forbidZack M. Davis-0/+3
When we emit E0453 (lint level attribute overruled by outer `forbid` lint level), it could be helpful to note where the `forbid` level was set, for the convenience of users who, e.g., believe that the correct fix is to weaken the `forbid` to `deny`.
2016-07-31Suppress unused type parameter error when type has error fieldSeo Sanghyeon-7/+23
2016-07-30Rollup merge of #35106 - xen0n:issue-35082, r=alexcrichtonManish Goregaokar-0/+6
syntax_ext: format: fix ICE with bad named arguments Fixes #35082 by guarding against a new case of malformed invocation not previously covered. r? @alexcrichton
2016-07-30Rollup merge of #35080 - jonathandturner:fix_numeric_expected_found, ↵Manish Goregaokar-40/+40
r=nikomatsakis Rename _ to {integer} and {float} for unknown numeric types This PR renames _ to {integer} or {float} for unknown numeric types, to help people parse error messages that have numeric types that haven't been nailed down. Example: ```rust fn main() { let x: String = 4; } ``` Before: ``` error[E0308]: mismatched types --> quicktest.rs:2:21 | 2 | let x: String = 4; | ^ expected struct `std::string::String`, found integral variable | = note: expected type `std::string::String` = note: found type `_` error: aborting due to previous error ``` after: ``` error[E0308]: mismatched types --> quicktest.rs:2:21 | 2 | let x: String = 4; | ^ expected struct `std::string::String`, found integral variable | = note: expected type `std::string::String` = note: found type `{integer}` error: aborting due to previous error ``` ```
2016-07-30Rollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrcManish Goregaokar-8/+8
resolve: Exclude inaccessible names from single imports 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. r? @nrc
2016-07-29syntax_ext: format: fix ICE with bad named argumentsWang Xuerui-0/+6
2016-07-29test: Fix a test on MSVCAlex Crichton-13/+1
Apparently MSVC now has namespaces in backtraces!
2016-07-29test: Remove the execution-engine testAlex Crichton-303/+0
We don't actually officially support this at all, and the execution engine support in LLVM we've had to gut as it's not compiling on MinGW, so just delete this test for now.
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-28Move to {integer} and {float}Jonathan Turner-40/+40
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-28Rename _ to {numerics} for unknown numeric typesJonathan Turner-39/+39
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