about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-09-08Tests: No longer emitting 0008, E0301, E0302.Mazdak Farrokhzad-36/+0
2019-09-08Update tests wrt. bind_by_by_move_pattern_guards stabilization.Mazdak Farrokhzad-217/+35
2019-09-07Rollup merge of #64139 - Mark-Simulacrum:strip-legacy-proc-macro, r=petrochenkovMazdak Farrokhzad-50/+7
Migrate internal diagnostic registration to macro_rules Review is best done commit-by-commit. Fixes #64132.
2019-09-07Rollup merge of #64233 - varkor:correct-pluralisation, r=estebankMazdak Farrokhzad-8/+8
Correct pluralisation of various diagnostic messages
2019-09-07Rollup merge of #64192 - estebank:turbofish-madness, r=petrochenkovMazdak Farrokhzad-136/+32
Bail out when encountering likely missing turbofish in parser When encountering a likely intended turbofish without `::`, bubble up the diagnostic instead of emitting it to allow the parser to recover more gracefully and avoid uneccessary type errors that are likely to be wrong. Fix #61329.
2019-09-07Rollup merge of #64149 - eddyb:llvm-var-names, r=rkruppeMazdak Farrokhzad-0/+15
rustc_codegen_llvm: give names to non-alloca variable values. These names only matter when looking at LLVM IR, but they can help. When one value is used for multiple variables, I decided to combine the names. I chose `,` as a separator but maybe `=` or ` ` (space) are more appropriate. (LLVM names can contain any characters - if necessary they end up having quotes) As an example, this function: ```rust #[no_mangle] pub fn test(a: u32, b: u32) -> u32 { let c = a + b; let d = c; let e = d * a; e } ``` Used to produce this LLVM IR: ```llvm define i32 @test(i32 %a, i32 %b) unnamed_addr #0 { start: %0 = add i32 %a, %b %1 = mul i32 %0, %a ret i32 %1 } ``` But after this PR you get this: ```llvm define i32 @test(i32 %a, i32 %b) unnamed_addr #0 { start: %"c,d" = add i32 %a, %b %e = mul i32 %"c,d", %a ret i32 %e } ``` cc @nagisa @rkruppe
2019-09-07Rollup merge of #63919 - matthewjasper:remove-gensymmed, r=petrochenkovMazdak Farrokhzad-110/+164
Use hygiene for AST passes AST passes are now able to have resolve consider their expansions as if they were opaque macros defined either in some module in the current crate, or a fake empty module with `#[no_implicit_prelude]`. * Add an ExpnKind for AST passes. * Remove gensyms in AST passes. * Remove gensyms in`#[test]`, `#[bench]` and `#[test_case]`. * Allow opaque macros to define tests. * Move tests for unit tests to their own directory. * Remove `Ident::{gensym, is_gensymed}` - `Ident::gensym_if_underscore` still exists. cc #60869, #61019 r? @petrochenkov
2019-09-06Update ui testsvarkor-8/+8
2019-09-06Rollup merge of #64202 - alexreg:rush-pr-1, r=CentrilMazdak Farrokhzad-354/+354
Fixed grammar/style in some error messages Factored out from hacking on rustc for work on the REPL. r? @Centril
2019-09-06Rollup merge of #64067 - Mark-Simulacrum:valgrind-dyn, r=alexcrichtonMazdak Farrokhzad-17/+0
Remove no-prefer-dynamic from valgrind tests This seems to be working locally. Resolves #31968
2019-09-06Rollup merge of #63565 - Centril:deny-nll-migrate-mode, r=matthewjasperMazdak Farrokhzad-10/+11
Rust 2018: NLL migrate mode => hard error As per decision on a language team meeting as described in https://github.com/rust-lang/rust/pull/63565#issuecomment-528563744, we refuse to downgrade NLL errors, that AST borrowck accepts, into warnings and keep them as hard errors. cc @rust-lang/lang cc @rust-lang/wg-compiler-nll
2019-09-06rustc_codegen_llvm: give names to non-alloca variable values.Eduard-Mihai Burtescu-0/+15
2019-09-06Refuse to downgrade NLL errors on Rust >= 2018.Mazdak Farrokhzad-10/+11
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-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-354/+354
2019-09-05Fix testEsteban Küber-22/+25
2019-09-05Bail out when encountering likely missing turbofish in parserEsteban Küber-114/+7
When encountering a likely intended turbofish without `::`, bubble up the diagnostic instead of emitting it to allow the parser to recover more gracefully and avoid uneccessary type errors that are likely to be wrong.
2019-09-05Remove rustc_diagnostic_macros featureMark Rousskov-50/+7
2019-09-05Add `with_{def_site,call_site,legacy}_ctxt,` methods to `Span`Vadim Petrochenkov-86/+86
Use these to create call-site spans for AST passes when needed.
2019-09-05Move tests for unit tests to their own directoryMatthew Jasper-0/+0
2019-09-05Make use of hygiene in AST passesMatthew Jasper-24/+78
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