-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Description
Code:
#![crate_type="lib"]
#[cfg(v1)]
pub fn foo(f: fn<'a>(x: &'a())) -> fn<'b>(y: &'b()) { f }
#[cfg(v2)]
pub fn foo(f: fn<'a>(x: &'a())) -> fn<'b>(y: &'b()) { f.clone() }
Transcript of compile attempts:
% rustc --cfg v1 /tmp/cf.rs
% rustc --cfg v2 /tmp/cf.rs
/tmp/cf.rs:7:55: 7:64 error: mismatched types: expected `fn(&'b ())` but found `fn(&())` (expected concrete lifetime, but found bound lifetime parameter 'b)
/tmp/cf.rs:7 pub fn foo(f: fn<'a>(x: &'a())) -> fn<'b>(y: &'b()) { f.clone() }
^~~~~~~~~
note: expected concrete lifetime is lifetime ReInfer(ReVar(middle::ty::RegionVid{id: 43u}))
error: aborting due to previous error
%
Metadata
Metadata
Assignees
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.