summary refs log tree commit diff
path: root/src/test/ui/span
AgeCommit message (Collapse)AuthorLines
2017-09-29WIP: don't suggest placing `use` statements into expanded codeOliver Schneider-1/+1
2017-08-22Fix fallout in tests.Jeffrey Seyfried-44/+38
2017-08-21Auto merge of #43929 - oli-obk:use_placement, r=nrcbors-8/+8
Improve placement of `use` suggestions r? @nrc cc @estebank @Mark-Simulacrum fixes #42835 fixes #42548 fixes #43769
2017-08-19Auto merge of #43933 - topecongiro:bad-span-for-attributes, r=petrochenkovbors-2/+2
Fix bad span for attributes Closes #42641.
2017-08-17Improve placement of `use` suggestionsOliver Schneider-8/+8
2017-08-17Update ui testsSeiichi Uchida-2/+2
2017-08-16Auto merge of #43864 - GuillaumeGomez:static-method-invalid-use, r=eddybbors-0/+3
Add help for static method invalid use Fixes #30391.
2017-08-16Stabilize rvalue promotion to 'static.Eduard-Mihai Burtescu-34/+42
2017-08-16Add a note to unused variablesGuillaume Gomez-0/+1
2017-08-14Add help for static method invalid useGuillaume Gomez-0/+3
2017-08-09rustc: Rearchitect lints to be emitted more eagerlyAlex Crichton-32/+52
In preparation for incremental compilation this commit refactors the lint handling infrastructure in the compiler to be more "eager" and overall more incremental-friendly. Many passes of the compiler can emit lints at various points but before this commit all lints were buffered in a table to be emitted at the very end of compilation. This commit changes these lints to be emitted immediately during compilation using pre-calculated lint level-related data structures. Linting today is split into two phases, one set of "early" lints run on the `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the "early" lints to running as late as possible in compilation, just before HIR lowering. This notably means that we're catching resolve-related lints just before HIR lowering. The early linting remains a pass very similar to how it was before, maintaining context of the current lint level as it walks the tree. Post-HIR, however, linting is structured as a method on the `TyCtxt` which transitively executes a query to calculate lint levels. Each request to lint on a `TyCtxt` will query the entire crate's 'lint level data structure' and then go from there about whether the lint should be emitted or not. The query depends on the entire HIR crate but should be very quick to calculate (just a quick walk of the HIR) and the red-green system should notice that the lint level data structure rarely changes, and should hopefully preserve incrementality. Overall this resulted in a pretty big change to the test suite now that lints are emitted much earlier in compilation (on-demand vs only at the end). This in turn necessitated the addition of many `#![allow(warnings)]` directives throughout the compile-fail test suite and a number of updates to the UI test suite.
2017-07-27Avoid duplicated errors for generic arguments in macro pathsVadim Petrochenkov-43/+1
2017-07-27Give span to angle bracketed generic argumentsVadim Petrochenkov-0/+182
2017-07-26Rollup merge of #43447 - estebank:import-span, r=nikomatsakisMark Simulacrum-0/+21
Point at path segment on module not found Point at the correct path segment on a import statement where a module doesn't exist. New output: ```rust error[E0432]: unresolved import `std::bar` --> <anon>:1:10 | 1 | use std::bar::{foo1, foo2}; | ^^^ Could not find `bar` in `std` ``` instead of: ```rust error[E0432]: unresolved import `std::bar::foo1` --> <anon>:1:16 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` error[E0432]: unresolved import `std::bar::foo2` --> <anon>:1:22 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` ``` Fix #43040.
2017-07-25Point at path segment on module not foundEsteban Küber-0/+21
Point at the correct path segment on a import statement where a module doesn't exist. New output: ```rust error[E0432]: unresolved import `std::bar` --> <anon>:1:10 | 1 | use std::bar::{foo1, foo2}; | ^^^ Could not find `bar` in `std` ``` instead of: ```rust error[E0432]: unresolved import `std::bar::foo1` --> <anon>:1:16 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` error[E0432]: unresolved import `std::bar::foo2` --> <anon>:1:22 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` ```
2017-07-20Use the macro structure spans instead of the invocationEsteban Küber-0/+30
2017-07-17Change some helps to suggestionsOliver Schneider-2/+2
2017-07-08Remove more anonymous trait method parametersVadim Petrochenkov-10/+10
2017-07-07Auto merge of #42809 - seanmonstar:stable-associated-consts, r=nikomatsakisbors-42/+40
remove associated_consts feature gate Currently struggling to run tests locally (something about jemalloc target missing). cc #29646
2017-07-06Only underline suggestion if it is not the only code being shownEsteban Küber-1/+1
2017-07-06Add extra whitespace for suggestionsEsteban Küber-0/+4
2017-07-06Make suggestion include the line numberEsteban Küber-2/+2
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-06remove associated_consts feature gateSean McArthur-42/+40
2017-07-02report the total number of errors on compilation failureAriel Ben-Yehuda-2/+2
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-78/+78
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-06-26make lint on-by-default/implied-by messages appear only onceZack M. Davis-4/+2
From review discussion on #38103 (https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).
2017-06-12Add E0608Guillaume Gomez-1/+1
2017-06-05Auto merge of #42383 - estebank:candidate-newline, r=arielb1bors-6/+8
Use multiline note for trait suggestion
2017-06-04Separate suggestion in a `help` and a `note`Esteban Küber-2/+4
2017-06-02Use multiline note for trait suggestionEsteban Küber-4/+4
2017-06-01Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakisbors-8/+3
Decompose Adjustment into smaller steps and remove the method map. The method map held method callee information for: * actual method calls (`x.f(...)`) * overloaded unary, binary, indexing and call operators * *every overloaded deref adjustment* (many can exist for each expression) That last one was a historical ~~accident~~ hack, and part of the motivation for this PR, along with: * a desire to compose adjustments more freely * containing the autoderef logic better to avoid mutation within an inference snapshot * not creating `TyFnDef` types which are incompatible with the original one * i.e. we used to take a`TyFnDef`'s `for<'a> &'a T -> &'a U` signature and instantiate `'a` using a region inference variable, *then* package the resulting `&'b T -> &'b U` signature in another `TyFnDef`, while keeping *the same* `DefId` and `Substs` * to fix #3548 by explicitly writing autorefs for the RHS of comparison operators Individual commits tell their own story, of "atomic" changes avoiding breaking semantics. Future work based on this PR could include: * removing the signature from `TyFnDef`, now that it's always "canonical" * some questions of variance remain, as subtyping *still* treats the signature differently * moving part of the typeck logic for methods, autoderef and coercion into `rustc::traits` * allowing LUB coercions (joining multiple expressions) to "stack up" many adjustments * transitive coercions (e.g. reify or unsize after multiple steps of autoderef) r? @nikomatsakis
2017-05-31Use callsite's span for macro calls on suggestionEsteban Küber-0/+19
When suggesting an appropriate mutability for a macro call, use the call span instead of the expanded macro's span.
2017-06-01tests: fix fallout from changing the span of binop errors.Eduard-Mihai Burtescu-8/+3
2017-05-30Add new error codeGuillaume Gomez-1/+1
2017-05-27Add new error codes and update testsGuillaume Gomez-95/+95
2017-05-24Rollup merge of #42150 - citizen428:feature/error-count-messages, ↵Mark Simulacrum-78/+78
r=Mark-Simulacrum Change error count messages See #33525 for details. r? @Mark-Simulacrum
2017-05-24Change error count messagesMichael Kohl-78/+78
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-2/+2
2017-05-05Move logic to `is_representable` instead of climbing HIREsteban Küber-22/+21
2017-05-04Only point at the fields that cause infinite sizeEsteban Küber-9/+6
* clean up code * point only fields that cause the type to be of infinite size * fix unittests
2017-05-04Point at fields that make the type recursiveEsteban Küber-0/+67
On recursive types of infinite size, point at all the fields that make the type recursive. ```rust struct Foo { bar: Bar, } struct Bar { foo: Foo, } ``` outputs ``` error[E0072]: recursive type `Foo` has infinite size --> file.rs:1:1 1 | struct Foo { | _^ starting here... 2 | | bar: Bar, | | -------- recursive here 3 | | } | |_^ ...ending here: recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable error[E0072]: recursive type `Bar` has infinite size --> file.rs:5:1 | 5 | struct Bar { | _^ starting here... 6 | | foo: Foo, | | -------- recursive here 7 | | } | |_^ ...ending here: recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable ```
2017-05-02Auto merge of #40851 - oli-obk:multisugg, r=jonathandturnerbors-8/+4
Minimize single span suggestions into a label changes ``` 14 | println!("☃{}", tup[0]); | ^^^^^^ | help: to access tuple elements, use tuple indexing syntax as shown | println!("☃{}", tup.0); ``` into ``` 14 | println!("☃{}", tup[0]); | ^^^^^^ to access tuple elements, use `tup.0` ``` Also makes suggestions explicit in the backend in preparation of adding multiple suggestions to a single diagnostic. Currently that's already possible, but results in a full help message + modified code snippet per suggestion, and has no rate limit (might show 100+ suggestions).
2017-04-25Point at variable moved by closureEsteban Küber-16/+35
2017-04-25Rebase and address commentsOliver Schneider-1/+1
2017-04-25Address PR commentsOliver Schneider-3/+4
2017-04-25Simplify a suggestion for str additionOliver Schneider-3/+1
2017-04-25Update affected testsOliver Schneider-7/+4
2017-04-21Rollup merge of #41435 - estebank:issue-33884, r=nikomatsakisCorey Farwell-0/+39
Add test for issue 33884 Fix #33884. r=nikomatsakis
2017-04-21Rollup merge of #37658 - GuillaumeGomez:ref_suggestion, r=nikomatsakis,eddybCorey Farwell-10/+5
Ref suggestion