about summary refs log tree commit diff
path: root/src/test/ui/resolve
AgeCommit message (Collapse)AuthorLines
2018-01-15Add note when trying to use `Self` as a ctorEsteban Küber-0/+4
2018-01-15Readd suggestion in enum variants with incorrect argsEsteban Küber-3/+3
2018-01-15Suggest the correct syntax for different struct typesEsteban Küber-33/+40
2018-01-15Hide suggestion to use struct ctor when it is not visibleEsteban Küber-9/+2
2018-01-02Correct for changes in line numbers in expected stderr output.Ed Schouten-23/+23
Due to the disable-cloudabi tags being added to the source files, the expected output of the compiler is altered slightly.
2018-01-02Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.Ed Schouten-0/+4
It looks like many of these tests are already disabled on emscripten, which also doesn't seem to support environment variables and subprocess spawning. Just add a similar tag for CloudABI. While there, sort some of the lists of operating systems alphabetically.
2017-12-21Do not emit type errors on recovered blocksEsteban Küber-8/+1
When a parse error occurs on a block, the parser will recover and create a block with the statements collected until that point. Now a flag stating that a recovery has been performed in this block is propagated so that the type checker knows that the type of the block (which will be identified as `()`) shouldn't be checked against the expectation to reduce the amount of irrelevant diagnostic errors shown to the user.
2017-12-14Remove NOTE/HELP annotations from UI testsVadim Petrochenkov-239/+171
2017-11-27Fix testEsteban Küber-1/+1
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-350/+311
2017-11-16Remove left over dead code from suggestion diagnostic refactoringOliver Schneider-18/+0
2017-11-15Add new error comparision to hide desugaringChristopher Vittal-13/+1
First some background: To the compiler, the following two signatures in the trait vs the impl are the same. ```rust trait Foo { fn foo(&self, &impl Debug); } impl Foo for () { fn foo<U: Debug>(&self, x: &U) { ... } } ``` We do not want to allow this, and so we add a new error and check. The check just tests that all paramters 'syntheticness' match up. As during collection, the impl Trait parameters are transformed into anonymous synthetic generics. Furthermore, causes a check for unused type parameters to be skipped in check_bounds_are_used if there is already a TyError. Thus, an unused input will not trigger `type parameter unused` errors. Update the one test that checked for this error in the case of a TyError.
2017-11-10Auto merge of #45050 - petrochenkov:ambind, r=nikomatsakisbors-0/+24
resolve: Use same rules for disambiguating fresh bindings in `match` and `let` Resolve `Unit` as a unit struct pattern in ```rust struct Unit; let Unit = x; ``` consistently with ```rust match x { Unit => {} } ``` It was previously an error. (The change also applies to unit variants and constants.) Fixes https://users.rust-lang.org/t/e0530-cannot-shadow-unit-structs-what-in-the-earthly-what/13054 (This particular change doesn't depend on a fix for the issue mentioned in https://users.rust-lang.org/t/e0530-cannot-shadow-unit-structs-what-in-the-earthly-what/13054/4) cc @rust-lang/lang r? @nikomatsakis
2017-11-03Detect `=` -> `:` typo in let bindingsEsteban Küber-19/+1
When encountering a let binding type error, attempt to parse as initializer instead. If successful, it is likely just a typo: ```rust fn main() { let x: Vec::with_capacity(10); } ``` ``` error: expected type, found `10` --> file.rs:3:31 | 3 | let x: Vec::with_capacity(10, 20); | -- ^^ | || | |help: did you mean assign here?: `=` | while parsing the type for `x` ```
2017-11-04Move some tests to UIVadim Petrochenkov-0/+24
2017-08-31WIP: don't suggest placing `use` statements into expanded codeOliver Schneider-4/+4
2017-08-31Add test for broken suggestionOliver Schneider-9/+29
2017-08-21Merge remote-tracking branch 'origin/master' into genAlex Crichton-9/+74
2017-08-17Improve placement of `use` suggestionsOliver Schneider-9/+74
2017-07-28Fix testsAlex Crichton-2/+2
2017-07-21Adjust new suggestions to the suggestion guidelinesOliver Schneider-1/+1
2017-07-18reorder span labelsgaurikholkar-7/+7
2017-07-17Change some helps to suggestionsOliver Schneider-32/+32
2017-07-06Only underline suggestion if it is not the only code being shownEsteban Küber-12/+20
2017-07-06Add extra whitespace for suggestionsEsteban Küber-7/+36
2017-07-06Make suggestion include the line numberEsteban Küber-22/+22
When there're more than one suggestions in the same diagnostic, they are displayed in their own block, instead of inline. In order to reduce confusion, those blocks now display the line number.
2017-07-02report the total number of errors on compilation failureAriel Ben-Yehuda-1/+1
Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed. This changes the compiler driver API to handle errors more smoothly, and therefore is a compiler-api-[breaking-change]. Fixes #42793.
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-25/+25
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-06-24Don't naively point to return type on type errorEsteban Küber-3/+0
2017-06-24Detect missing `;` on methods with return type `()`Esteban Küber-1/+6
- Point out the origin of a type requirement when it is the return type of a method - Point out possibly missing semicolon when the return type is () and the implicit return makes sense as a statement - Suggest changing the return type of methods with default return type - Don't suggest changing the return type on fn main() - Don't suggest changing the return type on impl fn
2017-06-02Add E0603 error codeGuillaume Gomez-5/+5
2017-05-30Add new error codeGuillaume Gomez-3/+3
2017-05-24Rollup merge of #42150 - citizen428:feature/error-count-messages, ↵Mark Simulacrum-25/+25
r=Mark-Simulacrum Change error count messages See #33525 for details. r? @Mark-Simulacrum
2017-05-24Change error count messagesMichael Kohl-25/+25
See #33525 for details.
2017-05-17Add better error message when == operator is badly usedGuillaume Gomez-2/+2
2017-05-10Example usage of multiple suggestionsOliver Schneider-38/+38
2017-04-28refac Move levenchstein before context dependent checkFreyskeyd-7/+54
Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
2017-04-12Add a way to get shorter spans until `char` for pointing at defsEsteban Küber-1/+1
```rust error[E0072]: recursive type `X` has infinite size --> file.rs:10:1 | 10 | struct X { | ^^^^^^^^ recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable ``` vs ```rust error[E0072]: recursive type `X` has infinite size --> file.rs:10:1 | 10 | struct X { | _^ starting here... 11 | | x: X, 12 | | } | |_^ ...ending here: recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable ```
2017-04-04Merge branch 'master' into issue-32540Esteban Küber-4/+0
2017-03-30update UI testNiko Matsakis-4/+0
We no longer give suggestions; this is presumably related to the changes I made in coercion. However, those suggestions appear to be wrong anyhow!
2017-03-25Improve wording and spans for unexpected tokenEsteban Küber-7/+3
* Point at where the token was expected instead of the last token successfuly parsed. * Only show `unexpected token` if the next char and the unexpected token don't have the same span. * Change some cfail and pfail tests to ui test. * Don't show all possible tokens in span label if they are more than 6.
2017-03-24Point at last valid token on failed `expect_one_of`Esteban Küber-3/+10
```rust error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)` --> $DIR/token-error-correct-3.rs:29:9 | 25 | foo() | - expected one of `.`, `;`, `?`, `}`, or an operator after this ... 29 | } else { | ^ unexpected token ```
2017-03-15Stabilize pub(restricted)Taylor Cramer-20/+16
2017-03-12Rollup merge of #40369 - petrochenkov:segspan, r=eddybCorey Farwell-21/+39
Give spans to individual path segments in AST And use these spans in path resolution diagnostics. The spans are spans of identifiers in segments, not whole segments. I'm not sure what spans are more useful in general, but identifier spans are a better fit for resolve errors. HIR still doesn't have spans. Fixes https://github.com/rust-lang/rust/pull/38927#discussion_r95336667 https://github.com/rust-lang/rust/pull/38890#issuecomment-271731008 r? @nrc @eddyb
2017-03-10resolve: Use path segment spans in smart_resolve_pathVadim Petrochenkov-21/+39
2017-03-10Update syntax for `pub(restricted)`Vadim Petrochenkov-2/+2
2017-02-25rustc_const_eval: always demand typeck_tables for evaluating constants.Eduard-Mihai Burtescu-7/+1
2017-02-25rustc_typeck: simplify AstConv requests as implemented by collect.Eduard-Mihai Burtescu-2/+9
2017-01-29Improve diagnostics for inaccessible constructorsVadim Petrochenkov-0/+137
2017-01-21Resolve `Self` in impl headersVadim Petrochenkov-10/+2