about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests/target/large_vec.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/large_vec.rs')
-rw-r--r--src/tools/rustfmt/tests/target/large_vec.rs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/large_vec.rs b/src/tools/rustfmt/tests/target/large_vec.rs
new file mode 100644
index 00000000000..95d1fc43c03
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/large_vec.rs
@@ -0,0 +1,42 @@
+// See #1470.
+
+impl Environment {
+    pub fn new_root() -> Rc<RefCell<Environment>> {
+        let mut env = Environment::new();
+        let builtin_functions = &[
+            (
+                "println",
+                Function::NativeVoid(
+                    CallSign {
+                        num_params: 0,
+                        variadic: true,
+                        param_types: vec![],
+                    },
+                    native_println,
+                ),
+            ),
+            (
+                "run_http_server",
+                Function::NativeVoid(
+                    CallSign {
+                        num_params: 1,
+                        variadic: false,
+                        param_types: vec![Some(ConstraintType::Function)],
+                    },
+                    native_run_http_server,
+                ),
+            ),
+            (
+                "len",
+                Function::NativeReturning(
+                    CallSign {
+                        num_params: 1,
+                        variadic: false,
+                        param_types: vec![None],
+                    },
+                    native_len,
+                ),
+            ),
+        ];
+    }
+}