about summary refs log tree commit diff
path: root/compiler/rustc_error_codes
AgeCommit message (Collapse)AuthorLines
2023-07-21error/E0691: include alignment in error messageDavid Rheinsberg-1/+2
Include the computed alignment of the violating field when rejecting transparent types with non-trivially aligned ZSTs. ZST member fields in transparent types must have an alignment of 1 (to ensure it does not raise the layout requirements of the transparent field). The current error message looks like this: LL | struct Foobar(u32, [u32; 0]); | ^^^^^^^^ has alignment larger than 1 This patch changes the report to include the alignment of the violating field: LL | struct Foobar(u32, [u32; 0]); | ^^^^^^^^ has alignment of 4, which is larger than 1 In case of unknown alignments, it will yield: LL | struct Foobar<T>(u32, [T; 0]); | ^^^^^^ may have alignment larger than 1 This allows developers to get a better grasp why a specific field is rejected. Knowing the alignment of the violating field makes it easier to judge where that alignment-requirement originates, and thus hopefully provide better hints on how to mitigate the problem. This idea was proposed in 2022 in #98071 as part of a bigger change. This commit simply extracts this error-message change, to decouple it from the other diagnostic improvements.
2023-07-18add links to query documentation for E0391nxya-0/+3
2023-06-01Implement custom diagnostic for ConstParamTyMichael Goulet-4/+8
2023-05-28Add details about `unsafe_op_in_unsafe_fn` to E0133Wim Looman-1/+18
2023-05-09Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillotMatthias Krüger-1/+3
Various changes to name resolution of anon consts Sorry this PR is kind of all over the place ^^' Fixes #111012 - Rewrites anon const nameres to all go through `fn resolve_anon_const` explicitly instead of `visit_anon_const` to ensure that we do not accidentally resolve anon consts as if they are allowed to use generics when they aren't. Also means that we dont have bits of code for resolving anon consts that will get out of sync (i.e. legacy const generics and resolving path consts that were parsed as type arguments) - Renames two of the `LifetimeRibKind`, `AnonConst -> ConcreteAnonConst` and `ConstGeneric -> ConstParamTy` - Noticed while doing this that under `generic_const_exprs` all lifetimes currently get resolved to errors without any error being emitted which was causing a bunch of tests to pass without their bugs having been fixed, incidentally fixed that in this PR and marked those tests as `// known-bug:`. I'm fine to break those since `generic_const_exprs` is a very unstable incomplete feature and this PR _does_ make generic_const_exprs "less broken" as a whole, also I can't be assed to figure out what the underlying causes of all of them are. This PR reopens #77357 #83993 - Changed `generics_of` to stop providing generics and predicates to enum variant discriminant anon consts since those are not allowed to use generic parameters - Updated the error for non 'static lifetime in const arguments and the error for non 'static lifetime in const param tys to use `derive(Diagnostic)` I have a vague idea why const-arg-in-const-arg.rs, in-closure.rs and simple.rs have started failing which is unfortunate since these were deliberately made to work, I think lifetime resolution being broken just means this regressed at some point and nobody noticed because the tests were not testing anything :( I'm fine breaking these too for the same reason as the tests for #77357 #83993. I couldn't get `// known-bug` to work for these ICEs and just kept getting different stderr between CI and local `--bless` so I just removed them and will create an issue to track re-adding (and fixing) the bugs if this PR lands. r? `@cjgillot` cc `@compiler-errors`
2023-05-06Update compiler/rustc_error_codes/src/error_codes/E0726.mdAstroide-1/+1
Co-authored-by: Michael Goulet <michael@errs.io>
2023-05-06rustc --explain E0726 - grammar fixing (it's => its + add a `the` where it ↵Astroide-2/+2
felt right to do so)
2023-05-05misc nameres changes for anon constsBoxy-1/+3
2023-04-17Spelling - compilerJosh Soref-7/+7
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-03Make "unneccesary visibility qualifier" error much more clearTam Pham-9/+20
2023-03-28Rollup merge of #109565 - WaffleLapkin:better_docs_for_e0223, r=oli-obkMatthias Krüger-13/+15
Improve documentation for E0223 See discussion in https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Inconsistency.20in.20prohibiting.20.60Type.3A.3AAssocType.60
2023-03-27Bless tidyMaybe Waffle-4/+5
2023-03-27Improve documentation for E0223Maybe Waffle-13/+15
2023-03-22Rollup merge of #109501 - lukas-code:link, r=WaffleLapkinMatthias Krüger-1/+1
make link clickable
2023-03-22make link clickableLukas Markeffsky-1/+1
2023-03-18Update links for custom discriminants.Eric Huss-5/+4
2023-03-18Rollup merge of #107416 - czzrr:issue-80618, r=GuillaumeGomezMatthias Krüger-0/+65
Error code E0794 for late-bound lifetime parameter error. This PR addresses [#80618](https://github.com/rust-lang/rust/issues/80618).
2023-03-18Rollup merge of #109211 - mili-l:mili_l/update_e0206_description, r=WaffleLapkinMatthias Krüger-4/+4
E0206 - update description added `union` to description
2023-03-17Update compiler/rustc_error_codes/src/error_codes/E0206.mdJamilya Shurukhova-1/+1
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
2023-03-17E0206 - code review changesJamilya Shurukhova-3/+4
2023-03-16E0206 - removed spaceJamilya Shurukhova-2/+1
2023-03-16E0206 - added `union` to descriptionJamilya Shurukhova-2/+2
2023-03-15unequal → not equalgimbles-1/+1
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-3/+1
2023-03-11Address the new odd backticks tidy lint in compiler/est31-3/+3
2023-03-07Error code E0794 for late-bound lifetime parameter error.Christopher Acosta-0/+65
2023-02-26refactor: statically guarantee that current error codes are documentedEzra Shaw-9/+9
2023-02-25docs/test: add UI test and docs for `E0476`Ezra Shaw-1/+22
2023-02-06Add extended error message for E0523Matthew Kelly-1/+41
Adds the extended error documentation for E0523 to indicate that the error is no longer produced by the compiler. Update the E0464 documentation to include example code that produces the error. Remove the error message E0523 from the compiler and replace it with an internal compiler error.
2023-01-31make unaligned_reference a hard errorRalf Jung-1/+66
2023-01-27compiler: Fix E0587 explanationSamuel Ortiz-1/+1
We meant to use 8 as the packed argument. Signed-off-by: Samuel Ortiz <sameo@rivosinc.com>
2023-01-23add UI test + docs for `E0789`Ezra Shaw-1/+31
2023-01-19Rollup merge of #106931 - Ezrashaw:docs-e0208, r=compiler-errorsGuillaume Gomez-0/+45
document + UI test `E0208` and make its output more user-friendly Cleans up `E0208`'s output a lot. It could actually be useful for someone learning about variance now. I also added a UI test for it in `tests/ui/error-codes/` and wrote some docs for it. r? `@GuillaumeGomez` another error code, can't be bothered to find the issue :P. Obviously there's some compiler stuff, so you'll have to hand it off. Part of https://github.com/rust-lang/rust/issues/61137.
2023-01-18remove error code from `#[rustc_variance]` and document its remainsEzra Shaw-0/+45
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-5/+5
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-5/+5
2023-01-16Improve a TAIT error and add an error code plus documentationOli Scherer-0/+61
2023-01-12Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwconils-1/+1
remove unreachable error code `E0490` AFAIK, the untested and undocumented error code `E0490` is now unreachable, it was from the days of the original borrow checker. cc ``@GuillaumeGomez`` #61137
2023-01-12remove unreachable error code `E0490`Ezra Shaw-1/+1
2023-01-10remove E0280 and ICE insteadbowlerman-1/+1
2023-01-09docs/test: add error-docs and UI test for `E0711`Ezra Shaw-1/+31
2023-01-09docs/test: add empty error-docs for `E0208`, `E0640` and `E0717`Ezra Shaw-3/+6
2023-01-08Rollup merge of #106580 - Ezrashaw:remove-e0313, r=compiler-errorsYuki Okushi-2/+1
remove unreachable error code `E0313` Fixes #103742 Makes #103433 redundant Implements removal of `E0313`. I agree with the linked issue that this error code is unreachable but if someone could confirm that would be great, are crater runs done for this sort of thing? Also removed a redundant `// ignore-tidy-filelength` that I found while reading code. cc ``@GuillaumeGomez`` #61137
2023-01-08Rollup merge of #106557 - Ezrashaw:ui-test-fixups-1, r=GuillaumeGomezYuki Okushi-15/+8
Add some UI tests and reword error-code docs Added UI tests for `E0013` and `E0015`. Error code docs for `E0015` were a bit unclear (they referred to all non-const errors in const context, when only non-const functions applied), so I touched them up a bit. I also fixed up some issues in the new `error_codes.rs` tidy check (linked #106341), that I overlooked previously. r? ``@GuillaumeGomez``
2023-01-08remove unreachable error code `E0313`Ezra Shaw-2/+1
2023-01-08doc/test: add UI test and reword docs for `E0013` and `E0015`Ezra Shaw-15/+8
2023-01-06Rollup merge of #106554 - LingMan:explanation_typo, r=compiler-errorsMichael Goulet-1/+1
Fix a typo in the explanation of E0588
2023-01-07Fix a typo in the explanation of E0588LingMan-1/+1
2023-01-02docs: revert removal of `E0729`Ezra Shaw-0/+33
2023-01-01refactor: clean up `errors.rs` and `error_codes_check.rs`Ezra Shaw-31/+0
Move them into new `error_codes.rs` tidy check.