Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilization PR for Issue-53125 #53982

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 3 additions & 30 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use visit::{self, FnKind, Visitor};
use parse::ParseSess;
use symbol::{keywords, Symbol};

use std::{env, path};
use std::{env};

macro_rules! set {
// The const_fn feature also enables the min_const_fn feature, because `min_const_fn` allows
Expand Down Expand Up @@ -409,9 +409,6 @@ declare_features! (
// Resolve absolute paths as paths from other crates
(active, extern_absolute_paths, "1.24.0", Some(44660), Some(Edition::Edition2018)),

// `foo.rs` as an alternative to `foo/mod.rs`
(active, non_modrs_mods, "1.24.0", Some(44660), Some(Edition::Edition2018)),

// `extern` in paths
(active, extern_in_paths, "1.23.0", Some(44660), None),

Expand Down Expand Up @@ -661,6 +658,8 @@ declare_features! (
(accepted, repr_transparent, "1.28.0", Some(43036), None),
// Defining procedural macros in `proc-macro` crates
(accepted, proc_macro, "1.29.0", Some(38356), None),
// `foo.rs` as an alternative to `foo/mod.rs`
(accepted, non_modrs_mods, "1.30.0", Some(44660), None),
// Allows use of the :vis macro fragment specifier
(accepted, macro_vis_matcher, "1.30.0", Some(41022), None),
// Allows importing and reexporting macros with `use`,
Expand Down Expand Up @@ -1497,31 +1496,6 @@ impl<'a> PostExpansionVisitor<'a> {
}
}

impl<'a> PostExpansionVisitor<'a> {
fn whole_crate_feature_gates(&mut self, _krate: &ast::Crate) {
for &(ident, span) in &*self.context.parse_sess.non_modrs_mods.borrow() {
if !span.allows_unstable() {
let cx = &self.context;
let level = GateStrength::Hard;
let has_feature = cx.features.non_modrs_mods;
let name = "non_modrs_mods";
debug!("gate_feature(feature = {:?}, span = {:?}); has? {}",
name, span, has_feature);

if !has_feature && !span.allows_unstable() {
leveled_feature_err(
cx.parse_sess, name, span, GateIssue::Language,
"mod statements in non-mod.rs files are unstable", level
)
.help(&format!("on stable builds, rename this file to {}{}mod.rs",
ident, path::MAIN_SEPARATOR))
.emit();
}
}
}
}
}

impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
fn visit_attribute(&mut self, attr: &ast::Attribute) {
if !attr.span.allows_unstable() {
Expand Down Expand Up @@ -2091,7 +2065,6 @@ pub fn check_crate(krate: &ast::Crate,
};

let visitor = &mut PostExpansionVisitor { context: &ctx };
visitor.whole_crate_feature_gates(krate);
visit::walk_crate(visitor, krate);
}

Expand Down
15 changes: 0 additions & 15 deletions src/test/ui/directory_ownership/mod_file_not_owning.rs

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/ui/directory_ownership/mod_file_not_owning.stderr

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/ui/directory_ownership/unowned_mod_with_path.rs

This file was deleted.

15 changes: 0 additions & 15 deletions src/test/ui/directory_ownership/unowned_mod_with_path.stderr

This file was deleted.

28 changes: 0 additions & 28 deletions src/test/ui/non_modrs_mods/non_modrs_mods.rs

This file was deleted.

39 changes: 0 additions & 39 deletions src/test/ui/non_modrs_mods/non_modrs_mods.stderr

This file was deleted.

2 changes: 1 addition & 1 deletion src/tools/clang
Submodule clang updated 859 files
2 changes: 1 addition & 1 deletion src/tools/lldb
Submodule lldb updated from 7728fa to 3dbe99