about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2017-11-01Auto merge of #45435 - eddyb:binop-subtype-lhs, r=nikomatsakisbors-0/+55
rustc_typeck: use subtyping on the LHS of binops. Fixes #45425. r? @nikomatsakis
2017-10-31rustc_typeck: use subtyping on the LHS of binops.Eduard-Mihai Burtescu-0/+55
2017-10-31Count type aliases in patternssinkuu-0/+18
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-0/+207
2017-10-26Auto merge of #45519 - michaelwoerister:dedup-errors, r=arielb1bors-0/+0
Don't emit the same compiler diagnostic twice. This PR makes the compiler filter out diagnostic messages that have already been emitted during the same compilation session.
2017-10-26Auto merge of #45488 - oli-obk:ctfe_resolve, r=eddybbors-0/+28
Resolve types properly in const eval r? @eddyb cc @arielb1
2017-10-26Auto merge of #45464 - sinkuu:ice_44851, r=jseyfriedbors-0/+24
Visit attribute tokens in `DefCollector` and `BuildReducedGraphVisitor` Fixes #44851.
2017-10-25Rename some run-pass tests so they don't crash when executed from eCryptfs.Michael Woerister-0/+0
2017-10-25Add a regression test for the const eval type resolutionOliver Schneider-0/+28
2017-10-23Fix #44851 by visiting tokens in `DefCollector` and `BuildReducedGraphVisitor`sinkuu-0/+24
2017-10-22`crate` shorthand visibility modifierZack M. Davis-1/+13
With regrets, this breaks rustfmt and rls. This is in the matter of #45388.
2017-10-20Auto merge of #45348 - alexcrichton:thinlto-timp, r=michaelwoeristerbors-0/+52
rustc: Add `_imp_` symbols later in compilation On MSVC targets rustc will add symbols prefixed with `_imp_` to LLVM modules to "emulate" dllexported statics as that workaround is still in place after #27438 hasn't been solved otherwise. These statics, however, were getting gc'd by ThinLTO accidentally which later would cause linking failures. This commit updates the location we add such symbols to happen just before codegen to ensure that (a) they're not eliminated by the optimizer and (b) the optimizer doesn't even worry about them. Closes #45347
2017-10-20Auto merge of #45359 - arielb1:escaping-borrow, r=eddybbors-1/+35
Fix a few bugs in drop generation This fixes a few bugs in drop generation, one of which causes spurious MIR borrowck errors. Fixes #44832. r? @eddyb
2017-10-20Auto merge of #45316 - goffrie:exitable-breakable-block, r=nikomatsakisbors-0/+24
Mark block exits as reachable if the block can break. This only happens when desugaring `catch` expressions for now, but regular blocks (in HIR) can be broken from - respect that when doing reachability analysis. Fixes #45124.
2017-10-20Rollup merge of #45352 - alexcrichton:emscripten-tests, r=nikomatsakiskennytm-56/+55
test: Update Emscripten failures/passing All tests should now have annotation for *why* they're ignored on emscripten. A few tests no longer need such an annotation as well! Closes #41299
2017-10-19Rollup merge of #45326 - cuviper:min-llvm-3.9, r=alexcrichtonkennytm-2/+0
Bump the minimum LLVM to 3.9 Old LLVM bugs are reportedly cropping up harder, but 3.9 seems to be OK. Fixes #45277.
2017-10-18Remove two obsolete min-llvm-version testsJosh Stone-2/+0
2017-10-18rustc: Add `_imp_` symbols later in compilationAlex Crichton-0/+52
On MSVC targets rustc will add symbols prefixed with `_imp_` to LLVM modules to "emulate" dllexported statics as that workaround is still in place after #27438 hasn't been solved otherwise. These statics, however, were getting gc'd by ThinLTO accidentally which later would cause linking failures. This commit updates the location we add such symbols to happen just before codegen to ensure that (a) they're not eliminated by the optimizer and (b) the optimizer doesn't even worry about them. Closes #45347
2017-10-18Auto merge of #44501 - nikomatsakis:issue-44137-non-query-data-in-tcx, r=eddybbors-0/+36
remove or encapsulate the remaining non-query data in tcx I wound up removing the existing cache around inhabitedness since it didn't seem to be adding much value. I reworked const rvalue promotion, but not that much (i.e., I did not split the computation into bits, as @eddyb had tossed out as a suggestion). But it's now demand driven, at least. cc @michaelwoerister -- see the `forbid_reads` change in last commit r? @eddyb -- since the trickiest of this PR is the work on const rvalue promotion cc #44137
2017-10-17test: Update Emscripten failures/passingAlex Crichton-56/+55
All tests should now have annotation for *why* they're ignored on emscripten. A few tests no longer need such an annotation as well! Closes #41299
2017-10-17look past the next drop for the drop panic targetAriel Ben-Yehuda-5/+17
The previous code would leak data on a drop panic if the immediate next drop was a StorageDead that was followed by another drop.
2017-10-17fix generator drop cachingAriel Ben-Yehuda-1/+23
Fixes #45328.
2017-10-17Auto merge of #45311 - goffrie:issue-40003, r=alexcrichtonbors-0/+186
Add the test for #40003. I checked that the test failed to compile on an older nightly (I tried 2017-09-29) and that it compiles against master. Closes #40003.
2017-10-16restructure the public inhabitedness APIs and remove the cacheNiko Matsakis-0/+36
The cache was broken anyhow and this computation doesn't look that expensive. These public accessors could potentially become queries, but we'd have to add some more complex logic around lift. I'd prefer to have some test cases to profile with before doing that. Fixes #44402.
2017-10-16Auto merge of #45297 - matthewjasper:associated-item-namespaces, r=petrochenkovbors-0/+51
Check namespaces when resolving associated items in typeck Closes #35600 Closes #44247 Fixes a "cannot move a value of type..." error in the same case as #44247 but with the associated items swapped.
2017-10-15Mark block exits as reachable if the block can break.Geoffry Song-0/+24
2017-10-15Add test for #40003.Geoffry Song-0/+186
2017-10-15rustc: Fix some ThinLTO internalizationAlex Crichton-0/+34
First the `addPreservedGUID` function forgot to take care of "alias" summaries. I'm not 100% sure what this is but the current code now matches upstream. Next the `computeDeadSymbols` return value wasn't actually being used, but it needed to be used! Together these should... Closes #45195
2017-10-15Check namespaces when resolving associated items in typeckmatthewjasper-0/+51
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-0/+24
2017-10-13Rollup merge of #45189 - alexcrichton:thinlto-allocators, r=michaelwoeristerkennytm-41/+19
rustc: Handle `#[no_mangle]` anywhere in a crate This commit updates the reachability pass of the compiler to seed the local worklist with `#[no_mangle]`-like items anywhere in a crate, not just those reachable from public items. Closes #45165
2017-10-12rustc: Handle `#[linkage]` anywhere in a crateAlex Crichton-41/+19
This commit updates the reachability pass of the compiler to seed the local worklist with `#[linkage]`-like items anywhere in a crate, not just those reachable from public items. Closes #45165
2017-10-11Shorten some test namesVadim Petrochenkov-9/+9
Paths to object files generated from them were too long and caused errors
2017-10-10Auto merge of #44822 - frewsxcv:frewsxcv-eprintln, r=Kimundibors-3/+1
Migrate to eprint/eprintln macros where appropriate. None
2017-10-07Auto merge of #44841 - alexcrichton:thinlto, r=michaelwoeristerbors-0/+94
rustc: Implement ThinLTO This commit is an implementation of LLVM's ThinLTO for consumption in rustc itself. Currently today LTO works by merging all relevant LLVM modules into one and then running optimization passes. "Thin" LTO operates differently by having more sharded work and allowing parallelism opportunities between optimizing codegen units. Further down the road Thin LTO also allows *incremental* LTO which should enable even faster release builds without compromising on the performance we have today. This commit uses a `-Z thinlto` flag to gate whether ThinLTO is enabled. It then also implements two forms of ThinLTO: * In one mode we'll *only* perform ThinLTO over the codegen units produced in a single compilation. That is, we won't load upstream rlibs, but we'll instead just perform ThinLTO amongst all codegen units produced by the compiler for the local crate. This is intended to emulate a desired end point where we have codegen units turned on by default for all crates and ThinLTO allows us to do this without performance loss. * In anther mode, like full LTO today, we'll optimize all upstream dependencies in "thin" mode. Unlike today, however, this LTO step is fully parallelized so should finish much more quickly. There's a good bit of comments about what the implementation is doing and where it came from, but the tl;dr; is that currently most of the support here is copied from upstream LLVM. This code duplication is done for a number of reasons: * Controlling parallelism means we can use the existing jobserver support to avoid overloading machines. * We will likely want a slightly different form of incremental caching which integrates with our own incremental strategy, but this is yet to be determined. * This buys us some flexibility about when/where we run ThinLTO, as well as having it tailored to fit our needs for the time being. * Finally this allows us to reuse some artifacts such as our `TargetMachine` creation, where all our options we used today aren't necessarily supported by upstream LLVM yet. My hope is that we can get some experience with this copy/paste in tree and then eventually upstream some work to LLVM itself to avoid the duplication while still ensuring our needs are met. Otherwise I fear that maintaining these bindings may be quite costly over the years with LLVM updates!
2017-10-07rustc: Implement ThinLTOAlex Crichton-0/+94
This commit is an implementation of LLVM's ThinLTO for consumption in rustc itself. Currently today LTO works by merging all relevant LLVM modules into one and then running optimization passes. "Thin" LTO operates differently by having more sharded work and allowing parallelism opportunities between optimizing codegen units. Further down the road Thin LTO also allows *incremental* LTO which should enable even faster release builds without compromising on the performance we have today. This commit uses a `-Z thinlto` flag to gate whether ThinLTO is enabled. It then also implements two forms of ThinLTO: * In one mode we'll *only* perform ThinLTO over the codegen units produced in a single compilation. That is, we won't load upstream rlibs, but we'll instead just perform ThinLTO amongst all codegen units produced by the compiler for the local crate. This is intended to emulate a desired end point where we have codegen units turned on by default for all crates and ThinLTO allows us to do this without performance loss. * In anther mode, like full LTO today, we'll optimize all upstream dependencies in "thin" mode. Unlike today, however, this LTO step is fully parallelized so should finish much more quickly. There's a good bit of comments about what the implementation is doing and where it came from, but the tl;dr; is that currently most of the support here is copied from upstream LLVM. This code duplication is done for a number of reasons: * Controlling parallelism means we can use the existing jobserver support to avoid overloading machines. * We will likely want a slightly different form of incremental caching which integrates with our own incremental strategy, but this is yet to be determined. * This buys us some flexibility about when/where we run ThinLTO, as well as having it tailored to fit our needs for the time being. * Finally this allows us to reuse some artifacts such as our `TargetMachine` creation, where all our options we used today aren't necessarily supported by upstream LLVM yet. My hope is that we can get some experience with this copy/paste in tree and then eventually upstream some work to LLVM itself to avoid the duplication while still ensuring our needs are met. Otherwise I fear that maintaining these bindings may be quite costly over the years with LLVM updates!
2017-10-06implement pattern-binding-modes RFCTobias Schottdorf-0/+636
See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06Improve resolution of associated types in macros 2.0Vadim Petrochenkov-0/+34
2017-09-30Auto merge of #44783 - alexcrichton:lto-codegen-units, r=michaelwoeristerbors-0/+15
rustc: Enable LTO and multiple codegen units This commit is a refactoring of the LTO backend in Rust to support compilations with multiple codegen units. The immediate result of this PR is to remove the artificial error emitted by rustc about `-C lto -C codegen-units-8`, but longer term this is intended to lay the groundwork for LTO with incremental compilation and ultimately be the underpinning of ThinLTO support. The problem here that needed solving is that when rustc is producing multiple codegen units in one compilation LTO needs to merge them all together. Previously only upstream dependencies were merged and it was inherently relied on that there was only one local codegen unit. Supporting this involved refactoring the optimization backend architecture for rustc, namely splitting the `optimize_and_codegen` function into `optimize` and `codegen`. After an LLVM module has been optimized it may be blocked and queued up for LTO, and only after LTO are modules code generated. Non-LTO compilations should look the same as they do today backend-wise, we'll spin up a thread for each codegen unit and optimize/codegen in that thread. LTO compilations will, however, send the LLVM module back to the coordinator thread once optimizations have finished. When all LLVM modules have finished optimizing the coordinator will invoke the LTO backend, producing a further list of LLVM modules. Currently this is always a list of one LLVM module. The coordinator then spawns further work to run LTO and code generation passes over each module. In the course of this refactoring a number of other pieces were refactored: * Management of the bytecode encoding in rlibs was centralized into one module instead of being scattered across LTO and linking. * Some internal refactorings on the link stage of the compiler was done to work directly from `CompiledModule` structures instead of lists of paths. * The trans time-graph output was tweaked a little to include a name on each bar and inflate the size of the bars a little
2017-09-30rustc: Enable LTO and multiple codegen unitsAlex Crichton-0/+15
This commit is a refactoring of the LTO backend in Rust to support compilations with multiple codegen units. The immediate result of this PR is to remove the artificial error emitted by rustc about `-C lto -C codegen-units-8`, but longer term this is intended to lay the groundwork for LTO with incremental compilation and ultimately be the underpinning of ThinLTO support. The problem here that needed solving is that when rustc is producing multiple codegen units in one compilation LTO needs to merge them all together. Previously only upstream dependencies were merged and it was inherently relied on that there was only one local codegen unit. Supporting this involved refactoring the optimization backend architecture for rustc, namely splitting the `optimize_and_codegen` function into `optimize` and `codegen`. After an LLVM module has been optimized it may be blocked and queued up for LTO, and only after LTO are modules code generated. Non-LTO compilations should look the same as they do today backend-wise, we'll spin up a thread for each codegen unit and optimize/codegen in that thread. LTO compilations will, however, send the LLVM module back to the coordinator thread once optimizations have finished. When all LLVM modules have finished optimizing the coordinator will invoke the LTO backend, producing a further list of LLVM modules. Currently this is always a list of one LLVM module. The coordinator then spawns further work to run LTO and code generation passes over each module. In the course of this refactoring a number of other pieces were refactored: * Management of the bytecode encoding in rlibs was centralized into one module instead of being scattered across LTO and linking. * Some internal refactorings on the link stage of the compiler was done to work directly from `CompiledModule` structures instead of lists of paths. * The trans time-graph output was tweaked a little to include a name on each bar and inflate the size of the bars a little
2017-09-29Rollup merge of #44287 - Eh2406:master, r=aturonMark Simulacrum-2/+95
Allow T op= &T for built-in numeric types T v2 Manually rebase of @Migi https://github.com/rust-lang/rust/pull/41336
2017-09-28Migrate to eprint/eprintln macros where appropriate.Corey Farwell-3/+1
2017-09-27Auto merge of #44709 - Badel2:inclusive-range-dotdoteq, r=petrochenkovbors-35/+57
Initial support for `..=` syntax #28237 This PR adds `..=` as a synonym for `...` in patterns and expressions. Since `...` in expressions was never stable, we now issue a warning. cc @durka r? @aturon
2017-09-23Rollup merge of #44770 - dtolnay:borrowed, r=sfacklerCorey Farwell-0/+12
Less confusing placeholder when RefCell is exclusively borrowed Based on ExpHP's comment in [*RefCell.borrow_mut get strange result*](https://users.rust-lang.org/t/refcell-borrow-mut-get-strange-result/12994): > it would perhaps be nicer if it didn't put something that could be misinterpreted as a valid string value The previous Debug implementation would show: RefCell { value: "<borrowed>" } The new one is: RefCell { value: <borrowed> }
2017-09-23Rollup merge of #44745 - alexcrichton:no-delim-none, r=estebankCorey Farwell-0/+24
rustc: Don't use DelimToken::None if possible This commit fixes a regression from #44601 where lowering attribute to HIR now involves expanding interpolated tokens to their actual tokens. In that commit all interpolated tokens were surrounded with a `DelimToken::None` group of tokens, but this ended up causing regressions like #44730 where the various attribute parsers in `syntax/attr.rs` weren't ready to cope with `DelimToken::None`. Instead of fixing the parser in `attr.rs` this commit instead opts to just avoid the `DelimToken::None` in the first place, ensuring that the token stream should look the same as it did before where possible. Closes #44730
2017-09-22dotdoteq_in_patterns feature gateBadel2-0/+2
2017-09-22Add support for `..=` syntaxAlex Burka-35/+55
Add ..= to the parser Add ..= to libproc_macro Add ..= to ICH Highlight ..= in rustdoc Update impl Debug for RangeInclusive to ..= Replace `...` to `..=` in range docs Make the dotdoteq warning point to the ... Add warning for ... in expressions Updated more tests to the ..= syntax Updated even more tests to the ..= syntax Updated the inclusive_range entry in unstable book
2017-09-21Less confusing placeholder when RefCell is exclusively borrowedDavid Tolnay-0/+12
Based on ExpHP's comment in https://users.rust-lang.org/t/refcell-borrow-mut-get-strange-result/12994 > it would perhaps be nicer if it didn't put something that could be > misinterpreted as a valid string value The previous Debug implementation would show: RefCell { value: "<borrowed>" } The new one is: RefCell { value: <borrowed> }
2017-09-21Refactor lifetime name into an enumTaylor Cramer-0/+12
2017-09-21rustc: Don't use DelimToken::None if possibleAlex Crichton-0/+24
This commit fixes a regression from #44601 where lowering attribute to HIR now involves expanding interpolated tokens to their actual tokens. In that commit all interpolated tokens were surrounded with a `DelimToken::None` group of tokens, but this ended up causing regressions like #44730 where the various attribute parsers in `syntax/attr.rs` weren't ready to cope with `DelimToken::None`. Instead of fixing the parser in `attr.rs` this commit instead opts to just avoid the `DelimToken::None` in the first place, ensuring that the token stream should look the same as it did before where possible. Closes #44730