Commit graph

568 commits

Author SHA1 Message Date
Manish Goregaokar
b9a0f5803e
Rollup merge of #74173 - estebank:struct-pat-as-enum, r=petrochenkov
Detect tuple struct incorrectly used as struct pat

Subpart of #74005.

r? @petrochenkov
2020-07-14 07:39:02 -07:00
Manish Goregaokar
5e61827dd3
Rollup merge of #73720 - GuillaumeGomez:cleanup-e0704, r=Dylan-DPC
Clean up E0704 error explanation

r? @Dylan-DPC
2020-07-14 07:38:53 -07:00
Manish Goregaokar
9a1df31d55
Rollup merge of #74286 - PankajChaudhary5:E0688, r=GuillaumeGomez
Added detailed error code explanation for issue E0688 in Rust compiler.

Added proper error explanation for issue E0688 in the Rust compiler.
Error Code E0688

Sub Part of Issue #61137

r? @GuillaumeGomez
2020-07-13 22:23:15 -07:00
Manish Goregaokar
549aa03d86
Rollup merge of #74123 - GuillaumeGomez:cleanup-e0718, r=pickfire
clean up E0718 explanation

r? @Dylan-DPC
2020-07-13 22:23:10 -07:00
Pankaj Chaudhary
bc2b37aad7 Merge branch 'master' into E0688 2020-07-13 14:57:22 +05:30
PankajChaudhary5
e3ae4c7345 Added proper explanation of ErrorCode-E0688 2020-07-13 14:05:48 +05:30
Esteban Küber
5daedea3db Detect tuple struct incorrectly used as struct pat 2020-07-12 10:34:48 -07:00
Guillaume Gomez
633d1a5af9 Clean up E0720 explanation 2020-07-12 14:15:39 +02:00
Guillaume Gomez
2ba68f1888 Clean up E0719 explanation 2020-07-11 18:10:57 +02:00
Guillaume Gomez
4728438344
Improve wording 2020-07-11 17:34:11 +02:00
Tamir Duberstein
1e567c1168
Avoid "blacklist"
Other terms are more inclusive and precise.

Clippy still has a lint named "blacklisted-name", but renaming it would
be a breaking change, so is left for future work.

The target configuration option "abi-blacklist" has been depreciated and
renamed to "unsupported-abis". The old name continues to work.
2020-07-08 12:08:27 -04:00
Guillaume Gomez
00980b6ccd clean up E0718 explanation 2020-07-07 14:13:03 +02:00
bors
51eeabf505 Auto merge of #73562 - poliorcetics:e0432-to-edition2018, r=GuillaumeGomez
Update E0432 long description with the separate behaviors of editions 2015 and 2018

Fixes #64668.

I restarted from the work done in #71413.
2020-07-07 09:22:57 +00:00
Guillaume Gomez
d64a4b57ae Create new E0768 error code for "no valid digits found for number" error 2020-07-04 00:15:29 +02:00
Guillaume Gomez
69d5fc1a9f Clean up E0710 explanation 2020-07-02 15:44:22 +02:00
David Wood
cb541dc12c
resolve: disallow label use through closure/async
This commit modifies resolve to disallow `break`/`continue` to labels
through closures or async blocks. This doesn't make sense and should
have been prohibited anyway.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-02 13:48:32 +01:00
Guillaume Gomez
818aaa7b58 Clean up E0716 explanation 2020-07-02 13:15:05 +02:00
Manish Goregaokar
1b37bfa537
Rollup merge of #73892 - GuillaumeGomez:cleanup-e0712, r=Dylan-DPC
Clean up E0712 explanation

r? @Dylan-DPC
2020-07-01 20:36:00 -07:00
Manish Goregaokar
ae79c30d74
Rollup merge of #72445 - anp:stabilize-track-caller, r=oli-obk
Stabilize `#[track_caller]`.

# Stabilization Report

RFC: [2091]
Tracking issue: https://github.com/rust-lang/rust/issues/47809

