summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2016-09-21Workaround #34427 by using memset of 0 on ARM to set the discriminant.Felix S. Klock II-0/+26
Conflicts: src/librustc_trans/adt.rs
2016-09-21add missing testNiko Matsakis-0/+28
2016-09-21use `adt::trans_const` when translating constant closures and tuplesAriel Ben-Yehuda-0/+25
Fixes #36401
2016-09-19Remove data structure specialization for .zip() iteratorUlrik Sverdrup-0/+17
Go back on half the specialization, the part that changed the Zip struct's fields themselves depending on the types of the iterators. This means that the Zip iterator will always carry two usize fields, which are unused. If a whole for loop using a .zip() iterator is inlined, these are simply removed and have no effect. The same improvement for Zip of for example slice iterators remain, and they still optimize well. However, like when the specialization of zip was merged, the compiler is still very sensistive to the exact context. For example this code only autovectorizes if the function is used, not if the code in zip_sum_i32 is inserted inline it was called: ``` fn zip_sum_i32(xs: &[i32], ys: &[i32]) -> i32 { let mut s = 0; for (&x, &y) in xs.iter().zip(ys) { s += x * y; } s } fn zipdot_i32_default_zip(b: &mut test::Bencher) { let xs = vec![1; 1024]; let ys = vec![1; 1024]; b.iter(|| { zip_sum_i32(&xs, &ys) }) } ``` Include a test that checks that Zip<T, U> is covariant w.r.t. T and U.
2016-09-19Up the LLVMSimonas Kazlauskas-0/+40
Fixes #36474
2016-09-16Make `private_in_public` compatibility lint warn-by-default againVadim Petrochenkov-2/+6
2016-09-16Fix issue #36036.Felix S. Klock II-0/+36
We were treating an associated type as unsized even when the concrete instantiation was actually sized. Fix is to normalize before checking if it is sized.
2016-09-12llvm: backport "[SimplifyCFG] Hoisting invalidates metadata".Eduard Burtescu-0/+32
2016-09-12rustc_trans: do not generate allocas for unused locals.Eduard Burtescu-0/+18
2016-09-12typeck: use NoExpectation to check return type of diverging fnAlex Burka-0/+35
This fixes #35849, a regression introduced by the typeck refactoring around TyNever/!.
2016-08-22Properly invalidate the early exit cacheSimonas Kazlauskas-0/+37
Fixes #35737
2016-08-16Auto merge of #35617 - jseyfried:fix_unused_cfg_attr_path, r=eddybbors-2/+14
Fix incorrect unused import warnings on `cfg_attr`ed `path` attributes Fixes #35584. r? @eddyb
2016-08-16Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakisbors-67/+319
Implement the `!` type This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
2016-08-15Auto merge of #35680 - GuillaumeGomez:err_codes, r=jonathandturnerbors-0/+242
Err codes r? @jonathandturner
2016-08-15Auto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakisbors-3/+38
Take commandline arguments into account for incr. comp. Implements the conservative strategy described in https://github.com/rust-lang/rust/issues/33727. From now one, every time a new commandline option is added, one has to specify if it influences the incremental compilation cache. I've tried to implement this as automatic as possible: One just has to added either the `[TRACKED]` or the `[UNTRACKED]` marker next to the field. The `Options`, `CodegenOptions`, and `DebuggingOptions` definitions in `session::config` show plenty of examples. The PR removes some cruft from `session::config::Options`, mostly unnecessary copies of flags also present in `DebuggingOptions` or `CodeGenOptions` in the same struct. One notable removal is the `cfg` field that contained the values passed via `--cfg` commandline arguments. I chose to remove it because (1) its content is only a subset of what later is stored in `hir::Crate::config` and it's pretty likely that reading the cfgs from `Options` would not be what you wanted, and (2) we could not incorporate it into the dep-tracking hash of the `Options` struct because of how the test framework works, leaving us with a piece of untracked but vital data. It is now recommended (just as before) to access the crate config via the `krate()` method in the HIR map. Because the `cfg` field is not present in the `Options` struct any more, some methods in the `CompilerCalls` trait now take the crate config as an explicit parameter -- which might constitute a breaking change for plugin authors.
2016-08-15Add new error code testsGuillaume Gomez-0/+242
2016-08-15Auto merge of #35567 - creativcoder:e0261, r=jonathandturnerbors-0/+3
Update E0261 and E0262 to new error format Fixes #35516 and #35517 . Part of #35233 r? @jonathandturner
2016-08-14Auto merge of #35666 - eddyb:rollup, r=eddybbors-86/+162
Rollup of 30 pull requests - Successful merges: #34941, #35392, #35444, #35447, #35491, #35533, #35539, #35558, #35573, #35574, #35577, #35586, #35588, #35594, #35596, #35597, #35598, #35606, #35611, #35615, #35616, #35620, #35622, #35640, #35643, #35644, #35646, #35647, #35648, #35661 - Failed merges: #35395, #35415
2016-08-14Auto merge of #35409 - eddyb:mir-storage-stmts, r=nikomatsakisbors-2/+101
[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}. Storage live ranges are tracked for all MIR variables and temporaries with a drop scope. `StorageLive` is lowered to `llvm.lifetime.start` and `StorageDead` to `llvm.lifetime.end`. There are some improvements possible here, such as: * pack multiple storage liveness statements by using the index of first local + `u64` bitset * enforce that locals are not directly accessed outside their storage live range * shrink storage live ranges for never-borrowed locals to initialization -> last use * emit storage liveness statements for *all* temporaries * however, the remaining ones are *always* SSA immediates, so they'd be noop in MIR trans * could have a flag on the temporary that its storage is irrelevant (a la C's old `register`) * would also deny borrows if necessary * this seems like an overcompliation and with packing & optimizations it may be pointless Even in the current state, it helps stage2 `rustc` compile `boiler` without overflowing (see #35408). A later addition fixes #26764 and closes #27372 by emitting `.section` directives for dylib metadata to avoid them being allocated into memory or read as `.note`. For this PR, those bugs were tripping valgrind.
2016-08-14Rollup merge of #35648 - ahmedcharles:pred, r=alexcrichtonEduard-Mihai Burtescu-18/+0
Predicates haven't existed in almost 5 years. This test probably adds negative value other than historical amusement.
2016-08-14Rollup merge of #35647 - ahmedcharles:spelling, r=alexcrichtonEduard-Mihai Burtescu-23/+23
Ensure that attributes are spelled properly.
2016-08-14Rollup merge of #35646 - theypsilon:master, r=jonathandturnerEduard-Mihai Burtescu-0/+1
E0094 error message updated Part of #35233 Fixes #35231 r? @jonathandturner
2016-08-14Rollup merge of #35644 - garekkream:update-E0302-new-error-format, ↵Eduard-Mihai Burtescu-0/+1
r=jonathandturner Update E0302 to the new format Part of #35233. Fixes #35523. r? @jonathandturner
2016-08-14Rollup merge of #35643 - garekkream:update-E0301-new-error-format, ↵Eduard-Mihai Burtescu-0/+1
r=jonathandturner Update E0301 to the new format Part of #35233. Fixes #35522. r? @jonathandturner
2016-08-14Rollup merge of #35616 - clementmiao:E0067_new_error_format, r=jonathandturnerEduard-Mihai Burtescu-0/+2
changed E0067 to new error format Updated E0067 to new error format. Part of #35233 Fixes #35502 Passes all the tests when running: `python src/bootstrap/bootstrap.py --step check-cfail --stage 1` **This seems strange, given that the format for E0067 has been changed.** It feels like it should fail some unit tests maybe? Let me know if I'm mistaken. Otherwise I can create a unit test for it. Thanks for letting me help! r? @jonathandturner
2016-08-14Rollup merge of #35615 - clementmiao:E0070_new_error_format, r=jonathandturnerEduard-Mihai Burtescu-0/+1
Update E0070 to new error format Updated E0070 to new error format. Part of #35233 Fixes #35503 Thanks for letting me help! r? @jonathandturner
2016-08-14Rollup merge of #35611 - jonathandturner:ptr-helper, r=nikomatsakisEduard-Mihai Burtescu-21/+21
Improve &-ptr printing This PR replaces printing `&-ptr` with a more readable description. To do so it uses a few heuristics. If the name of the type is unknown, too long (longer than just saying "reference"), or too complex (a type with explicit lifetime annotations), it will instead opt to print either "reference" or "mutable reference", depending on the mutability of the type. Before: ``` error[E0308]: mismatched types --> src/test/compile-fail/issue-7061.rs:14:46 | 14 | fn foo(&'a mut self) -> Box<BarStruct> { self } | ^^^^ expected box, found &-ptr | = note: expected type `Box<BarStruct>` = note: found type `&'a mut BarStruct` error: aborting due to previous error ``` After: ``` error[E0308]: mismatched types --> src/test/compile-fail/issue-7061.rs:14:46 | 14 | fn foo(&'a mut self) -> Box<BarStruct> { self } | ^^^^ expected box, found mutable reference | = note: expected type `Box<BarStruct>` = note: found type `&'a mut BarStruct` error: aborting due to previous error ```
2016-08-14Rollup merge of #35596 - crypto-universe:E0254_style_and_tests, ↵Eduard-Mihai Burtescu-1/+4
r=jonathandturner Add label to E0254 This issue #35513 is a part of #35233. r? @jonathandturner
2016-08-14Rollup merge of #35586 - shyaamsundhar:SqushCom, r=jonathandturnerEduard-Mihai Burtescu-0/+2
E0248, E0267 & E0268 Change into issue format r? @jonathandturner Part of #35391, #35519 and #35520. I have squashed all changes into a single commit. Please review the changes. E0248 Change in issue format E0267 UT New Format E0268 UT New Format E0267 & E0268 New Error Format
2016-08-14Rollup merge of #35574 - badboy:emscripten-test-fixes, r=brsonEduard-Mihai Burtescu-3/+57
Emscripten test fixes This picks up parts of #31623 to disable certain tests that emscripten can't run, as threads/processes are not supported. I re-applied @tomaka's changes manually, I can rebase those commits with his credentials if he wants. It also disables jemalloc for emscripten (at least in Rustbuild, I have to check if there is another setting for the same thing in the old makefile approach). This should not impact anything for normal builds.
2016-08-14Rollup merge of #35573 - wdv4758h:E0138, r=jonathandturnerEduard-Mihai Burtescu-1/+4
Update E0138 to new format Part of #35233 Fix #35510 r? @jonathandturner ![e0138](https://cloud.githubusercontent.com/assets/2716047/17562415/7200d93c-5f5d-11e6-98ff-e15c29f40e03.png) Question: How can I only underline the function name ? I have observed the debug output and the struct of item, but I can't find the `Span` for function name. Should I modify the struct I get to save function name's position or there is another way to get it ? (I can only find `Span`s for function attributes, inputs, outputs, blocks)
2016-08-14Rollup merge of #35558 - lukehinds:master, r=nikomatsakisEduard-Mihai Burtescu-1/+3
Update error message for E0253 #35512 Fixes #35512. Part of #35233.
2016-08-14Rollup merge of #35533 - frewsxcv:22984, r=brsonEduard-Mihai Burtescu-0/+13
Add regression test for #22894. None
2016-08-14Rollup merge of #35491 - sanxiyn:pub-restricted-span, r=nikomatsakisEduard-Mihai Burtescu-16/+27
Correct span for pub_restricted field Fix #35435.
2016-08-14Auto merge of #35534 - michaelwoerister:fix-const-collection2, r=nikomatsakisbors-0/+93
Make the translation item collector handle *uses* of 'const' items instead of declarations. This should fix issue #34754.
2016-08-14Auto merge of #34206 - petrochenkov:pipdeny, r=nikomatsakisbors-58/+97
Make `private_in_public` compatibility lint deny-by-default In accordance with the [plan](https://internals.rust-lang.org/t/fcp-for-various-future-compatibility-warnings/3590/5?u=petrochenkov). r? @nikomatsakis
2016-08-14updated compile-fail testsRahul Sharma-0/+3
2016-08-13Auto merge of #35453 - jseyfried:hygienize_metavariables, r=nrcbors-2/+29
macros: Make metavariables hygienic This PR makes metavariables hygienic. For example, consider: ```rust macro_rules! foo { ($x:tt) => { // Suppose that this token tree argument is always a metavariable. macro_rules! bar { ($x:expr, $y:expr) => { ($x, $y) } } } } fn main() { foo!($z); // This currently compiles. foo!($y); // This is an error today but compiles after this PR. } ``` Today, the `macro_rules! bar { ... }` definition is only valid when the metavariable passed to `foo` is not `$y` (since it unhygienically conflicts with the `$y` in the definition of `bar`) or `$x` (c.f. #35450). After this PR, the definition of `bar` is always valid (and `bar!(a, b)` always expands to `(a, b)` as expected). This can break code that was allowed in #34925 (landed two weeks ago). For example, ```rust macro_rules! outer { ($t:tt) => { macro_rules! inner { ($i:item) => { $t } } } } outer!($i); // This `$i` should not interact with the `$i` in the definition of `inner!`. inner!(fn main() {}); // After this PR, this is an error ("unknown macro variable `i`"). ``` Due to the severe limitations on nested `macro_rules!` before #34925, this is not a breaking change for stable/beta. Fixes #35450. r? @nrc
2016-08-14[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}.Eduard Burtescu-2/+101
2016-08-13Add regression test.Jeffrey Seyfried-2/+14
2016-08-13Improve comments on ! testsAndrew Cann-0/+2
2016-08-13Fix `make tidy`Andrew Cann-1/+1
2016-08-13Add explanations to testsAndrew Cann-0/+37
2016-08-13Permit `! as T` with testAndrew Cann-0/+18
2016-08-13Add another test for !Andrew Cann-0/+34
2016-08-13Add tests for ! typeAndrew Cann-0/+259
2016-08-13Add some tests for ! typeAndrew Cann-0/+60
2016-08-13Add run-pass/never_coercions.rs testAndrew Cann-0/+19
2016-08-13Rename empty/bang to neverAndrew Cann-3/+1
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Control usage of `!` through a feature gate.Andrew Cann-0/+1
Adds the `bang_type` feature gate. `!` in a non-return-type position now relies on that feature.