summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2017-11-14Auto merge of #45986 - arielb1:beta-next, r=alexcrichtonbors-8/+184
Fixes for beta - #45785 - #45890 - #45985
2017-11-14check_unsafety: fix unused unsafe block duplicationAriel Ben-Yehuda-8/+9
The duplicate error message is later removed by error message deduplication, but it still appears on beta and is still a bug
2017-11-14Backported merge of #45890 - arielb1:self-first, r=eddybbors-0/+35
check::method - unify receivers before normalizing method signatures Normalizing method signatures can unify inference variables, which can cause receiver unification to fail. Unify the receivers first to avoid that. Fixes #36701. Fixes #45801. Fixes #45855. r? @eddyb beta-nominating because #43880 made this ICE happen in more cases (the code in that issue ICEs post-#43880 only, but the unit test here ICEs on all versions).
2017-11-14Backported merge of #45785 - arielb1:unsafe-fixes, r=eddybbors-8/+148
fixes to MIR effectck r? @eddyb beta-nominating because regression (MIR effectck is new)
2017-11-12Disable `mmap` in `libbacktrace` on Apple platformsJohn Colanduoni-0/+34
Fixes #45731 libbacktrace uses mmap if available to map ranges of the files containing debug information. On macOS `mmap` will succeed even if the mapped range does not exist, and a SIGBUS (with an unusual EXC_BAD_ACCESS code 10) will occur when the program attempts to page in the memory. To combat this we force `libbacktrace` to be built with the simple `read` based fallback on Apple platforms.
2017-10-09Auto merge of #45075 - alexcrichton:inline-less, r=michaelwoeristerbors-2/+71
rustc: Don't inline in CGUs at -O0 This commit tweaks the behavior of inlining functions into multiple codegen units when rustc is compiling in debug mode. Today rustc will unconditionally treat `#[inline]` functions by translating them into all codegen units that they're needed within, marking the linkage as `internal`. This commit changes the behavior so that in debug mode (compiling at `-O0`) rustc will instead only translate `#[inline]` functions into *one* codegen unit, forcing all other codegen units to reference this one copy. The goal here is to improve debug compile times by reducing the amount of translation that happens on behalf of multiple codegen units. It was discovered in #44941 that increasing the number of codegen units had the adverse side effect of increasing the overal work done by the compiler, and the suspicion here was that the compiler was inlining, translating, and codegen'ing more functions with more codegen units (for example `String` would be basically inlined into all codegen units if used). The strategy in this commit should reduce the cost of `#[inline]` functions to being equivalent to one codegen unit, which is only translating and codegen'ing inline functions once. Collected [data] shows that this does indeed improve the situation from [before] as the overall cpu-clock time increases at a much slower rate and when pinned to one core rustc does not consume significantly more wall clock time than with one codegen unit. One caveat of this commit is that the symbol names for inlined functions that are only translated once needed some slight tweaking. These inline functions could be translated into multiple crates and we need to make sure the symbols don't collideA so the crate name/disambiguator is mixed in to the symbol name hash in these situations. [data]: https://github.com/rust-lang/rust/issues/44941#issuecomment-334880911 [before]: https://github.com/rust-lang/rust/issues/44941#issuecomment-334583384
2017-10-08Auto merge of #45016 - pnkfelix:mir-borrowck-gather-and-signal-move-errors, ↵bors-13/+60
r=nikomatsakis MIR-borrowck: gather and signal any move errors When building up the `MoveData` structure for a given MIR, also accumulate any erroneous actions, and then report all of those errors when the construction is complete. This PR adds a host of move-related error constructor methods to `trait BorrowckErrors`. I think I got the notes right; but we should plan to audit all of the notes before turning MIR-borrowck on by default. Fix #44830
2017-10-08Auto merge of #45020 - MaloJaffre:needs-test, r=alexcrichtonbors-0/+119
Fix some E-needstest issues. Also ignore `attr-on-trait` test on stage-1 to keep `./x.py test --stage 1` successful. Fixes #30355. Fixes #33241. Fixes #36400. Fixes #37887. Fixes #44578.
2017-10-08Rollup merge of #45018 - michaelwoerister:fix-dep-node-debug-recursion, r=eddybkennytm-10/+10
incr.comp.: Fix infinite recursion in Debug implementation of DepNode Small bug fix. Depends on #44901 to land first.
2017-10-07rustc: Don't inline in CGUs at -O0Alex Crichton-2/+71
This commit tweaks the behavior of inlining functions into multiple codegen units when rustc is compiling in debug mode. Today rustc will unconditionally treat `#[inline]` functions by translating them into all codegen units that they're needed within, marking the linkage as `internal`. This commit changes the behavior so that in debug mode (compiling at `-O0`) rustc will instead only translate `#[inline]` functions into *one* codegen unit, forcing all other codegen units to reference this one copy. The goal here is to improve debug compile times by reducing the amount of translation that happens on behalf of multiple codegen units. It was discovered in #44941 that increasing the number of codegen units had the adverse side effect of increasing the overal work done by the compiler, and the suspicion here was that the compiler was inlining, translating, and codegen'ing more functions with more codegen units (for example `String` would be basically inlined into all codegen units if used). The strategy in this commit should reduce the cost of `#[inline]` functions to being equivalent to one codegen unit, which is only translating and codegen'ing inline functions once. Collected [data] shows that this does indeed improve the situation from [before] as the overall cpu-clock time increases at a much slower rate and when pinned to one core rustc does not consume significantly more wall clock time than with one codegen unit. One caveat of this commit is that the symbol names for inlined functions that are only translated once needed some slight tweaking. These inline functions could be translated into multiple crates and we need to make sure the symbols don't collideA so the crate name/disambiguator is mixed in to the symbol name hash in these situations. [data]: https://github.com/rust-lang/rust/issues/44941#issuecomment-334880911 [before]: https://github.com/rust-lang/rust/issues/44941#issuecomment-334583384
2017-10-07Auto merge of #44841 - alexcrichton:thinlto, r=michaelwoeristerbors-37/+131
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-07Auto merge of #44892 - GuillaumeGomez:fnty-args-rustdoc, r=eddybbors-0/+15
Fnty args rustdoc Fixes #44570. cc @QuietMisdreavus cc @rust-lang/dev-tools Considering the impact on the `hir` libs, I'll put @eddyb as reviewer. r? @eddyb
2017-10-07Fix invalid rustdoc rendering for FnTy argsGuillaume Gomez-0/+15
2017-10-07rustc: Implement ThinLTOAlex Crichton-37/+131
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-07Auto merge of #44860 - kennytm:fix-44731, r=alexcrichtonbors-0/+51
Fix issue #44731. Also excludes `impl Trait` from everybody_loops if it appears in the path. Fixes #44731.
2017-10-07Auto merge of #44614 - tschottdorf:pat_adjustments, r=nikomatsakisbors-23/+1045
implement pattern-binding-modes RFC See the [RFC] and [tracking issue]. [tracking issue]: #42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06implement pattern-binding-modes RFCTobias Schottdorf-23/+1045
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-06Auto merge of #43604 - abonander:proc_macro_span_api, r=jseyfriedbors-0/+107
Improvements to `proc_macro::Span` API Motivation: https://internals.rust-lang.org/t/better-panic-location-reporting-for-unwrap-and-friends/5042/12?u=logician TODO: - [x] Bikeshedding/complete API - [x] Implement tests/verify return values cc @jseyfried @nrc
2017-10-06Auto merge of #44818 - petrochenkov:astymac2, r=jseyfriedbors-0/+135
Improve resolution of associated types in declarative macros 2.0 Make various identifier comparisons for associated types (and sometimes other associated items) hygienic. Now declarative macros 2.0 can use `Self::AssocTy`, `TyParam::AssocTy`, `Trait<AssocTy = u8>` where `AssocTy` is an associated type of a trait `Trait` visible from the macro. Also, `Trait` can now be implemented inside the macro and specialization should work properly (fixes https://github.com/rust-lang/rust/pull/40847#issuecomment-310867299). r? @jseyfried or @eddyb
2017-10-06Auto merge of #44951 - vitiral:incr_struct_defs, r=michaelwoeristerbors-4/+177
incr compilation struct_defs.rs I am prematurely openeing this as I need mentoring help from @michaelwoerister (also pinged @nikomatsakis) First, is this the right approach for these changes? Second, I'm a bit confused by the results so far. - Changing `TupleStructFieldType(i32)` -> `...(u32)` changes only Hir and HirBody, not TypeOfItem - Chaning `TupleStructAddField(i32)` -> `...(i32, u32)` *does* change TypeOfItem This seems wrong. I feel like it should change TypeOfItem in both cases. Is this a bug in incr compilation or is it expected?
2017-10-05`proc_macro::Span` API improvementsAustin Bonander-0/+107
2017-10-06Improve resolution of associated types in macros 2.0Vadim Petrochenkov-0/+135
2017-10-05Fix infinite recursion in <DepNode as Debug>.Michael Woerister-10/+10
2017-10-05Auto merge of #44940 - philipc:remap-path, r=michaelwoeristerbors-0/+23
Don't use remapped path when loading modules and include files Fixes bug reported in https://github.com/rust-lang/rust/issues/41555#issuecomment-327866056. cc @michaelwoerister
2017-10-04Auto merge of #44901 - michaelwoerister:on-demand-eval, r=nikomatsakisbors-19/+14
incr.comp.: Switch to red/green change tracking, remove legacy system. This PR finally switches incremental compilation to [red/green tracking](https://github.com/rust-lang/rust/issues/42293) and completely removes the legacy dependency graph implementation -- which includes a few quite costly passes that are simply not needed with the new system anymore. There's still some documentation to be done and there's certainly still lots of optimizing and tuning ahead -- but the foundation for red/green is in place with this PR. This has been in the making for a long time `:)` r? @nikomatsakis cc @alexcrichton, @rust-lang/compiler
2017-10-04Fix some E-needstest issues.Malo Jaffré-0/+119
Also ignore `attr-on-trait` test on stage-1 to keep `./x.py test --stage 1` successful. Fixes #30355. Fixes #33241. Fixes #36400. Fixes #37887. Fixes #44578.
2017-10-04Unit tests for gathering and reporting move-errors from mir-borrowck.Felix S. Klock II-13/+60
This commit tests *just* the subset of the tests that were previously ICE'ing and where now AST- and MIR-borrowck both match in terms of the errors they report. In other words: there remain *other* tests that previously ICE'd, and now no longer ICE, but their remains a divergence between the errors reported by AST-borrowck and by MIR-borrowck.
2017-10-03Auto merge of #44949 - QuietMisdreavus:rustdoctest-dirs, r=nikomatsakisbors-0/+3
let htmldocck.py check for directories Since i messed this up during https://github.com/rust-lang/rust/pull/44613, i wanted to codify this into the rustdoc tests to make sure that doesn't happen again.
2017-10-03related to #44924: update incr compilation for struct_defs.rsGarrett Berg-4/+177
2017-10-03Auto merge of #44922 - zilbuz:issue-44596/E0594, r=pnkfelixbors-5/+44
MIR borrowck: move span_label to `borrowck_errors.rs` The calls to `span_label` are moved and factorized for: * E0503 (`cannot_use_when_mutably_borrowed()`) * E0506 (`cannot_assign_to_borrowed()`) Additionnally, the error E0594 (`cannot_assign_static()`) has been factorized between `check_loan.rs` and `borrowc_check.rs`. Part of #44596
2017-10-03Auto merge of #44920 - vi:rustdoc_implementors_src_link, r=GuillaumeGomezbors-0/+24
rustdoc: Render [src] links for trait implementors Should close #43893. <s>No tests [yet].</s> r? @QuietMisdreavus
2017-10-03Auto merge of #44966 - zackmdavis:no_mangle_no_snake, r=aturonbors-0/+18
make non_snake_case lint allow extern no-mangle functions Resolves #31924. r? @sfackler
2017-10-02rustdoc: Remove cruft from the testVitaly _Vi Shukela-14/+4
per @GuillaumeGomez's sample, but with one change.
2017-10-02incr.comp.: Use red/green tracking for CGU re-use.Michael Woerister-19/+14
2017-10-02Auto merge of #44959 - arielb1:generic-errors, r=eddybbors-1/+75
handle nested generics in Generics::type_param/region_param Fixes #44952. r? @eddyb
2017-10-02fix handling of `Self`Ariel Ben-Yehuda-15/+46
2017-10-02Auto merge of #44942 - zackmdavis:lint_suggestions, r=estebankbors-3/+94
code suggestions for unused-mut, while-true, deprecated-attribute, and unused-parens lints ![lint_suggestions](https://user-images.githubusercontent.com/1076988/31044068-b2074de8-a57c-11e7-9319-6668508b6d1f.png) r? @estebank
2017-10-01correct unused-parens lint suggestion to strip exact pairZack M. Davis-0/+26
2017-10-01make non_snake_case lint allow extern no-mangle functionsZack M. Davis-0/+18
Resolves #31924.
2017-10-01handle nested generics in Generics::type_param/region_paramAriel Ben-Yehuda-1/+44
Fixes #44952.
2017-10-01Auto merge of #44945 - petrochenkov:fixtyrec, r=arielb1bors-3/+22
Do not require semantic types for all syntactic types when there are errors Fixes https://github.com/rust-lang/rust/issues/44814 Fixes https://github.com/rust-lang/rust/issues/44858 Fixes https://github.com/rust-lang/rust/issues/44946 r? @nikomatsakis
2017-10-01Auto merge of #44906 - dkl:main-signature, r=nagisabors-0/+55
Fix native main() signature on 64bit Hello, in LLVM-IR produced by rustc on x86_64-linux-gnu, the native main() function had incorrect types for the function result and argc parameter: i64, while it should be i32 (really c_int). See also #20064, #29633. So I've attempted a fix here. I tested it by checking the LLVM IR produced with --target x86_64-unknown-linux-gnu and i686-unknown-linux-gnu. Also I tried running the tests (`./x.py test`), however I'm getting two failures with and without the patch, which I'm guessing is unrelated.
2017-09-30test: Update target specs test for new target-c-int-width fieldDaniel Klauer-0/+3
2017-09-30code suggestions for unused-mut, while-true lints; UI testZack M. Davis-2/+67
2017-09-30code suggestion for deprecated-attribute lintZack M. Davis-1/+1
Also, fix the deprecation message for the late no-debug feature.
2017-09-30let htmldocck.py check for directoriesQuietMisdreavus-0/+3
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-30Do not require semantic types for all syntactic types when there are type errorspetrochenkov-3/+22
2017-09-30rustc: Use 16bit c_int for msp430Daniel Klauer-0/+35
Fix regression from c2fe69b9, where main() signature was changed from using 16bit isize to 32bit c_int for argc parameter/result.
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