about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-03-13Rollup merge of #48898 - GuillaumeGomez:remove-empty-section, r=QuietMisdreavuskennytm-0/+20
Remove auto trait implementation section when empty Fixes #48882.
2018-03-13Rollup merge of #48934 - Phlosioneer:42453-debug-hygene, r=petrochenkovkennytm-0/+17
Fix hygene issue when deriving Debug The code for several of the core traits doesn't use hygenic macros. This isn't a problem, except for the Debug trait, which is the only one that uses a variable, named "builder". Variables can't share names with unit structs, so attempting to [derive(Debug)] on any type while a unit struct with the name "builder" was in scope would result in an error. This commit just changes the name of the variable to "__debug_trait_builder", because I couldn't figure out how to get a list of all unit structs in-scope from within the derive expansion function. If someone wants to have a unit struct with the exact name "__debug_trait_builder", they'll just have to do it without a [derive(Debug)]. I also checked the implementations of the other built-in derives to ensure they didn't declare any variables.
2018-03-13Rollup merge of #48928 - zackmdavis:span_suggestion_field_day, r=estebankkennytm-20/+34
in which some labels and notes are upgraded to structured suggestions (Meanwhile, a couple of parse-fail tests are moved to UI tests so that the reader can see the new output, and an existing UI test is given a more evocative name.) r? @estebank
2018-03-13Rollup merge of #48880 - petrochenkov:badstderr, r=kennytmkennytm-140/+0
tidy: Add a check for stray `.stderr` and `.stdout` files in UI test directories
2018-03-12Auto merge of #48770 - bobtwinkles:two_phase_borrows_rewrite, r=pnkfelixbors-30/+20
Two phase borrows rewrite This definitely needs a careful review. Both @pnkfelix and @nikomatsakis were involved with the design of this so they're natural choices here. I'm r?'ing @pnkfelix since they wrote the original two-phase borrow implementation. Also ping @KiChjang who expressed interest in working on this. I'm going to leave a few comments below pointing out some of the more dangerous changes I made (i.e. what I would like reviewers to pay special attention too.) r? @pnkfelix
2018-03-11Auto merge of #48549 - alexcrichton:update-cargo, r=Mark-Simulacrumbors-627/+0
Update Cargo submodule Hopefully a routine update...
2018-03-11Update Cargo submoduleAlex Crichton-627/+0
Required moving all fulldeps tests depending on `rand` to different locations as now there's multiple `rand` crates that can't be implicitly linked against.
2018-03-11Fix hygene issue when deriving DebugPhlosioneer-0/+17
The code for several of the core traits doesn't use hygenic macros. This isn't a problem, except for the Debug trait, which is the only one that uses a variable, named "builder". Variables can't share names with unit structs, so attempting to [derive(Debug)] on any type while a unit struct with the name "builder" was in scope would result in an error. This commit just changes the name of the variable to "__debug_trait_builder", because I couldn't figure out how to get a list of all unit structs in-scope from within the derive expansion function. If someone wants to have a unit struct with the exact name "__debug_trait_builder", they'll just have to do it without a [derive(Debug)].
2018-03-11Auto merge of #48799 - alexcrichton:more-osx-cores, r=Mark-Simulacrumbors-17/+68
travis: Upgrade OSX builders This upgrades the OSX builders to the `xcode9.3-moar` image which has 3 cores as opposed to the 2 that our builders currently have. Should help make those OSX builds a bit speedier!
2018-03-11in which some labels and notes are upgraded to structured suggestionsZack M. Davis-20/+34
(Meanwhile, a couple of parse-fail tests are moved to UI tests so that the reader can see the new output, and an existing UI test is given a more evocative name.)
2018-03-10Auto merge of #48419 - bobtwinkles:fix_late_bound_reg_self, r=nikomatsakisbors-0/+71
Use free regions when determining self type in `compare_impl_method` The ExplicitSelf::determine function expects to be able to compare regions. However, when the compare_self_type error reporting code runs we haven't resolved bound regions yet. Thus we replace them with free regions first. Fixes #48276
2018-03-10Auto merge of #48388 - kyrias:relro-level-cg, r=alexcrichtonbors-0/+34
Add relro-level tests The `relro-level` debugging flag was added in #43170 which was merged in July 2017. This PR moves this flag to be a proper codegen flag.
2018-03-10Auto merge of #47574 - zilbuz:issue-14844, r=nikomatsakisbors-13/+61
Show the used type variable when issuing a "can't use type parameters from outer function" error message Fix #14844 r? @estebank
2018-03-10Auto merge of #48755 - GuillaumeGomez:rustdoc-fixes, r=QuietMisdreavusbors-0/+19
Multiple rustdoc fixes Fixes #48733. r? @QuietMisdreavus
2018-03-09Remove added two-phase-borrows flagbobtwinkles-1/+1
It seems whatever was causing problems has been fixed.
2018-03-09Remove auto trait implementation section when emptyGuillaume Gomez-0/+20
2018-03-09Fix tests after two-phase borrow rewritebobtwinkles-14/+2
2018-03-09Complete re-implementation of 2-phase borrowsbobtwinkles-1/+0
See #48431 for discussion as to why this was necessary and what we hoped to accomplish. A brief summary: - the first implementation of 2-phase borrows was hard to limit in the way we wanted. That is, it was too good at accepting all 2-phase borrows rather than just autorefs =) - Numerous diagnostic regressions were introduced by 2-phase borrow support which were difficult to fix
2018-03-09Finally start down the right pathbobtwinkles-16/+19
2018-03-09Add missing items in the sidebar for functionsGuillaume Gomez-0/+19
2018-03-09tidy: Add a check for stray `.stderr` and `.stdout` files in UI test directoriesVadim Petrochenkov-140/+0
2018-03-09Auto merge of #48326 - RalfJung:generic-bounds, r=petrochenkovbors-36/+184
Warn about ignored generic bounds in `for` This adds a new lint to fix #42181. For consistency and to avoid code duplication, I also moved the existing "bounds in type aliases are ignored" here. Questions to the reviewer: * Is it okay to just remove a diagnostic error code like this? Should I instead keep the warning about type aliases where it is? The old code provided a detailed explanation of what's going on when asked, that information is now lost. On the other hand, `span_warn!` seems deprecated (after this patch, it has exactly one user left!). * Did I miss any syntactic construct that can appear as `for` in the surface syntax? I covered function types (`for<'a> fn(...)`), generic traits (`for <'a> Fn(...)`, can appear both as bounds as as trait objects) and bounds (`for<'a> F: ...`). * For the sake of backwards compatibility, this adds a warning, not an error. @nikomatsakis suggested an error in https://github.com/rust-lang/rust/issues/42181#issuecomment-306924389, but I feel that can only happen in a new epoch -- right? Cc @eddyb
2018-03-08Rollup merge of #48801 - Manishearth:epoch-features, r=nikomatsakisManish Goregaokar-1/+22
Add functionality for gating feature flags on epochs ; rejigger epoch lints fixes #48794 r? @nikomatsakis
2018-03-08Rollup merge of #48527 - zackmdavis:and_the_social_construction_of_tuples, ↵Manish Goregaokar-0/+135
r=estebank in which parentheses are suggested for should-have-been-tuple-patterns ![destructure_suggest_parens](https://user-images.githubusercontent.com/1076988/36638335-48b082d4-19a7-11e8-9726-0d043544df2f.png) Programmers used to working in some other languages (such as Python or Go) might expect to be able to destructure values with comma-separated identifiers but no parentheses on the left side of an assignment. Previously, the first name in such code would get parsed as a single-indentifier pattern—recognizing, for example, the `let a` in `let a, b = (1, 2);`—whereupon we would have a fatal syntax error on seeing an unexpected comma rather than the expected semicolon (all the way nearer to the end of `parse_full_stmt`). Instead, let's look for that comma when parsing the pattern, and if we see it, make-believe that we're parsing the remaining elements in a tuple pattern, so that we can suggest wrapping it all in parentheses. We need to do this in a separate wrapper method called on a "top-level" pattern, rather than within `parse_pat` itself, because `parse_pat` gets called recursively to parse the sub-patterns within a tuple pattern. ~~We could also do this for `match` arms, `if let`, and `while let`, but we elect not to in this patch, as it seems less likely for users to make the mistake in those contexts.~~ Resolves #48492. r? @petrochenkov
2018-03-08Add rust_2018_idioms lint groupManish Goregaokar-1/+1
2018-03-08Add testManish Goregaokar-0/+21
2018-03-08Update testsBasile Desloges-13/+61
2018-03-08in which parentheses are suggested for should-have-been-tuple-patternsZack M. Davis-0/+135
Programmers used to working in some other languages (such as Python or Go) might expect to be able to destructure values with comma-separated identifiers but no parentheses on the left side of an assignment. Previously, the first name in such code would get parsed as a single-indentifier pattern—recognizing, for example, the `let a` in `let a, b = (1, 2);`—whereupon we would have a fatal syntax error on seeing an unexpected comma rather than the expected semicolon (all the way nearer to the end of `parse_full_stmt`). Instead, let's look for that comma when parsing the pattern, and if we see it, momentarily make-believe that we're parsing the remaining elements in a tuple pattern, so that we can suggest wrapping it all in parentheses. We need to do this in a separate wrapper method called on the top-level pattern (or `|`-patterns) in a `let` statement, `for` loop, `if`- or `while let` expression, or match arm rather than within `parse_pat` itself, because `parse_pat` gets called recursively to parse the sub-patterns within a tuple pattern. Resolves #48492.
2018-03-08Rollup merge of #48752 - alexcrichton:fix-target-feature, r=michaelwoeristerManish Goregaokar-1/+14
rustc: Fix ICE with `#[target_feature]` on module This commit fixes an ICE in rustc when `#[target_feature]` was applied to items other than functions due to the way the feature was validated.
2018-03-08Rollup merge of #48682 - spastorino:make_causal_lazy, r=nikomatsakisManish Goregaokar-34/+46
[NLL] Make causal tracking lazy Close #46590 cc @nikomatsakis
2018-03-08Unify the const folding errorsOliver Schneider-124/+167
before they differed depending on whether optimizations were on or not
2018-03-08Regenerate testsOliver Schneider-239/+223
2018-03-08Adjust test which differs between 32 bit and 64 bitOliver Schneider-2/+2
The differences are not part of what the test is testing, so they were simply removed.
2018-03-08Don't use the undefined bytes of PrimVal::BytesOliver Schneider-0/+2
2018-03-08Fix mozjs crater failureOliver Schneider-0/+37
2018-03-08Add regression testOliver Schneider-0/+34
2018-03-08Rebase falloutOliver Schneider-2/+2
2018-03-08Report tcx errors with the span of the currently evaluating statementOliver Schneider-2/+2
2018-03-08Update compile-fail testsOliver Schneider-89/+24
2018-03-08Add a test for transmuting via unions in constantsOliver Schneider-0/+62
2018-03-08Unregress error spans in constant errorsOliver Schneider-4/+3
2018-03-08Stage 2 doesn't see suggestion_approximateOliver Schneider-16/+0
2018-03-08Remove dead codeOliver Schneider-0/+37
2018-03-08Update testsOliver Schneider-26/+30
2018-03-08Add regression test for const propOliver Schneider-0/+28
2018-03-08Update testsOliver Schneider-0/+24
2018-03-08Update testsOliver Schneider-50/+67
2018-03-08Adjust tests to changed const err lintsOliver Schneider-27/+47
2018-03-08Adjust tests to more aggressive const err lintingOliver Schneider-0/+26
2018-03-08Report errors in statics during collecting instead of translatingOliver Schneider-4/+14