about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-10-30Always pass `-Z future-incompat-report` to UI testsAaron Hill-28/+26
2020-10-30Update into-iter-on-arrays test to check future-incompat-reportAaron Hill-1/+143
2020-10-30Some workAaron Hill-12/+14
2020-10-30Auto merge of #78562 - JohnTitor:rollup-otg906u, r=JohnTitorbors-21/+28
Rollup of 8 pull requests Successful merges: - #77334 (Reorder benches const variable) - #77888 (Simplify a nested bool match) - #77921 (f64: Refactor collapsible_if) - #78523 (Revert invalid `fn` return type parsing change) - #78524 (Avoid BorrowMutError with RUSTC_LOG=debug) - #78545 (Make anonymous binders start at 0) - #78554 (Improve wording of `core::ptr::drop_in_place` docs) - #78556 (Link to pass docs from NRVO module docs) Failed merges: - #78424 (Fix some more clippy warnings) r? `@ghost`
2020-10-30Rollup merge of #78545 - jackh726:anonymous, r=oli-obkYuki Okushi-16/+16
Make anonymous binders start at 0 A few changes to some test outputs, but these actually look *more* correct to me.
2020-10-30Rollup merge of #78524 - tmiasko:source-files-borrow, r=Aaron1011Yuki Okushi-1/+2
Avoid BorrowMutError with RUSTC_LOG=debug ```console $ touch empty.rs $ env RUSTC_LOG=debug rustc +stage1 --crate-type=lib empty.rs ``` Fails with a `BorrowMutError` because source map files are already borrowed while `features_query` attempts to format a log message containing a span. Release the borrow before the query to avoid the issue.
2020-10-30Rollup merge of #78523 - estebank:fix-return-type-parse-regression, r=dtolnayYuki Okushi-4/+10
Revert invalid `fn` return type parsing change Revert one of the changes in #78379. Fix #78507.
2020-10-30Auto merge of #78393 - SNCPlay42:match-if-guard, r=tmandrybors-1/+20
Always record reference to binding in match if guards When encountering a binding from a `match` pattern in its `if` guard when computing a generator's interior types, we must always record the type of a reference to the binding because of how `if` guards are lowered to MIR. This was missed in #75213 because the binding in that test case was autorefed and we recorded that adjusted type anyway. Fixes #78366
2020-10-30Auto merge of #78432 - sexxi-goose:fix-77993-take3, r=nikomatsakisbors-0/+45
Handle type errors in closure/generator upvar_tys Fixes #77993
2020-10-29Make anonymous binders start at 0Jack Huey-16/+16
2020-10-29Rollup merge of #78431 - Rustin-Liu:rustin-patch-lint, r=estebankJonas Schievink-4/+4
Prefer new associated numeric consts in float error messages Fix https://github.com/rust-lang/rust/issues/78382
2020-10-29Rollup merge of #78422 - estebank:fix-78372, r=pnkfelixJonas Schievink-0/+76
Do not ICE on invalid input Fix #78372.
2020-10-29Add regression testEsteban Küber-0/+6
2020-10-29Revert invalid `fn` return type parsing changeEsteban Küber-4/+4
Fix #78507.
2020-10-29Auto merge of #78512 - JohnTitor:rollup-a7qwjah, r=JohnTitorbors-45/+359
Rollup of 11 pull requests Successful merges: - #77213 (rustdoc options to set default theme (and other settings)) - #78224 (min_const_generics: allow ty param in repeat expr) - #78428 (MinConstGenerics UI test for invalid values for bool & char) - #78460 (Adjust turbofish help message for const generics) - #78470 (Clean up intra-doc links in `std::path`) - #78475 (fix a comment in validity check) - #78478 (Add const generics tests for supertraits + dyn traits.) - #78487 (Fix typo "compiltest") - #78491 (Inline NonZeroN::from(n)) - #78492 (Update books) - #78494 (Fix typos) Failed merges: r? `@ghost`
2020-10-29Rollup merge of #78478 - hameerabbasi:const-generics-supertraits, r=lcnrYuki Okushi-0/+85
Add const generics tests for supertraits + dyn traits. Partially addresses #78433
2020-10-29Rollup merge of #78460 - varkor:turbofish-string-generic, r=lcnrYuki Okushi-25/+25
Adjust turbofish help message for const generics Types are no longer special. (This message arguably only makes sense with `min_const_generics` or more, but we'll be there soon.) r? @lcnr
2020-10-29Rollup merge of #78428 - JulianKnodt:invalid_patterns, r=lcnrYuki Okushi-0/+105
MinConstGenerics UI test for invalid values for bool & char This adds a test for `feature(min_const_generics)` with some invalid values for bools and chars and ensures that they do not ICE and error with understandable messages. r? @lcnr
2020-10-29Rollup merge of #78224 - lcnr:repeat-expr, r=varkorYuki Okushi-20/+144
min_const_generics: allow ty param in repeat expr implements https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/repeat.20expressions Even with `min_const_generics` active, now keeps resulting in future compat warnings instead of hard errors. Const parameters, for example `[0; N + 1]`, still result in hard errors during resolve. ```rust #![allow(dead_code)] fn foo<T>() { [0; std::mem::size_of::<*mut T>()]; } struct Foo<T>(T); impl<T> Foo<T> { const ASSOC: usize = 4; fn test() { [0; Self::ASSOC]; } } ``` r? @varkor cc @petrochenkov
2020-10-29Auto merge of #78430 - Nadrieril:taking-constructors-seriously2, r=varkorbors-6/+6
Clarify main code paths in exhaustiveness checking This PR massively clarifies the main code paths of exhaustiveness checking, by using the `Constructor` enum to a fuller extent. I've been itching to write it for more than a year, but the complexity of matching consts had prevented me. Behold a massive simplification :D. This in particular removes a fair amount of duplication between various parts, localizes code into methods of relevant types when applicable, makes some implicit assumptions explicit, and overall improves legibility a lot (or so I hope). Additionally, after my changes undoing #76918 turned out to be a noticeable perf gain. As usual I tried my best to make the commits self-contained and easy to follow. I've also tried to keep the code well-commented, but I tend to forget how complex this file is; I'm happy to clarify things as needed. My measurements show good perf improvements on the two match-heavy benchmarks (-18.0% on `unicode_normalization-check`! :D); I'd like a perf run to check the overall impact. r? `@varkor` `@rustbot` modify labels: +A-exhaustiveness-checking
2020-10-29Test building of libraries with rustc logging enabledTomasz Miąsko-1/+2
2020-10-28Assert in every case.Hameer Abbasi-19/+22
2020-10-28Extend test to cover dyn methods/functions.Hameer Abbasi-20/+44
2020-10-28Adjust turbofish help message for const genericsvarkor-25/+25
2020-10-28Add const generics tests for supertraits + dyn traits.Hameer Abbasi-0/+58
2020-10-28Auto merge of #78458 - Dylan-DPC:rollup-tan044s, r=Dylan-DPCbors-189/+621
Rollup of 10 pull requests Successful merges: - #78152 (Separate unsized locals) - #78297 (Suggest calling await on method call and field access) - #78351 (Move "mutable thing in const" check from interning to validity) - #78365 (check object safety of generic constants) - #78379 (Tweak invalid `fn` header and body parsing) - #78391 (Add const_fn in generics test) - #78401 (resolve: private fields in tuple struct ctor diag) - #78408 (Remove tokens from foreign items in `TokenStripper`) - #78447 (Fix typo in comment) - #78453 (Fix typo in comments) Failed merges: r? `@ghost`
2020-10-28Rollup merge of #78408 - Aaron1011:fix/remove-foreign-tokens, r=oli-obkDylan DPC-0/+19
Remove tokens from foreign items in `TokenStripper` Fixes #78398 I forgot to handle this case in #77255
2020-10-28Rollup merge of #78401 - ↵Dylan DPC-13/+47
davidtwco:issue-75906-tuple-construct-private-field, r=estebank resolve: private fields in tuple struct ctor diag Fixes #75906. This PR improves the diagnostic emitted when a tuple struct is being constructed which has private fields so that private fields are labelled and the message is improved. r? @estebank
2020-10-28Rollup merge of #78391 - JulianKnodt:mc_test, r=lcnrDylan DPC-0/+17
Add const_fn in generics test Adds a test that constant functions in generic parameters work properly. I was surprised this works, but I also to turbofish the constant in main, otherwise it didn't infer properly: ``` let v: ConstU32<3> = ... ``` Did not work as I expected, which I can highlight in the test if that's the intended behaviour. r? @lcnr
2020-10-28Rollup merge of #78379 - estebank:fn-signature-parse, r=varkorDylan DPC-30/+34
Tweak invalid `fn` header and body parsing * Rely on regular "expected"/"found" parser error for `fn`, fix #77115 * Recover empty `fn` bodies when encountering `}` * Recover trailing `>` in return types * Recover from non-type in array type `[<BAD TOKEN>; LEN]`
2020-10-28Rollup merge of #78365 - lcnr:const-eval-obj-safety, r=oli-obkDylan DPC-0/+140
check object safety of generic constants As `Self` can only be effectively used in constants with `const_evaluatable_checked` this should not matter outside of it. Implements the first item of #72219 > Object safety interactions with constants r? @oli-obk for now cc @nikomatsakis
2020-10-28Rollup merge of #78351 - RalfJung:validity-unsafe-cell, r=oli-obkDylan DPC-9/+16
Move "mutable thing in const" check from interning to validity This moves the check for mutable things (such as `UnsafeCell` or `&mut`) in a`const` from interning to validity. That means we can give more targeted error messages (pointing out *where* the problem lies), and we can simplify interning a bit. Also fix the interning mode used for promoteds in statics. r? @oli-obk
2020-10-28Rollup merge of #78297 - estebank:match-semicolon-2, r=oli-obkDylan DPC-9/+49
Suggest calling await on method call and field access When encountering a failing method or field resolution on a `Future`, look at the `Output` and try the same operation on it. If successful, suggest calling `.await` on the `Future`. This had already been introduced in #72784, but at some point they stopped working. Built on top of #78214, only last commit is relevant. r? @oli-obk
2020-10-28Rollup merge of #78152 - spastorino:separate-unsized-locals, r=oli-obkDylan DPC-128/+299
Separate unsized locals Closes #71694 Takes over again #72029 and #74971 cc @RalfJung @oli-obk @pnkfelix @eddyb as they've participated in previous reviews of this PR.
2020-10-27Auto merge of #75671 - nathanwhit:cstring-temp-lint, r=oli-obkbors-0/+56
Uplift `temporary-cstring-as-ptr` lint from `clippy` into rustc The general consensus seems to be that this lint covers a common enough mistake to warrant inclusion in rustc. The diagnostic message might need some tweaking, as I'm not sure the use of second-person perspective matches the rest of rustc, but I'd like to hear others' thoughts on that. (cc #53224). r? `@oli-obk`
2020-10-27Add UI test for invalid values for bool & charkadmin-0/+105
2020-10-27Add const_fn in generics testkadmin-0/+17
2020-10-27Merge unsized locals pat testsSantiago Pastorino-39/+29
2020-10-27Bless tests againSantiago Pastorino-3/+3
2020-10-27Add comment explaining why in these tests unsized locals are not acceptedSantiago Pastorino-0/+4
2020-10-27Do not use unsized_fn_params in patternsSantiago Pastorino-1/+35
2020-10-27Test that unsized locals fail when turning unsized_fn_params feature flag onSantiago Pastorino-0/+20
2020-10-27Better test unsized_fn_paramsSantiago Pastorino-8/+8
2020-10-27Bless issue-53448 testSantiago Pastorino-1/+1
2020-10-27unsized_locals feature is not needed in this testSantiago Pastorino-1/+1
2020-10-27Using unsized_local feature is not needed in these testsSantiago Pastorino-30/+9
2020-10-27Make tidy happySantiago Pastorino-24/+25
2020-10-27This flag is not really needed in the testSantiago Pastorino-1/+0
2020-10-27Add unsized_locals to INCOMPLETE_FEATURES listSantiago Pastorino-57/+154
2020-10-27Add unsized_fn_params featureSantiago Pastorino-68/+115