summary refs log tree commit diff
path: root/src/test/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2018-06-19Suggest that values are dropped in the opposite order they are definedSantiago Pastorino-0/+2
2018-06-19NLL: Updates to diagnostic output in `test/ui`.Felix S. Klock II-1/+1
2018-06-08Rollup merge of #51360 - estebank:braces-around-literal-structs, r=nikomatsakisMark Rousskov-2/+60
Suggest parentheses when a struct literal needs them When writing a struct literal in an expression that expects a block to be started afterwards (like an `if` statement), do not suggest using the same struct literal: ``` did you mean `S { /* fields * /}`? ``` Instead, suggest surrounding the expression with parentheses: ``` did you mean `(S { /* fields * /})`? ``` Fix #47360, #50090. Leaving #42982 open to come back to this problem with a better solution.
2018-06-05Refactor the const eval diagnostic APIOliver Schneider-3/+3
2018-06-04Suggest braces when a struct literal needs themEsteban Küber-2/+60
When writing a struct literal in an expression that expects a block to be started afterwards (like an `if` statement), do not suggest using the same struct literal: ``` did you mean `S { /* fields * /}`? ``` Instead, suggest surrounding the expression with parentheses: ``` did you mean `(S { /* fields * /})`? ```
2018-06-03implement #[panic_implementation]Jorge Aparicio-2/+2
2018-05-26Rollup merge of #51057 - pnkfelix:issue-51025-make-ui-tests-robust-wrt-nll, ↵Mark Simulacrum-50/+79
r=nikomatsakis make ui tests robust with respect to NLL This PR revises the `ui` tests that I could quickly identify that: 1. previously had successful compilations under non-lexical lifetimes (NLL) because they assumed lexical lifetimes, but 2. such assumption of lexical lifetimes was actually not necessarily part of the spirit of the original issue/bug we want to witness. In many cases, this is simply a matter of adding a use of a borrow so that it gets extended long enough to observe a conflict. (In some cases the revision was more subtle, such as adding a destructor, or revising the order of declaration of some variables.) ---- With these test revisions in place, I subsequently updated the expected stderr output under the NLL compiletest mode. So now we should get even more testing of NLL than we were before. Fix #51025
2018-05-25rust-lang/rust#51025: improve test robustness so that they work under NLL too.Felix S. Klock II-50/+79
2018-05-22Tweak `main` type arguments and where clause spansEsteban Küber-11/+9
Tweak the spans for error when finding type arguments or where clauses in main and start functions.
2018-05-19Auto merge of #50782 - matthewjasper:wheres-main, r=matthewjasperbors-0/+50
Prevent main from having a where clause. Closes #50714 Should this have a crater run? cc #48557, #48214 r? @nikomatsakis
2018-05-18Prevent main and start from having a where clause.Matthew Jasper-0/+50
2018-05-18Auto merge of #50653 - oli-obk:bad_const, r=cramertjbors-4/+4
Make the `const_err` lint `deny`-by-default At best these things are runtime panics (debug mode) or overflows (release mode). More likely they are public constants that are unused in the crate declaring them. This is not a breaking change, as dependencies won't break and root crates can `#![warn(const_err)]`, though I don't know why anyone would do that.
2018-05-12Make the `const_err` lint `deny`-by-defaultOliver Schneider-4/+4
2018-05-11unary op filter, dereference hintRoman Stoliar-3/+1
2018-05-11added missing implementation hintRoman Stoliar-0/+4
2018-04-30Improve div by zero const eval errorsOliver Schneider-2/+1
2018-04-30Update ui test outputOliver Schneider-1/+1
2018-04-27Allow #[inline] on closuresAmanieu d'Antras-4/+4
Fixes #49632
2018-04-18Trivial updates to `.nll.stderr` files post-rebase, reflecting s/-Znll/nll/ ↵Felix S. Klock II-1/+1
in messages.
2018-04-18Update the previously checkpointed (but unused by bors) tests to reflect ↵Felix S. Klock II-4/+4
current reality.
2018-04-12AST/HIR: Merge field access expressions for named and numeric fieldsVadim Petrochenkov-22/+22
2018-04-11Checkpoint the current status of NLL on `ui` tests via compare-mode=nll.Felix S. Klock II-0/+184
2018-04-11Workaround rust-lang/rust#49855 by forcing rustc_error in any mode, ↵Felix S. Klock II-10/+10
including NLL. NOTE: I was careful to make each change in a manner that preserves the existing diagnostic output (usually by ensuring that no lines were added or removed). This means that the resulting source files are not as nice to read as they were at the start. But we will have to review these cases by hand anyway as follow-up work, so cleanup could reasonably happen then (or not at all).
2018-04-04Auto merge of #48171 - FraGag:doc-copy-clone-impls, r=nikomatsakisbors-4/+4
Better document the implementors of Clone and Copy There are two parts to this change. The first part is a change to the compiler and to the standard library (specifically, libcore) to allow implementations of `Clone` and `Copy` to be written for a subset of builtin types. By adding these implementations to libcore, they now show up in the documentation. This is a [breaking-change] for users of `#![no_core]`, because they will now have to supply their own copy of the implementations of `Clone` and `Copy` that were added in libcore. The second part is purely a documentation change to document the other implementors of `Clone` and `Copy` that cannot be described in Rust code (yet) and are thus provided by the compiler. Fixes #25893
2018-03-29Stabilize underscore lifetimesTaylor Cramer-4/+3
2018-03-28Stabilize match_default_bindingsTaylor Cramer-24/+4
This includes a submodule update to rustfmt in order to allow a stable feature declaration.
2018-03-26Move some implementations of Clone and Copy to libcoreFrancis Gagné-4/+4
Add implementations of `Clone` and `Copy` for some primitive types to libcore so that they show up in the documentation. The concerned types are the following: * All primitive signed and unsigned integer types (`usize`, `u8`, `u16`, `u32`, `u64`, `u128`, `isize`, `i8`, `i16`, `i32`, `i64`, `i128`); * All primitive floating point types (`f32`, `f64`) * `bool` * `char` * `!` * Raw pointers (`*const T` and `*mut T`) * Shared references (`&'a T`) These types already implemented `Clone` and `Copy`, but the implementation was provided by the compiler. The compiler no longer provides these implementations and instead tries to look them up as normal trait implementations. The goal of this change is to make the implementations appear in the generated documentation. For `Copy` specifically, the compiler would reject an attempt to write an `impl` for the primitive types listed above with error `E0206`; this error no longer occurs for these types, but it will still occur for the other types that used to raise that error. The trait implementations are guarded with `#[cfg(not(stage0))]` because they are invalid according to the stage0 compiler. When the stage0 compiler is updated to a revision that includes this change, the attribute will have to be removed, otherwise the stage0 build will fail because the types mentioned above no longer implement `Clone` or `Copy`. For type variants that are variadic, such as tuples and function pointers, and for array types, the `Clone` and `Copy` implementations are still provided by the compiler, because the language is not expressive enough yet to be able to write the appropriate implementations in Rust. The initial plan was to add `impl` blocks guarded by `#[cfg(dox)]` to make them apply only when generating documentation, without having to touch the compiler. However, rustdoc's usage of the compiler still rejected those `impl` blocks. This is a [breaking-change] for users of `#![no_core]`, because they will now have to supply their own implementations of `Clone` and `Copy` for the primitive types listed above. The easiest way to do that is to simply copy the implementations from `src/libcore/clone.rs` and `src/libcore/marker.rs`. Fixes #25893
2018-03-26Fix e0658 ui testMark Mansi-7/+12
2018-03-26Stabilize i128 feature tooMark Mansi-1/+1
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-3/+2
2018-03-25Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoeristerkennytm-2/+4
Always print `aborting due to n previous error(s)` r? @michaelwoerister
2018-03-23Rollup merge of #49160 - estebank:issue-47457-missing-fields, r=oli-obkAlex Crichton-2/+2
Reduce the diagnostic spam when multiple fields are missing in pattern Fix #47457.
2018-03-20Auto merge of #49190 - kennytm:rollup, r=kennytmbors-3/+3
Rollup of 17 pull requests - Successful merges: #46518, #48810, #48834, #48902, #49004, #49092, #49096, #49099, #49104, #49125, #49139, #49152, #49157, #49161, #49166, #49176, #49184 - Failed merges:
2018-03-19Reduce diagnostic verbosity by removing labelsEsteban Küber-2/+2
2018-03-20Stabilize slice patterns without `..`Vadim Petrochenkov-6/+2
Merge `feature(advanced_slice_patterns)` into `feature(slice_patterns)`
2018-03-19#49133 - Reworded the Error message: "`pub` not needed here" messageDileep Bapat-3/+3
2018-03-16Update testsJohn Kåre Alsaker-2/+4
2018-03-16Rollup merge of #49037 - estebank:coherence-tweaks, r=nikomatsakiskennytm-2/+31
Coherence diagnostic tweaks
2018-03-16Rollup merge of #49007 - estebank:follow-up-47574, r=oli-obkkennytm-8/+9
Some tweaks to "type parameters from outer function" diagnostic Follow up to #47574.
2018-03-15Coherence diagnostic tweaksEsteban Küber-2/+31
2018-03-16Rollup merge of #48706 - ehuss:main-not-found-in-crate, r=estebankkennytm-5/+22
Add crate name to "main function not found" error message. Fixes #44798 and rust-lang/cargo#4948. I was wondering if it might be cleaner to update the ui tests to add a simple `fn main() {}` for the unrelated tests. Let me know if you would prefer that.
2018-03-15Auto merge of #48138 - estebank:issue-45092, r=nikomatsakisbors-10/+11
Reword E0044 and message for `!Send` types - Reword E0044 help. - Change error message for types that don't implement `Send` CC #45092, #46678, #24909, #33307.
2018-03-14Add span label to E0044Esteban Küber-1/+2
2018-03-14Reword E0044 and message for `!Send` typesEsteban Küber-10/+10
- Reword E0044 help. - Change error message for types that don't implement `Send`
2018-03-14Update E0601 test for new message format.Eric Huss-1/+1
2018-03-14Some tweaks to "type parameters from outer function" diagnosticEsteban Küber-8/+9
Follow up to #47574.
2018-03-14Add backticks to `main` not found errors.Eric Huss-2/+2
2018-03-14Add suggestion where to add main function.Eric Huss-0/+18
2018-03-14Add empty main() to tests where it is missing.Eric Huss-5/+4
2018-03-14Add crate name to "main function not found" error message.Eric Huss-1/+1
Fixes #44798 and rust-lang/cargo#4948.