about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-09-06Rollup merge of #64161 - estebank:point-variant, r=CentrilMazdak Farrokhzad-0/+21
Point at variant on pattern field count mismatch
2019-09-06Rollup merge of #64111 - Centril:ast-only-patkind-or, r=petrochenkovMazdak Farrokhzad-40/+685
or-patterns: Uniformly use `PatKind::Or` in AST & Fix/Cleanup resolve Following up on work in https://github.com/rust-lang/rust/pull/63693 and https://github.com/rust-lang/rust/pull/61708, in this PR we: - Uniformly use `PatKind::Or(...)` in AST: - Change `ast::Arm.pats: Vec<P<Pat>>` => `ast::Arm.pat: P<Pat>` - Change `ast::ExprKind::Let.0: Vec<P<Pat>>` => `ast::ExprKind::Let.0: P<Pat>` - Adjust `librustc_resolve/late.rs` to correctly handle or-patterns at any level of nesting as a result. In particular, the already-bound check which rejects e.g. `let (a, a);` now accounts for or-patterns. The consistency checking (ensures no missing bindings and binding mode consistency) also now accounts for or-patterns. In the process, a bug was found in the current compiler which allowed: ```rust enum E<T> { A(T, T), B(T) } use E::*; fn foo() { match A(0, 1) { B(mut a) | A(mut a, mut a) => {} } } ``` The new algorithms took a few iterations to get right. I tried several clever schemes but ultimately a version based on a stack of hashsets and recording product/sum contexts was chosen since it is more clearly correct. - Clean up `librustc_resolve/late.rs` by, among other things, using a new `with_rib` function to better ensure stack dicipline. - Do not push the change in AST to HIR for now to avoid doing too much in this PR. To cope with this, we introduce a temporary hack in `rustc::hir::lowering` (clearly marked in the diff). cc https://github.com/rust-lang/rust/issues/54883 cc @dlrobertson @matthewjasper r? @petrochenkov
2019-09-06Rollup merge of #64094 - kawa-yoiko:rustdoc-search, r=GuillaumeGomezMazdak Farrokhzad-0/+163
Improve searching in rustdoc and add tests 👋 I have made searching in rustdoc more intuitive, added a couple more tests and made a little shell script to aid testing. Closes #63005. It took me quite a while to figure out how to run the tests for rustdoc (instead of running tests for other crates with rustdoc); the only pointer I found was [hidden in the rustc book](https://rust-lang.github.io/rustc-guide/rustdoc.html#cheat-sheet). Maybe this could be better documented? I shall be delighted to help if it is desirable.
2019-09-05Rollup merge of #64157 - gilescope:opaque-type-location, r=cramertj,CentrilMazdak Farrokhzad-2/+2
Opaque type locations in error message for clarity. Attempts to fix #63167
2019-09-05Rollup merge of #64083 - estebank:tweak-e0308, r=oli-obkMazdak Farrokhzad-13/+86
Point at appropriate arm on type error on if/else/match with one non-! arm Fix https://github.com/rust-lang/rust/issues/61281.
2019-09-05Rollup merge of #64063 - JohnTitor:fix-const-err, r=oli-obkMazdak Farrokhzad-49/+468
Fix const_err with `-(-0.0)` Fixes #64059 r? @oli-obk
2019-09-05Rollup merge of #64041 - matklad:token-stream-tt, r=petrochenkovMazdak Farrokhzad-3/+3
use TokenStream rather than &[TokenTree] for built-in macros That way, we don't loose the jointness info
2019-09-05Rollup merge of #63930 - estebank:rustdoc-ice, r=GuillaumeGomezMazdak Farrokhzad-0/+32
Account for doc comments coming from proc macros without spans Fix https://github.com/rust-lang/rust/issues/63821.
2019-09-05or-patterns: fix fallout from #664128.Mazdak Farrokhzad-34/+19
2019-09-05or-patterns: fix pprust-expr-roundtrip due to AST change.Mazdak Farrokhzad-3/+3
2019-09-05resolve: test consistent or-patterns being allowed.Mazdak Farrokhzad-38/+132
2019-09-05resolve: test binding mode consistency for or-patterns.Mazdak Farrokhzad-0/+98
2019-09-05resolve: add test for missing bindings in or-patterns.Mazdak Farrokhzad-0/+324
2019-09-05resolve: account for general or-patterns in consistency checking.Mazdak Farrokhzad-4/+11
2019-09-05resolve: add tests for already-bound check.Mazdak Farrokhzad-0/+136
2019-09-05resolve: already-bound-check: account for or-patterns.Mazdak Farrokhzad-3/+4
Also document `ast::Pat::walk`.
2019-09-05Opaque type locations in error message for clarity.Giles Cope-2/+2
2019-09-04Point at variant on pattern field count mismatchEsteban Küber-0/+21
2019-09-05Rollup merge of #64128 - Centril:unused-parens-pat, r=davidtwcoMazdak Farrokhzad-47/+192
unused_parens: account for or-patterns and `&(mut x)` Fixes https://github.com/rust-lang/rust/issues/55342. Fixes https://github.com/rust-lang/rust/issues/64106. cc https://github.com/rust-lang/rust/issues/54883 cc https://github.com/rust-lang/rust/pull/64111 r? @oli-obk
2019-09-05Rollup merge of #64110 - estebank:receiver-type, r=CentrilMazdak Farrokhzad-99/+133
Refer to "`self` type" instead of "receiver type" Fix https://github.com/rust-lang/rust/issues/42603.
2019-09-05Rollup merge of #64043 - matthewjasper:underscore-import-tests, r=alexcrichtonMazdak Farrokhzad-0/+54
Add some more tests for underscore imports
2019-09-05Rollup merge of #64038 - matthewjasper:deny-mutual-impl-trait-recursion, ↵Mazdak Farrokhzad-2/+94
r=varkor Check impl trait substs when checking for recursive types closes #64004
2019-09-05Rollup merge of #64031 - Centril:param-attrs-no-macros-test, r=nikomatsakisMazdak Farrokhzad-0/+299
Harden `param_attrs` test wrt. usage of a proc macro `#[attr]` The `param-attrs-builtin-attrs.rs` test file uses the `#[test]` attribute which should cover this but `#[test]` isn't a proc macro attribute so we add another test to be on the safe side. This intends to address https://github.com/rust-lang/rust/pull/64010#issuecomment-526564316. r? @nikomatsakis cc @c410-f3r @petrochenkov cc https://github.com/rust-lang/rust/issues/60406
2019-09-04Improve searching in rustdoc and add testsShiqing-0/+163
2019-09-04Auto merge of #63825 - nathanwhit:check-run-results, r=Mark-Simulacrumbors-82/+30
Allow checking of run-pass execution output in compiletest Closes #63751 Adds a `check-run-results` flag to compiletest headers, which if enabled checks the output of the execution of a run-pass test's binary against expected output.
2019-09-04Add compile flagYuki Okushi-41/+43
2019-09-03use TokenStream rather than &[TokenTree] for built-in macrosAleksey Kladov-3/+3
That way, we don't loose the jointness info
2019-09-03review commentsEsteban Küber-2/+2
2019-09-03unused_parens: fix for or-patterns + &(mut x)Mazdak Farrokhzad-47/+192
2019-09-03Rollup merge of #64104 - Mark-Simulacrum:intrinsic-fn-ptr-ice, r=estebankMazdak Farrokhzad-0/+37
Emit error on intrinsic to fn ptr casts I'm not sure if a type error is the best way of doing this but it seemed like a relatively correct place to do it, and I expect this is a pretty rare case to hit anyway. Fixes #15694
2019-09-03Rollup merge of #64056 - estebank:arbitrary-self-types, r=CentrilMazdak Farrokhzad-0/+67
Account for arbitrary self types in E0599 Fix https://github.com/rust-lang/rust/issues/62373
2019-09-03Rollup merge of #64049 - estebank:if-else-type-err, r=CentrilMazdak Farrokhzad-96/+9
Emit a single error on if expr with expectation and no else clause Fix https://github.com/rust-lang/rust/issues/60254. r? @Centril
2019-09-02account for DUMMY_SP and correct wordingEsteban Küber-9/+11
2019-09-02On object safety violation, point at source when possibleEsteban Küber-62/+92
2019-09-02Refer to "`self` type" instead of "receiver type"Esteban Küber-48/+50
2019-09-02Add match test casesEsteban Küber-1/+76
2019-09-02Emit error on intrinsic to fn ptr castsMark Rousskov-0/+37
2019-09-02Auto merge of #63692 - iluuu1994:issue-49660, r=sfacklerbors-0/+77
Test that Wrapping arithmetic ops are implemented for all int types Closes #49660
2019-09-01Point at appropriate arm on type error on if/else/match with one non-! armEsteban Küber-12/+10
2019-09-02Auto merge of #63834 - andjo403:rustdoc-linker-remove, r=Mark-Simulacrumbors-1/+1
remove the unstable rustdoc parameter --linker use the code generation parameter -Clinker (same parameter as rustc) to control what linker to use for building the rustdoc test executables. closes: #63816
2019-09-02Fix tests againYuki Okushi-72/+542
2019-09-02Fix condition and tests' flagsYuki Okushi-141/+74
2019-09-02Fix overflow_checkYuki Okushi-49/+163
2019-09-01Auto merge of #63870 - estebank:async-fn-call, r=oli-obkbors-2081/+1234
Suggest call fn ctor passed as arg to fn with type param bounds _Reviewer note: the relevant changes are in the second commit, the first is simple and mechanical, but verbose._ When forgetting to call a fn in an argument position to an fn that has a generic bound: ```rust async fn foo() {} fn bar(f: impl Future<Output=()>) {} fn main() { bar(foo); // <- should be `bar(foo());` } ``` suggest calling it: ``` error[E0277]: the trait bound `fn() -> impl std::future::Future {foo}: std::future::Future` is not satisfied --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:9:5 | LL | fn bar(f: impl Future<Output=()>) {} | --------------------------------- required by `bar` ... LL | bar(foo); | ^^^ the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}` | = help: it looks like you forgot to use parentheses to call the function: `foo()` ``` Fix #63100. Follow up to #63833 and #63337.
2019-09-02Add `overflow_check` checkYuki Okushi-6/+0
2019-09-02Add `opt-level` checkYuki Okushi-145/+53
2019-09-01Fix const_err with `-(-0.0)`Yuki Okushi-14/+12
2019-09-01Account for arbitrary self types in E0599Esteban Küber-0/+67
2019-09-01review commentEsteban Küber-2/+2
2019-09-01Auto merge of #64036 - matthewjasper:kill-borrows-on-self-assign, r=estebankbors-0/+20
Kill borrows from assignments after generating new borrows Closes #63719