summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-04-17macro_rules: `NtLifetime` cannot start with an identifierVadim Petrochenkov-0/+13
2020-04-17Tests.Felix S. Klock II-0/+52
Namely, a regression test for issue #69798 (export added), and the inverse of that test (export removd).
2020-04-06Use TypeRelating for instantiating query responsesMatthew Jasper-0/+33
2020-04-03Account for bad placeholder types in where clausesEsteban Küber-55/+158
2020-04-03parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.Mazdak Farrokhzad-0/+11
2020-03-21can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs.Mazdak Farrokhzad-1/+37
2020-03-10Rollup merge of #69836 - JohnTitor:immediate-outputs, r=nagisaMazdak Farrokhzad-0/+22
Check if output is immediate value Fixes #62046 r? @nagisa
2020-03-10Rollup merge of #69817 - thekuom:test/borrow-checking-pattern-features, ↵Mazdak Farrokhzad-0/+432
r=Centril test(patterns): add patterns feature tests to borrowck test suite Addresses request here: https://github.com/rust-lang/rust/pull/69690#issuecomment-595763571 Fixes https://github.com/rust-lang/rust/issues/67311. r? @Centril
2020-03-10Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnisonMazdak Farrokhzad-52/+0
Remove spotlight I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it. r? @kinnison cc @ollie27
2020-03-09test(patterns): add borrowck tests for combination of pattern featuresMatthew Kuo-0/+432
Adds borrowck tests for the following features: - bindings_after_at - or_patterns - slice_patterns - box_patterns
2020-03-09Rollup merge of #69842 - JohnTitor:more-tests, r=CentrilMazdak Farrokhzad-0/+131
Add more regression tests Closes #54239 Closes #57200 Closes #57201 Closes #60473 Closes #64620 Closes #67166 r? @Centril
2020-03-09Rollup merge of #69762 - RalfJung:validity-errors, r=oli-obkMazdak Farrokhzad-28/+48
Ensure that validity only raises validity errors For now, only as a debug-assertion (similar to const-prop detecting errors that allocate). Now includes https://github.com/rust-lang/rust/pull/69646. [Relative diff](https://github.com/RalfJung/rust/compare/layout-visitor...RalfJung:validity-errors). r? @oli-obk
2020-03-09Rollup merge of #69685 - cuviper:soft-segv, r=sfacklerMazdak Farrokhzad-0/+19
unix: Don't override existing SIGSEGV/BUS handlers Although `stack_overflow::init` runs very early in the process, even before `main`, there may already be signal handlers installed for things like the address sanitizer. In that case, just leave it alone, and don't bother trying to allocate our own signal stacks either. Fixes #69524.
2020-03-09Rollup merge of #69201 - Aaron1011:feature/permit-if-attr, r=CentrilMazdak Farrokhzad-111/+248
Permit attributes on 'if' expressions Previously, attributes on 'if' expressions (e.g. `#[attr] if true {}`) were disallowed during parsing. This made it impossible for macros to perform any custom handling of such attributes (e.g. stripping them away), since a compilation error would be emitted before they ever had a chance to run. This PR permits attributes on 'if' expressions ('if-attrs' from here on). Both built-in attributes (e.g. `#[allow]`, `#[cfg]`) and proc-macro attributes are supported. We still do *not* accept attributes on 'other parts' of an if-else chain. That is, the following code snippet still fails to parse: ```rust if true {} #[attr] else if false {} else #[attr] if false {} #[attr] else {} ``` Closes https://github.com/rust-lang/rust/issues/68618
2020-03-09Add FIXMEsYuki Okushi-6/+9
2020-03-08unix: Don't override existing SIGSEGV/BUS handlersJosh Stone-0/+19
Although `stack_overflow::init` runs very early in the process, even before `main`, there may already be signal handlers installed for things like the address sanitizer. In that case, just leave it alone, and don't bother trying to allocate our own signal stacks either.
2020-03-09Add test for issue-67166Yuki Okushi-0/+22
2020-03-09Add test for issue-64620Yuki Okushi-0/+18
2020-03-09Add test for issue-60473Yuki Okushi-0/+27
2020-03-09Add test for issue-57201Yuki Okushi-0/+22
2020-03-09Add test for issue-57200Yuki Okushi-0/+22
2020-03-09Add test for issue-54239Yuki Okushi-0/+17
2020-03-09Check if output is immediate valueYuki Okushi-0/+22
2020-03-08fix some cases of unexpected exceptions leaving validationRalf Jung-28/+48
2020-03-08Rollup merge of #69800 - tmiasko:address-g, r=nikicMazdak Farrokhzad-3/+2
Compile address sanitizer test with debuginfo This makes error-pattern to match regardless of current configuration of `rust.debuginfo-level-tests` in `config.toml`.
2020-03-08Rollup merge of #69734 - tmiasko:di-enumerator, r=ecstatic-morseMazdak Farrokhzad-0/+27
Change DIBuilderCreateEnumerator signature to match LLVM 9 * Change DIBuilderCreateEnumerator signature to match LLVM 9 C API. * Use provided is unsigned flag when emitting enumerators.
2020-03-08Rollup merge of #69120 - spunit262:invalid-sugar-suggest, r=matthewjasperMazdak Farrokhzad-8/+2
Don't give invalid suggestion on desugared span.
2020-03-08Rollup merge of #69646 - RalfJung:layout-visitor, r=eddybMazdak Farrokhzad-228/+305
Miri visitor: detect primitive types based on type, not layout (also, more tests) I also converted the union-based transmutes to use `mem::transmute` for increased readability. r? @eddyb @oli-obk
2020-03-08fix type size mismatch on 32bitRalf Jung-20/+19
2020-03-08Rollup merge of #69810 - ↵Mazdak Farrokhzad-0/+48
thekuom:test/67523-dynamic-semantics-bindings-after-at, r=Centril test(bindings_after_at): add dynamic drop tests for bindings_after_at Fixes https://github.com/rust-lang/rust/issues/67523. Working towards https://github.com/rust-lang/rust/issues/65490.
2020-03-08Rollup merge of #69805 - petrochenkov:importname, r=CentrilMazdak Farrokhzad-2/+2
resolve: Modernize some naming `ImportDirective` -> `Import` `ImportDirectiveSubclass` -> `ImportKind` `ImportKind::SingleImport` -> `ImportKind::Single` `ImportKind::GlobImport` -> `ImportKind::Glob`
2020-03-08Rollup merge of #69599 - Centril:typeck-tweak-wording, r=davidtwcoMazdak Farrokhzad-8/+8
check_binding_alt_eq_ty: improve precision wrt. `if let` Follow up to https://github.com/rust-lang/rust/pull/69452 -- this tweaks the `check_binding_alt_eq_ty` logic wrt. wording so that `if let` doesn't include "in this arm" (because there can only ever be one arm). r? @estebank
2020-03-08Rollup merge of #69561 - JohnTitor:clean-up-unstable-book, r=Mark-SimulacrumMazdak Farrokhzad-13/+0
Clean up unstable book - #58402's feature was renamed to `tidy_test_never_used_anywhere_else` and it is now used for tidy only - `read_initializer` link is wrong and the doc should be auto-generated so removed - Add dummy doc for `link_cfg` - Stop generating `compiler_builtins_lib` doc in favor of b8ccc0f8a60ac16fdc00f4b2e36e1a5db8b78295 - Make `rustc_attrs` tracking issue "None"
2020-03-08Rollup merge of #69548 - LeSeulArtichaut:assert-errors, r=petrochenkovMazdak Farrokhzad-13/+7
Turn trailing tokens in `assert!()` into hard errors I didn't have time to build the compiler and thus edited the tests manually, I hope it will still pass. Closes #69531 r? @Centril do you want to queue the Crater experiment?
2020-03-08Rollup merge of #69422 - JohnTitor:remove-unwrap, r=XanewokMazdak Farrokhzad-33/+38
Remove use of `unwrap()` from save-analysis Fix #69409, fix #69416
2020-03-07test(bindings_after_at): add dynamic drop tests for bindings_after_atMatthew Kuo-0/+48
2020-03-07resolve: `directive` -> `import`Vadim Petrochenkov-2/+2
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-21/+21
fix various typos
2020-03-07Rollup merge of #69708 - estebank:tiny, r=petrochenkovMazdak Farrokhzad-8/+2
On mismatched delimiters, only point at empty blocks that are in the same line We point at empty blocks when we have mismatched braces to detect cases where editors auto insert `}` after writing `{`. Gate this to only the case where the entire span is in the same line so we never point at explicitly empty blocks.
2020-03-07Rollup merge of #69687 - Centril:bm-inconsistent-wording, r=estebankMazdak Farrokhzad-72/+73
resolve, inconsistent binding mode: tweak wording Now that we can have e.g. `let Ok(x) | Err(x) = res;`, it's no longer appropriate to refer to "the same *match arm*", so let's tweak the wording. r? @estebank
2020-03-07Rollup merge of #69667 - JohnTitor:no-debug, r=nikomatsakisMazdak Farrokhzad-95/+11
Remove the `no_debug` feature Context: https://github.com/rust-lang/rust/issues/29721#issuecomment-367642779 r? @nikomatsakis
2020-03-07Compile address sanitizer test with debuginfoTomasz Miąsko-3/+2
This makes error-pattern to match regardless of current configuration of `rust.debuginfo-level-tests` in `config.toml`.
2020-03-07Rollup merge of #69727 - JohnTitor:sugg-unwrap, r=estebankMazdak Farrokhzad-0/+37
Avoid using `unwrap()` in suggestions Fixes #69725 r? @estebank
2020-03-07Rollup merge of #69690 - thekuom:test/67311-extend-bindings-after-at-tests, ↵Mazdak Farrokhzad-0/+307
r=Centril test(pattern): add tests for combinations of pattern features Reference issue #67311 Tests combinations of the following pattern features: - bindings_after_at - or_patterns - slice_patterns - box_patterns r? @Centril
2020-03-07Rollup merge of #68985 - daboross:fix-35813, r=CentrilMazdak Farrokhzad-10/+613
Parse & reject postfix operators after casts This adds an explicit error messages for when parsing `x as Type[0]` or similar expressions. Our add an extra parse case for parsing any postfix operator (dot, indexing, method calls, await) that triggers directly after parsing `as` expressions. My friend and I worked on this together, but they're still deciding on a github username and thus I'm submitting this for both of us. It will immediately error out, but will also provide the rest of the parser with a useful parse tree to deal with. There's one decision we made in how this produces the parse tree. In the situation `&x as T[0]`, one could imagine this parsing as either `&((x as T)[0])` or `((&x) as T)[0]`. We chose the latter for ease of implementation, and as it seemed the most intuitive. Feedback welcome! This is our first change to the parser section, and it might be completely horrible. Fixes #35813.
2020-03-07Rollup merge of #67741 - estebank:point-at-pat-def, r=CentrilMazdak Farrokhzad-4/+68
When encountering an Item in a pat context, point at the item def ``` error[E0308]: mismatched types --> $DIR/const-in-struct-pat.rs:8:17 | LL | struct foo; | ----------- `foo` defined here ... LL | let Thing { foo } = t; | ^^^ expected struct `std::string::String`, found struct `foo` | = note: `foo` is interpreted as a unit struct, not a new binding help: you can bind the struct field to a different name | LL | let Thing { foo: other_foo } = t; | ^^^^^^^^^^^^^^ ``` ``` error[E0308]: mismatched types --> $DIR/const.rs:14:9 | LL | const FOO: Foo = Foo{bar: 5}; | ----------------------------- constant defined here ... LL | FOO => {}, | ^^^ | | | expected `&Foo`, found struct `Foo` | `FOO` is interpreted as a constant, not a new binding | help: use different name to introduce a new binding: `other_foo` ``` Fix #55631, fix #48062, cc #42876.
2020-03-06When encountering an Item in a pat context, point at the item defEsteban Küber-4/+68
2020-03-06please tidyRalf Jung-13/+14
2020-03-06better error messages for invalid boxes (and a few more tests)Ralf Jung-17/+39
2020-03-06test some more kinds of enums with uninhabited variantsRalf Jung-11/+77