about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
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-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 #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-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-5/+5
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-37/+16
Move promoted MIR out of `mir::Body` r? @oli-obk
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-25pprust: Do not print spaces before some tokensVadim Petrochenkov-5/+5
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-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.
2019-08-23Suggest calling closure with resolved return type when appropriateEsteban Küber-1/+17
2019-08-23`--bless` some tests due to message format change.Mazdak Farrokhzad-34/+34
2019-08-23Simplify eager normalization of constantsOliver Scherer-10/+10
2019-08-22Do not suggest `.try_into()` on `i32::from(x)`Esteban Küber-0/+12
2019-08-22Rollup merge of #63796 - estebank:opaque_future, r=CentrilMazdak Farrokhzad-0/+44
Tweak E0308 on opaque types ``` error[E0308]: if and else have incompatible types --> file.rs:21:9 | 18 | / if true { 19 | | thing_one() | | ----------- expected because of this 20 | | } else { 21 | | thing_two() | | ^^^^^^^^^^^ expected opaque type, found a different opaque type 22 | | }.await | |_____- if and else have incompatible types | = note: expected type `impl std::future::Future` (opaque type) found type `impl std::future::Future` (opaque type) = note: distinct uses of `impl Trait` result in different opaque types = help: if both futures resolve to the same type, consider `await`ing on both of them ``` r? @Centril CC #63167
2019-08-22Rollup merge of #63737 - HowJMay:fix_naming, r=jonas-schievinkMazdak Farrokhzad-16/+16
Fix naming misspelling Fixes #63734
2019-08-22Rollup merge of #63624 - estebank:unreachable-macro, r=petrochenkovMazdak Farrokhzad-0/+8
When declaring a declarative macro in an item it's only accessible inside it Fix #63164. r? @petrochenkov
2019-08-22Changed testsWesley Wiser-37/+16
2019-08-22Fix naming misspellingYangHau-16/+16
2019-08-22Auto merge of #63175 - jsgf:argsfile, r=jsgfbors-0/+50
rustc: implement argsfiles for command line Many tools, such as gcc and gnu-ld, support "args files" - that is, being able to specify @file on the command line. This causes `file` to be opened and parsed for command line options. They're separated with whitespace; whitespace can be quoted with double or single quotes, and everything can be \\-escaped. Args files may recursively include other args files via `@file2`. See https://sourceware.org/binutils/docs/ld/Options.html#Options for the documentation of gnu-ld's @file parameters. This is useful for very large command lines, or when command lines are being generated into files by other tooling.