Skip to content

Infinite recursion error instead of trait bound error #40827

Closed
@dnorman

Description

@dnorman

Observed behavior:
Receiving the following error when attempting to compile the sample program.

Expected behavior:
Indicate that there is a trait bound error.


rustc 1.16.0 (30cf806ef 2017-03-10)
error[E0275]: overflow evaluating the requirement `TransmitterInternal: std::marker::Send`
  --> <anon>:22:16
   |
22 | fn g(x: Memo) {f(x)}
   |                ^
   |
   = note: consider adding a `#![recursion_limit="128"]` attribute to your crate
   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::Arc<TransmitterInternal>`
   = note: required because it appears within the type `SlabRef`
   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<SlabRef>`
   = note: required because it appears within the type `alloc::raw_vec::RawVec<SlabRef>`
   = note: required because it appears within the type `std::vec::Vec<SlabRef>`
   = note: required because it appears within the type `TransmitterInternal`
   = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<TransmitterInternal>`
   = note: required because it appears within the type `SlabRef`
   = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<SlabRef>`
   = note: required because it appears within the type `alloc::raw_vec::RawVec<SlabRef>`
   = note: required because it appears within the type `std::vec::Vec<SlabRef>`
   = note: required because it appears within the type `TransmitterInternal`
   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::Arc<TransmitterInternal>`
   = note: required because it appears within the type `SlabRef`
...

Minimal reproduction case:

https://is.gd/KgD5Tk
Many thanks to the tireless efforts of @stephaneyfx in creating the repro above!

Bonus round
I haven't yet figured out a minimal repro for this second part, but if I'm interpreting correctly, it's possible that a variant of this endless recursion error does not require a trait bound error to be triggered. (noob warning: it's possible that the omission of +Send+Sync in 4ab0fdf is actually a trait bounds error, but I don't presently understand why)

Non-minimal repro:
https://travis-ci.org/dnorman/unbase/jobs/209643435#L240

Minimal change that fixed it:
dnorman/unbase@47c68bf
https://travis-ci.org/dnorman/unbase/jobs/209649602#L228

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions