Open
Description
Playground Rustc version:
1.34.0-nightly 2019-02-27 7e001e5c6c7c090b4141
Code:
#![feature(unboxed_closures, fn_traits, specialization)]
use std::ops::{Deref, FnOnce};
struct Foo<T> {
val: T,
}
default impl<'a, T> FnOnce<()> for &'a Foo<T> {
type Output = &'a T;
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
&self.val
}
}
impl<'a, T: 'a, U: 'a> FnOnce<()> for &'a Foo<T> where T: Deref<Target = U> {
type Output = &'a U;
extern "rust-call" fn call_once(self, _args: ()) -> Self::Output {
self.val.deref()
}
}
fn main() {}
Error message:
Compiling playground v0.0.1 (/playground)
error[E0275]: overflow evaluating the requirement `&Foo<_>: std::ops::FnOnce<()>`
|
= help: consider adding a `#![recursion_limit="128"]` attribute to your crate
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
= note: required because of the requirements on the impl of `std::ops::FnOnce<()>` for `&Foo<_>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0275`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Trait impl specializationCategory: An issue proposing an enhancement or a PR with one.`#![feature(specialization)]``#![feature(unboxed_closures)]`Relevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.