Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow macros in type positions #27245
Comments
steveklabnik
added
the
B-RFC
label
Aug 4, 2015
alexcrichton
removed
the
B-RFC
label
Aug 11, 2015
steveklabnik
added
the
B-RFC-approved
label
Aug 13, 2015
This comment has been minimized.
This comment has been minimized.
|
The feature gate for this points at #27336, should it point here instead? |
This comment has been minimized.
This comment has been minimized.
|
How is this going? Is anything on fire yet? |
nodakai
added a commit
to nodakai/rust
that referenced
this issue
Mar 26, 2016
bors
added a commit
that referenced
this issue
Mar 27, 2016
nodakai
added a commit
to nodakai/rust
that referenced
this issue
Mar 27, 2016
bors
added a commit
that referenced
this issue
Mar 27, 2016
durka
referenced this issue
Apr 14, 2016
Closed
'rustc' panicked at 'visit_mac disabled by default' #32950
This comment has been minimized.
This comment has been minimized.
|
Is there any review/stability status on this feature by any chance? |
kennytm
referenced this issue
Apr 26, 2016
Open
Tracking Issue for RFC 213: Default Type Parameter Fallback #27336
This comment has been minimized.
This comment has been minimized.
|
Any update on this? |
huonw
added
T-lang
B-unstable
I-nominated
labels
May 21, 2016
This comment has been minimized.
This comment has been minimized.
|
cc @rust-lang/lang. This seems like a constrained extension to macros, that we could consider stabilising. |
This comment has been minimized.
This comment has been minimized.
|
There's an issue re interaction with deriving, see #32950, but I think it's minor. |
This comment has been minimized.
This comment has been minimized.
|
Going to FCP for this feature seems good to me. If people are using it successfully (or have found bugs!) please say so :-) |
This comment has been minimized.
This comment has been minimized.
|
+1 to stabilising. There are still a few issues with type macros, but just bugs, and nothing major that I'm aware of. |
nikomatsakis
removed
the
I-nominated
label
Jun 2, 2016
This comment has been minimized.
This comment has been minimized.
|
Did the lang team decide to FCP or wait? |
aturon
added
the
final-comment-period
label
Jun 21, 2016
This comment has been minimized.
This comment has been minimized.
|
We went to FCP. Apologies @durka for the dropped administrative work recently -- all of the Mozilla folks just traveled to London for a week and the preparations for that resulted in some balls being dropped. |
This comment has been minimized.
This comment has been minimized.
|
This feature is in its final comment period for stabilization (in 1.11). |
acmcarther
referenced this issue
Aug 6, 2016
Merged
Even more extreme macro (builds off last PR) #85
This comment has been minimized.
This comment has been minimized.
|
rustc 1.11 still reports type macros as unstable. Is there any chance of having this feature stabilized in 1.12? |
This comment has been minimized.
This comment has been minimized.
|
Yes, it's ready for immediate stabilization. Anyone should feel free to open a stabilization PR and ping me on it. |
This comment has been minimized.
This comment has been minimized.
|
Indeed I am slow in writing it up, but the @rust-lang/lang team decided formally to stabilize this feature (as @aturon commented). Horray! |
nikomatsakis
added
E-mentor
and removed
final-comment-period
labels
Aug 22, 2016
This comment has been minimized.
This comment has been minimized.
|
I am tagging the issue with E-mentor because I would be happy to mentor someone through the process of implementing a stabilization PR. |
nikomatsakis
added
E-easy
E-help-wanted
labels
Aug 22, 2016
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis I don't have experience with rustc internals, but I'd be happy to try to implement the stabilization PR. :-) |
This comment has been minimized.
This comment has been minimized.
|
@slash3g ok, basically all you have to do is to modify pub fn expand_type(t: P<ast::Ty>, fld: &mut MacroExpander) -> P<ast::Ty> {
let t = match t.node.clone() {
ast::TyKind::Mac(mac) => {
if fld.cx.ecfg.features.unwrap().type_macros {
expand_mac_invoc(mac, None, Vec::new(), t.span, fld)
} else {
feature_gate::emit_feature_err(
&fld.cx.parse_sess.span_diagnostic,
"type_macros",
t.span,
feature_gate::GateIssue::Language,
"type macros are experimental");
DummyResult::raw_ty(t.span)
}
}
_ => t
};
fold::noop_fold_ty(t, fld)
}you also need to change this declaration from // Allows macros to appear in the type position.
(active, type_macros, "1.3.0", Some(27245)), |
This comment has been minimized.
This comment has been minimized.
|
Also remove |
This comment has been minimized.
This comment has been minimized.
|
Ok, I've removed the check on the feature gate in
|
pnkfelix commentedJul 23, 2015
Tracking issue for rust-lang/rfcs#873