summary refs log tree commit diff
path: root/src/test/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2018-12-04Update testsOliver Scherer-12/+22
2018-11-30Updated ui tests.Alexander Regueiro-1/+1
2018-11-29Rollup merge of #56114 - varkor:nonexhaustive-backticks, r=nikomatsakisGuillaume Gomez-2/+2
Enclose type in backticks for "non-exhaustive patterns" error This makes the error style consistent with the convention in error messages.
2018-11-26Auto merge of #56070 - oli-obk:const_let, r=eddybbors-8/+34
Allow assignments in const contexts fixes https://github.com/rust-lang/rust/issues/54098 fixes https://github.com/rust-lang/rust/issues/51251 fixes https://github.com/rust-lang/rust/issues/52613
2018-11-22Reword and fix testEsteban Küber-2/+2
2018-11-22Suggest correct syntax when writing type arg instead of assoc typeEsteban Küber-35/+0
When confusing an associated type with a type argument, suggest the appropriate syntax. Given `Iterator<isize>`, suggest `Iterator<Item = isize>`.
2018-11-22Point at the associated type's def spanEsteban Küber-0/+12
2018-11-22Join multiple E0191 errors in the same location under a single diagnosticEsteban Küber-9/+6
2018-11-22Point at every unexpected lifetime and type argument in E0107Esteban Küber-3/+38
2018-11-21Enclose type in backticks for "reached the recursion limit while ↵varkor-1/+1
auto-dereferencing" error
2018-11-20Enclose type in backticks for "non-exhaustive patterns" errorvarkor-1/+1
This makes the error style consistent with the convention in error messages.
2018-11-19Update nll stderr filesOliver Scherer-4/+16
2018-11-19Also catch static mutation at evaluation timeOliver Scherer-4/+18
2018-11-19Auto merge of #56051 - pietroalbini:rollup, r=pietroalbinibors-2/+6
Rollup of 25 pull requests Successful merges: - #55562 (Add powerpc- and powerpc64-unknown-linux-musl targets) - #55564 (test/linkage-visibility: Ignore on musl targets) - #55827 (A few tweaks to iterations/collecting) - #55834 (Forward the ABI of the non-zero sized fields of an union if they have the same ABI) - #55857 (remove unused dependency) - #55862 (in which the E0618 "expected function" diagnostic gets a makeover) - #55867 (do not panic just because cargo failed) - #55894 (miri enum discriminant handling: Fix treatment of pointers, better error when it is undef) - #55916 (Make miri value visitor useful for mutation) - #55919 (core/tests/num: Simplify `test_int_from_str_overflow()` test code) - #55923 (reword #[test] attribute error on fn items) - #55949 (ty: return impl Iterator from Predicate::walk_tys) - #55952 (Update to Clang 7 on CI.) - #55953 (#53488 Refactoring UpvarId) - #55962 (rustdoc: properly calculate spans for intra-doc link resolution errors) - #55963 (Stress test for MPSC) - #55968 (Clean up some non-mod-rs stuff.) - #55970 (Miri backtrace improvements) - #56007 (CTFE: dynamically make sure we do not call non-const-fn) - #56011 (Replace data.clone() by Arc::clone(&data) in mutex doc.) - #56012 (avoid shared ref in UnsafeCell::get) - #56016 (Add VecDeque::resize_with) - #56027 (docs: Add missing backtick in object_safety.rs docs) - #56043 (remove "approx env bounds" if we already know from trait) - #56059 (Increase `Duration` approximate equal threshold to 1us)
2018-11-18Rollup merge of #55862 - zackmdavis:but_will_they_come_when_you_call_them, ↵Pietro Albini-2/+6
r=estebank in which the E0618 "expected function" diagnostic gets a makeover A woman of wisdom once told me, "Better late than never." (Can't reopen the previously-closed pull request from six months ago [due to GitHub limitations](https://github.com/rust-lang/rust/pull/51098#issuecomment-437647157).) Now the main span focuses on the erroneous not-a-function callee, while showing the entire call expression is relegated to a secondary span. In the case where the erroneous callee is itself a call, we point out the definition, and, if the call expression spans multiple lines, tentatively suggest a semicolon (because we suspect that the "outer" call is actually supposed to be a tuple). ![not_a_fn_1](https://user-images.githubusercontent.com/1076988/48309935-96755000-e538-11e8-9390-02a048abb0c2.png) ![not_a_fn_2](https://user-images.githubusercontent.com/1076988/48309936-98d7aa00-e538-11e8-8b9b-257bc77d6261.png) The new `bug!` assertion is, in fact, safe (`confirm_builtin_call` is only called by `check_call`, which is only called with a first arg of kind `ExprKind::Call` in `check_expr_kind`). Resolves #51055. r? @estebank
2018-11-18resolve: Avoid sentence breaks in diagnosticsVadim Petrochenkov-3/+3
2018-11-18resolve: Tweak some articles in ambiguity diagnosticsVadim Petrochenkov-1/+1
2018-11-18resolve: Improve diagnostics for resolution ambiguitiesVadim Petrochenkov-4/+5
2018-11-10in which the E0618 "expected function" diagnostic gets a makeoverZack M. Davis-2/+6
Now the main span focuses on the erroneous not-a-function callee, while showing the entire call expression is relegated to a secondary span. In the case where the erroneous callee is itself a call, we point out the definition, and, if the call expression spans multiple lines, tentatively suggest a semicolon (because we suspect that the "outer" call is actually supposed to be a tuple). The new `bug!` assertion is, in fact, safe (`confirm_builtin_call` is only called by `check_call`, which is only called with a first arg of kind `ExprKind::Call` in `check_expr_kind`). Resolves #51055.
2018-11-07Only do check for trait objects, not trait or trait alias definitions.Alexander Regueiro-83/+24
2018-11-07Added error for duplicate bindings of associated type.Alexander Regueiro-6/+89
2018-11-07Added tests.Alexander Regueiro-2/+18
2018-11-03Make "all possible cases" help message uniform with existing help messagesvarkor-1/+1
Specifically no capitalisation or trailing full stops.
2018-11-01Put backticks around field names, types and paths in error messagesMichael Hewson-1/+1
Added to `DispatchFromDyn` and `CoerceUnsized` error messages
2018-10-29Don't emit cannot move errors twice in migrate modeMatthew Jasper-18/+0
2018-10-28resolve: More precise spans for privacy errorsVadim Petrochenkov-2/+2
2018-10-26Auto merge of #54929 - csmoe:cfg_lint, r=petrochenkovbors-2/+26
Suggest to remove prefix `b` in cfg attribute lint string Closes #54926 r? @estebank
2018-10-25Report const eval error inside the queryOliver Schneider-30/+5
2018-10-23Auto merge of #55113 - mockersf:master, r=estebankbors-9/+10
#45829 when a renamed import conflict with a previous import Fix the suggestion when a renamed import conflict. It check if the snipped contains `" as "`, and if so uses everything before for the suggestion.
2018-10-22optimize unsupported literal diag messagecsmoe-3/+3
2018-10-20update meta item checking testcsmoe-0/+24
2018-10-19Auto merge of #55162 - nikomatsakis:issue-54902-underscore-bound, r=tmandrybors-9/+9
handle underscore bounds in unexpected places Per the discussion on #54902, I made it a hard error to use lifetime bounds in various places where they used to be permitted: - `where Foo: Bar<'_>` for example I also moved error reporting to HIR lowering and added `Error` variants to let us suppress downstream errors that result. I (imo) improved the error message wording to be clearer, as well. In the process, I fixed the ICE in #52098. Fixes #54902 Fixes #52098
2018-10-18Auto merge of #54979 - estebank:path-unsized, r=nikomatsakisbors-1/+1
Custom E0277 diagnostic for `Path` r? @nikomatsakis we have a way to target `Path` exclusively, we need to identify the correct text to show to consider #23286 fixed.
2018-10-17move E0637 to lowering and improve output, add more testsNiko Matsakis-9/+9
2018-10-17fix other tests failing due to change in case or new suggestion for extern crateFrançois Mockers-9/+10
2018-10-17Update output for borrowck=migrate compare mode.David Wood-11/+18
This commit updates the test output for the updated NLL compare mode that uses `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The previous commit changes `compiletest` and this commit only updates `.nll.stderr` files.
2018-10-13Auto merge of #54997 - davidtwco:issue-54896, r=nagisabors-3/+29
The #[panic_handler] attribute can be applied to non-functions Fixes #54896. This commit extends the existing lang items functionality to assert that the `#[lang_item]` attribute is only found on the appropriate item for any given lang item. That is, language items representing traits must only ever have their corresponding attribute placed on a trait, for example. r? @nagisa
2018-10-11structured suggestion for E0223 ambiguous associated typeZack M. Davis-3/+1
It looks like we tend to use angle-brackets around the placeholder in the few other places we use `Applicability::HasPlaceholders`, but that would be confusing here, so ...
2018-10-11Extend lang items to assert correct target.David Wood-3/+29
This commit extends the existing lang items functionality to assert that the `#[lang_item]` attribute is only found on the appropriate item for any given lang item. That is, language items representing traits must only ever have their corresponding attribute placed on a trait, for example.
2018-10-10Custom E0277 diagnostic for `Path`Esteban Küber-1/+1
2018-10-05Updates to .stderr output in ui tests from earlier changes.Felix S. Klock II-1/+1
2018-10-03Clearer later use messages for callsMatthew Jasper-2/+2
Give a special message when the later use is from a call. Use the span of the callee instead of the whole expression. For conflicting borrow messages say that the later use is of the first borrow.
2018-09-23Improve error message for E0424Julian Kulesh-1/+1
2018-09-17On nightly with NLL, suggest `#![feature(bind_by_move_pattern_guards)]` when ↵Felix S. Klock II-0/+22
it might fix the code.
2018-09-09Auto merge of #53778 - petrochenkov:shadrelax2, r=nikomatsakisbors-2/+2
resolve: Relax shadowing restrictions on macro-expanded macros Previously any macro-expanded macros weren't allowed to shadow macros from outer scopes. Now only "more macro-expanded" macros cannot shadow "less macro-expanded" macros. See comments to `fn may_appear_after` and added tests for more details and examples. The functional changes are a21f6f588fc28c97533130ae44a6957b579ab58c and 46dd365ce9ca0a6b8653849b80267763c542842a, other commits are refactorings.
2018-09-09Auto merge of #53960 - estebank:issue-51303, r=nagisabors-4/+5
Fix incorrect outer function type parameter message Fix #51303.
2018-09-08resolve: More precise spans for ambiguous resolution errorsVadim Petrochenkov-2/+2
Add labels to ambiguous resolution errors
2018-09-06Auto merge of #53575 - matthewjasper:unsized-is-an-error, r=estebankbors-3/+94
Don't reduce E0161 to a warning in NLL migrate mode This error has been on stable for a while, and allowing such code cause the compile to later ICE (since we can't codegen it). Errors `box UNSIZED EXPR` with unsized locals because it's not compatible with the current evaluation order (create the box before evaluating the expressions). cc #53469 (fixes the ICE in this case) cc @qnighy
2018-09-05reword label as per reviewEsteban Küber-1/+1
2018-09-05slight rewording of labelsEsteban Küber-1/+1