"exclusive range pattern syntax is experimental");
}
+void
+FeatureGate::visit (AST::UseTreeGlob &use)
+{
+ // At the moment, UseTrees do not have outer attributes, but they should. we
+ // need to eventually gate `#[prelude_import]` on use-trees based on the
+ // #[feature(prelude_import)]
+}
+
} // namespace Rust
void visit (AST::TypeBoundWhereClauseItem &item) override {}
void visit (AST::Module &module) override {}
void visit (AST::ExternCrate &crate) override {}
- void visit (AST::UseTreeGlob &use_tree) override {}
+ void visit (AST::UseTreeGlob &use_tree) override;
void visit (AST::UseTreeList &use_tree) override {}
void visit (AST::UseTreeRebind &use_tree) override {}
void visit (AST::UseDeclaration &use_decl) override {}
return Feature (Feature::Name::EXCLUSIVE_RANGE_PATTERN,
Feature::State::ACTIVE, "exclusive_range_pattern",
"1.11.0", 37854, tl::nullopt, "");
+ case Feature::Name::PRELUDE_IMPORT:
+ return Feature (Feature::Name::PRELUDE_IMPORT, Feature::State::ACTIVE,
+ "prelude_import", "1.0.0", 0, tl::nullopt, "");
default:
rust_unreachable ();
}
{"dropck_eyepatch", Feature::Name::DROPCK_EYEPATCH},
{"raw_ref_op", Feature::Name::RAW_REF_OP},
{"exclusive_range_pattern", Feature::Name::EXCLUSIVE_RANGE_PATTERN},
+ {"prelude_import", Feature::Name::PRELUDE_IMPORT},
}; // namespace Rust
tl::optional<Feature::Name>
DROPCK_EYEPATCH,
RAW_REF_OP,
EXCLUSIVE_RANGE_PATTERN,
+ PRELUDE_IMPORT,
};
const std::string &as_string () { return m_name_str; }
static constexpr auto &RUSTC_CONST_STABLE = "rustc_const_stable";
static constexpr auto &RUSTC_CONST_UNSTABLE = "rustc_const_unstable";
static constexpr auto &MAY_DANGLE = "may_dangle";
+ static constexpr auto &PRELUDE_IMPORT = "prelude_import";
};
} // namespace Values
} // namespace Rust
{Attrs::UNSTABLE, STATIC_ANALYSIS},
// assuming we keep these for static analysis
{Attrs::RUSTC_CONST_STABLE, STATIC_ANALYSIS},
- {Attrs::RUSTC_CONST_UNSTABLE, STATIC_ANALYSIS}};
+ {Attrs::RUSTC_CONST_UNSTABLE, STATIC_ANALYSIS},
+ {Attrs::PRELUDE_IMPORT, NAME_RESOLUTION}};
BuiltinAttributeMappings *
BuiltinAttributeMappings::get ()
--- /dev/null
+#![feature(prelude_import)]
+
+mod core {
+ mod prelude {
+ mod v1 {
+ // hehe
+ }
+ }
+}
+
+#[prelude_import]
+use core::prelude::v1::*;