Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with rust nightly by updating try block syntax. #2965

Merged
merged 3 commits into from
Aug 26, 2018

Conversation

zachlute
Copy link
Contributor

This is a version of #2964 that doesn't change all the line endings. Sorry about that.

It still seems to be failing some tests. One of them seems to be related to this change in that it's reformatting the line I changed, but...I don't understand why it's different than the previous behavior.

The rest seem unrelated to this change?

@zachlute
Copy link
Contributor Author

zachlute commented Aug 26, 2018

The related test failure is this one:

---- test::self_tests stdout ----

Mismatch at src\expr.rs:318:
         // satisfy our width restrictions.
         ast::ExprKind::InlineAsm(..) => Some(context.snippet(expr.span).to_owned()),
         ast::ExprKind::TryBlock(ref block) => {
-            if let rw @ Some(_) = rewrite_single_line_block(
-                context,
-                "try ",
-                block,
-                Some(&expr.attrs),
-                None,
-                shape,
-            ) {
+            if let rw @ Some(_) =
+                rewrite_single_line_block(context, "try ", block, Some(&expr.attrs), None, shape)
+            {
                 rw
             } else {
                 // 9 = `try `

But all I did there was change do catch to try, so maybe that was just enough to make the line short enough as a single line now?

@zachlute
Copy link
Contributor Author

zachlute commented Aug 26, 2018

Oh, it dawned on me I probably just need to run rustfmt on my change to fix that test. I'm not very smart.

@zachlute
Copy link
Contributor Author

Apparently running rustfmt changed all the line endings again? For real? This is a comedy of errors.

@zachlute
Copy link
Contributor Author

I don't think the Travis failures are related to this change.

@topecongiro topecongiro merged commit ca19c9a into rust-lang:master Aug 26, 2018
@topecongiro
Copy link
Contributor

Thank you!

@dtolnay
Copy link
Member

dtolnay commented Aug 26, 2018

Could this change be published to crates.io? The most recent version on crates.io does not compile on the most recent nightly.

@nrc
Copy link
Member

nrc commented Aug 26, 2018

Published as nightly 0.99.4

@zachlute zachlute deleted the fix-try-blocks branch August 27, 2018 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants