about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2020-11-22Rollup merge of #79293 - Havvy:test-eval-order-compound-assign, ↵Mara Bos-0/+76
r=Mark-Simulacrum Add test for eval order for a+=b Yes, the order of evaluation *does* change depending on the types of the operands. Cursed, I know. I've elected to place this test into `expr/compound-assignment` creating both the `expr` directory and the `compound-assignment` directory. I plan in a future PR to also move the `if` directory and the loose `if` tests into `expr/if` and other similar cleanups of the `test/ui` directory. Future work: Test more than just `+=`, but all operators. I don't know if using a macro to generate these tests cases would be okay or not, but it'd be boilerplatey without it. I'm also confident you cannot change the evaluation order of one operator without changing all of them. Future work: Additionally, test more than just `i32 += i32` for the primitive version. I don't actually know the full set of primitive implementations, but I imagine there's enough to cause a combinatorial explosion with the previous future work item. Somewhere on the order of one to two hundred individual functions.
2020-11-22Rollup merge of #77697 - WaffleLapkin:iter_split_adaptors, r=m-ou-seMara Bos-3/+5
Split each iterator adapter and source into individual modules This PR creates individual modules for each iterator adapter and iterator source. This is done to enhance the readability of corresponding modules (`adapters/mod.rs` and `sources.rs`) which were hard to navigate and read because of lots of repeated lines (e.g.: `adapters/mod.rs` was 3k lines long). This is also in line with some adapters which already had their own modules (`Flatten`, `FlatMap`, `Chain`, `Zip`, `Fuse`). This PR also makes `Take`s adapter fields private (I have no idea why they were `pub(super)` before). r? ``@LukasKalbertodt``
2020-11-22Auto merge of #79243 - Nadrieril:consolidate-tests, r=varkorbors-665/+907
Consolidate exhaustiveness-related tests I hunted for tests that only exercised the match exhaustiveness algorithm and regrouped them. I also improved integer-range tests since I had found them lacking while hacking around. The interest is mainly so that one can pass `--test-args patterns` and catch most relevant tests. r? `@varkor` `@rustbot` modify labels: +A-exhaustiveness-checking
2020-11-22Rollup merge of #79302 - est31:issue_73899_test, r=lcnrGuillaume Gomez-0/+21
Add regression test for issue 73899 Closes #73899
2020-11-22Add regression test for issue 73899est31-0/+21
Adds regression test for https://github.com/rust-lang/rust/issues/73899
2020-11-22Add test for eval order for a+=bHavvy (Ryan Scheel)-0/+76
Yes, the order of evaluation *does* change depending on the types of the operands. Cursed, I know. I've elected to place this test into `expr/compound-assignment` creating both the `expr` directory and the `compound-assignment` directory. I plan in a future PR to also move the `if` directory and the loose `if` tests into `expr/if` and other similar cleanups of the `test/ui` directory. Future work: Test more than just `+=`, but all operators. I don't know if using a macro to generate these tests cases would be okay or not, but it'd be boilerplatey without it. I'm also confident you cannot change the evaluation order of one operator without changing all of them. Future work: Additionally, test more than just `i32 += i32` for the primitive version. I don't actually know the full set of primitive implementations, but I imagine there's enough to cause a combinatorial explosion with the previous future work item. Somewhere on the order of one to two hundred individual functions.
2020-11-22Fix UI testsWaffle-3/+5
Some UI tests started failing after moving iterator adapters to different modules.
2020-11-21Auto merge of #78461 - TimDiekmann:vec-alloc, r=Amanieubors-10/+12
Add support for custom allocators in `Vec` This follows the [roadmap](https://github.com/rust-lang/wg-allocators/issues/7) of the allocator WG to add custom allocators to collections. r? `@Amanieu` This pull request requires a crater run. ### Prior work: - #71873: Crater-test to solve rust-lang/wg-allocators#1 - [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate
2020-11-21Rollup merge of #79272 - tmiasko:array-clone, r=jonas-schievinkDylan DPC-0/+13
Support building clone shims for arrays with generic size Fixes #79269.
2020-11-21Rollup merge of #79231 - wusyong:issue-79137, r=lcnrDylan DPC-0/+52
Exhaustively match in variant count instrinsic Fix #79137
2020-11-21Auto merge of #77805 - JohnTitor:non-standard-char-sugg, r=Dylan-DPCbors-0/+56
lint: Do not provide suggestions for non standard characters Fixes #77273 Only provide suggestions if the case-fixed result is different than the original.
2020-11-21Fix comments of toogeneris testNgo Iok Ui-5/+3
2020-11-21Improve integer range testsNadrieril-665/+907
2020-11-21Support building clone shims for arrays with generic sizeTomasz Miąsko-0/+13
2020-11-20rustc_expand: Mark inner `#![test]` attributes as soft-unstableVadim Petrochenkov-3/+20
2020-11-20Exhaustively match in variant count instrinsicNgo Iok Ui-0/+54
2020-11-20Auto merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=estebankbors-0/+146
Add lint for panic!("{}") This adds a lint that warns about `panic!("{}")`. `panic!(msg)` invocations with a single argument use their argument as panic payload literally, without using it as a format string. The same holds for `assert!(expr, msg)`. This lints checks if `msg` is a string literal (after expansion), and warns in case it contained braces. It suggests to insert `"{}", ` to use the message literally, or to add arguments to use it as a format string. ![image](https://user-images.githubusercontent.com/783247/96643867-79eb1080-1328-11eb-8d4e-a5586837c70a.png) This lint is also a good starting point for adding warnings about `panic!(not_a_string)` later, once [`panic_any()`](https://github.com/rust-lang/rust/pull/74622) becomes a stable alternative.
2020-11-19Rollup merge of #79193 - tmiasko:revert-78969-normalize, r=davidtwcoDylan DPC-14/+8
Revert #78969 "Normalize function type during validation" Closes #79066. Reopens #78442.
2020-11-19Rollup merge of #79185 - petrochenkov:derattr2, r=Aaron1011Dylan DPC-267/+204
expand/resolve: Pre-requisites to "Turn `#[derive]` into a regular macro attribute" Miscellaneous refactorings and error reporting changes extracted from https://github.com/rust-lang/rust/pull/79078. Unlike https://github.com/rust-lang/rust/pull/79078 this PR doesn't make any observable changes to the language or library. r? ```@Aaron1011```
2020-11-19Rollup merge of #79177 - fanzier:drop-order-test, r=RalfJungDylan DPC-0/+44
Test drop order for (destructuring) assignments Add a test that checks whether the drop order of `let` bindings is consistent with the drop order of the corresponding destructuring assignments. Thanks to ```@RalfJung``` for the suggesting this test ([here](https://github.com/rust-lang/rust/pull/79016#issuecomment-727608732)) and an implementation! r? ```@RalfJung```
2020-11-19Regroup many usefulness-related test in the same folderNadrieril-0/+0
2020-11-19expand: Stop derive expansion un unexpected targets earlyVadim Petrochenkov-63/+6
Collect derive placeholders using `collect` instead of `push`
2020-11-19resolve: Centralize some error reporting for unexpected macro resolutionsVadim Petrochenkov-196/+196
2020-11-19expand: Tell built-in macros whether we are currently in forced expansion modeVadim Petrochenkov-8/+2
2020-11-19Rollup merge of #79164 - varkor:unbraced-single-segment-const-arguments, ↵Dylan DPC-21/+36
r=petrochenkov Permit standalone generic parameters as const generic arguments in macros Fixes https://github.com/rust-lang/rust/issues/79127. r? ```@petrochenkov```
2020-11-19Rollup merge of #79117 - cjkenn:mir-fuel, r=oli-obkDylan DPC-2/+2
add optimization fuel checks to some mir passes Fixes #77402 Inserts a bunch of calls to `consider_optimizing`. Note that `consider_optimizing` is the method that actually decrements the fuel count, so the point at which it's called is when the optimization takes place, from a fuel perspective. This means that where we call it has some thought behind it: 1. We probably don't want to decrement the fuel count before other simple checks, otherwise we count an optimization as being performed even if nothing was mutated (ie. it returned early). 2. In cases like `InstCombine`, where we gather optimizations in a pass and then mutate values, we probably would rather skip the gathering pass for performance reasons rather than skip the mutations afterwards.
2020-11-19Rollup merge of #79110 - estebank:issue-58964, r=oli-obkDylan DPC-506/+93
Remove redundant notes in E0275 Fix #58964.
2020-11-19Rollup merge of #79102 - Alexendoo:ice-regression-tests, r=Mark-SimulacrumDylan DPC-0/+90
Add two regression tests For #78721 and #78722
2020-11-19Rollup merge of #79082 - ThePuzzlemaker:issue-78941-fix, r=estebankDylan DPC-21/+42
Improve the diagnostic for when an `fn` contains qualifiers inside an `extern` block. This mitigates #78941. As suggested by ```@estebank,``` `span_suggestion` was replaced with `span_suggestion_verbose` for this specific diagnostic.
2020-11-19Rollup merge of #78961 - CraftSpider:22565, r=oli-obkDylan DPC-14/+53
Make bad "rust-call" arguments no longer ICE The simplest of bad rust-call definitions will no longer cause an ICE. There is a FIXME added for future work, as I wanted to get this easy fix in before trying to either add a hack or mess with the whole obligation system fixes #22565
2020-11-19update print fuel test output again...cjkenn-1/+1
2020-11-19Revert "Normalize function type during validation"Tomasz Miąsko-14/+8
This reverts commit d486bfcbff107e8a6769e00c59d02b13c664b6ee.
2020-11-18Auto merge of #78995 - Nadrieril:clean-empty-match, r=varkorbors-57/+176
Handle empty matches cleanly in exhaustiveness checking This removes the special-casing of empty matches that was done in `check_match`. This fixes most of https://github.com/rust-lang/rust/issues/55123. Somewhat unrelatedly, I also made `_match.rs` more self-contained, because I think it's cleaner. r? `@varkor` `@rustbot` modify labels: +A-exhaustiveness-checking
2020-11-18Test drop order for (destructuring) assignmentsFabian Zaiser-0/+44
2020-11-18Use `Cell` instead of `Vec` in const-generics testTim Diekmann-4/+6
As `Cell` won't receive an allocator parameter, it is used. Otherwise a `#![feature(allocator_api)]` could have been added, but for the purpose of this test, changing the type is more clear.
2020-11-18Add support for custom allocators in `Vec`Tim Diekmann-6/+6
2020-11-18Account for indirect cyclic requirementsEsteban Küber-1/+89
2020-11-18Remove redundant notes in E0275Esteban Küber-505/+4
Fix #58964.
2020-11-18change print-fuel ui test to check-passcjkenn-2/+2
2020-11-18Rollup merge of #79158 - lcnr:lazy-norm-coerce, r=oli-obkMara Bos-17/+30
type is too big -> values of the type are too big strictly speaking, `[u8; usize::MAX]` or even `[[[u128; usize::MAX]; usize::MAX]; usize::MAX]` are absolutely fine types as long as you don't try to deal with any values of it. This error message seems to cause some confusion imo, for example in https://github.com/rust-lang/rust/pull/79135#issuecomment-729361380 so I would prefer us to be more precise here. See the added test case which uses one of these types without causing an error. r? ``@oli-obk``
2020-11-18Rollup merge of #78999 - petrochenkov:deprid, r=eddybMara Bos-1/+11
stability: More precise location for deprecation lint on macros One missing piece of https://github.com/rust-lang/rust/pull/73178.
2020-11-18move fuel checks to later points in instcombine and const_prop, add opt ↵cjkenn-2/+2
level flag to test
2020-11-18Add tests for multi-segment paths in const generic argumentsvarkor-12/+49
2020-11-18Permit standalone generic parameters as const generic arguments in macrosvarkor-25/+3
2020-11-18change error for `LayoutErr::SizeOverflow`Bastian Kauschke-17/+30
2020-11-17Move change to check_fn, fix up overloaded-calls-nontupleRune Tynan-2/+16
2020-11-17Rollup merge of #79130 - lcnr:extend-tes, r=varkorMara Bos-2/+44
extend macro braces test r? `@varkor`
2020-11-17Rollup merge of #79072 - oli-obk:byte_str_pat, r=estebankMara Bos-2/+59
Fix exhaustiveness in case a byte string literal is used at slice type fixes #79048
2020-11-17Fix ui tests for `fn`s with qualifiers in `extern` blocksThePuzzlemaker-21/+42
2020-11-17extend macro braces testBastian Kauschke-2/+44