From 7c2050f95cd2763d8bf4be7f4164cb1b8e01ec69 Mon Sep 17 00:00:00 2001 From: Gigih Aji Ibrahim Date: Thu, 23 Mar 2023 09:19:23 +0700 Subject: [PATCH] remove #![feature(label_break_value)] from generated source code --- c2rust-analyze/tests/filecheck/alloc.rs | 1 - c2rust-refactor/src/lib.rs | 1 - c2rust-transpile/src/cfg/mod.rs | 1 - c2rust-transpile/src/translator/mod.rs | 1 - examples/tinycc/translate.py | 1 - examples/tmux/translate.py | 1 - tests/gotos/src/test_translation_only.rs | 2 -- 7 files changed, 8 deletions(-) diff --git a/c2rust-analyze/tests/filecheck/alloc.rs b/c2rust-analyze/tests/filecheck/alloc.rs index bcd0e64671..dfff23b51e 100644 --- a/c2rust-analyze/tests/filecheck/alloc.rs +++ b/c2rust-analyze/tests/filecheck/alloc.rs @@ -1,5 +1,4 @@ #![feature(extern_types)] -#![feature(label_break_value)] #![feature(rustc_private)] #![feature(c_variadic)] #![allow(non_upper_case_globals)] diff --git a/c2rust-refactor/src/lib.rs b/c2rust-refactor/src/lib.rs index 2247c923b4..5a8c6a84b8 100644 --- a/c2rust-refactor/src/lib.rs +++ b/c2rust-refactor/src/lib.rs @@ -5,7 +5,6 @@ box_patterns, generator_trait, drain_filter, - label_break_value, )] #![cfg_attr(feature = "profile", feature(proc_macro_hygiene))] diff --git a/c2rust-transpile/src/cfg/mod.rs b/c2rust-transpile/src/cfg/mod.rs index 1676a07892..4425d09f3a 100644 --- a/c2rust-transpile/src/cfg/mod.rs +++ b/c2rust-transpile/src/cfg/mod.rs @@ -2072,7 +2072,6 @@ impl CfgBuilder { || !IncCleanup::new(in_tail, brk_lbl.clone()).remove_tail_expr(&mut stmts); if has_fallthrough && need_block && use_brk_lbl { - translator.use_feature("label_break_value"); let block_body = mk().block(stmts); let block: Box = mk().labelled_block_expr(block_body, brk_lbl.pretty_print()); stmts = vec![mk().expr_stmt(block)] diff --git a/c2rust-transpile/src/translator/mod.rs b/c2rust-transpile/src/translator/mod.rs index d269e023f1..dee088cc5e 100644 --- a/c2rust-transpile/src/translator/mod.rs +++ b/c2rust-transpile/src/translator/mod.rs @@ -4109,7 +4109,6 @@ impl<'c> Translation<'c> { return Ok(WithStmts::new(stmts, val)); } _ => { - self.use_feature("label_break_value"); stmts.push(stmt) } } diff --git a/examples/tinycc/translate.py b/examples/tinycc/translate.py index eaa1052748..1d613a003f 100755 --- a/examples/tinycc/translate.py +++ b/examples/tinycc/translate.py @@ -35,7 +35,6 @@ MAIN_RS = os.path.join(RUST_SRC_DIR, "main.rs") # TODO(kkysen) shouldn't need `extern crate` MAIN_MODS = """\ -#![feature(label_break_value)] extern crate libc; pub mod i386_asm; pub mod libtcc; diff --git a/examples/tmux/translate.py b/examples/tmux/translate.py index 96d84a6426..088d5db3c0 100755 --- a/examples/tmux/translate.py +++ b/examples/tmux/translate.py @@ -56,7 +56,6 @@ ] # TODO(kkysen) shouldn't need `extern crate` MAIN_MODS = """\ -#![feature(label_break_value)] #![allow(unused_imports)] extern crate libc; diff --git a/tests/gotos/src/test_translation_only.rs b/tests/gotos/src/test_translation_only.rs index 52eb2a2470..507d1d85d7 100644 --- a/tests/gotos/src/test_translation_only.rs +++ b/tests/gotos/src/test_translation_only.rs @@ -1,5 +1,3 @@ -//! feature_label_break_value - use crate::jump_into_loop::rust_jump_into_loop; use crate::label_break_trigger::rust_triggers_label_break;