## Summary

From the [rustc-dev-guide chapter][dev-guide]:

> Take this example program:

```rust
fn main() {
    let foo: Option<()> = None;
    foo.unwrap(); // this should produce a useful panic message!
}
```

> Prior to Rust 1.42, panics like this `unwrap()` printed a location in libcore:

```
$ rustc +1.41.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value',...core\macros\mod.rs:15:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
```

> As of 1.42, we get a much more helpful message:

```
$ rustc +1.42.0 example.rs; example.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', example.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

> These error messages are achieved through a combination of changes to `panic!` internals to make use of `core::panic::Location::caller` and a number of `#[track_caller]` annotations in the standard library which propagate caller information.

The attribute adds an implicit caller location argument to the ABI of annotated functions, but does not affect the type or MIR of the function. We implement the feature entirely in codegen and in the const evaluator.

## Bottom Line

This PR stabilizes the use of `#[track_caller]` everywhere, including traits and extern blocks. It also stabilizes `core::panic::Location::caller`, although the use of that function in a const context remains gated by `#![feature(const_caller_location)]`.

The implementation for the feature already changed the output of panic messages for a number of std functions, as described in the [1.42 release announcement]. The attribute's use in `Index` and `IndexMut` traits is visible to users since 1.44.

## Tests

All of the tests for this feature live under [src/test/ui/rfc-2091-track-caller][tests] in the repo.

Noteworthy cases:

* [use of attr in std]
  * validates user-facing benefit of the feature
* [trait attribute inheritance]
  * covers subtle behavior designed during implementation and not RFC'd
* [const/codegen equivalence]
  * this was the result of a suspected edge case and investigation
* [diverging function support]
  * covers an unresolved question from the RFC
* [fn pointers and shims]
  * covers important potential sources of unsoundness

## Documentation

The rustc-dev-guide now has a chapter on [Implicit Caller Location][dev-guide].

I have an [open PR to the reference][attr-reference-pr] documenting the attribute.

The intrinsic's [wrapper] includes some examples as well.

## Implementation History

