about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-08-28Auto merge of #63875 - philipc:issue-57822, r=michaelwoeristerbors-8/+63
debuginfo: give unique names to closure and generator types Closure types have been moved to the namespace where they are defined, and both closure and generator type names now include the disambiguator. This fixes an exception when lldb prints nested closures. Fixes #57822 I haven't included the `DW_AT_artificial` changes discussed in #57822 because they make the output worse IMO, but I can easily add these if still required. For example, for the new test case the output is now: ``` (lldb) p g (issue_57822::main::closure-1) $1 = closure-1(closure(1)) ``` but adding `DW_AT_artificial` changes this to: ``` (lldb) p g (issue_57822::main::closure-1) $0 = closure-1 { } ``` Note that nested generators didn't cause the exception. I haven't determined why, but I think it makes sense to add the disambiguator for them too. It feels like we still don't really understand why closures were causing an error though. r? @michaelwoerister
2019-08-28Auto merge of #63853 - matthewjasper:test-ast-serialization, r=estebankbors-0/+51
Add default serialization for `Ident`s Also add tests for `-Zast-json` and `-Zast-json-noexpand` closes #63728
2019-08-28Auto merge of #63820 - oli-obk:eager_const_eval, r=nikomatsakisbors-10/+10
Simplify eager normalization of constants r? @nikomatsakis
2019-08-28Auto merge of #63127 - kper:pr, r=nikomatsakisbors-12/+12
Cleanup: Consistently use `Param` instead of `Arg` #62426 Fixes #62426
2019-08-27Add default serialization for `Ident`sMatthew Jasper-0/+51
Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.
2019-08-27Changing error messages and renaming tests #63127Kevin Per-2/+2
`async-await/no-args-non-move-async-closure` `generator/no-arguments-on-generators`
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-4/+4
2019-08-27Rollup merge of #63917 - lzutao:langitem_gen_63912, r=centril,cramertMazdak Farrokhzad-0/+23
Error when generator trait is not found Closes #63912
2019-08-27Rollup merge of #63761 - petrochenkov:procattrs, r=eddybMazdak Farrokhzad-41/+188
Propagate spans and attributes from proc macro definitions Thanks to https://github.com/rust-lang/rust/pull/63269 we now have spans and attributes from proc macro definitions available in metadata. However, that PR didn't actually put them into use! This PR finishes that work. Attributes `rustc_macro_transparency`, `allow_internal_unstable`, `allow_internal_unsafe`, `local_inner_macros`, `rustc_builtin_macro`, `stable`, `unstable`, `rustc_deprecated`, `deprecated` now have effect when applied to proc macro definition functions. From those attributes only `deprecated` is both stable and supposed to be used in new code. (`#![staged_api]` still cannot be used in proc macro crates for unrelated reasons though.) `Span::def_site` from the proc macro API now returns the correct location of the proc macro definition. Also, I made a mistake in https://github.com/rust-lang/rust/pull/63269#discussion_r312702919, loaded proc macros didn't actually use the resolver cache. This PR fixes the caching issue, now proc macros go through the `Resolver::macro_map` cache as well. (Also, the first commit turns `proc_macro::quote` into a regular built-in macro to reduce the number of places where `SyntaxExtension`s need to be manually created.)
2019-08-27Rollup merge of #62600 - emmericp:libtest-add-show-output, r=gnzlbgMazdak Farrokhzad-6/+21
libtest: add --show-output flag to print stdout of successful tests This pull request adds a new flag `--show-output` for tests to show the output of successful tests. For most formatters this was already supported just not exposed via the CLI (apparently only used by `librustdoc`). I've also added support for this option in the JSON formatter. This kind of fixes https://github.com/rust-lang/rust/issues/54669 which wants `--format json` to work with `--nocapture`, which is... well, impossible. What this issue really calls for is `--show-output` as implemented here.
2019-08-27debuginfo: always include disambiguator in type namesPhilip Craig-10/+10
2019-08-27proc_macro: Update `Span::def_site` to use the proc macro definition locationVadim Petrochenkov-41/+143
Which is no longer dummy and is available from metadata now.
2019-08-27Respect attributes on proc macro definitionsVadim Petrochenkov-0/+43
2019-08-26Rollup merge of #63921 - RalfJung:file-check, r=alexcrichtonMazdak Farrokhzad-0/+2
add link to FileCheck docs Thanks @gnzlbg for pointing me to those docs.
2019-08-26Rollup merge of #63693 - Centril:polish-parse-or-pats, r=estebankMazdak Farrokhzad-117/+871
Fully implement or-pattern parsing Builds upon the initial parsing in https://github.com/rust-lang/rust/pull/61708 to fully implement or-pattern (`p | q`) parsing as specified in [the grammar section of RFC 2535](https://github.com/rust-lang/rfcs/blob/master/text/2535-or-patterns.md#grammar). Noteworthy: - We allow or-patterns in `[p | q, ...]`. - We allow or-patterns in `let` statements and `for` expressions including with leading `|`. - We improve recovery for `p || q` (+ tests for that in `multiple-pattern-typo.rs`). - We improve recovery for `| p | q` in inner patterns (tests in `or-patterns-syntactic-fail.rs`). - We rigorously test or-pattern parsing (in `or-patterns-syntactic-{pass,fail}.rs`). - We harden the feature gating tests. - We do **_not_** change `ast.rs`. That is, `ExprKind::Let.0` and `Arm.pats` still accept `Vec<P<Pat>>`. I was starting work on that but it would be cleaner to do this in a separate PR so this one has a narrower scope. cc @dlrobertson cc the tracking issue https://github.com/rust-lang/rust/issues/54883. r? @estebank
2019-08-26Rollup merge of #63317 - estebank:dead-code, r=matthewjasperMazdak Farrokhzad-14/+152
Do not complain about unused code when used in `impl` `Self` type Fix https://github.com/rust-lang/rust/issues/18290.
2019-08-27proc_macro: Turn `quote` into a regular built-in macroVadim Petrochenkov-0/+2
Previously in was implemented using a special hack in the metadata loader
2019-08-26review commentEsteban Küber-2/+2
2019-08-26parser: fix span for leading vert.Mazdak Farrokhzad-4/+4
2019-08-26add link to FileCheck docsRalf Jung-0/+2
2019-08-26Error when generator trait is not foundLzu Tao-0/+23
2019-08-26Auto merge of #63901 - estebank:unknown-receiver-type, r=zackmdavisbors-2/+16
Point at method call on missing annotation error Make it clearer where the type name that couldn't be inferred comes from. Before: ``` error[E0282]: type annotations needed --> src/test/ui/span/type-annotations-needed-expr.rs:2:13 | 2 | let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S` | = note: type must be known at this point ``` after ``` error[E0282]: type annotations needed --> src/test/ui/span/type-annotations-needed-expr.rs:2:39 | 2 | let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282 | ^^^ cannot infer type for `S` | = note: type must be known at this point ``` CC #63852.
2019-08-26Auto merge of #63897 - petrochenkov:prettycomma, r=estebankbors-14/+11
pprust: Do not print spaces before some tokens Fixes https://github.com/rust-lang/rust/issues/63896 r? @Mark-Simulacrum
2019-08-26Auto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obkbors-41/+26
Move promoted MIR out of `mir::Body` r? @oli-obk
2019-08-26Auto merge of #62603 - cuviper:no-unwind-abort, r=joshtriplettbors-2/+10
Permit unwinding through FFI by default This repeats #62505 for master (Rust 1.38+), as #58794 is not yet resolved. This is a stopgap until a stable alternative is available, like [RFC 2699](https://github.com/rust-lang/rfcs/pull/2699), as long as progress is being made to that end. r? @joshtriplett
2019-08-25Point at method call on missing annotation errorEsteban Küber-2/+16
Make it clearer where the type name that couldn't be infered comes from.
2019-08-25Auto merge of #61613 - sinkuu:impl_trait_inline, r=ollie27bors-0/+50
Support `impl Trait` in inlined documentation `impl Trait` in argument position was not properly rendered when inlined from other crates. ([a live example on docs.rs](https://docs.rs/libp2p/0.8.1/libp2p/floodsub/struct.Floodsub.html#method.unsubscribe)) ![old](https://user-images.githubusercontent.com/7091080/59089838-14ba9900-8946-11e9-830b-53b317bdecb4.png) ↓ ![new](https://user-images.githubusercontent.com/7091080/59089844-16845c80-8946-11e9-9fe3-8998af9d73ce.png)
2019-08-25pprust: Do not print spaces before some tokensVadim Petrochenkov-14/+11
2019-08-25Force #[unwind(aborts)] in test/codegen/c-variadic.rsJosh Stone-0/+6
2019-08-25Revert "Allow a dirty MirBuilt for make_extern and make_method_extern"Josh Stone-2/+2
This reverts commit b4a6f597934f16f89e27058a32a514c9572f148f.
2019-08-25Permit unwinding through FFI by defaultMark Rousskov-0/+2
See #58794 for context.
2019-08-25or_patterns: add run-rustfix tests.Mazdak Farrokhzad-0/+150
2019-08-25parser: gracefully handle `fn foo(A | B: type)`.Mazdak Farrokhzad-86/+84
2019-08-25debuginfo: give unique names to closure and generator typesPhilip Craig-0/+55
Closure types have been moved to the namespace where they are defined, and both closure and generator type names now include the disambiguator. This fixes an exception when lldb prints nested closures. Fixes #57822
2019-08-25Rollup merge of #63859 - matthewjasper:check-snippet-result, r=CentrilMazdak Farrokhzad-0/+45
Don't unwrap the result of `span_to_snippet` Closes #63800
2019-08-25Rollup merge of #63833 - estebank:suggest-closure-call, r=petrochenkovMazdak Farrokhzad-1/+17
Suggest calling closure with resolved return type when appropriate Follow up to #63337. CC #63100. ``` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:46:20 | LL | let closure = || 42; | -- closure defined here LL | let _: usize = closure; | ^^^^^^^ | | | expected usize, found closure | help: use parentheses to call this closure: `closure()` | = note: expected type `usize` found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]` ```
2019-08-25Rollup merge of #63813 - estebank:int-from, r=varkorMazdak Farrokhzad-0/+12
Do not suggest `.try_into()` on `i32::from(x)` Fix #63697.
2019-08-25parser: 'while parsing this or-pattern...'Mazdak Farrokhzad-0/+19
2019-08-24parser: reword || recovery.Mazdak Farrokhzad-7/+7
2019-08-24parse_top_pat: silence leading vert gating sometimes.Mazdak Farrokhzad-33/+65
2019-08-24parser: better recovery for || in inner pats.Mazdak Farrokhzad-43/+73
2019-08-24or-patterns: harden feature gating tests.Mazdak Farrokhzad-2/+227
2019-08-24move `feature-gate-or_patterns.*` -> `ui/or-patterns/`Mazdak Farrokhzad-0/+0
2019-08-24or-patterns: add syntactic tests.Mazdak Farrokhzad-0/+217
2019-08-24move `ui/or-pattern-mismatch` -> `ui/or-patterns/`.Mazdak Farrokhzad-0/+0
2019-08-24parser: `let` stmts & `for` exprs: allow or-patterns.Mazdak Farrokhzad-32/+33
2019-08-24parser: use `eat_or_separator` for leading vert.Mazdak Farrokhzad-1/+12
2019-08-24parser: `multiple-pattern-typo`: cover more or-pattern places.Mazdak Farrokhzad-2/+73
2019-08-24parser: move `multiple-pattern-typo` -> `or-patterns` directory.Mazdak Farrokhzad-0/+0
2019-08-24Don't unwrap the result of `span_to_snippet`Matthew Jasper-0/+45
It can return `Err` due to macros being expanded across crates or files.