summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-12-27Prevent caching projections in the case of cyclesMatthew Jasper-14/+120
When normalizing a projection which results in a cycle, we would cache the result of `project_type` without the nested obligations (because they're not needed for inference). This would result in the nested obligations only being handled once in fulfill, which would avoid the cycle error. Fixes #79714, a regresion from #79305 caused by the removal of `get_paranoid_cache_value_obligation`.
2020-12-27Make recursion limit fatal in projectMatthew Jasper-2/+1
This avoid the hang/oom from #79714
2020-12-27Don't allow `const` to begin a nonterminalCamelid-0/+20
Thanks to Vadim Petrochenkov who [told me what the fix was][z]! [z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422
2020-12-27Revert change to evaluation orderMatthew Jasper-0/+39
This change breaks some code and doesn't appear to enable any new code.
2020-12-19Revert "Promote missing_fragment_specifier to hard error"Wesley Wiser-16/+37
This reverts commit 02eae432e7476a0686633a8c2b7cb1d5aab1bd2c.
2020-12-10Fix exhaustiveness in case a byte string literal is used at slice typeoli-2/+59
2020-12-10Revert "Prevent forbid from being ignored if overriden at the same level."Mark Rousskov-78/+0
This reverts commit afa2a675453091773eb9dd1b19389725526224b9.
2020-12-10Revert "rewrite old test so that its attributes are consistent with what we ↵Mark Rousskov-6/+6
want in the language." This reverts commit b4e77d21bcf8b15ef7d873005382ba8ca309faf5.
2020-11-17Update fulldeps testMark Rousskov-29/+18
2020-11-12Rollup merge of #78987 - lcnr:integer-sizes, r=varkorMara Bos-5/+94
extend min_const_generics param ty tests Apparently we never tested for `u128` and `i128` before this, so I added a test for all types which are allowed. r? ``@varkor``
2020-11-12Rollup merge of #78836 - fanzier:struct-and-slice-destructuring, r=petrochenkovMara Bos-64/+411
Implement destructuring assignment for structs and slices This is the second step towards implementing destructuring assignment (RFC: rust-lang/rfcs#2909, tracking issue: #71126). This PR is the second part of #71156, which was split up to allow for easier review. Note that the first PR (#78748) is not merged yet, so it is included as the first commit in this one. I thought this would allow the review to start earlier because I have some time this weekend to respond to reviews. If ``@petrochenkov`` prefers to wait until the first PR is merged, I totally understand, of course. This PR implements destructuring assignment for (tuple) structs and slices. In order to do this, the following *parser change* was necessary: struct expressions are not required to have a base expression, i.e. `Struct { a: 1, .. }` becomes legal (in order to act like a struct pattern). Unfortunately, this PR slightly regresses the diagnostics implemented in #77283. However, it is only a missing help message in `src/test/ui/issues/issue-77218.rs`. Other instances of this diagnostic are not affected. Since I don't exactly understand how this help message works and how to fix it yet, I was hoping it's OK to regress this temporarily and fix it in a follow-up PR. Thanks to ``@varkor`` who helped with the implementation, particularly around the struct rest changes. r? ``@petrochenkov``
2020-11-12Rollup merge of #76730 - ebkalderon:rustdoc-fix-mut-args-async-fn, r=tmandryMara Bos-2/+15
Fix rustdoc rendering of by-value mutable arguments in async fn r? `@jyn514` Fixes #76517.
2020-11-12Handle and test wildcard argumentsJoshua Nelson-2/+7
2020-11-12Don't reuse bindings for `ref mut`Joshua Nelson-0/+8
Reusing bindings causes errors later in lowering: ``` error[E0596]: cannot borrow `vec` as mutable, as it is not declared as mutable --> /checkout/src/test/ui/async-await/argument-patterns.rs:12:20 | LL | async fn b(n: u32, ref mut vec: A) { | ^^^^^^^^^^^ | | | cannot borrow as mutable | help: consider changing this to be mutable: `mut vec` ```
2020-11-12extend min_const_generics param ty testsBastian Kauschke-5/+94
2020-11-12Auto merge of #76256 - tgnottingham:issue-74890, r=nikomatsakisbors-0/+48
incr-comp: hash and serialize span end line/column Hash both the length and the end location (line/column) of a span. If we hash only the length, for example, then two otherwise equal spans with different end locations will have the same hash. This can cause a problem during incremental compilation wherein a previous result for a query that depends on the end location of a span will be incorrectly reused when the end location of the span it depends on has changed. A similar analysis applies if some query depends specifically on the length of the span, but we only hash the end location. So hash both. Fix #46744, fix #59954, fix #63161, fix #73640, fix #73967, fix #74890, fix #75900 --- See #74890 for a more in-depth analysis. I haven't thought about what other problems this root cause could be responsible for. Please let me know if anything springs to mind. I believe the issue has existed since the inception of incremental compilation.
2020-11-12Rollup merge of #78960 - ethanboxx:const-gen-test-default-error, r=lcnrGuillaume Gomez-0/+28
Test default values for const parameters. The last topic on #78433 I originally intended to place these tests in a single file, however, due to them being parser errors that are fatal, they must be in separate files to be detected. Thanks, ``@lcnr`` for mentoring me on this PR. r? ``@lcnr``
2020-11-12Rollup merge of #78916 - lcnr:const-generics-tests, r=varkorGuillaume Gomez-0/+1126
extend const generics test suite should implement most of #78433, especially all parts of [the hackmd](https://hackmd.io/WnFmN4MjRCqAjGmYfYcu2A?view) which I did not explicitly mention in that issue. r? ``@varkor``
2020-11-12Auto merge of #78782 - petrochenkov:nodoctok, r=Aaron1011bors-2/+2
Do not collect tokens for doc comments Doc comment is a single token and AST has all the information to re-create it precisely. Doc comments are also responsible for majority of calls to `collect_tokens` (with `num_calls == 1` and `num_calls == 0`, cc https://github.com/rust-lang/rust/pull/78736). (I also moved token collection into `fn parse_attribute` to deduplicate code a bit.) r? `@Aaron1011`
2020-11-11default_trait_paramEthan Brierley-0/+14
2020-11-11Add test `default_function_param`Ethan Brierley-0/+14
2020-11-11add error-in-impl-trait const generics testBastian Kauschke-0/+24
2020-11-11add rustdoc testBastian Kauschke-0/+148
2020-11-11Rollup merge of #78899 - tmiasko:inline-diverging, r=oli-obkJonas Schievink-0/+180
Support inlining diverging function calls The existing heuristic does penalize diverging calls to some degree, but since it never inlined them previously it might need some further modifications. Additionally introduce storage markers for all temporaries created by the inliner. The temporary introduced for destination rebrorrow, didn't use them previously.
2020-11-11Rollup merge of #78873 - tmiasko:inline-opts, r=oli-obkJonas Schievink-0/+75
Add flags customizing behaviour of MIR inlining * `-Zinline-mir-threshold` to change the default threshold. * `-Zinline-mir-hint-threshold` to change the threshold used by functions with inline hint. Having those as configurable flags makes it possible to experiment with with different inlining thresholds and substantially increase test coverage of MIR inlining when used with increased thresholds (for example, necessary to test #78844).
2020-11-11Rollup merge of #78832 - lcnr:const-evaluatable-unevaluated, r=oli-obkJonas Schievink-0/+61
look at assoc ct, check the type of nodes an example where types matter are function objects, see the added test which previously passed. Now does a shallow comparison of unevaluated constants. r? ```@oli-obk```
2020-11-11Implement destructuring assignment for structs and slicesFabian Zaiser-64/+411
Co-authored-by: varkor <github@varkor.com>
2020-11-10Rollup merge of #78912 - JulianKnodt:mcg_macro, r=lcnrJonas Schievink-0/+212
Add macro test for min-const-generics Adds a test which uses a macro inside a block for a const-expression, as per #78433 r? `@lcnr`
2020-11-10Rollup merge of #78908 - liketechnik:fix_macro_expand_src_link, r=jyn514Jonas Schievink-7/+4
(rustdoc) [src] link for types defined by macros shows invocation, not defintion Previously the [src] link on types defined by a macro pointed to the macro definition. This pr makes the Clean-Implementation for Spans aware of macro defined types, so that the link points to the invocation instead. I'm not totally sure if it's okay to add the 'macro awareness' in the Clean-Implementation, because it erases that knowledge for all following code. Maybe it would be more sensible to add the check only for the link generation at https://github.com/rust-lang/rust/blob/25f6938da459a57b43bdf16ed6bdad3225b2a3ce/src/librustdoc/html/render/mod.rs#L1619 Closes #39726.
2020-11-10Rollup merge of #78898 - SNCPlay42:issue-78892, r=Mark-SimulacrumJonas Schievink-0/+14
add regression test for #78892 closes #78892, which was already fixed on nightly.
2020-11-10Rollup merge of #78897 - hyd-dev:alloc-error-hook-newline, r=m-ou-seJonas Schievink-1/+1
Add missing newline to error message of the default OOM hook Currently the default OOM hook in libstd does not end the error message with a newline: ``` memory allocation of 4 bytes failedtimeout: the monitored command dumped core /playground/tools/entrypoint.sh: line 11: 7 Aborted timeout --signal=KILL ${timeout} "$`@"` ``` https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=030d8223eb57dfe47ef157709aa26542 This is because the `fmt::Arguments` passed to `dumb_print()` does not end with a newline. All other calls to `dumb_print()` in libstd pass a `\n`-ended `fmt::Arguments` to `dumb_print()`. For example: https://github.com/rust-lang/rust/blob/25f6938da459a57b43bdf16ed6bdad3225b2a3ce/library/std/src/sys_common/util.rs#L18 I think the `\n` was forgotten in #51264. This PR appends `\n` to the error string. ~~Note that I didn't add a test, because I didn't find tests for functions in ` library/std/src/alloc.rs` or a test that is similar to the test of this change would be.~~ *Edit: CI told me there is an existing test. Sorry.*
2020-11-10Rollup merge of #78669 - sasurau4:test/check-pass-consts, r=jyn514Jonas Schievink-4/+4
Use check-pass instead of build-pass in some consts ui test suits Helps with #62277 Changed tests modified by https://github.com/rust-lang/rust/pull/57175 because of the stabilization `#![feature(const_let)]`. They should be compile-fail because the feature gate checking disallow the feature before stabilization. So the feature gate checking have nothing to do with codegen according to https://rustc-dev-guide.rust-lang.org/feature-gate-ck.html.
2020-11-10Rollup merge of #78574 - sasurau4:test/check-pass-regions, r=jyn514Jonas Schievink-18/+18
Use check-pass instead of build-pass in regions ui test suite ## Overview Helps with #62277 Region inference have nothing to do with codegen because they are erased before codegen. Ref: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20region.20inference.20.20nothing.20to.20do.20with.20codegen.20process.3F/near/215956759
2020-11-10Rollup merge of #76765 - guswynn:async_return, r=tmandryJonas Schievink-100/+218
Make it more clear what an about async fn's returns when referring to what it returns see #76547 This is *likely* not the ONLY place that this happens to be unclear, but we can move this fn to rustc_middle or something like that and reuse it if need be, to apply it to more diagnostics One outstanding question I have is, if the fn returns (), should I make the message more clear (what about `fn f()` vs `fn f() -> ()`, can you tell those apart in the hir?) R? `@tmandry` `@rustbot` modify labels +A-diagnostics +T-compiler
2020-11-10use check-pass instead of build-pass in consts ui test suitsDaiki Ihara-4/+4
2020-11-10add cross crate testBastian Kauschke-0/+47
2020-11-10add test for where clauses mentioning const paramsBastian Kauschke-0/+35
2020-11-10const param in asyncBastian Kauschke-0/+35
2020-11-10try referencing outer paramsBastian Kauschke-0/+247
2020-11-10exhaustively enumerate all values of a const paramBastian Kauschke-0/+310
2020-11-10add associated type bounds testBastian Kauschke-0/+71
2020-11-10add macro_rules test regarding bracesBastian Kauschke-0/+149
2020-11-10Add macro test for min-const-genericskadmin-0/+212
2020-11-10add generic param mismatch testBastian Kauschke-0/+38
2020-11-10const param macro testBastian Kauschke-0/+22
2020-11-09Update src/test/ui/issues/issue-76547.rsTyler Mandry-1/+1
Co-authored-by: Camelid <camelidcamel@gmail.com>
2020-11-09add nll compare mode stderr fileGus Wynn-0/+20
2020-11-10(rustdoc) [src] link for types defined by macros shows invocationFlorian Warzecha-7/+4
Previously the [src] link on types defined by a macro pointed to the macro definition. This commit makes the Clean-Implementation for Spans aware of macro defined types, so that the link points to the invocation instead.
2020-11-10Add flags customizing behaviour of MIR inliningTomasz Miąsko-0/+75
* `-Zinline-mir-threshold` to change the default threshold. * `-Zinline-mir-hint-threshold` to change the threshold used by functions with inline hint.
2020-11-09incr-comp: add ignore-32bit directive to incr-prev-body-beyond-eof testTyson Nottingham-1/+5
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>