about summary refs log tree commit diff
path: root/src/test/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2019-01-13Rollup merge of #57412 - JohnTitor:improve-the-wording-1, r=varkorMazdak Farrokhzad-2/+2
Improve the wording I'm sorry but re-opened the PR because I failed to squash commits(#57397). Fixes #55752. r? @varkor
2019-01-12Rollup merge of #57535 - varkor:stabilise-if-while-let-patterns, r=CentrilMazdak Farrokhzad-35/+0
Stabilise irrefutable if-let and while-let patterns This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). This replaces https://github.com/rust-lang/rust/pull/55639, as we want to stabilise this in time for the beta cut-off. Closes https://github.com/rust-lang/rust/pull/55639. r? @Centril
2019-01-12Rollup merge of #57493 - euclio:deref-suggest, r=oli-obkMazdak Farrokhzad-7/+4
use structured suggestion when casting a reference
2019-01-12Stabilise irrefutable if-let and while-let patternsvarkor-35/+0
This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). Co-Authored-By: Sebastian Malton <sebastian@malton.name>
2019-01-10use structured suggestion when casting a referenceAndy Russell-7/+4
2019-01-09Stabilize `let` bindings and destructuring in constants and const fnOliver Scherer-4/+23
2019-01-08Improve the wordingYuki Okushi-2/+2
2019-01-06Auto merge of #57291 - euclio:method-call-suggestion, r=estebankbors-3/+1
use structured suggestion for method calls Furthermore, don't suggest calling the method if it is part of a place expression, as this is invalid syntax. I'm thinking it might be worth putting a label on the method assignment span like "this is a method" and removing the span from the "methods are immutable" text so it isn't reported twice. The suggestions in `src/test/ui/did_you_mean/issue-40396.stderr` are suboptimal. I could check if the containing expression is `BinOp`, but I'm not sure if that's general enough. Any ideas? r? @estebank
2019-01-05Rollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAuskennytm-1/+1
Fix broken links to second edition TRPL. Fixes https://github.com/rust-lang/rust/issues/57104. Remove `second-edition/` from TRPL hyperlinks.
2019-01-03use structured suggestion for method callsAndy Russell-3/+1
Furthermore, don't suggest calling the method if it is part of a place expression, as this is invalid syntax.
2019-01-02Auto merge of #57250 - codeworm96:tyerr_msg, r=varkorbors-1/+1
Improve type mismatch error messages Closes #56115. Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing. TODO the book and clippy needs to be changed accordingly later. r? @varkor
2019-01-01Fix broken links to second edition TRPL.Corey Farwell-1/+1
Fixes https://github.com/rust-lang/rust/issues/57104.
2018-12-31Improve type mismatch error messagesYuning Zhang-1/+1
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
2018-12-31Auto merge of #56878 - petrochenkov:privdyn, r=arielb1bors-5/+2
privacy: Use common `DefId` visiting infrastructure for all privacy visitors One repeating pattern in privacy checking is going through a type, visiting all `DefId`s inside it and doing something with them. This is the case because visibilities and reachabilities are attached to `DefId`s. Previously various privacy visitors visited types slightly differently using their own methods, with most recently written `TypePrivacyVisitor` being the "gold standard". This mostly worked okay, but differences could manifest in overly conservative reachability analysis, some errors being reported twice, some private-in-public lints (not errors) being wrongly reported or not reported. This PR does something that I wanted to do since https://github.com/rust-lang/rust/pull/32674#discussion_r58291608 - factoring out the common visiting logic! Now all the common logic is contained in `struct DefIdVisitorSkeleton`, with specific privacy visitors deciding only what to do with visited `DefId`s (via `trait DefIdVisitor`). A bunch of cleanups is also applied in the process. This area is somewhat tricky due to lots of easily miss-able details, but thankfully it's was well covered by tests in https://github.com/rust-lang/rust/pull/46083 and previous PRs, so I'm relatively sure in the refactoring correctness. Fixes https://github.com/rust-lang/rust/pull/56837#discussion_r241962239 in particular. Also this will help with implementing https://github.com/rust-lang/rust/issues/48054.
2019-01-01privacy: Use common `DefId` visiting infra for all privacy visitorsVadim Petrochenkov-5/+2
2018-12-31Auto merge of #57047 - euclio:field-structured-suggestions, r=estebankbors-1/+1
use structured suggestions for nonexistent fields r? @estebank
2018-12-31use structured suggestions for nonexistent fieldsAndy Russell-1/+1
2018-12-31Auto merge of #57044 - varkor:E0512-equal-type, r=matthewjasperbors-3/+3
Add specific diagnostic when attempting to transmute between equal generic types Also clarifies the wording of E0512. Fixes https://github.com/rust-lang/rust/issues/49793.
2018-12-29Fixed stderr files for ui tests.Alexander Regueiro-10/+1
2018-12-28Clarify wording of E0512varkor-3/+3
2018-12-26Added regression test for using generic parameters on modules.Alexander Regueiro-4/+12
2018-12-26Fixed more tests.Alexander Regueiro-2/+2
2018-12-25Remove licensesMark Rousskov-2784/+372
2018-12-25Auto merge of #57088 - euclio:non-camel-case-early-lint, r=estebankbors-9/+16
make non_camel_case_types an early lint This allows us to catch these kinds of style violations much earlier, as evidenced by the large number of tests that had to be updated for this change.
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.