diff --git a/src/items.rs b/src/items.rs index c013733f37f..9e5b964429e 100644 --- a/src/items.rs +++ b/src/items.rs @@ -1078,12 +1078,13 @@ fn rewrite_fn_base(context: &RewriteContext, let mut result = String::with_capacity(1024); // Vis unsafety abi. result.push_str(format_visibility(vis)); - result.push_str(::utils::format_unsafety(unsafety)); if let ast::Constness::Const = constness { result.push_str("const "); } + result.push_str(::utils::format_unsafety(unsafety)); + if abi != abi::Abi::Rust { result.push_str(&::utils::format_abi(abi)); } diff --git a/tests/source/issue-850.rs b/tests/source/issue-850.rs new file mode 100644 index 00000000000..c939716a6a8 --- /dev/null +++ b/tests/source/issue-850.rs @@ -0,0 +1 @@ +const unsafe fn x() {} diff --git a/tests/target/issue-850.rs b/tests/target/issue-850.rs new file mode 100644 index 00000000000..c939716a6a8 --- /dev/null +++ b/tests/target/issue-850.rs @@ -0,0 +1 @@ +const unsafe fn x() {}