about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-02 01:58:40 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-02 02:40:01 +0300
commit62ec2cb7acb1b16d0abd8a2cf40da545a13d29f3 (patch)
tree7692fc594e177ae978e2b3951600e8a0edc41a65 /src/libsyntax/print/pprust
parent3d0d6ee271a34d2329235b9a04cf4a421d9026cd (diff)
downloadrust-62ec2cb7acb1b16d0abd8a2cf40da545a13d29f3.tar.gz
rust-62ec2cb7acb1b16d0abd8a2cf40da545a13d29f3.zip
Remove some more `cfg(test)`s
Diffstat (limited to 'src/libsyntax/print/pprust')
-rw-r--r--src/libsyntax/print/pprust/tests.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust/tests.rs b/src/libsyntax/print/pprust/tests.rs
index 97df7e6dcbd..082a430e0ed 100644
--- a/src/libsyntax/print/pprust/tests.rs
+++ b/src/libsyntax/print/pprust/tests.rs
@@ -5,6 +5,22 @@ use crate::source_map;
 use crate::with_default_globals;
 use syntax_pos;
 
+fn fun_to_string(
+    decl: &ast::FnDecl, header: ast::FnHeader, name: ast::Ident, generics: &ast::Generics
+) -> String {
+    to_string(|s| {
+        s.head("");
+        s.print_fn(decl, header, Some(name),
+                   generics, &source_map::dummy_spanned(ast::VisibilityKind::Inherited));
+        s.end(); // Close the head box
+        s.end(); // Close the outer box
+    })
+}
+
+fn variant_to_string(var: &ast::Variant) -> String {
+    to_string(|s| s.print_variant(var))
+}
+
 #[test]
 fn test_fun_to_string() {
     with_default_globals(|| {