Stream: t-compiler

Topic: How to declare new langauge feature?

matklad (Jul 21 2019 at 14:38, on Zulip):

In, I am trying to remove char::is_xid_start / char::is_xid_continue from libcore. The problem I face is that these two methods are the only one annotated with feature = "rustc_private", so, If I remove them, rustc complains that it knows no such feature.

I think I need to make rustc_private a language feature, as opposed to library features. I've tried to add it to libsyntx/feature_gate, as (active, rustc_private, "1.0.0", None, None),, but I still get "error[E0635]: unknown feature rustc_private".

What should I do? :)

simulacrum (Jul 21 2019 at 14:45, on Zulip):

@matklad I presume you'll want #[cfg_attr(bootstrap, unstable(...))]since stage1+ will know about it via libsyntax but before then we won't

matklad (Jul 21 2019 at 14:50, on Zulip):

@simulacrum doesn't seem to help:

error[E0635]: unknown feature `rustc_private`
   --> src/libstd/
309 | #![cfg_attr(bootstrap, feature(rustc_private))]
    |                                ^^^^^^^^^^^^^

I am also not sure if it should help. My understanding is that the main thing that rustc_private unlocks is using compler-private crates. If I don't activate that feature, I'll get missing crates errors?

simulacrum (Jul 21 2019 at 14:53, on Zulip):

hm, is that during stage 1 or stage 0 compilation?

simulacrum (Jul 21 2019 at 14:53, on Zulip):

missing crates, no, but a bunch of feature gate warnings

simulacrum (Jul 21 2019 at 14:54, on Zulip):

it might be that we're not properly hooking into rustc-private via -Zforce-unstable-if-unmarked

simulacrum (Jul 21 2019 at 14:54, on Zulip):

that is, the new rustc_private

Last update: May 24 2020 at 22:45UTC