about summary refs log tree commit diff
path: root/src/test/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2018-12-24make non_camel_case_types an early lintAndy Russell-9/+16
2018-12-23Rollup merge of #57020 - estebank:return-span, r=zackmdavisMazdak Farrokhzad-1/+3
Point to cause of `fn` expected return type Fix #48136.
2018-12-20Point to return span when writing `return;` on non-() fnEsteban Küber-1/+3
2018-12-14Auto merge of #56572 - kevgrasso:let_self_err_dev, r=estebankbors-1/+8
Contexually dependent error message for E0424 when value is assigned to "self" This is an improvement for pull request #54495 referencing issue #54369. If the "self" keyword is assigned a value as though it were a valid identifier, it will now report: ``` let self = "self"; ^^^^ `self` value is a keyword and may not be bound to variables or shadowed ``` instead of ``` let self = "self"; ^^^^ `self` value is a keyword only available in methods with `self` parameter ``` If anyone has a better idea for what the error should be I'd be happy to modify it appropriately.
2018-12-13debug logging, added conditional error message, tests updatedKevyn Grasso-1/+8
2018-12-11std: Depend directly on crates.io cratesAlex Crichton-1/+1
Ever since we added a Cargo-based build system for the compiler the standard library has always been a little special, it's never been able to depend on crates.io crates for runtime dependencies. This has been a result of various limitations, namely that Cargo doesn't understand that crates from crates.io depend on libcore, so Cargo tries to build crates before libcore is finished. I had an idea this afternoon, however, which lifts the strategy from #52919 to directly depend on crates.io crates from the standard library. After all is said and done this removes a whopping three submodules that we need to manage! The basic idea here is that for any crate `std` depends on it adds an *optional* dependency on an empty crate on crates.io, in this case named `rustc-std-workspace-core`. This crate is overridden via `[patch]` in this repository to point to a local crate we write, and *that* has a `path` dependency on libcore. Note that all `no_std` crates also depend on `compiler_builtins`, but if we're not using submodules we can publish `compiler_builtins` to crates.io and all crates can depend on it anyway! The basic strategy then looks like: * The standard library (or some transitive dep) decides to depend on a crate `foo`. * The standard library adds ```toml [dependencies] foo = { version = "0.1", features = ['rustc-dep-of-std'] } ``` * The crate `foo` has an optional dependency on `rustc-std-workspace-core` * The crate `foo` has an optional dependency on `compiler_builtins` * The crate `foo` has a feature `rustc-dep-of-std` which activates these crates and any other necessary infrastructure in the crate. A sample commit for `dlmalloc` [turns out to be quite simple][commit]. After that all `no_std` crates should largely build "as is" and still be publishable on crates.io! Notably they should be able to continue to use stable Rust if necessary, since the `rename-dependency` feature of Cargo is soon stabilizing. As a proof of concept, this commit removes the `dlmalloc`, `libcompiler_builtins`, and `libc` submodules from this repository. Long thorns in our side these are now gone for good and we can directly depend on crates.io! It's hoped that in the long term we can bring in other crates as necessary, but for now this is largely intended to simply make it easier to manage these crates and remove submodules. This should be a transparent non-breaking change for all users, but one possible stickler is that this almost for sure breaks out-of-tree `std`-building tools like `xargo` and `cargo-xbuild`. I think it should be relatively easy to get them working, however, as all that's needed is an entry in the `[patch]` section used to build the standard library. Hopefully we can work with these tools to solve this problem! [commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-12-08fix span for invalid number of parameters in trait methodGuillaume Gomez-4/+4
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