Skip to content

Commit 4efe144

Browse files
committed
attempt to register the helper macro so that it allows unstable things internally.
Unfortunately, i am having issues getting this to actually work. I repeatedly see: ``` failures: [run-fail] run-fail/explicit-panic-msg.rs ``` Namely: ``` failures: ---- [run-fail] run-fail/explicit-panic-msg.rs stdout ---- error: compilation failed! status: exit code: 101 command: x86_64-apple-darwin/stage2/bin/rustc /Users/fklock/Dev/Mozilla/rust-panic/src/test/run-fail/explicit-panic-msg.rs -L x86_64-apple-darwin/test/run-fail/ --target=x86_64-apple-darwin -L x86_64-apple-darwin/test/run-fail/explicit-panic-msg.stage2-x86_64-apple-darwinlibaux -C prefer-dynamic -o x86_64-apple-darwin/test/run-fail/explicit-panic-msg.stage2-x86_64-apple-darwin --cfg rtopt --cfg debug -L x86_64-apple-darwin/rt stdout: ------------------------------------------ ------------------------------------------ stderr: ------------------------------------------ <std macros>:2:26: 2:57 error: use of unstable library feature 'core': internal to format_args! <std macros>:2 $ crate:: fmt:: format ( format_args ! ( $ ( $ arg ) * ) ) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: in expansion of __unstable_rustc_ensure_not_fmt_string_literal! <std macros>:4:1: 4:78 note: expansion site <std macros>:1:1: 12:23 note: in expansion of panic! /Users/fklock/Dev/Mozilla/rust-panic/src/test/run-fail/explicit-panic-msg.rs:18:5: 18:37 note: expansion site <std macros>:2:26: 2:57 help: add #![feature(core)] to the crate attributes to enable <std macros>:2:26: 2:57 error: use of unstable library feature 'core': internal to format_args! <std macros>:2 $ crate:: fmt:: format ( format_args ! ( $ ( $ arg ) * ) ) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: in expansion of __unstable_rustc_ensure_not_fmt_string_literal! <std macros>:4:1: 4:78 note: expansion site <std macros>:1:1: 12:23 note: in expansion of panic! /Users/fklock/Dev/Mozilla/rust-panic/src/test/run-fail/explicit-panic-msg.rs:18:5: 18:37 note: expansion site <std macros>:2:26: 2:57 help: add #![feature(core)] to the crate attributes to enable error: aborting due to 2 previous errors ------------------------------------------ ``` and I have not yet figured out why this happens even now, nor how to resolve it.
1 parent ee540bc commit 4efe144

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/libsyntax/ext/base.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,14 @@ fn initial_syntax_expander_table<'feat>(ecfg: &expand::ExpansionConfig<'feat>)
458458
syntax_expanders.insert(intern("format_args"),
459459
// format_args uses `unstable` things internally.
460460
NormalTT(Box::new(ext::format::expand_format_args), None, true));
461-
syntax_expanders.insert(intern("__unstable_rustc_ensure_not_fmt_string_literal"),
462-
builtin_normal_expander(
463-
ext::format::ensure_not_fmt_string_literal));
461+
462+
// ensure_not_fmt_string_literal is passed `unstable` things to
463+
// use in its expansion. (Of course, that should not actually
464+
// force us to pass `true` to allow the use of unstable things;
465+
// i.e. this is working around a bug elsewhere.)
466+
let tt = NormalTT(Box::new(ext::format::ensure_not_fmt_string_literal), None, true);
467+
syntax_expanders.insert(intern("__unstable_rustc_ensure_not_fmt_string_literal"), tt);
468+
464469
syntax_expanders.insert(intern("env"),
465470
builtin_normal_expander(
466471
ext::env::expand_env));

0 commit comments

Comments
 (0)