about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
AgeCommit message (Collapse)AuthorLines
2020-10-10Fix typo in error code descriptionNaoki Hayama-1/+1
s/abitrary/arbitrary/
2020-10-08Implement the instruction_set attributexd009642-0/+69
2020-10-07Auto merge of #77464 - ecstatic-morse:const-fn-impl-trait, r=oli-obkbors-12/+4
Give `impl Trait` in a `const fn` its own feature gate ...previously it was gated under `#![feature(const_fn)]`. I think we actually want to do this in all const-contexts? If so, this should be `#![feature(const_impl_trait)]` instead. I don't think there's any way to make use of `impl Trait` within a `const` initializer. cc #77463 r? `@oli-obk`
2020-10-06Update error code pageDylan MacKenzie-12/+4
2020-10-06Don't immediately error for recursive projectionsMatthew Jasper-1/+1
2020-10-06Fix toolsMatthew Jasper-23/+15
2020-10-01Create E0777 error code for "invalid literal in derive"Guillaume Gomez-0/+20
2020-10-01Auto merge of #77354 - ecstatic-morse:const-checking-moar-errors, r=oli-obkbors-37/+1
Overhaul const-checking diagnostics The primary purpose of this PR was to remove `NonConstOp::STOPS_CONST_CHECKING`, which causes any additional errors found by the const-checker to be silenced. I used this flag to preserve diagnostic parity with `qualify_min_const_fn.rs`, which has since been removed. However, simply removing the flag caused a deluge of errors in some cases, since an error would be emitted any time a local or temporary had a wrong type. To remedy this, I added an alternative system (`DiagnosticImportance`) to silence additional error messages that were likely to distract the user from the underlying issue. When an error of the highest importance occurs, all less important errors are silenced. When no error of the highest importance occurs, all less important errors are emitted after checking is complete. Following the suggestions from the important error is usually enough to fix the less important errors, so this should lead to better UX most of the time. There's also some unrelated diagnostics improvements in this PR isolated in their own commits. Splitting them out would be possible, but a bit of a pain. This isn't as tidy as some of my other PRs, but it should *only* affect diagnostics, never whether or not something passes const-checking. Note that there are a few trivial exceptions to this, like banning `Yield` in all const-contexts, not just `const fn`. As always, meant to be reviewed commit-by-commit. r? `@oli-obk`
2020-09-30Remove E0019, use E0015 for inline assembly in a constDylan MacKenzie-39/+1
2020-09-30Add more tests and check for ABIHugues de Valon-1/+15
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-09-30Add support for cmse_nonsecure_entry attributeHugues de Valon-0/+18
This patch adds support for the LLVM cmse_nonsecure_entry attribute. This is a target-dependent attribute that only has sense for the thumbv8m Rust targets. You can find more information about this attribute here: https://developer.arm.com/documentation/ecm0359818/latest/ Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-09-29Rewrite E0019 exampleDylan MacKenzie-4/+6
Inline assembly is now the only user of E0019. What is it doing that E0015 is not?
2020-09-25Rollup merge of #76973 - lzutao:unstably-const-assume, r=oli-obkJonas Schievink-4/+4
Unstably allow assume intrinsic in const contexts Not sure much about this usage because there are concerns about [blocking optimization][1] and [slowing down LLVM][2] when using `assme` intrinsic in inline functions. But since Oli suggested in https://github.com/rust-lang/rust/issues/76960#issuecomment-695772221, here we are. [1]: https://github.com/rust-lang/rust/pull/54995#issuecomment-429302709 [2]: https://github.com/rust-lang/rust/issues/49572#issuecomment-589615423
2020-09-21Add explanation for E0756Guillaume Gomez-1/+30
2020-09-21Rollup merge of #76439 - GuillaumeGomez:add-error-explanation-e0755, ↵Ralf Jung-1/+29
r=pickfire,jyn514 Add error explanation for E0755 r? @pickfire
2020-09-20Correct file path after some restructures in compilerLzu Tao-4/+4
2020-09-15Adjust spellingNiclas Schwarzlose-2/+2
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-09-15Disabled error `E0007` from rustc_error_codesAmjad Alsharafi-2/+6
2020-09-11Improve E0118 descriptionaticu-3/+24
2020-09-09Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasperTyler Mandry-3/+13
Improve unresolved use error message "use of undeclared type or module `foo`" doesn't mention that it could be a crate. This error can happen when users forget to add a dependency to `Cargo.toml`, so I think it's important to mention that it could be a missing crate. I've used a heuristic based on Rust's naming conventions. It complains about an unknown type if the ident starts with an upper-case letter, and crate or module otherwise. It seems to work very well. The expanded error help covers both an unknown type and a missing crate case.
2020-09-09Auto merge of #76406 - GuillaumeGomez:create-e0774, r=pickfire,jyn514bors-0/+25
Create E0774
2020-09-09Auto merge of #76463 - camelid:improve-E0607-explanation, r=jyn514bors-7/+7
Improve wording of E0607 explanation `@rustbot` modify labels: A-diagnostics C-enhancement
2020-09-08Create new E0774 code errorGuillaume Gomez-0/+25
2020-09-08Add error explanation for E0755Guillaume Gomez-1/+29
2020-09-07Add "For example,"Camelid-3/+3
2020-09-07Improve wording of E0607 explanationCamelid-7/+7
2020-09-08Auto merge of #75138 - jumbatm:session-diagnostic-derive, r=oli-obkbors-2/+2
Add derive macro for specifying diagnostics using attributes. Introduces `#[derive(SessionDiagnostic)]`, a derive macro for specifying structs that can be converted to Diagnostics using directions given by attributes on the struct and its fields. Currently, the following attributes have been implemented: - `#[code = "..."]` -- this sets the Diagnostic's error code, and must be provided on the struct iself (ie, not on a field). Equivalent to calling `code`. - `#[message = "..."]` -- this sets the Diagnostic's primary error message. - `#[label = "..."]` -- this must be applied to fields of type `Span`, and is equivalent to `span_label` - `#[suggestion(..)]` -- this allows a suggestion message to be supplied. This attribute must be applied to a field of type `Span` or `(Span, Applicability)`, and is equivalent to calling `span_suggestion`. Valid arguments are: - `message = "..."` -- this sets the suggestion message. - (Optional) `code = "..."` -- this suggests code for the suggestion. Defaults to empty. `suggestion`also comes with other variants: `#[suggestion_short(..)]`, `#[suggestion_hidden(..)]` and `#[suggestion_verbose(..)]` which all take the same keys. Within the strings passed to each attribute, fields can be referenced without needing to be passed explicitly into the format string -- eg, `#[error = "{ident} already declared"] ` will set the error message to `format!("{} already declared", &self.ident)`. Any fields on the struct can be referenced in this way. Additionally, for any of these attributes, Option fields can be used to only optionally apply the decoration -- for example: ```rust #[derive(SessionDiagnostic)] #[code = "E0123"] struct SomeKindOfError { ... #[suggestion(message = "informative error message")] opt_sugg: Option<(Span, Applicability)> ... } ``` will not emit a suggestion if `opt_sugg` is `None`. We plan on iterating on this macro further; this PR is a start. Closes #61132. r? `@oli-obk`
2020-09-01Rollup merge of #76143 - jyn514:duplicate-builtin-macros, r=petrochenkovTyler Mandry-0/+39
Give a better error message for duplicate built-in macros Minor follow-up to https://github.com/rust-lang/rust/pull/75176 giving a better error message for duplicate builtin macros. This would have made it a little easier to debug. r? @petrochenkov
2020-09-01Clarify message about unresolved useKornel-3/+13
2020-09-01Fix typos in E0224jumbatm-2/+2
2020-09-01Give a better error message for duplicate built-in macrosJoshua Nelson-0/+39
Previously, this would say no such macro existed, but this was misleading, since the macro _did_ exist, it was just already seen. - Say where the macro was previously defined - Add long-form error message
2020-08-31Rollup merge of #76103 - GuillaumeGomez:cleanup-e0769, r=Dylan-DPCTyler Mandry-7/+15
Clean up E0769 r? @pickfire cc @Dylan-DPC
2020-08-31Clean up E0764 explanationGuillaume Gomez-9/+13
2020-08-31Clean up E0769 explanationGuillaume Gomez-7/+15
2020-08-30mv compiler to compiler/mark-0/+15139