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

AST/HIR: Introduce ExprKind::Err for better error recovery in the front-end #56999

Merged
merged 7 commits into from
Dec 28, 2018

Conversation

petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Dec 20, 2018

This way we can avoid aborting compilation if expansion produces errors and generate ExprKind::Errs instead.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 20, 2018
Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool!

CC #48724

src/libsyntax/parse/parser.rs Show resolved Hide resolved
src/libsyntax/print/pprust.rs Show resolved Hide resolved
--> $DIR/issue-40396.rs:12:21
|
LL | (0..13).collect<Vec<i32>>();
| ^^^ did you mean `Vec { /* fields */ }`?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallout on this case is a bit unfortunate.

In my ideal world we would use something similar to #53578 to parse missing the turbofish and avoid all of these errors, but that's not gonna happen anytime soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty bad, but not actually a fallout from this PR.
(0..13).collect<Vec<i32>>() outside of macros already produced this.
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=0be590d180bad8cbea3789d5e7d2e269

src/test/ui/issues/issue-10536.stderr Show resolved Hide resolved
src/test/ui/issues/issue-6596-1.stderr Outdated Show resolved Hide resolved
src/librustc_resolve/macros.rs Outdated Show resolved Hide resolved
src/libsyntax/feature_gate.rs Show resolved Hide resolved
@rust-highfive

This comment has been minimized.

@petrochenkov petrochenkov force-pushed the macrecov2 branch 2 times, most recently from 737a178 to 4a6aa36 Compare December 21, 2018 00:00
@petrochenkov
Copy link
Contributor Author

Updated with test fixes and one new commit making sure that all feature-gate errors are recoverable.

@estebank
Copy link
Contributor

r=me once travis is happy

@petrochenkov
Copy link
Contributor Author

@bors r=estebank

@bors
Copy link
Contributor

bors commented Dec 21, 2018

📌 Commit 4a6aa36 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 21, 2018
Centril added a commit to Centril/rust that referenced this pull request Dec 22, 2018
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end

This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
Centril added a commit to Centril/rust that referenced this pull request Dec 23, 2018
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end

This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
bors added a commit that referenced this pull request Dec 23, 2018
Rollup of 10 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #56999 (AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)

Failed merges:

r? @ghost
@Centril
Copy link
Contributor

Centril commented Dec 23, 2018

This PR failed in a rollup: #57075 (comment)

@pietroalbini
Copy link
Member

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 24, 2018
@bors
Copy link
Contributor

bors commented Dec 26, 2018

