{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/49560","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/49560/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/49560/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/49560/events","html_url":"https://github.com/rust-lang/rust/issues/49560","id":310332724,"number":49560,"title":"Compiler panics when passing a tuple struct constructor as a function with the wrong number of arguments","user":{"login":"grenewode","id":3177877,"avatar_url":"https://avatars3.githubusercontent.com/u/3177877?v=4","gravatar_id":"","url":"https://api.github.com/users/grenewode","html_url":"https://github.com/grenewode","followers_url":"https://api.github.com/users/grenewode/followers","following_url":"https://api.github.com/users/grenewode/following{/other_user}","gists_url":"https://api.github.com/users/grenewode/gists{/gist_id}","starred_url":"https://api.github.com/users/grenewode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grenewode/subscriptions","organizations_url":"https://api.github.com/users/grenewode/orgs","repos_url":"https://api.github.com/users/grenewode/repos","events_url":"https://api.github.com/users/grenewode/events{/privacy}","received_events_url":"https://api.github.com/users/grenewode/received_events","type":"User","site_admin":false},"labels":[{"id":650731663,"url":"https://api.github.com/repos/rust-lang/rust/labels/C-bug","name":"C-bug","color":"f5f1fd","default":false},{"id":9618520,"url":"https://api.github.com/repos/rust-lang/rust/labels/I-ICE","name":"I-ICE","color":"e10c02","default":false},{"id":203429200,"url":"https://api.github.com/repos/rust-lang/rust/labels/P-high","name":"P-high","color":"eb6420","default":false},{"id":211668100,"url":"https://api.github.com/repos/rust-lang/rust/labels/T-compiler","name":"T-compiler","color":"bfd4f2","default":false},{"id":262252840,"url":"https://api.github.com/repos/rust-lang/rust/labels/regression-from-stable-to-stable","name":"regression-from-stable-to-stable","color":"e4008a","default":false}],"state":"open","locked":false,"assignee":{"login":"estebank","id":1606434,"avatar_url":"https://avatars2.githubusercontent.com/u/1606434?v=4","gravatar_id":"","url":"https://api.github.com/users/estebank","html_url":"https://github.com/estebank","followers_url":"https://api.github.com/users/estebank/followers","following_url":"https://api.github.com/users/estebank/following{/other_user}","gists_url":"https://api.github.com/users/estebank/gists{/gist_id}","starred_url":"https://api.github.com/users/estebank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estebank/subscriptions","organizations_url":"https://api.github.com/users/estebank/orgs","repos_url":"https://api.github.com/users/estebank/repos","events_url":"https://api.github.com/users/estebank/events{/privacy}","received_events_url":"https://api.github.com/users/estebank/received_events","type":"User","site_admin":false},"assignees":[{"login":"estebank","id":1606434,"avatar_url":"https://avatars2.githubusercontent.com/u/1606434?v=4","gravatar_id":"","url":"https://api.github.com/users/estebank","html_url":"https://github.com/estebank","followers_url":"https://api.github.com/users/estebank/followers","following_url":"https://api.github.com/users/estebank/following{/other_user}","gists_url":"https://api.github.com/users/estebank/gists{/gist_id}","starred_url":"https://api.github.com/users/estebank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estebank/subscriptions","organizations_url":"https://api.github.com/users/estebank/orgs","repos_url":"https://api.github.com/users/estebank/repos","events_url":"https://api.github.com/users/estebank/events{/privacy}","received_events_url":"https://api.github.com/users/estebank/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-04-01T15:40:51Z","updated_at":"2018-04-26T14:45:14Z","closed_at":null,"author_association":"NONE","body":"When a tuple struct's constructor is passed to a function as a callback, the compiler panics if the constructor the wrong number of arguments. \r\n\r\nI tried this code:\r\n```rust\r\nfn call<F, R>(_: F)\r\nwhere\r\n    F: FnOnce() -> R,\r\n{\r\n}\r\n\r\nstruct Foo(u8);\r\n\r\nfn main() {\r\n    // Problem is here\r\n    call(Foo);\r\n}\r\n```\r\nOn `1.24.1`, this results in the following error as expected:\r\n```\r\nerror[E0593]: function is expected to take 0 arguments, but it takes 1 argument\r\n  --> main.rs:10:5\r\n   |\r\n7  | struct Foo(u8);\r\n   | --------------- takes 1 argument\r\n...\r\n10 |     call(Foo);\r\n   |     ^^^^ expected function that takes 0 arguments\r\n   |\r\n   = note: required by `call`\r\n\r\nerror: aborting due to previous error\r\n```\r\n\r\nHowever, on 1.25.0, the compiler panics instead:\r\n```\r\nthread 'rustc' panicked at 'non-FnLike node found: NodeStructCtor(Tuple([StructField { span: main.rs:7:12: 7:15, name: 0, vis: Inherited, id: NodeId(17), ty: type(u8), attrs: [] }], NodeId(19)))', librustc/traits/error_reporting.rs:873:18\r\n```\r\nThis may be a duplicate of #47706, although this is occuring on a newer version of the compiler.\r\n\r\n## Meta\r\nThis happens on stable and nightly\r\n`rustc --version --verbose`:\r\n```\r\nrustc 1.25.0 (84203cac6 2018-03-25)\r\nbinary: rustc\r\ncommit-hash: 84203cac67e65ca8640b8392348411098c856985\r\ncommit-date: 2018-03-25\r\nhost: x86_64-unknown-linux-gnu\r\nrelease: 1.25.0\r\nLLVM version: 6.0\r\n```\r\n`rustup run nightly rustc --version --verbose`:\r\n```\r\nrustc 1.26.0-nightly (517f24025 2018-03-31)\r\nbinary: rustc\r\ncommit-hash: 517f24025a04e09936a6d07dc5298ca2b9371329\r\ncommit-date: 2018-03-31\r\nhost: x86_64-unknown-linux-gnu\r\nrelease: 1.26.0-nightly\r\nLLVM version: 6.0\r\n```\r\n\r\n\r\nBacktrace:\r\n```\r\nthread 'rustc' panicked at 'non-FnLike node found: NodeStructCtor(Tuple([StructField { span: main.rs:7:12: 7:15, name: 0, vis: Inherited, id: NodeId(17), ty: type(u8), attrs: [] }], NodeId(19)))', librustc/traits/error_reporting.rs:873:18\r\nnote: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.\r\nstack backtrace:\r\n   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace\r\n             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49\r\n   1: std::sys_common::backtrace::_print\r\n             at libstd/sys_common/backtrace.rs:71\r\n   2: std::panicking::default_hook::{{closure}}\r\n             at libstd/sys_common/backtrace.rs:59\r\n             at libstd/panicking.rs:380\r\n   3: std::panicking::default_hook\r\n             at libstd/panicking.rs:396\r\n   4: std::panicking::rust_panic_with_hook\r\n             at libstd/panicking.rs:576\r\n   5: std::panicking::begin_panic\r\n             at libstd/panicking.rs:537\r\n   6: std::panicking::begin_panic_fmt\r\n             at libstd/panicking.rs:521\r\n   7: rustc::traits::error_reporting::<impl rustc::infer::InferCtxt<'a, 'gcx, 'tcx>>::report_selection_error\r\n   8: rustc::traits::error_reporting::<impl rustc::infer::InferCtxt<'a, 'gcx, 'tcx>>::report_fulfillment_errors\r\n   9: rustc_typeck::check::FnCtxt::select_obligations_where_possible\r\n  10: rustc_typeck::check::FnCtxt::check_argument_types\r\n  11: rustc_typeck::check::callee::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::confirm_builtin_call\r\n  12: rustc_typeck::check::FnCtxt::check_expr_kind\r\n  13: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs\r\n  14: rustc_typeck::check::FnCtxt::check_block_with_expected::{{closure}}\r\n  15: rustc_typeck::check::FnCtxt::check_block_with_expected\r\n  16: rustc_typeck::check::FnCtxt::check_expr_kind\r\n  17: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs\r\n  18: rustc_typeck::check::FnCtxt::check_return_expr\r\n  19: rustc_typeck::check::check_fn\r\n  20: rustc_typeck::check::typeck_tables_of::{{closure}}\r\n  21: rustc_typeck::check::typeck_tables_of\r\n  22: rustc::dep_graph::graph::DepGraph::with_task_impl\r\n  23: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::force\r\n  24: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get\r\n  25: rustc::ty::maps::TyCtxtAt::typeck_tables_of\r\n  26: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::ensure\r\n  27: rustc_typeck::check::typeck_item_bodies\r\n  28: rustc::dep_graph::graph::DepGraph::with_task_impl\r\n  29: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::force\r\n  30: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get\r\n  31: rustc::ty::maps::TyCtxtAt::typeck_item_bodies\r\n  32: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies\r\n  33: rustc_typeck::check_crate\r\n  34: rustc::ty::context::TyCtxt::create_and_enter\r\n  35: rustc_driver::driver::compile_input\r\n  36: rustc_driver::run_compiler\r\n\r\nerror: internal compiler error: unexpected panic\r\n\r\nnote: the compiler unexpectedly panicked. this is a bug.\r\n\r\nnote: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports\r\n\r\nnote: rustc 1.25.0 (84203cac6 2018-03-25) running on x86_64-unknown-linux-gnu\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/384667122","html_url":"https://github.com/rust-lang/rust/issues/49560#issuecomment-384667122","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/49560","id":384667122,"user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars0.githubusercontent.com/u/155238?v=4","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"created_at":"2018-04-26T14:45:13Z","updated_at":"2018-04-26T14:45:13Z","author_association":"CONTRIBUTOR","body":"I'm going to optimistically assign @estebank -- but feel free to tell me it's not his fault. It may be mine, I touched some code there too. Mostly waiting on a bisection. \r\n\r\n@grenewode if you are able to give https://github.com/rust-lang-nursery/cargo-bisect-rustc a try, that'd be great.\r\n\r\ncc @rust-lang/release, otherwise."}}
{"actor":{"display_login":"nikomatsakis"}}