Skip to content

Fix tracking issue numbers for some unstable features #55601

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Nov 6, 2018
Merged
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
6 changes: 2 additions & 4 deletions src/librustc/middle/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,8 @@ fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt<'_, '_, '_>,
return true;
}

// (To be) stable attribute for #[lang = "panic_impl"]
if attr::contains_name(attrs, "panic_implementation") ||
attr::contains_name(attrs, "panic_handler")
{
// Stable attribute for #[lang = "panic_impl"]
if attr::contains_name(attrs, "panic_handler") {
return true;
}

Expand Down
4 changes: 1 addition & 3 deletions src/librustc/middle/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
if let Some(value) = attribute.value_str() {
return Some((value, attribute.span));
}
} else if attribute.check_name("panic_implementation") ||
attribute.check_name("panic_handler")
{
} else if attribute.check_name("panic_handler") {
return Some((Symbol::intern("panic_impl"), attribute.span))
} else if attribute.check_name("alloc_error_handler") {
return Some((Symbol::intern("oom"), attribute.span))
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/monomorphize/partitioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ fn mono_item_visibility(
//
// * First is weak lang items. These are basically mechanisms for
// libcore to forward-reference symbols defined later in crates like
// the standard library or `#[panic_implementation]` definitions. The
// the standard library or `#[panic_handler]` definitions. The
// definition of these weak lang items needs to be referenceable by
// libcore, so we're no longer a candidate for internalization.
// Removal of these functions can't be done by LLVM but rather must be
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
}
}