☔ The latest upstream changes (presumably #57108) made this pull request unmergeable. Please resolve the merge conflicts.

@petrochenkov petrochenkov force-pushed the macrecov2 branch 2 times, most recently from 9ed057f to fdde6df Compare December 27, 2018 00:13
@petrochenkov
Copy link
Contributor Author

@bors r=estebank

@bors
Copy link
Contributor

bors commented Dec 27, 2018

📌 Commit fdde6df45855155510ca567b28dc37233bab9773 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 27, 2018
@bors
Copy link
Contributor

bors commented Dec 27, 2018

⌛ Testing commit fdde6df45855155510ca567b28dc37233bab9773 with merge 220af3d83594be55382de515730c07d9067c41d0...

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 27, 2018
@bors
Copy link
Contributor

bors commented Dec 27, 2018

⌛ Testing commit 994215781986afb842e4690592859e68a60092ca with merge 3e5056f704e1e533995af5aef6564c43876feba3...

@bors
Copy link
Contributor

bors commented Dec 27, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 27, 2018
@rust-highfive
Copy link
Collaborator

The job wasm32-unknown of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:55:58] 
[00:55:58] ---- [ui] ui/macros/macro-comma-behavior.rs#core stdout ----
[00:55:58] diff of stderr:
[00:55:58] 
[00:55:58] 40 LL |             write!(f, "{}",)?;
[00:55:58] 42 
[00:55:58] 42 
[00:55:58] - error: language item required, but not found: `eh_personality`
[00:55:58] - error: aborting due to 8 previous errors
[00:55:58] + error: aborting due to 7 previous errors
[00:55:58] 46 
[00:55:58] 47 
[00:55:58] 47 
[00:55:58] 
[00:55:58] 
[00:55:58] The actual stderr differed from the expected stderr.
[00:55:58] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-behavior.core/macro-comma-behavior.core.stderr
[00:55:58] To update references, rerun the tests and pass the `--bless` flag
[00:55:58] To only update this specific test, also pass `--test-args macros/macro-comma-behavior.rs`
[00:55:58] 
[00:55:58] error in revision `core`: 1 errors occurred comparing output.
[00:55:58] status: exit code: 1
[00:55:58] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/macros/macro-comma-behavior.rs" "--target=wasm32-unknown-unknown" "--cfg" "core" "--error-format" "json" "-Zui-testing" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-behavior.core/a.wasm" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-C" "debug_assertions=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/macro-comma-behavior.core/auxiliary" "-A" "unused"
[00:55:58] ------------------------------------------
[00:55:58] 
[00:55:58] ------------------------------------------
[00:55:58] stderr:
[00:55:58] stderr:
[00:55:58] ------------------------------------------
[00:55:58] {"message":"1 positional argument in format string, but no arguments were given","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":577,"byte_end":579,"line_start":20,"line_end":20,"column_start":23,"column_end":25,"is_primary":true,"text":[{"text":"    assert_eq!(1, 1, \"{}\",);","highlight_start":23,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::core::macros::assert_eq macros>","byte_start":626,"byte_end":657,"line_start":21,"line_end":21,"column_start":24,"column_end":55,"is_primary":false,"text":[{"text":"left_val , right_val , format_args ! ( $ ( $ arg ) + ) ) } } } } ) ;","highlight_start":24,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":559,"byte_end":583,"line_start":20,"line_end":20,"column_start":5,"column_end":29,"is_primary":false,"text":[{"text":"    assert_eq!(1, 1, \"{}\",);","highlight_start":5,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"assert_eq!","def_site_span":{"file_name":"<::core::macros::assert_eq macros>","byte_start":0,"byte_end":671,"line_start":1,"line_end":21,"column_start":1,"column_end":69,"is_primary":false,"text":[{"text":"( $ left : expr , $ right : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"match ( & $ left , & $ right ) {","highlight_start":1,"highlight_end":33},{"text":"( left_val , right_val ) => {","highlight_start":1,"highlight_end":30},{"text":"if ! ( * left_val == * right_val ) {","highlight_start":1,"highlight_end":37},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"r#\"assertion failed: `(left == right)`","highlight_start":1,"highlight_end":39},{"text":"  left: `{:?}`,","highlight_start":1,"highlight_end":16},{"text":" right: `{:?}`\"# ,","highlight_start":1,"highlight_end":19},{"text":"left_val , right_val ) } } } } ) ; ( $ left : expr , $ right : expr , ) => (","highlight_start":1,"highlight_end":77},{"text":"{ assert_eq ! ( $ left , $ right ) } ) ; (","highlight_start":1,"highlight_end":43},{"text":"$ left : expr , $ right : expr , $ ( $ arg : tt ) + ) => (","highlight_start":1,"highlight_end":59},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"match ( & ( $ left ) , & ( $ right ) ) {","highlight_start":1,"highlight_end":41},{"text":"( left_val , right_val ) => {","highlight_start":1,"highlight_end":30},{"text":"if ! ( * left_val == * right_val ) {","highlight_start":1,"highlight_end":37},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"r#\"assertion failed: `(left == right)`","highlight_start":1,"highlight_end":39},{"text":"  left: `{:?}`,","highlight_start":1,"highlight_end":16},{"text":" right: `{:?}`: {}\"# ,","highlight_start":1,"highlight_end":23},{"text":"left_val , right_val , format_args ! ( $ ( $ arg ) + ) ) } } } } ) ;","highlight_start":1,"highlight_end":69}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"format_args!","def_site_span":null}}],"children":[],"rendered":"error: 1 positional argument in format string, but no arguments were given\n  --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:20:23\n   |\nLL |     assert_eq!(1, 1, \"{}\",);\n   |                       ^^\n\n"}
[00:55:58] {"message":"1 positional argument in format string, but no arguments were given","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":674,"byte_end":676,"line_start":23,"line_end":23,"column_start":23,"column_end":25,"is_primary":true,"text":[{"text":"    assert_ne!(1, 2, \"{}\",);","highlight_start":23,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::core::macros::assert_ne macros>","byte_start":610,"byte_end":641,"line_start":21,"line_end":21,"column_start":24,"column_end":55,"is_primary":false,"text":[{"text":"left_val , right_val , format_args ! ( $ ( $ arg ) + ) ) } } } } ) ;","highlight_start":24,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":656,"byte_end":680,"line_start":23,"line_end":23,"column_start":5,"column_end":29,"is_primary":false,"text":[{"text":"    assert_ne!(1, 2, \"{}\",);","highlight_start":5,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"assert_ne!","def_site_span":{"file_name":"<::core::macros::assert_ne macros>","byte_start":0,"byte_end":655,"line_start":1,"line_end":21,"column_start":1,"column_end":69,"is_primary":false,"text":[{"text":"( $ left : expr , $ right : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"match ( & $ left , & $ right ) {","highlight_start":1,"highlight_end":33},{"text":"( left_val , right_val ) => {","highlight_start":1,"highlight_end":30},{"text":"if * left_val == * right_val {","highlight_start":1,"highlight_end":31},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"r#\"assertion failed: `(left != right)`","highlight_start":1,"highlight_end":39},{"text":"  left: `{:?}`,","highlight_start":1,"highlight_end":16},{"text":" right: `{:?}`\"# ,","highlight_start":1,"highlight_end":19},{"text":"left_val , right_val ) } } } } ) ; ( $ left : expr , $ right : expr , ) => {","highlight_start":1,"highlight_end":77},{"text":"assert_ne ! ( $ left , $ right ) } ; (","highlight_start":1,"highlight_end":39},{"text":"$ left : expr , $ right : expr , $ ( $ arg : tt ) + ) => (","highlight_start":1,"highlight_end":59},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"match ( & ( $ left ) , & ( $ right ) ) {","highlight_start":1,"highlight_end":41},{"text":"( left_val , right_val ) => {","highlight_start":1,"highlight_end":30},{"text":"if * left_val == * right_val {","highlight_start":1,"highlight_end":31},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"r#\"assertion failed: `(left != right)`","highlight_start":1,"highlight_end":39},{"text":"  left: `{:?}`,","highlight_start":1,"highlight_end":16},{"text":" right: `{:?}`: {}\"# ,","highlight_start":1,"highlight_end":23},{"text":"left_val , right_val , format_args ! ( $ ( $ arg ) + ) ) } } } } ) ;","highlight_start":1,"highlight_end":69}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"format_args!","def_site_span":null}}],"children":[],"rendered":"error: 1 positional argument in format string, but no arguments were given\n  --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:23:23\n   |\nLL |     assert_ne!(1, 2, \"{}\",);\n   |                       ^^\n\n"}
[00:55:58] {"message":"1 positional argument in format string, but no arguments were given","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":830,"byte_end":832,"line_start":29,"line_end":29,"column_start":29,"column_end":31,"is_primary":true,"text":[{"text":"    debug_assert_eq!(1, 1, \"{}\",);","highlight_start":29,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::core::macros::assert_eq macros>","byte_start":626,"byte_end":657,"line_start":21,"line_end":21,"column_start":24,"column_end":55,"is_primary":false,"text":[{"text":"left_val , right_val , format_args ! ( $ ( $ arg ) + ) ) } } } } ) ;","highlight_start":24,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::core::macros::debug_assert_eq macros>","byte_start":60,"byte_end":91,"line_start":2,"line_end":2,"column_start":33,"column_end":64,"is_primary":false,"text":[{"text":"if cfg ! ( debug_assertions ) { assert_eq ! ( $ ( $ arg ) * ) ; } )","highlight_start":33,"highlight_end":64}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":806,"byte_end":836,"line_start":29,"line_end":29,"column_start":5,"column_end":35,"is_primary":false,"text":[{"text":"    debug_assert_eq!(1, 1, \"{}\",);","highlight_start":5,"highlight_end":35}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"debug_assert_eq!","def_site_span":{"file_name":"<::core::macros::debug_assert_eq macros>","byte_start":0,"byte_end":95,"line_start":1,"line_end":2,"column_start":1,"column_end":68,"is_primary":false,"text":[{"text":"( $ ( $ arg : tt ) * ) => (","highlight_start":1,"highlight_end":28},{"text":"if cfg ! ( debug_assertions ) { assert_eq ! ( $ ( $ arg ) * ) ; } )","highlight_start":1,"highlight_end":68}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"assert_eq!","def_site_span":{"file_name":"<::core::macros::assert_eq macros>","byte_start":0,"byte_end":671,"line_start":1,"line_end":21,"column_start":1,"column_end":69,"is_primary":false,"text":[{"text":"( $ left : expr , $ right : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"match ( & $ left , & $ right ) {","highlight_start":1,"highlight_end":33},{"text":"( left_val , right_val ) => {","highlight_start":1,"highlight_end":30},{"text":"if ! ( * left_val == * right_val ) {","highlight_start":1,"highlight_end":37},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"r#\"assertion failed: `(left == right)`","highlight_start":1,"highlight_end":39},{"text":"  left: `{:?}`,","highlight_start":1,"highlight_end":16},{"text":" right: `{:?}`\"# ,","highlight_start":1,"highlight_end":19},{"text":"left_val , right_val ) } } } } ) ; ( $ left : expr , $ right : expr , ) => (","highlight_start":1,"highlight_end":77},{"text":"{ assert_eq ! ( $ left , $ right ) } ) ; (","highlight_start":1,"highlight_end":43},{"text":"$ left : expr , $ right : expr , $ ( $ arg : tt ) + ) => (","highlight_start":1,"highlight_end":59},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"match ( & ( $ left ) , & ( $ right ) ) {","highlight_start":1,"highlight_end":41},{"text":"( left_val , right_val ) => {","highlight_start":1,"highlight_end":30},{"text":"if ! ( * left_val == * right_val ) {","highlight_start":1,"highlight_end":37},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"r#\"assertion failed: `(left == right)`","highlight_start":1,"highlight_end":39},{"text":"  left: `{:?}`,","highlight_start":1,"highlight_end":16},{"text":" right: `{:?}`: {}\"# ,","highlight_start":1,"highlight_end":23},{"text":"left_val , right_val , format_args ! ( $ ( $ arg ) + ) ) } } } } ) ;","highlight_start":1,"highlight_end":69}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"format_args!","def_site_span":null}}],"children":[],"rendered":"error: 1 positional argument in format string, but no arguments were given\n  --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:29:29\n   |\nLL |     debug_assert_eq!(1, 1, \"{}\",);\n   |                             ^^\n\n"}
[00:55:58] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:495:22
[00:55:58] {"message":"1 positional argument in format string, but no arguments were given","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":933,"byte_end":935,"line_start":32,"line_end":32,"column_start":29,"column_end":31,"is_primary":true,"text":[{"text":"    debug_assert_ne!(1, 2, \"{}\",);","highlight_start":29,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::core::macros::assert_ne macros>","byte_start":610,"byte_end":641,"line_start":21,"line_end":21,"column_start":24,"column_end":55,"is_primary":false,"text":[{"text":"left_val , right_val , format_args ! ( $ ( $ arg ) + ) ) } } } } ) ;","highlight_start":24,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::core::macros::debug_assert_ne macros>","byte_start":60,"byte_end":91,"line_start":2,"line_end":2,"column_start":33,"column_end":64,"is_primary":false,"text":[{"text":"if cfg ! ( debug_assertions ) { assert_ne ! ( $ ( $ arg ) * ) ; } )","highlight_start":33,"highlight_end":64}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":909,"byte_end":939,"line_start":32,"line_end":32,"column_start":5,"column_end":35,"is_primary":false,"text":[{"text":"    debug_assert_ne!(1, 2, \"{}\",);","highlight_start":5,"highlight_end":35}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"debug_assert_ne!","def_site_span":{"file_name":"<::core::macros::debug_assert_ne macros>","byte_start":0,"byte_end":95,"line_start":1,"line_end":2,"column_start":1,"column_end":68,"is_primary":false,"text":[{"text":"( $ ( $ arg : tt ) * ) => (","highlight_start":1,"highlight_end":28},{"text":"if cfg ! ( debug_assertions ) { assert_ne ! ( $ ( $ arg ) * ) ; } )","highlight_start":1,"highlight_end":68}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"assert_ne!","def_site_span":{"file_name":"<::core::macros::assert_ne macros>","byte_start":0,"byte_end":655,"line_start":1,"line_end":21,"column_start":1,"column_end":69,"is_primary":false,"text":[{"text":"( $ left : expr , $ right : expr ) => (","highlight_start":1,"highlight_end":40},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"match ( & $ left , & $ right ) {","highlight_start":1,"highlight_end":33},{"text":"( left_val , right_val ) => {","highlight_start":1,"highlight_end":30},{"text":"if * left_val == * right_val {","highlight_start":1,"highlight_end":31},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"r#\"assertion failed: `(left != right)`","highlight_start":1,"highlight_end":39},{"text":"  left: `{:?}`,","highlight_start":1,"highlight_end":16},{"text":" right: `{:?}`\"# ,","highlight_start":1,"highlight_end":19},{"text":"left_val , right_val ) } } } } ) ; ( $ left : expr , $ right : expr , ) => {","highlight_start":1,"highlight_end":77},{"text":"assert_ne ! ( $ left , $ right ) } ; (","highlight_start":1,"highlight_end":39},{"text":"$ left : expr , $ right : expr , $ ( $ arg : tt ) + ) => (","highlight_start":1,"highlight_end":59},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"match ( & ( $ left ) , & ( $ right ) ) {","highlight_start":1,"highlight_end":41},{"text":"( left_val , right_val ) => {","highlight_start":1,"highlight_end":30},{"text":"if * left_val == * right_val {","highlight_start":1,"highlight_end":31},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"r#\"assertion failed: `(left != right)`","highlight_start":1,"highlight_end":39},{"text":"  left: `{:?}`,","highlight_start":1,"highlight_end":16},{"text":" right: `{:?}`: {}\"# ,","highlight_start":1,"highlight_end":23},{"text":"left_val , right_val , format_args ! ( $ ( $ arg ) + ) ) } } } } ) ;","highlight_start":1,"highlight_end":69}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"format_args!","def_site_span":null}}],"children":[],"rendered":"error: 1 positional argument in format string, but no arguments were given\n  --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:32:29\n   |\nLL |     debug_assert_ne!(1, 2, \"{}\",);\n   |                             ^^\n\n"}
[00:55:58] {"message":"1 positional argument in format string, but no arguments were given","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":1420,"byte_end":1422,"line_start":53,"line_end":53,"column_start":19,"column_end":21,"is_primary":true,"text":[{"text":"    format_args!(\"{}\",);","highlight_start":19,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":1406,"byte_end":1426,"line_start":53,"line_end":53,"column_start":5,"column_end":25,"is_primary":false,"text":[{"text":"    format_args!(\"{}\",);","highlight_start":5,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"format_args!","def_site_span":null}}],"children":[],"rendered":"error: 1 positional argument in format string, but no arguments were given\n  --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:53:19\n   |\nLL |     format_args!(\"{}\",);\n   |                   ^^\n\n"}
[00:55:58] {"message":"1 positional argument in format string, but no arguments were given","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":1876,"byte_end":1878,"line_start":71,"line_end":71,"column_start":21,"column_end":23,"is_primary":true,"text":[{"text":"    unimplemented!(\"{}\",);","highlight_start":21,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::core::macros::unimplemented macros>","byte_start":114,"byte_end":145,"line_start":2,"line_end":2,"column_start":39,"column_end":70,"is_primary":false,"text":[{"text":"panic ! ( \"not yet implemented: {}\" , format_args ! ( $ ( $ arg ) * ) ) ) ;","highlight_start":39,"highlight_end":70}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":1860,"byte_end":1882,"line_start":71,"line_end":71,"column_start":5,"column_end":27,"is_primary":false,"text":[{"text":"    unimplemented!(\"{}\",);","highlight_start":5,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"unimplemented!","def_site_span":{"file_name":"<::core::macros::unimplemented macros>","byte_start":0,"byte_end":151,"line_start":1,"line_end":2,"column_start":1,"column_end":76,"is_primary":false,"text":[{"text":"(  ) => ( panic ! ( \"not yet implemented\" ) ) ; ( $ ( $ arg : tt ) + ) => (","highlight_start":1,"highlight_end":76},{"text":"panic ! ( \"not yet implemented: {}\" , format_args ! ( $ ( $ arg ) * ) ) ) ;","highlight_start":1,"highlight_end":76}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"format_args!","def_site_span":null}}],"children":[],"rendered":"error: 1 positional argument in format string, but no arguments were given\n  --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:71:21\n   |\nLL |     unimplemented!(\"{}\",);\n   |                     ^^\n\n"}
[00:55:58] {"message":"1 positional argument in format string, but no arguments were given","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":2143,"byte_end":2145,"line_start":80,"line_end":80,"column_start":24,"column_end":26,"is_primary":true,"text":[{"text":"            write!(f, \"{}\",)?;","highlight_start":24,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"<::core::macros::write macros>","byte_start":63,"byte_end":94,"line_start":2,"line_end":2,"column_start":21,"column_end":52,"is_primary":false,"text":[{"text":"$ dst . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) )","highlight_start":21,"highlight_end":52}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/macros/macro-comma-behavior.rs","byte_start":2132,"byte_end":2148,"line_start":80,"line_end":80,"column_start":13,"column_end":29,"is_primary":false,"text":[{"text":"            write!(f, \"{}\",)?;","highlight_start":13,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"write!","def_site_span":{"file_name":"<::core::macros::write macros>","byte_start":0,"byte_end":98,"line_start":1,"line_end":2,"column_start":1,"column_end":56,"is_primary":false,"text":[{"text":"( $ dst : expr , $ ( $ arg : tt ) * ) => (","highlight_start":1,"highlight_end":43},{"text":"$ dst . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) )","highlight_start":1,"highlight_end":56}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"format_args!","def_site_span":null}}],"children":[],"rendered":"error: 1 positional argument in format string, but no arguments were given\n  --> /checkout/src/test/ui/macros/macro-comma-behavior.rs:80:24\n   |\nLL |             write!(f, \"{}\",)?;\n   |                        ^^\n\n"}
[00:55:58] {"message":"aborting due to 7 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 7 previous errors\n\n"}
[00:55:58] ------------------------------------------
[00:55:58] 
[00:55:58] thread '[ui] ui/macros/macro-comma-behavior.rs#core' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3245:9
[00:55:58] 
---
[00:55:58] test result: FAILED. 5141 passed; 1 failed; 57 ignored; 0 measured; 0 filtered out
[00:55:58] 
[00:55:58] 
[00:55:58] 
[00:55:58] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-wasm32-unknown-unknown" "--mode" "ui" "--target" "wasm32-unknown-unknown" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/node-v9.2.0-linux-x64/bin/node" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0svn\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:55:58] 
[00:55:58] 
[00:55:58] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-unknown src/test/run-make src/test/ui src/test/run-pass src/test/compile-fail src/test/mir-opt src/test/codegen-units src/libcore
[00:55:58] Build completed unsuccessfully in 0:54:02
---
travis_time:end:045d45f8:start=1545888620616685002,finish=1545888620636834473,duration=20149471
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:11f016d5
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:241f0292
travis_time:start:241f0292
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:091b9704
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@petrochenkov
Copy link
Contributor Author

@bors r=estebank

@bors
Copy link
Contributor

bors commented Dec 27, 2018

📌 Commit bc16ede has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 27, 2018
@bors
Copy link
Contributor

bors commented Dec 27, 2018

⌛ Testing commit bc16ede with merge f8caa32...

bors added a commit that referenced this pull request Dec 27, 2018
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end

This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
@bors
Copy link
Contributor

bors commented Dec 28, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: estebank
Pushing f8caa32 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants