Commit graph

102 commits

Author SHA1 Message Date
Guillaume Gomez
c899f67673
Improve E0185 wording 2020-01-10 10:05:49 +01:00
Guillaume Gomez
f79ba857dd clean up E0185 explanation 2020-01-09 22:25:58 +01:00
Guillaume Gomez
99fda5c1ce Clean up E0178 explanation 2020-01-06 15:28:12 +01:00
Dylan DPC
062cd78958
Update E0164.md 2020-01-04 11:41:35 +05:30
Guillaume Gomez
aab4276477 Clean up E0164 explanation 2020-01-04 00:32:29 +01:00
Guillaume Gomez
ec64bbbe07 Small error explanations cleanup 2020-01-04 00:32:29 +01:00
Guillaume Gomez
8341a9a8f7 Clean up E0131 error explanation 2020-01-03 00:07:09 +01:00
Guillaume Gomez
d202b59506 Clean up E0130 error explanation 2020-01-02 19:57:19 +01:00
Donough Liu
b4e1fbcf81 Gammer fix 2019-12-30 17:14:08 +08:00
Donough Liu
751fe7c43d Add error code explanation for E0477 2019-12-30 14:41:46 +08:00
bors
c0b16b4e6a Auto merge of #67268 - estebank:assoc-types, r=oli-obk
Tweak errors for missing associated types and type parameters

* On `dyn Trait` missing associated types, provide a structured suggestion for them
* On missing type parameters, provide structured suggestion for them
* Point at trait definition when missing required type parameter
* Tweak output of E0658
* Tweak wording of E0719
* Account for `Trait1 + Trait2` case

Fix #66380, fix #60595. CC #63711.
2019-12-26 03:42:59 +00:00
David Tolnay
4646a88b7a
Deprecate Error::description for real
`description` has been documented as soft-deprecated since 1.27.0 (17
months ago). There is no longer any reason to call it or implement it.

This commit:

- adds #[rustc_deprecated(since = "1.41.0")] to Error::description;

- moves description (and cause, which is also deprecated) below the
  source and backtrace methods in the Error trait;

- reduces documentation of description and cause to take up much less
  vertical real estate in rustdocs, while preserving the example that
  shows how to render errors without needing to call description;

- removes the description function of all *currently unstable* Error
  impls in the standard library;

- marks #[allow(deprecated)] the description function of all *stable*
  Error impls in the standard library;

- replaces miscellaneous uses of description in example code and the
  compiler.
2019-12-24 22:39:49 -08:00
Esteban Küber
66ea471f9d Handle more specific case E0222 2019-12-24 22:10:15 -08:00
Mazdak Farrokhzad
a75968a782
Rollup merge of #67551 - ldm0:E0627, r=Dylan-DPC
Add long error code explanation message for E0627

Part of #61137.

r? @GuillaumeGomez
2019-12-24 04:39:58 +01:00
Mazdak Farrokhzad
d130e8d550
Rollup merge of #67547 - GuillaumeGomez:cleanup-err-codes, r=Dylan-DPC
Cleanup err codes

r? @Dylan-DPC
2019-12-24 04:39:57 +01:00
Mazdak Farrokhzad
acfe58272c adjust E0303 error code docs 2019-12-23 14:47:20 +01:00
Donough Liu
1485c16899 Add long error code explanation message for E0627 2019-12-23 21:05:02 +08:00
Dylan DPC
256eec4ae0
Update E0124.md 2019-12-23 12:55:33 +05:30
Guillaume Gomez
1474d2a41a Clean up E0128 explanation 2019-12-22 20:39:25 +01:00
Guillaume Gomez
4ee18c94d4 Clean up E0124 explanation 2019-12-22 20:39:17 +01:00
Mazdak Farrokhzad
eaeb1138c6
Rollup merge of #67480 - rossmacarthur:fix-41260-avoid-issue-0-part-2, r=Centril
Require issue = "none" over issue = "0" in unstable attributes

These changes make the use of `issue = "none"` required in unstable attributes throughout the compiler.

Notes:
- #66299 is now in beta so `issue = "none"` is accepted.
- The `tidy` tool now fails on `issue = "0"`.
- Tests that used `issue = "0"` were changed to use `issue = "none"`, except for _one_ that asserts `issue = "0"` can still be used.
- The compiler still allows `issue = "0"` because some submodules require it, this could be disallowed once these are updated.

Resolves #41260

r? @varkor
2019-12-22 02:40:04 +01:00
Mazdak Farrokhzad
a01f956f98
Rollup merge of #67422 - GuillaumeGomez:cleanup-err-codes, r=Dylan-DPC
Cleanup err codes

r? @Dylan-DPC
2019-12-21 15:29:45 +01:00
Ross MacArthur
f7256d28d1
Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
Mazdak Farrokhzad
ec82174fad
Rollup merge of #67131 - Centril:item-merge, r=petrochenkov
Merge `TraitItem` & `ImplItem into `AssocItem`

In this PR we:

- Merge `{Trait,Impl}Item{Kind?}` into `AssocItem{Kind?}` as discussed in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286.

   - This is done by using the cover grammar of both forms.

   - In particular, it requires that we syntactically allow (under `#[cfg(FALSE)]`):

      - `default`ness on `trait` items,

      - `impl` items without a body / definition (`const`, `type`, and `fn`),

      - and associated `type`s in `impl`s with bounds, e.g., `type Foo: Ord;`.

   - The syntactic restrictions are replaced by semantic ones in `ast_validation`.