// Check that a function marked as `#[panic_implementation]` has signature `fn(&PanicInfo) -> !`
// Check that a function marked as `#[panic_handler]` has signature `fn(&PanicInfo) -> !`
if let Some(panic_impl_did) = fcx.tcx.lang_items().panic_impl() {
if panic_impl_did == fcx.tcx.hir.local_def_id(fn_id) {
if let Some(panic_info_did) = fcx.tcx.lang_items().panic_info() {
Expand Down
27 changes: 8 additions & 19 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ declare_features! (
(active, abi_thiscall, "1.19.0", None, None),

// Allows a test to fail without failing the whole suite
(active, allow_fail, "1.19.0", Some(42219), None),
(active, allow_fail, "1.19.0", Some(46488), None),

// Allows unsized tuple coercion.
(active, unsized_tuple_coercion, "1.20.0", Some(42877), None),
Expand All @@ -376,7 +376,7 @@ declare_features! (
(active, non_exhaustive, "1.22.0", Some(44109), None),

// `crate` as visibility modifier, synonymous to `pub(crate)`
(active, crate_visibility_modifier, "1.23.0", Some(45388), None),
(active, crate_visibility_modifier, "1.23.0", Some(53120), None),

// extern types
(active, extern_types, "1.23.0", Some(43467), None),
Expand All @@ -391,13 +391,13 @@ declare_features! (
(active, generic_associated_types, "1.23.0", Some(44265), None),

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

// Use `?` as the Kleene "at most one" operator
(active, macro_at_most_once_rep, "1.25.0", Some(48075), None),

// Infer static outlives requirements; RFC 2093
(active, infer_static_outlives_requirements, "1.26.0", Some(44493), None),
(active, infer_static_outlives_requirements, "1.26.0", Some(54185), None),

// Multiple patterns with `|` in `if let` and `while let`
(active, if_while_or_patterns, "1.26.0", Some(48215), None),
Expand Down Expand Up @@ -448,9 +448,6 @@ declare_features! (
// Integer match exhaustiveness checking
(active, exhaustive_integer_patterns, "1.30.0", Some(50907), None),

// RFC 2070: #[panic_implementation] / #[panic_handler]
(active, panic_implementation, "1.28.0", Some(44489), None),

// #[doc(keyword = "...")]
(active, doc_keyword, "1.28.0", Some(51315), None),

Expand All @@ -466,7 +463,7 @@ declare_features! (
(active, test_2018_feature, "1.31.0", Some(0), Some(Edition::Edition2018)),

// Support for arbitrary delimited token streams in non-macro attributes
(active, unrestricted_attribute_tokens, "1.30.0", Some(44690), None),
(active, unrestricted_attribute_tokens, "1.30.0", Some(55208), None),

// Allows `use x::y;` to resolve through `self::x`, not just `::x`
(active, uniform_paths, "1.30.0", Some(53130), None),
Expand Down Expand Up @@ -503,7 +500,7 @@ declare_features! (
(active, underscore_const_names, "1.31.0", Some(54912), None),

// `extern crate foo as bar;` puts `bar` into extern prelude.
(active, extern_crate_item_prelude, "1.31.0", Some(54658), None),
(active, extern_crate_item_prelude, "1.31.0", Some(55599), None),

// `reason = ` in lint attributes and `expect` lint attribute
(active, lint_reasons, "1.31.0", Some(54503), None),
Expand Down Expand Up @@ -541,6 +538,8 @@ declare_features! (
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
(removed, proc_macro_gen, "1.27.0", Some(54727), None,
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
(removed, panic_implementation, "1.28.0", Some(44489), None,
Some("subsumed by `#[panic_handler]`")),
);

declare_features! (
Expand Down Expand Up @@ -1160,16 +1159,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
"infer 'static lifetime requirements",
cfg_fn!(infer_static_outlives_requirements))),

// RFC 2070 (deprecated attribute name)
("panic_implementation",
Normal,
Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/44489\
#issuecomment-415140224",
Some("replace this attribute with `#[panic_handler]`")),
"panic_implementation",
"this attribute was renamed to `panic_handler`",
cfg_fn!(panic_implementation))),

// RFC 2070
("panic_handler", Normal, Ungated),

Expand Down
4 changes: 1 addition & 3 deletions src/test/run-make/wasm-symbols-not-imported/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// except according to those terms.

#![crate_type = "cdylib"]

#![feature(panic_implementation)]
#![no_std]

use core::panic::PanicInfo;
Expand All @@ -20,7 +18,7 @@ pub extern fn foo() {
panic!()
}

#[panic_implementation]
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
2 changes: 1 addition & 1 deletion src/test/ui/feature-gates/feature-gate-allow_fail.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: allow_fail attribute is currently unstable (see issue #42219)
error[E0658]: allow_fail attribute is currently unstable (see issue #46488)
--> $DIR/feature-gate-allow_fail.rs:13:1
|
LL | #[allow_fail] //~ ERROR allow_fail attribute is currently unstable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: `crate` visibility modifier is experimental (see issue #45388)
error[E0658]: `crate` visibility modifier is experimental (see issue #53120)
--> $DIR/feature-gate-crate_visibility_modifier.rs:11:1
|
LL | crate struct Bender { //~ ERROR `crate` visibility modifier is experimental
Expand Down
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:26:9
|
LL | use alloc;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable

error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:28:9
|
LL | use alloc::boxed;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable

error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:33:11
|
LL | use ::alloc;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable

error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:35:11
|
LL | use ::alloc::boxed;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable

error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:9:17
|
LL | let v = alloc::vec![0];
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable

error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:11:18
|
LL | type A = alloc::boxed::Box<u8>;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable

error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:18:19
|
LL | let v = ::alloc::vec![0];
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable

error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:20:20
|
LL | type A = ::alloc::boxed::Box<u8>;
| ^^^^^
|
= help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable

error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #54658)
error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599)
--> $DIR/feature-gate-extern_crate_item_prelude.rs:42:14
|
LL | type A = core::boxed::Box<u8>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: `extern` in paths is experimental (see issue #44660)
error[E0658]: `extern` in paths is experimental (see issue #55600)
--> $DIR/feature-gate-extern_in_paths.rs:14:13
|
LL | let _ = extern::std::vec::Vec::new(); //~ ERROR `extern` in paths is experimental
Expand Down
21 changes: 0 additions & 21 deletions src/test/ui/feature-gates/feature-gate-panic-implementation.rs

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/ui/feature-gates/feature-gate-panic-implementation.stderr

This file was deleted.

This file was deleted.

This file was deleted.