You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a tracking issue for cleaning up early/late bound lifetimes in the compiler, most notably impacting turbofish syntax (e.g. some_fn::<'static>()). See t-types/#133, as well as the project goal (link missing; wait for the pr).
The feature gate for the issue is #![feature(late_bound_turbofishing)].
Description
In the compiler, function item types are currently represented with TyKind::FnDef, but currently this definition doesn't support late-bound generics.
Currently, using turbofish syntax to provide a specific lifetime for a late-bound lifetime argument on a function does not compile.
// 'a is late boundfnfoo<'a>(b:&'au32) -> &'au32{ b }// errorlet f /* : FooFnItem<????> */ = foo::<'static>;
Compare this to early bound arguments, where this does compile (note that 'a: 'a here is just used to coerce the compiler into treating 'a as early bound).
// 'a is early bound.fnfoo<'a:'a>(b:&'au32) -> &'au32{ b }let f /* : FooFnItem<'static> */ = foo::<'static>;
Our goals with this issue are twofold:
to allow late-bound lifetimes to be specified with turbofish syntax (allowing the first code block to compile), and
generally clean up internal representation WRT differentiating between early & late bound parameters
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
Reevaluate type definitions WRT early/late bound param
This is a tracking issue for cleaning up early/late bound lifetimes in the compiler, most notably impacting turbofish syntax (e.g.
some_fn::<'static>()). See t-types/#133, as well as the project goal (link missing; wait for the pr).The feature gate for the issue is
#![feature(late_bound_turbofishing)].Description
In the compiler, function item types are currently represented with
TyKind::FnDef, but currently this definition doesn't support late-bound generics.Currently, using turbofish syntax to provide a specific lifetime for a late-bound lifetime argument on a function does not compile.
Compare this to early bound arguments, where this does compile (note that
'a: 'ahere is just used to coerce the compiler into treating'aas early bound).Our goals with this issue are twofold:
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
ty::Generics,GenericParamDef/GenericParamDefKindTyKind::FnDefgenerics_ofquery to matchrustfmtUnresolved Questions
Implementation history