- Move syntactic restrictions around C-variadic parameters from the parser into `ast_validation`:

    - `fn`s in all contexts now syntactically allow `...`,

    - `...` can occur anywhere in the list syntactically (`fn foo(..., x: usize) {}`),

    - and `...` can be the sole parameter (`fn foo(...) {}`.

r? @petrochenkov
2019-12-20 17:22:19 +01:00
Dylan DPC
dce0f06f95
Update E0121.md 2019-12-20 17:02:39 +05:30
Dylan DPC
7f0741db9e
Update E0120.md 2019-12-20 16:50:20 +05:30
Guillaume Gomez
94d207f4b2 Clean up E0121 long explanation 2019-12-19 13:45:36 +01:00
Guillaume Gomez
020be74f6b Clean up E0120 long explanation 2019-12-19 13:45:28 +01:00
Matthew Jasper
6dcc78997f Add more tests for raw_ref_op 2019-12-18 20:30:00 +00:00
bors
fc6b5d6efe Auto merge of #67216 - ecstatic-morse:const-loop, r=oli-obk
Enable `loop` and `while` in constants behind a feature flag

This PR is an initial implementation of #52000. It adds a `const_loop` feature gate, which allows `while` and `loop` expressions through both HIR and MIR const-checkers if enabled. `for` expressions remain forbidden by the HIR const-checker, since they desugar to a call to `IntoIterator::into_iter`, which will be rejected anyways.

`while` loops also require [`#![feature(const_if_match)]`](https://github.com/rust-lang/rust/pull/66507), since they have a conditional built into them. The diagnostics from the HIR const checker will suggest this to the user.

r? @oli-obk
cc @rust-lang/wg-const-eval
2019-12-15 01:28:28 +00:00
Niko Matsakis
d286113024 Revert "Stabilize the never_type, written !."
This reverts commit 15c30ddd69.
2019-12-14 09:01:09 -05:00
Dylan MacKenzie
a2a077460b Look for "unstable feature" error code in test
Conditionals and loops now have unstable features, and `feature_err` has
its own error code. I think that `feature_err` should take an error code
as a parameter, but don't have the energy to make this change throughout
the codebase. Also, the error code system may be torn out entirely.
2019-12-13 10:39:14 -08:00
Mazdak Farrokhzad
74d4fbc5f5 De-fatalize ... parsing.
Also fix error the code description.
2019-12-12 18:05:05 +01:00
Dylan DPC
2183a949a8
Update E0478.md 2019-12-09 12:17:38 +01:00
ryan
f430fca73a corrected comment to reflect that 'SnowWhite lives longer than 'kiss in E0478 2019-12-08 18:09:36 -08:00
Mazdak Farrokhzad
2bd35c065c
Rollup merge of #66606 - christianpoveda:mut-refs-in-const-fn, r=oli-obk
Add feature gate for mut refs in const fn

r? @oli-obk
2019-12-06 23:26:54 +01:00
Yuki Okushi
662a225f1d
Rollup merge of #67017 - GuillaumeGomez:long-err-explanations-2, r=Dylan-DPC
cleanup long error explanations

r? @Dylan-DPC
2019-12-06 15:37:08 +09:00
Yuki Okushi
6c0165fa78
Rollup merge of #66979 - reese:E0631-long-error, r=GuillaumeGomez
Add long error for E0631 and update ui tests.

This PR adds a long error for `E0631`, which covers errors where closure argument types are mismatched. It also updates UI tests where this error is applicable.

Part of #61137
2019-12-06 15:37:06 +09:00
Yuki Okushi
c31773cece
Rollup merge of #66900 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Clean up error codes

r? @Dylan-DPC
2019-12-06 15:37:03 +09:00
Guillaume Gomez
ae753a55ac some error codes long explanation 2019-12-04 13:36:50 +01:00
Guillaume Gomez
9eaea4d3ea Clean up E0118 error code long explanation 2019-12-04 13:35:26 +01:00
Guillaume Gomez
1e5450d4cb Clean up E0117 error code long explanation 2019-12-04 13:32:37 +01:00
Guillaume Gomez
c2ce7dd756 Clean up E0116 error code long explanation 2019-12-04 13:32:37 +01:00
Guillaume Gomez
c911bb1a2e clean up E0107 error explanation 2019-12-03 22:25:15 +01:00
Reese Williams
26a1ba85b8 Use simpler code example for E0631 long error. 2019-12-03 07:51:11 -05:00
Reese Williams
7693bb9e1d Add long error for E0631 and update ui tests. 2019-12-02 22:01:27 -05:00
Christian Poveda
e01ad6a01a Remove E0017 from error codes index 2019-12-02 09:46:27 -05:00
Mazdak Farrokhzad
d4f59564e7
Rollup merge of #66880 - aDotInTheVoid:add-E0203-long, r=GuillaumeGomez
Add long error code explanation message for E0203

Addressed some of #61137

r? @GuillaumeGomez
2019-12-01 04:49:29 +01:00
Guillaume Gomez
481b18acd0 Small error codes explanation cleanup (E0092, E0093 and E0094) 2019-11-30 13:43:50 +01:00
Nixon
a52eb05ec6 Address review comments 2019-11-30 11:22:20 +00:00