Rollup merge of #122060 - clubby789:stabilize-imported-main, r=lcnr
Stabilize `imported_main` FCP: https://github.com/rust-lang/rust/issues/28937#issuecomment-1977822831 Docs: https://github.com/rust-lang/reference/pull/1461
This commit is contained in:
commit
b19c67c0fc
17 changed files with 7 additions and 51 deletions
|
@ -203,6 +203,8 @@ declare_features! (
|
|||
(accepted, impl_header_lifetime_elision, "1.31.0", Some(15872)),
|
||||
/// Allows referencing `Self` and projections in impl-trait.
|
||||
(accepted, impl_trait_projections, "1.74.0", Some(103532)),
|
||||
/// Allows using imported `main` function
|
||||
(accepted, imported_main, "CURRENT_RUSTC_VERSION", Some(28937)),
|
||||
/// Allows using `a..=b` and `..=b` as inclusive range syntaxes.
|
||||
(accepted, inclusive_range_syntax, "1.26.0", Some(28237)),
|
||||
/// Allows inferring outlives requirements (RFC 2093).
|
||||
|
|
|
@ -495,8 +495,6 @@ declare_features! (
|
|||
(unstable, impl_trait_in_assoc_type, "1.70.0", Some(63063)),
|
||||
/// Allows `impl Trait` as output type in `Fn` traits in return position of functions.
|
||||
(unstable, impl_trait_in_fn_trait_return, "1.64.0", Some(99697)),
|
||||
/// Allows using imported `main` function
|
||||
(unstable, imported_main, "1.53.0", Some(28937)),
|
||||
/// Allows associated types in inherent impls.
|
||||
(incomplete, inherent_associated_types, "1.52.0", Some(8995)),
|
||||
/// Allow anonymous constants from an inline `const` block
|
||||
|
|
|
@ -7,7 +7,6 @@ use rustc_hir::{ItemId, Node, CRATE_HIR_ID};
|
|||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_session::config::{sigpipe, CrateType, EntryFnType};
|
||||
use rustc_session::parse::feature_err;
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
|
@ -133,16 +132,6 @@ fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_>) -> Option<(DefId,
|
|||
return None;
|
||||
}
|
||||
|
||||
if main_def.is_import && !tcx.features().imported_main {
|
||||
let span = main_def.span;
|
||||
feature_err(
|
||||
&tcx.sess,
|
||||
sym::imported_main,
|
||||
span,
|
||||
"using an imported function as entry point `main` is experimental",
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
return Some((def_id, EntryFnType::Main { sigpipe: sigpipe(tcx, def_id) }));
|
||||
}
|
||||
no_main_err(tcx, visitor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue