summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/try-conversion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/target/try-conversion.rs')
-rw-r--r--src/tools/rustfmt/tests/target/try-conversion.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/try-conversion.rs b/src/tools/rustfmt/tests/target/try-conversion.rs
new file mode 100644
index 000000000..04992a0a0
--- /dev/null
+++ b/src/tools/rustfmt/tests/target/try-conversion.rs
@@ -0,0 +1,28 @@
+// rustfmt-use_try_shorthand: true
+
+fn main() {
+ let x = some_expr()?;
+
+ let y = a
+ .very
+ .loooooooooooooooooooooooooooooooooooooong()
+ .chain()
+ .inside()
+ .weeeeeeeeeeeeeee()?
+ .test()
+ .0
+ .x;
+}
+
+fn test() {
+ a?
+}
+
+fn issue1291() {
+ fs::create_dir_all(&gitfiledir).chain_err(|| {
+ format!(
+ "failed to create the {} submodule directory for the workarea",
+ name
+ )
+ })?;
+}