* 2019-10-02: [`#[track_caller]` feature gate (RFC 2091 1/N) #65037](https://github.com/rust-lang/rust/pull/65037)
  * Picked up the patch that @ayosec had started on the feature gate.
* 2019-10-13: [Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N) #65182](https://github.com/rust-lang/rust/pull/65182)
* 2019-10-20: ~~[WIP Add MIR argument for #[track_caller] (RFC 2091 3/N) #65258](https://github.com/rust-lang/rust/pull/65258)~~
  * Abandoned approach to send location as a MIR argument.
* 2019-10-28: [`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) #65664](https://github.com/rust-lang/rust/pull/65664)
* 2019-12-07: [Implement #[track_caller] attribute. (RFC 2091 4/N) #65881](https://github.com/rust-lang/rust/pull/65881)
* 2020-01-04: [libstd uses `core::panic::Location` where possible. #67137](https://github.com/rust-lang/rust/pull/67137)
* 2020-01-08: [`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]` #67887](https://github.com/rust-lang/rust/pull/67887)
* 2020-01-20: [Fix #[track_caller] and function pointers #68302](https://github.com/rust-lang/rust/pull/68302) (fixed #68178)
* 2020-03-23: [#[track_caller] in traits #69251](https://github.com/rust-lang/rust/pull/69251)
* 2020-03-24: [#[track_caller] on core::ops::{Index, IndexMut}. #70234](https://github.com/rust-lang/rust/pull/70234)
* 2020-04-08 [Support `#[track_caller]` on functions in `extern "Rust" { ... }` #70916](https://github.com/rust-lang/rust/pull/70916)

## Unresolveds

### From the RFC

> Currently the RFC simply prohibit applying #[track_caller] to trait methods as a future-proofing
> measure.

**Resolved.** See the dev-guide documentation and the tests section above.

> Diverging functions should be supported.

**Resolved.** See the tests section above.

> The closure foo::{{closure}} should inherit most attributes applied to the function foo, ...

**Resolved.** This unknown was related to specifics of the implementation which were made irrelevant by the final implementation.

### Binary Size

I [instrumented track_caller to use custom sections][measure-size] in a local build and discovered relatively minor binary size usage for the feature overall. I'm leaving the issue open to discuss whether we want to upstream custom section support.

There's an [open issue to discuss mitigation strategies][mitigate-size]. Some decisions remain about the "right" strategies to reduce size without overly constraining the compiler implementation. I'd be excited to see someone carry that work forward but my opinion is that we shouldn't block stabilization on implementing compiler flags for redaction.

### Specialization

There's an [open issue][specialization] on the semantics of the attribute in specialization chains. I'm inclined to move forward with stabilization without an exact resolution here given that specialization is itself unstable, but I also think it should be an easy question to resolve.

### Location only points to the start of a call span

https://github.com/rust-lang/rust/issues/69977 was resolved by https://github.com/rust-lang/rust/pull/73182, and the next step should probably be to [extend `Location` with a notion of the end of a call](https://github.com/rust-lang/rust/issues/73554).

### Regression of std's panic messages

#70963 should be resolved by serializing span hygeine to crate metadata: https://github.com/rust-lang/rust/issues/68686.

[2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
[dev-guide]: https://rustc-dev-guide.rust-lang.org/codegen/implicit-caller-location.html
[specialization]: https://github.com/rust-lang/rust/issues/70293
[measure-size]: https://github.com/rust-lang/rust/issues/70579
[mitigate-size]: https://github.com/rust-lang/rust/issues/70580
[attr-reference-pr]: https://github.com/rust-lang/reference/pull/742
[wrapper]: https://doc.rust-lang.org/nightly/core/panic/struct.Location.html#method.caller
[tests]: https://github.com/rust-lang/rust/tree/master/src/test/ui/rfc-2091-track-caller
[const/codegen equivalence]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs
[diverging function support]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/diverging-caller-location.rs
[use of attr in std]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
[fn pointers and shims]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs
[trait attribute inheritance]: https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2091-track-caller/tracked-trait-impls.rs
[1.42 release announcement]: https://blog.rust-lang.org/2020/03/12/Rust-1.42.html#useful-line-numbers-in-option-and-result-panic-messages
2020-07-01 07:42:33 -07:00
Manish Goregaokar
128fa2b981
Rollup merge of #72071 - PankajChaudhary5:ErrorCode-E0687, r=davidtwco
Added detailed error code explanation for issue E0687 in Rust compiler.

Added proper error explanation for issue E0687 in the Rust compiler.
Error Code E0687

Sub Part of Issue #61137

r? @GuillaumeGomez
2020-07-01 07:42:27 -07:00
Guillaume Gomez
13a6aeff77 Clean up E0715 explanation 2020-07-01 14:13:41 +02:00
Adam Perry
f07d10db7c Stabilize #[track_caller].
Does not yet make its constness stable, though. Use of
`Location::caller` in const contexts is still gated by
`#![feature(const_caller_location)]`.
2020-06-30 22:22:32 -07:00
Guillaume Gomez
f74a7d3ff1 Clean up E0712 explanation 2020-06-30 13:36:33 +02:00
Guillaume Gomez
99c1513363 Small cleanup for E0705 explanation 2020-06-27 13:07:59 +02:00
Manish Goregaokar
8c5d794b52
Rollup merge of #73687 - GuillaumeGomez:cleanup-e0701, r=Dylan-DPC
Clean up E0701 explanation

r? @Dylan-DPC
2020-06-25 18:00:25 -07:00
Guillaume Gomez
eb6d9a49a8 Add E0766 error for unterminated double quote byte string 2020-06-25 13:28:45 +02:00
Guillaume Gomez
3e48aaea03 Clean up E0704 error explanation 2020-06-25 13:19:56 +02:00
Guillaume Gomez
65becefd4a Clean up E0701 explanation 2020-06-24 13:19:06 +02:00
bors
1557fb031b Auto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearth
Rollup of 9 pull requests

Successful merges:

 - #72271 (Improve compiler error message for wrong generic parameter order)
 - #72493 ( move leak-check to during coherence, candidate eval)
 - #73398 (A way forward for pointer equality in const eval)
 - #73472 (Clean up E0689 explanation)
 - #73496 (Account for multiple impl/dyn Trait in return type when suggesting `'_`)
 - #73515 (Add second message for LiveDrop errors)
 - #73567 (Clarify --extern documentation.)
 - #73572 (Fix typos in doc comments)
 - #73590 (bootstrap: no `config.toml` exists regression)

Failed merges:

r? @ghost
2020-06-23 07:50:51 +00:00
Manish Goregaokar
98aa34cb57
Rollup merge of #73472 - GuillaumeGomez:cleanup-e0689, r=Dylan-DPC
Clean up E0689 explanation

r? @Dylan-DPC
2020-06-23 00:33:56 -07:00
Dylan DPC
e979392756
Rollup merge of #73610 - GuillaumeGomez:cleanup-e0699, r=Dylan-DPC
Clean up E0699 explanation

r? @Dylan-DPC
2020-06-23 03:16:28 +02:00
Dylan DPC
4dfae775d3
Rollup merge of #73575 - dario23:typo-errorcodes-doc, r=matthewjasper
Fix typo in error_codes doc
2020-06-23 03:16:21 +02:00
Guillaume Gomez
c474317747 Clean up E0699 explanation 2020-06-22 11:50:55 +02:00
Alexis Bourget
59701360dc Fix some small mistakes 2020-06-21 15:47:08 +02:00
Alexis Bourget
6e82517420 Documenting the separate behaviors of edition 2015 and 2018 2020-06-21 14:39:46 +02:00
Guillaume Gomez
a657be42b1 Create E0765 error for unterminated double quote strings 2020-06-21 14:09:12 +02:00
Johannes Schilling
e3d735dcbf Fix typo in error_codes doc 2020-06-21 10:22:19 +02:00
Ralf Jung
bb0016bdec
Rollup merge of #73543 - GuillaumeGomez:cleanup-e0695, r=Dylan-DPC
Clean up E0695 explanation

r? @Dylan-DPC
2020-06-20 16:40:01 +02:00
Guillaume Gomez
59d8c4549a Clean up E0695 explanation 2020-06-20 13:28:01 +02:00
Manish Goregaokar
2377a50f42
Rollup merge of #73436 - GuillaumeGomez:cleanup-e0670, r=Dylan-DPC
Clean up E0670 explanation

r? @Dylan-DPC
2020-06-19 19:43:01 -07:00
Manish Goregaokar
2dbb8b6ac6
Rollup merge of #73399 - GuillaumeGomez:cleanup-e0668, r=Dylan-DPC
Clean up E0668 explanation

r? @Dylan-DPC
2020-06-19 19:42:59 -07:00
Christian Poveda
96031e22d2
add new error code 2020-06-19 14:16:38 -05:00
Ralf Jung
45aa36bae5
Rollup merge of #73280 - GuillaumeGomez:add-e0763, r=petrochenkov
Add E0763
2020-06-19 14:29:29 +02:00
Guillaume Gomez
1d08b1b042 Clean up E0689 explanation 2020-06-18 13:10:22 +02:00
Guillaume Gomez
bde1ccfcb2 Clean up E0670 explanation 2020-06-17 14:07:34 +02:00
Guillaume Gomez
a19dfb573d Create new E0763 error code for unterminated byte constant 2020-06-16 13:14:04 +02:00
Guillaume Gomez
5e13935677 Clean up E0668 explanation 2020-06-16 13:11:32 +02:00
Esteban Küber
f7a1f97307 Change E0758 to E0759 to avoid conflict with #72912 2020-06-15 09:06:58 -07:00
Ralf Jung
192e9bde80
Rollup merge of #73351 - gnodarse:patch-1, r=ecstatic-morse
Update E0446.md

The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself):
https://github.com/rust-lang/rust/issues/30905
https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958
2020-06-15 09:57:35 +02:00
gnodarse
8361ee5b38
Update E0446.md
The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself):
https://github.com/rust-lang/rust/issues/30905
https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958
2020-06-14 14:25:19 -04:00
pankajchaudhary5
46bfc48272 Added proper explanation of ErrorCode-E0687 2020-06-14 22:57:19 +05:30
Dylan MacKenzie
9e2ee322e8 Update incorrect error code docs 2020-06-13 11:05:13 -07:00
Dylan DPC
b4cb12fd21
Rollup merge of #73236 - GuillaumeGomez:cleanup-e0666, r=Dylan-DPC
Clean up E0666 explanation

r? @Dylan-DPC
2020-06-12 12:28:29 +02:00
Dylan DPC
6baf867882
Rollup merge of #73163 - ayushmishra2005:61137-add-long-error-code-e0724, r=davidtwco
Add long error explanation for E0724

Add long explanation for the E0724 error code
Part of #61137
2020-06-12 00:05:29 +02:00
Ayush Kumar Mishra
68b4c03dbc Add long error explanation for E0724
Minor refactoring

Minor refactoring

Update src/librustc_error_codes/error_codes/E0724.md

Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>

Update src/librustc_error_codes/error_codes/E0724.md

Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>

Update src/librustc_error_codes/error_codes/E0724.md

Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>

Minor refactoring
2020-06-11 23:16:42 +05:30
Dylan DPC
6b418b307c
Rollup merge of #73207 - GuillaumeGomez:cleanup-e0648, r=Dylan-DPC
Clean up E0648 explanation

r? @Dylan-DPC
2020-06-11 19:04:18 +02:00
Guillaume Gomez
9da3a7aece Clean up E0666 explanation 2020-06-11 13:34:04 +02:00
Dylan DPC
70c14c2d43
Rollup merge of #73164 - GuillaumeGomez:add-e0761, r=petrochenkov
Add new E0762 error code
2020-06-11 13:16:02 +02:00
Dylan DPC
f4661e2707
Rollup merge of #72976 - GuillaumeGomez:cleanup-e0642, r=Dylan-DPC
Clean up E0642 explanation

r? @Dylan-DPC
2020-06-11 13:15:57 +02:00
Guillaume Gomez
50a42fe513 Create new error code E0762 for unterminated char literals 2020-06-10 11:54:09 +02:00
Guillaume Gomez
dc230c06b2 Clean up E0648 explanation 2020-06-10 11:44:32 +02:00
Dylan DPC
4ac3efa96e
Rollup merge of #73123 - GuillaumeGomez:cleanup-e0647, r=Dylan-DPC
Clean up E0647 explanation

r? @Dylan-DPC
2020-06-10 01:06:29 +02:00
Dylan DPC
95479d4905
Rollup merge of #73122 - doctorn:issue-73116, r=varkor
Resolve E0584 conflict

Adds a new error code (`E0761`) to indicate ambiguity in module file names and an accompanying expanded description to resolve a conflict over `E0584`.

Resolves #73116
2020-06-10 01:06:27 +02:00
Nathan Corbyn
039da0b832 Update comments 2020-06-09 11:14:41 +01:00
Dylan DPC
31a1858a73
Rollup merge of #73124 - ayushmishra2005:correction_in_explanation_of_E0207, r=petrochenkov
Removed lifetime parameters from Explanation of E0207

Removed lifetime parameters from Explanation of E0207
Fixes #62144
2020-06-08 22:15:17 +02:00
Dylan DPC
82fd390d67
Rollup merge of #72912 - GuillaumeGomez:add-e0755, r=estebank
Add new E0758 error code
2020-06-08 22:15:10 +02:00
Ayush Kumar Mishra
b7f25d512c Removed lifetime parameters from Explanation of E0207 #62144 2020-06-08 17:15:48 +05:30
Guillaume Gomez
f615582d65 Clean up E0647 explanation 2020-06-08 13:02:59 +02:00
Nathan Corbyn
a1eeaddf3f Resolve E0584 conflict 2020-06-08 12:00:12 +01:00
Ralf Jung
7983e56f40
Rollup merge of #73092 - GuillaumeGomez:cleanup-e0646, r=Dylan-DPC
Clean up E0646

r? @Dylan-DPC
2020-06-08 09:55:35 +02:00
Guillaume Gomez
af68249a8d Clean up E0646 2020-06-07 15:22:15 +02:00
Guillaume Gomez
e8fb46090e Create new error code E0758 for unterminated multi-line comments 2020-06-07 14:57:53 +02:00
Dylan DPC
71230e135b
Rollup merge of #73057 - GuillaumeGomez:cleanup-e0644, r=Dylan-DPC
Clean up E0644 explanation

r? @Dylan-DPC
2020-06-07 02:29:00 +02:00
Guillaume Gomez
392c6f45a4 Clean up E0644 explanation 2020-06-06 13:16:26 +02:00
Dylan DPC
14dc34dd89
Rollup merge of #72260 - csmoe:issue-69276, r=estebank
Spell out `Self` in async function return

Closes #69276
r? @tmandry
2020-06-05 13:07:03 +02:00
Guillaume Gomez
c183c3f4d1 Clean up E0642 explanation 2020-06-04 13:03:50 +02:00
csmoe
9be635306c resolve error code e0760 2020-06-04 09:37:32 +08:00
Guillaume Gomez
64b5520757 clean up E0641 explanation 2020-06-03 13:52:09 +02:00
Yuki Okushi
b3cf989eaf
Rollup merge of #72880 - GuillaumeGomez:cleanup-e0637, r=Dylan-DPC
Clean up E0637 explanation

r? @Dylan-DPC
2020-06-02 13:07:20 +09:00
Guillaume Gomez
576a97b6d1 Clean up E0637 explanation 2020-06-01 13:07:29 +02:00
Dylan DPC
2e3417a82d
Rollup merge of #72818 - GuillaumeGomez:cleanup-e0622, r=Dylan-DPC
Clean up E0622 explanation

r? @Dylan-DPC
2020-06-01 03:14:10 +02:00
Guillaume Gomez
1fbc037da6 Clean up E0622 explanation 2020-05-31 14:09:15 +02:00
Ralf Jung
f96e3e2069
Rollup merge of #72540 - davidtwco:issue-67552-mono-collector-comparison, r=varkor
mir: adjust conditional in recursion limit check

Fixes #67552.

This PR adjusts the condition used in the recursion limit check of
the monomorphization collector, from `>` to `>=`.

In #67552, the test case had infinite indirect recursion, repeating a
handful of functions (from the perspective of the monomorphization
collector): `rec` -> `identity` -> `Iterator::count` -> `Iterator::fold`
-> `Iterator::next` -> `rec`.

During this process, `resolve_associated_item` was invoked for
`Iterator::fold` (during the construction of an `Instance`), and
ICE'd due to substitutions needing inference. However, previous
iterations of this recursion would have called this function for
`Iterator::fold` - and did! - and succeeded in doing so (trivially
checkable from debug logging, `()` is present where `_` is in the substs
of the failing execution).

The expected outcome of this test case would be a recursion limit error
(which is present when the `identity` fn indirection is removed), and
the recursion depth of `rec` is increasing (other functions finish
collecting their neighbours and thus have their recursion depths reset).

When the ICE occurs, the recursion depth of `rec` is 256 (which matches
the recursion limit), which suggests perhaps that a different part of
the compiler is using a `>=` comparison and returning a different result
on this recursion rather than what it returned in every previous
recursion, thus stopping the monomorphization collector from reporting
an error on the next recursion, where `recursion_depth_of_rec > 256`
would have been true.

With grep and some educated guesses, we can determine that
the recursion limit check at line 818 in
`src/librustc_trait_selection/traits/project.rs` is the other check that
is using a different comparison. Modifying either comparison to be `>` or
`>=` respectively will fix the error, but changing the monomorphization
collector produces the nicer error.
2020-05-30 13:45:10 +02:00
Dylan DPC
180a92cad7
Rollup merge of #72731 - GuillaumeGomez:cleanup-e0619, r=Dylan-DPC
Add missing empty line in E0619 explanation

r? @Dylan-DPC
2020-05-29 20:21:26 +02:00
Guillaume Gomez
12c03db157 Add missing empty line in E0619 explanation 2020-05-29 11:06:48 +02:00
Yuki Okushi
6786c7d190
Rollup merge of #72495 - GuillaumeGomez:cleanup-e0601, r=Dylan-DPC
Improve E0601 explanation

r? @Dylan-DPC
2020-05-29 15:07:02 +09:00
Dylan DPC
235f382731
Rollup merge of #72605 - GuillaumeGomez:cleanup-e0617, r=Dylan-DPC
Add working example for E0617 explanation

r? @Dylan-DPC
2020-05-29 02:33:14 +02:00
David Wood
a54ed872cb
standardize limit comparisons with Limit type
This commit introduces a `Limit` type which is used to ensure that all
comparisons against limits within the compiler are consistent (which can
result in ICEs if they aren't).

Signed-off-by: David Wood <david@davidtw.co>
2020-05-28 10:33:07 +01:00
Guillaume Gomez
5548e69226 Add working example for E0617 explanation 2020-05-27 21:29:09 +02:00
Dylan DPC
aa8d64b005
Rollup merge of #72567 - GuillaumeGomez:cleanup-e0608, r=Dylan-DPC
Clean up E0608 explanation

r? @Dylan-DPC
2020-05-25 18:07:48 +02:00
Guillaume Gomez
632f3de12b Clean up E0608 explanation 2020-05-25 13:03:38 +02:00
Ralf Jung
cdeef96267
Rollup merge of #72530 - GuillaumeGomez:cleanup-e0602, r=Dylan-DPC
Clean up E0602 explanation

r? @Dylan-DPC
2020-05-24 16:51:32 +02:00
Guillaume Gomez
2220eb4d8a Clean up E0602 explanation 2020-05-24 12:52:45 +02:00
Guillaume Gomez
d01f1314b7 Improve E0601 explanation 2020-05-23 13:19:57 +02:00
Dylan DPC
bf1b998be6
Rollup merge of #72461 - GuillaumeGomez:cleanup-e0600, r=Dylan-DPC
Clean up E0600 explanation

r? @Dylan-DPC
2020-05-22 21:45:04 +02:00
Dylan DPC
47f3c440ec
Rollup merge of #72375 - GuillaumeGomez:cleanup-e0599, r=Dylan-DPC
Improve E0599 explanation

r? @Dylan-DPC
2020-05-22 21:44:54 +02:00
Ralf Jung
f7ed13b6a5
Rollup merge of #72345 - GuillaumeGomez:cleanup-e0593, r=Dylan-DPC
Clean up E0593 explanation

r? @Dylan-DPC
2020-05-22 16:58:29 +02:00
Ralf Jung
02eb002ee3
Rollup merge of #72235 - GuillaumeGomez:cleanup-E0590, r=Dylan-DPC
Clean up E0590 explanation

r? @Dylan-DPC
2020-05-22 16:58:26 +02:00
Guillaume Gomez
985ebf2c4a Clean up E0590 explanation 2020-05-22 13:26:11 +02:00
Guillaume Gomez
6e5cb37b66 Clean up E0600 explanation 2020-05-22 13:24:34 +02:00