]> git.lizzy.rs Git - rust.git/commitdiff
Make wording verbose
authorYuki OKUSHI <huyuumi.dev@gmail.com>
Mon, 15 Apr 2019 22:32:19 +0000 (07:32 +0900)
committerYuki OKUSHI <huyuumi.dev@gmail.com>
Mon, 15 Apr 2019 22:32:19 +0000 (07:32 +0900)
src/librustc_mir/transform/qualify_min_const_fn.rs

index 5cea8ba27142d4ecbb42251c07bdb6d5b544e4a4..7826d3da4fed2a2e79587138823705f1d983998f 100644 (file)
@@ -326,7 +326,12 @@ fn check_terminator(
                     abi::Abi::Rust if tcx.is_min_const_fn(def_id) => {},
                     abi::Abi::Rust => return Err((
                         span,
-                        "can only call other `const` within a `const`".into(),
+                        format!(
+                            "can only call other `const fn` within a `const fn`, \
+                             but `{:?}` is not stable as `const fn`",
+                            func,
+                        )
+                        .into(),
                     )),
                     abi => return Err((
                         span,