summary refs log tree commit diff
path: root/compiler/rustc_error_codes
AgeCommit message (Collapse)AuthorLines
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.
2022-12-31refactor: merge `E0465` into `E0464`Ezra Shaw-1/+1
2022-12-29docs: add long-form error docs for `E0514`Ezra Shaw-1/+34
2022-12-29docs/test: add UI test and long-form error docs for `E0519`Ezra Shaw-1/+41
2022-12-27docs: add long-form error docs for `E0461`Ezra Shaw-1/+31
2022-12-24Rollup merge of #105970 - Ezrashaw:add-docs+test-e0462, r=GuillaumeGomezMatthias Krüger-1/+33
docs/test: add UI test and long-form error docs for E0462 Another UI test/ docs combo. r? ``@GuillaumeGomez``
2022-12-23docs/test: add UI test and long-form error docs for E0462Ezra Shaw-1/+33
2022-12-20Rollup merge of #105791 - Ezrashaw:add-e0472-long-docs, r=GuillaumeGomezMatthias Krüger-1/+32
docs: add long error explanation for error E0472 Add long-form error docs for E0472: "inline assembly not supported on this target" and update UI tests. R? `@GuillaumeGomez`
2022-12-20docs: add long error explanation for error E0472Ezra Shaw-1/+32
2022-12-20docs/test: add UI test and long-form error docs for `E0377`Ezra Shaw-2/+30
2022-12-19more markdown list formattingEzra Shaw-3/+3
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-12-19docs: add long-form error-code docs for E0457Ezra Shaw-1/+37
2022-12-19docs: add long-form error-code docs for E0460Ezra Shaw-1/+72
2022-12-17docs: add long error explanation for error E0320Ezra Shaw-1/+28
2022-12-16docs: rewrite E0158 error-code docs for clarityEzra Shaw-19/+34
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-12-05Support Option and similar enums as type of static variable with linkage ↵Peter Collingbourne-0/+42
attribute. Compiler MCP: https://github.com/rust-lang/compiler-team/issues/565
2022-11-21Auto merge of #103491 - cjgillot:self-rpit, r=oli-obkbors-1/+3
Support using `Self` or projections inside an RPIT/async fn I reuse the same idea as https://github.com/rust-lang/rust/pull/103449 to use variances to encode whether a lifetime parameter is captured by impl-trait. The current implementation of async and RPIT replace all lifetimes from the parent generics by `'static`. This PR changes the scheme ```rust impl<'a> Foo<'a> { fn foo<'b, T>() -> impl Into<Self> + 'b { ... } } opaque Foo::<'_a>::foo::<'_b, T>::opaque<'b>: Into<Foo<'_a>> + 'b; impl<'a> Foo<'a> { // OLD fn foo<'b, T>() -> Foo::<'static>::foo::<'static, T>::opaque::<'b> { ... } ^^^^^^^ the `Self` becomes `Foo<'static>` // NEW fn foo<'b, T>() -> Foo::<'a>::foo::<'b, T>::opaque::<'b> { ... } ^^ the `Self` stays `Foo<'a>` } ``` There is the same issue with projections. In the example, substitute `Self` by `<T as Trait<'b>>::Assoc` in the sugared version, and `Foo<'_a>` by `<T as Trait<'_b>>::Assoc` in the desugared one. This allows to support `Self` in impl-trait, since we do not replace lifetimes by `'static` any more. The same trick allows to use projections like `T::Assoc` where `Self` is allowed. The feature is gated behind a `impl_trait_projections` feature gate. The implementation relies on 2 tweaking rules for opaques in 2 places: - we only relate substs that correspond to captured lifetimes during TypeRelation; - we only list captured lifetimes in choice region computation. For simplicity, I encoded the "capturedness" of lifetimes as a variance, `Bivariant` vs `Invariant` for unused vs captured lifetimes. The `variances_of` query used to ICE for opaques. Impl-trait that do not reference `Self` or projections will have their variances as: - `o` (invariant) for each parent type or const; - `*` (bivariant) for each parent lifetime --> will not participate in borrowck; - `o` (invariant) for each own lifetime. Impl-trait that does reference `Self` and/or projections will have some parent lifetimes marked as `o` (as the example above), and participate in type relation and borrowck. In the example above, `variances_of(opaque) = ['_a: o, '_b: *, T: o, 'b: o]`. r? types cc `@compiler-errors` , as you asked about the issue with `Self` and projections.
2022-11-15Rollup merge of #104339 - compiler-errors:rustc_deny_explicit_impl, r=cjgillotMatthias Krüger-1/+2
Add `rustc_deny_explicit_impl` Also adjust `E0322` error message to be more general, since it's used for `DiscriminantKind` and `Pointee` as well. Also add `rustc_deny_explicit_impl` on the `Tuple` and `Destruct` marker traits.
2022-11-14Add rustc_deny_explicit_implMichael Goulet-1/+2
2022-11-12Retire error code.Camille GILLOT-1/+3
2022-11-11Rollup merge of #103924 - PeteDevoy:patch-1, r=estebankDylan DPC-1/+1
Fix broken link in description of error code E0706 Corresponding subsection in async book is `07.05` not `07.06`. The information on the linked page is the same so it may be reasonable to remove the whole sentence.
2022-11-07Rollup merge of #103757 - ffmancera:ff/clarify_E0207, r=jackh726Dylan DPC-4/+71
Mention const and lifetime parameters in error E0207 Error Index for E0207 must mention const and lifetime parameters. In addition, add code examples for these situations. Fixes #80862
2022-11-03Fix broken link in error code E0706 docsPete-1/+1
Corresponding subsection in async book is not `07.05` not `07.06`. The information on the linked page is the same so it may be reasonable to remove the whole sentence.
2022-10-31Update E0382.mdDominic Farolino-1/+1
2022-10-30Mention const and lifetime parameters in error E0207Fernando Fernandez Mancera-4/+71
Error Index for E0207 must mention const and lifetime parameters. In addition, add code examples for these situations. Fixes #80862
2022-10-26Rollup merge of #95710 - ↵Dylan DPC-4/+0
fee1-dead-contrib:stabilize_arbitrary_enum_discriminant, r=joshtriplett Stabilize arbitrary_enum_discriminant, take 2 Documentation has been updated in https://github.com/rust-lang/reference/pull/1055. cc #86860 for previous stabilization report. Not yet marks https://github.com/rust-lang/rust/issues/60553 as done: need documentation in the rust reference.