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

Remove most of PartialEq and Hash impls from AST and HIR structures #51829

Merged
merged 4 commits into from
Jul 14, 2018

Conversation

petrochenkov
Copy link
Contributor

Continuation of #49326, prerequisite for removing PartialEq for Ident.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

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

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned nikomatsakis Jun 26, 2018
@petrochenkov
Copy link
Contributor Author

A bit of a policy question - what to do with Eq impls?

  • Add them only when required (the less code the better) (this is what this PR does currently).
  • Always add them (if technically possible) if PartialEq is implemented (so if rusfmt or rustdoc suddenly need to put something in a map, then you don't have to send a PR to rustc).

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 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.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/ba/32/d6d254f6ccc2ed21f02d81f38709ff06feca9cbdb2e68ea90635fa483a73/awscli-1.15.46-py2.py3-none-any.whl (1.3MB)
    0% |▎                               | 10kB 7.6MB/s eta 0:00:01
    1% |▌                               | 20kB 1.7MB/s eta 0:00:01
    2% |▊                               | 30kB 2.1MB/s eta 0:00:01
    3% |█                               | 40kB 1.9MB/s eta 0:00:01
---
[01:33:11] travis_fold:start:test_stage1-syntax_ext
travis_time:start:test_stage1-syntax_ext
Testing syntax_ext stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:33:11]    Compiling syntax_ext v0.0.0 (file:///checkout/src/libsyntax_ext)
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:606:13
[01:33:13]     |
[01:33:13] 606 |             assert_eq!(pns("has no escapes"), None);
[01:33:13]     |
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:607:13
[01:33:13]     |
[01:33:13] 607 |             assert_eq!(pns("has no escapes, either %"), None);
[01:33:13]     |
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:638:13
[01:33:13]     |
[01:33:13] 638 | /             assert_pns_eq_sub!("%!",
[01:33:13] 639 | |                 { None, "", None, None, None, "!", });
[01:33:13]     | |______________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:642:13
[01:33:13]     |
[01:33:13]     |
[01:33:13] 642 | /             assert_pns_eq_sub!("%s",
[01:33:13] 643 | |                 { None, "", None, None, None, "s", });
[01:33:13]     | |______________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:644:13
[01:33:13]     |
[01:33:13] 644 | /             assert_pns_eq_sub!("%06d",
[01:33:13] 645 | |                 { None, "0", Some(N::Num(6)), None, None, "d", });
[01:33:13]     | |__________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:646:13
[01:33:13]     |
[01:33:13] 646 | /             assert_pns_eq_sub!("%4.2f",
[01:33:13] 647 | |                 { None, "", Some(N::Num(4)), Some(N::Num(2)), None, "f", });
[01:33:13]     | |____________________________________________________________________________^ in this macro invocation
[01:33:13] he current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:650:13
[01:33:13]     |
[01:33:13] 650 | /             assert_pns_eq_sub!("%-10s",
[01:33:13] 651 | |                 { None, "-", Some(N::Num(10)), None, None, "s", });
[01:33:13]     | |___________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:652:13
[01:33:13]     |
[01:33:13] 652 | /             assert_pns_eq_sub!("%*s",
[01:33:13] 653 | |                 { None, "", Some(N::Next), None, None, "s", });
[01:33:13]     | |_______________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:654:13
[01:33:13]     |
[01:33:13] 654 | /             assert_pns_eq_sub!("%-10.*s",
[01:33:13] 655 | |                 { None, "-", Some(N::Num(10)), Some(N::Next), None, "s", });
[01:33:13]     | |____________________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:656:13
[01:33:13]     |
[01:33:13] 656 | /             assert_pns_eq_sub!("%-*.*s",
[01:33:13] 657 | |                 { None, "-", Some(N::Next), Some(N::Next), None, "s", });
[01:33:13]     | |_________________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:658:13
[01:33:13]     |
[01:33:13] 658 | /             assert_pns_eq_sub!("%.6i",
[01:33:13] 659 | |                 { None, "", None, Some(N::Num(6)), None, "i", });
[01:33:13]     | |_________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:660:13
[01:33:13]     |
[01:33:13] 660 | /             assert_pns_eq_sub!("%+i",
[01:33:13] 661 | |                 { None, "+", None, None, None, "i", });
[01:33:13]     | |_______________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:662:13
[01:33:13]     |
[01:33:13] 662 | /             assert_pns_eq_sub!("%08X",
[01:33:13] 663 | |                 { None, "0", Some(N::Num(8)), None, None, "X", });
[01:33:13]     | |__________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:664:13
[01:33:13]     |
[01:33:13] 664 | /             assert_pns_eq_sub!("%lu",
[01:33:13] 665 | |                 { None, "", None, None, Some("l"), "u", });
[01:33:13]     | |___________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:666:13
[01:33:13]     |
[01:33:13] 666 | /             assert_pns_eq_sub!("%Iu",
[01:33:13] 667 | |                 { None, "", None, None, Some("I"), "u", });
[01:33:13]     | |___________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:668:13
[01:33:13]     |
[01:33:13] 668 | /             assert_pns_eq_sub!("%I32u",
[01:33:13] 669 | |                 { None, "", None, None, Some("I32"), "u", });
[01:33:13]     | |_____________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:670:13
[01:33:13]     |
[01:33:13] 670 | /             assert_pns_eq_sub!("%I64u",
[01:33:13] 671 | |                 { None, "", None, None, Some("I64"), "u", });
[01:33:13]     | |_____________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:672:13
[01:33:13]     |
[01:33:13] 672 | /             assert_pns_eq_sub!("%'d",
[01:33:13] 673 | |                 { None, "'", None, None, None, "d", });
[01:33:13]     | |_______________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:674:13
[01:33:13]     |
[01:33:13] 674 | /             assert_pns_eq_sub!("%10s",
[01:33:13] 675 | |                 { None, "", Some(N::Num(10)), None, None, "s", });
[01:33:13]     | |__________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:676:13
[01:33:13]     |
[01:33:13] 676 | /             assert_pns_eq_sub!("%-10.10s",
[01:33:13] 677 | |                 { None, "-", Some(N::Num(10)), Some(N::Num(10)), None, "s", });
[01:33:13]     | |_______________________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementati 682 | /             assert_pns_eq_sub!("%1$*2$.*3$d",
[01:33:13] 683 | |                 { Some(1), "", Some(N::Arg(2)), Some(N::Arg(3)), None, "d", });
[01:33:13]     | |_______________________________________________________________________________^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::printf::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:684:13
[01:33:13]     |
[01:33:13] 684 | /             assert_pns_eq_sub!("%-8ld",
[01:33:13] 685 | |                 { None, "-", Some(N::Num(8)), None, Some("lrrent crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:870:13
[01:33:13]     |
[01:33:13] 870 |             assert_eq!(pns("has no escapes, either $"), None);
[01:33:13]     |
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:871:13
[01:33:13]     |
[01:33:13] 871 |             assert_eq!(pns("*so* has a $$ escape"), Some((S::Escape, " escape")));
[01:33:13]     |
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:872:13
[01:33:13]     |
[01:33:13] 872 |             assert_eq!(pns("$$ leading escape"), Some((S::Escape, " leading escape")));
[01:33:13]     |
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:873:13
[01:33:13]     |
[01:33:13] 873 |             assert_eq!(pns("trailing escape $$"), Some((S::Escape, "")));
[01:33:13]     |
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:884:13
[01:33:13]     |
[01:33:13] 884 |             assert_pns_eq_sub!("$0", Ordinal(0));
[01:33:13]     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:885:13
[01:33:13]     |
[01:33:13] 885 |             assert_pns_eq_sub!("$1", Ordinal(1));
[01:33:13]     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:886:13
[01:33:13]     |
[01:33:13] 886 |             assert_pns_eq_sub!("$9", Ordinal(9));
[01:33:13]     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation
[01:33:13]     |
[01:33:13]     = note: an implementation of `std::cmp::PartialEq` might be missing for `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13] 
[01:33:13] 
[01:33:13] error[E0369]: binary operation `==` cannot be applied to type `std::option::Option<(format_foreign::shell::Substitution<'_>, &str)>`
[01:33:13]    --> libsyntax_ext/format_foreign.rs:887:13
[01:33:13]     |
[01:33:13] 887 |      [0mnote: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[01:33:13] error: aborting due to 39 previous errors
[01:33:13] 
[01:33:13] For more information about this error, try `rustc --explain E0369`.
[01:33:13] error: Could not compile `syntax_ext`.
[01:33:13] error: Could not compile `syntax_ext`.
[01:33:13] 
[01:33:13] To learn more, run the command again with --verbose.
[01:33:13] 
[01:33:13] 
[01:33:13] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "-p" "syntax_ext" "--" "--quiet"
[01:33:13] 
[01:33:13] 
[01:33:13] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:33:13] Build completed unsuccessfully in 0:44:42
[01:33:13] Build completed unsuccessfully in 0:44:42
[01:33:13] Makefile:58: recipe for target 'check' failed
[01:33:13] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:15e7dc26
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@@ -1922,7 +1922,7 @@ impl<'a> LoweringContext<'a> {
variadic: decl.variadic,
has_implicit_self: decl.inputs.get(0).map_or(false, |arg| match arg.ty.node {
TyKind::ImplicitSelf => true,
TyKind::Rptr(_, ref mt) => mt.ty.node == TyKind::ImplicitSelf,
TyKind::Rptr(_, ref mt) => mt.ty.node.is_implicit_self(),
Copy link
Member

@eddyb eddyb Jun 27, 2018

Choose a reason for hiding this comment

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

I think this should just use an inline match - since it's really the TyKind::ImplicitSelf => true, line above, applied to the pointee of the reference.
Nevermind, it's used at least twice.

attr.id.hash(hasher);
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Are these impls... even used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes :(
Rustdoc keeps things like full types in sets/maps for whatever reasons (see e.g. fn make_final_bounds). I don't want to touch that code.
cc @QuietMisdreavus

@@ -1841,6 +1866,8 @@ pub enum GenericParamDefKind {
},
}

impl Eq for GenericParamDefKind {}
Copy link
Member

Choose a reason for hiding this comment

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

What's up with these? Can they be avoided? Wait this is rustdoc, huh.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I just forgot to add Eq impl for hir::SyntheticTyParamKind and didn't want to recompile everything starting with rustc (will fix).
This is very much relevant to #51829 (comment) though.

@@ -84,7 +84,7 @@ impl<

impl<
K: Decodable + PartialEq + Ord,
V: Decodable + PartialEq
V: Decodable
> Decodable for BTreeMap<K, V> {
Copy link
Member

Choose a reason for hiding this comment

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

🤣

pub fn is_implicit_self(&self) -> bool {
if let TyKind::ImplicitSelf = *self { true } else { false }
}
pub(crate) fn is_empty_tuple(&self) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

I'd call this is_unit.

@eddyb
Copy link
Member

eddyb commented Jun 28, 2018

cc @rust-lang/compiler @rust-lang/dev-tools on #51829 (comment)

@nikomatsakis
Copy link
Contributor

I don't really have a strong opinion about when to derive Eq -- I tend to just add it whenever I do PartialEq, but it seems ok not to do so as well.

@nrc
Copy link
Member

nrc commented Jun 29, 2018

rustdoc is in the repo, so 'as needed' should cover that. Rustfmt typically does not do much with nodes other than passing them around by reference, so I'm pretty sure it will be ok. Would be great if you could test building rustfmt before landing, but if not we'll catch it when we try and update rustc_ap_syntax and can put back any necessary impls/derives.

@bors
Copy link
Contributor

bors commented Jun 30, 2018

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

pub enum VisibilityKind {
Public,
Crate(CrateSugar),
Restricted { path: P<Path>, id: NodeId },
Inherited,
}

impl VisibilityKind {
pub fn is_public(&self) -> bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FIXME: Rename to is_pub for compatibility with #51866.

@petrochenkov petrochenkov 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 1, 2018
@petrochenkov
Copy link
Contributor Author

@eddyb
Rebased, comments addressed.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 7, 2018
@bors
Copy link
Contributor

bors commented Jul 10, 2018

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

@eddyb
Copy link
Member

eddyb commented Jul 13, 2018

r=me, sorry for not saying this earlier

@rust-highfive
Copy link
Collaborator

The job dist-x86_64-netbsd 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.
[01:11:56] rustc exited with signal: 11
[01:11:56] error: Could not compile `rustc_codegen_llvm`.
[01:11:56] 
[01:11:56] Caused by:
[01:11:56]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_codegen_llvm librustc_codegen_llvm/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 --cfg feature="jemalloc" --cfg feature="rustc_target" -C metadata=e13747a0333e79cd -C extra-filename=-e13747a0333e79cd --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-5fdb96b18119744c.rlib --extern cc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libcc-0fa0588f1c4412f5.rlib --extern env_logger=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libenv_logger-895acd162c7c6552.rlib --extern flate2=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libflate2-62c67455b3319651.rlib --extern jobserver=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libjobserver-cd1507cdc2ba255a.rlib --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblibc-b06ca4d7515cc070.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-f4c6ca12c55cd938.rlib --extern num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libnum_cpus-1513440731e90940.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-a064f5f4e13b8c1d.so --extern rustc_demangle=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_demangle-5c04b6300494bc09.rlib --extern rustc_allocator=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_allocator-236e74b289f15265.so --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-bd66201c87c6792c.rlib --extern rustc_codegen_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_codegen_utils-37faab1b31eecbba.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-4de5b04ad8537345.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-8100b926b94dbf60.so --extern rustc_incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_incremental-68d160adb2df29c3.so --extern rustc_llvm=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_llvm-5d9d07b86cb623bf.rlib --extern rustc_mir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_mir-db6c274d71aca6a2.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-09130fa2a2fe1101.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-5fdc9ff03f0e244b.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-54cc3d2ef16bda3d.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-54cc3d2ef16bda3d.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-175297c8bd84f82b.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-3338f4d906a62ee8.so --extern tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtempfile-701aa691529fbea1.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-4266b9558e7a7bdc/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-94e3e427d24c98ad/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-8318ff5744d63dd8/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/lib -L native=/usr/lib/gcc/x86_64-linux-gnu/5` (exit code: 254)
[01:11:56] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--manifest-path" "/checkout/src/librustc_codegen_llvm/Cargo.toml" "--features" " jemalloc" "--message-format" "json"
[01:11:56] expected success, got: exit code: 101
[01:11:56] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1117:9
[01:11:56] travis_fold:start:stage1-rustc_codegen_llvm
travis_time:start:stage1-rustc_codegen_llvm
travis_fold:end:stage1-rustc_codegen_llvm

---
travis_time:end:23d347af:start=1531579841127693240,finish=1531579841134529863,duration=6836623
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:05829060
$ 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 -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:start:crashlog
obj/cores/core.22316.!checkout!obj!build!x86_64-unknown-linux-gnu!stage1!bin!rustc
Source directories searched: /home/travis/build/rust-lang/rust/src:$cdir:$cwd
Reading symbols from obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc...(no debugging symbols found)...done.
[New LWP 22324]
[New LWP 22323]
[New LWP 22321]
[New LWP 22316]
[New LWP 22317]
[New LWP 22325]
[New LWP 22318]
warning: Could not load shared library symbols for 7 libraries, e.g. /lib/x86_64-linux-gnu/libc.so.6.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc --crate-name rust'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f9fc5fe6a11 in llvm::scc_iterator<llvm::CallGraph*, llvm::GraphTraits<llvm::CallGraph*> >::DFSVisitOne(llvm::CallGraphNode*) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#0  0x00007f9fc5fe6a11 in llvm::scc_iterator<llvm::CallGraph*, llvm::GraphTraits<llvm::CallGraph*> >::DFSVisitOne(llvm::CallGraphNode*) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#1  0x00007f9fc6f295b1 in (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#2  0x00007f9fc7289f0c in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#3  0x00007f9fc720c829 in LLVMRunPassManager ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#4  0x00007f9fc5681fe7 in rustc_codegen_llvm::back::write::execute_work_item::hfd3cb98239864c6b ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00007f9fc56343a3 in std::sys_common::backtrace::__rust_begin_short_backtrace::h8c37409cc6efa4b9 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#6  0x00007f9fc5658096 in std::panicking::try::do_call::h3fbe882ce88a0178 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#7  0x00007f9fcfc0942a in __rust_maybe_catch_panic ()
    at libpanic_unwind/lib.rs:106
#8  0x00007f9fc5641ad1 in _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hcd99e38bedf3313c ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#9  0x00007f9fcfbc13bb in call_once<(),()> ()
    at /checkout/src/liballoc/boxed.rs:650
#10 std::sys_common::thread::start_thread::hf91e8d5f6a6b3cf0 ()
    at libstd/sys_common/thread.rs:24
#11 0x00007f9fcfbc6bf6 in std::sys::unix::thread::Thread::new::thread_start::h3a956f4a27a51528 () at libstd/sys/unix/thread.rs:90
#12 0x00007f9fc9d196ba in ?? ()
#13 0x0000000000000000 in ?? ()
travis_time:end:05829060:start=1531579841141196222,finish=1531579842185010652,duration=1043814430
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:06325780
travis_time:start:06325780
$ 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:11cc131a
$ 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)

1 similar comment
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-netbsd 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.
[01:11:56] rustc exited with signal: 11
[01:11:56] error: Could not compile `rustc_codegen_llvm`.
[01:11:56] 
[01:11:56] Caused by:
[01:11:56]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name rustc_codegen_llvm librustc_codegen_llvm/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 --cfg feature="jemalloc" --cfg feature="rustc_target" -C metadata=e13747a0333e79cd -C extra-filename=-e13747a0333e79cd --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-5fdb96b18119744c.rlib --extern cc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libcc-0fa0588f1c4412f5.rlib --extern env_logger=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libenv_logger-895acd162c7c6552.rlib --extern flate2=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libflate2-62c67455b3319651.rlib --extern jobserver=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libjobserver-cd1507cdc2ba255a.rlib --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblibc-b06ca4d7515cc070.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-f4c6ca12c55cd938.rlib --extern num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libnum_cpus-1513440731e90940.rlib --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-a064f5f4e13b8c1d.so --extern rustc_demangle=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_demangle-5c04b6300494bc09.rlib --extern rustc_allocator=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_allocator-236e74b289f15265.so --extern rustc_apfloat=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_apfloat-bd66201c87c6792c.rlib --extern rustc_codegen_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_codegen_utils-37faab1b31eecbba.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-4de5b04ad8537345.so --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-8100b926b94dbf60.so --extern rustc_incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_incremental-68d160adb2df29c3.so --extern rustc_llvm=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_llvm-5d9d07b86cb623bf.rlib --extern rustc_mir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_mir-db6c274d71aca6a2.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-09130fa2a2fe1101.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-5fdc9ff03f0e244b.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-54cc3d2ef16bda3d.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-54cc3d2ef16bda3d.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-175297c8bd84f82b.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-3338f4d906a62ee8.so --extern tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtempfile-701aa691529fbea1.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-4266b9558e7a7bdc/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-94e3e427d24c98ad/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-8318ff5744d63dd8/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/lib -L native=/usr/lib/gcc/x86_64-linux-gnu/5` (exit code: 254)
[01:11:56] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--manifest-path" "/checkout/src/librustc_codegen_llvm/Cargo.toml" "--features" " jemalloc" "--message-format" "json"
[01:11:56] expected success, got: exit code: 101
[01:11:56] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1117:9
[01:11:56] travis_fold:start:stage1-rustc_codegen_llvm
travis_time:start:stage1-rustc_codegen_llvm
travis_fold:end:stage1-rustc_codegen_llvm

---
travis_time:end:23d347af:start=1531579841127693240,finish=1531579841134529863,duration=6836623
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:05829060
$ 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 -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:start:crashlog
obj/cores/core.22316.!checkout!obj!build!x86_64-unknown-linux-gnu!stage1!bin!rustc
Source directories searched: /home/travis/build/rust-lang/rust/src:$cdir:$cwd
Reading symbols from obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc...(no debugging symbols found)...done.
[New LWP 22324]
[New LWP 22323]
[New LWP 22321]
[New LWP 22316]
[New LWP 22317]
[New LWP 22325]
[New LWP 22318]
warning: Could not load shared library symbols for 7 libraries, e.g. /lib/x86_64-linux-gnu/libc.so.6.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc --crate-name rust'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f9fc5fe6a11 in llvm::scc_iterator<llvm::CallGraph*, llvm::GraphTraits<llvm::CallGraph*> >::DFSVisitOne(llvm::CallGraphNode*) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#0  0x00007f9fc5fe6a11 in llvm::scc_iterator<llvm::CallGraph*, llvm::GraphTraits<llvm::CallGraph*> >::DFSVisitOne(llvm::CallGraphNode*) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#1  0x00007f9fc6f295b1 in (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#2  0x00007f9fc7289f0c in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#3  0x00007f9fc720c829 in LLVMRunPassManager ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#4  0x00007f9fc5681fe7 in rustc_codegen_llvm::back::write::execute_work_item::hfd3cb98239864c6b ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00007f9fc56343a3 in std::sys_common::backtrace::__rust_begin_short_backtrace::h8c37409cc6efa4b9 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#6  0x00007f9fc5658096 in std::panicking::try::do_call::h3fbe882ce88a0178 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#7  0x00007f9fcfc0942a in __rust_maybe_catch_panic ()
    at libpanic_unwind/lib.rs:106
#8  0x00007f9fc5641ad1 in _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::hcd99e38bedf3313c ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#9  0x00007f9fcfbc13bb in call_once<(),()> ()
    at /checkout/src/liballoc/boxed.rs:650
#10 std::sys_common::thread::start_thread::hf91e8d5f6a6b3cf0 ()
    at libstd/sys_common/thread.rs:24
#11 0x00007f9fcfbc6bf6 in std::sys::unix::thread::Thread::new::thread_start::h3a956f4a27a51528 () at libstd/sys/unix/thread.rs:90
#12 0x00007f9fc9d196ba in ?? ()
#13 0x0000000000000000 in ?? ()
travis_time:end:05829060:start=1531579841141196222,finish=1531579842185010652,duration=1043814430
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:06325780
travis_time:start:06325780
$ 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:11cc131a
$ 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)

@kennytm
Copy link
Member

kennytm commented Jul 14, 2018

@bors retry #52378

@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 Jul 14, 2018
@bors
Copy link
Contributor

bors commented Jul 14, 2018

⌛ Testing commit 7d142c1 with merge 0db03e6...

bors added a commit that referenced this pull request Jul 14, 2018
Remove most of `PartialEq` and `Hash` impls from AST and HIR structures

Continuation of #49326, prerequisite for removing `PartialEq` for `Ident`.
@bors
Copy link
Contributor

bors commented Jul 14, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 0db03e6 to master...

@bors bors merged commit 7d142c1 into rust-lang:master Jul 14, 2018
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #51829!

Tested on commit 0db03e6.
Direct link to PR: #51829

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Jul 14, 2018
Tested on commit rust-lang/rust@0db03e6.
Direct link to PR: <rust-lang/rust#51829>

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
@kennytm
Copy link
Member

kennytm commented Jul 14, 2018

Clippy error log:

[00:59:37] error[E0369]: binary operation `==` cannot be applied to type `syntax::ast::LitKind`
[00:59:37]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:110:51
[00:59:37]     |
[00:59:37] 110 |             (&ExprLit(ref l), &ExprLit(ref r)) => l.node == r.node,
[00:59:37]     |                                                   ^^^^^^^^^^^^^^^^
[00:59:37]     |
[00:59:37]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::LitKind`
[00:59:37]
[00:59:37] error[E0369]: binary operation `==` cannot be applied to type `&rustc::hir::PathSegment`
[00:59:37]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:121:36
[00:59:37]     |
[00:59:37] 121 |                 !self.ignore_fn && l_path == r_path && self.eq_exprs(l_args, r_args)
[00:59:37]     |                                    ^^^^^^^^^^^^^^^^
[00:59:37]     |
[00:59:37]     = note: an implementation of `std::cmp::PartialEq` might be missing for `&rustc::hir::PathSegment`
[00:59:37]
[00:59:37] error[E0599]: no method named `hash` found for type `rustc::hir::BlockCheckMode` in the current scope
[00:59:37]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:339:17
[00:59:37]     |
[00:59:37] 339 |         b.rules.hash(&mut self.s);
[00:59:37]     |                 ^^^^
[00:59:37]
[00:59:37] error[E0599]: no method named `hash` found for type `&syntax::codemap::Spanned<rustc::hir::BinOp_>` in the current scope
[00:59:37]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:376:19
[00:59:37]     |
[00:59:37] 376 |                 o.hash(&mut self.s);
[00:59:37]     |                   ^^^^
[00:59:37]     |
[00:59:37]     = note: the method `hash` exists but the following trait bounds were not satisfied:
[00:59:37]             `syntax::codemap::Spanned<rustc::hir::BinOp_> : std::hash::Hash`
[00:59:37]             `&syntax::codemap::Spanned<rustc::hir::BinOp_> : std::hash::Hash`
[00:59:37]             `syntax::codemap::Spanned<rustc::hir::BinOp_> : std::hash::Hash`
[00:59:37]
[00:59:37] error[E0599]: no method named `hash` found for type `rustc::hir::BinOp_` in the current scope
[00:59:37]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:388:25
[00:59:37]     |
[00:59:37] 388 |                 op.node.hash(&mut self.s);
[00:59:37]     |                         ^^^^
[00:59:37]
[00:59:37] error[E0599]: no method named `hash` found for type `rustc::hir::CaptureClause` in the current scope
[00:59:37]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:422:21
[00:59:37]     |
[00:59:37] 422 |                 cap.hash(&mut self.s);
[00:59:37]     |                     ^^^^
[00:59:37]
[00:59:37] error[E0599]: no method named `hash` found for type `&syntax::ptr::P<syntax::codemap::Spanned<syntax::ast::LitKind>>` in the current scope
[00:59:37]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:453:19
[00:59:37]     |
[00:59:37] 453 |                 l.hash(&mut self.s);
[00:59:37]     |                   ^^^^
[00:59:37]     |
[00:59:37]     = note: the method `hash` exists but the following trait bounds were not satisfied:
[00:59:37]             `syntax::ptr::P<syntax::codemap::Spanned<syntax::ast::LitKind>> : std::hash::Hash`
[00:59:37]             `&syntax::ptr::P<syntax::codemap::Spanned<syntax::ast::LitKind>> : std::hash::Hash`
[00:59:37]             `syntax::ptr::P<syntax::codemap::Spanned<syntax::ast::LitKind>> : std::hash::Hash`
[00:59:37]             `syntax::codemap::Spanned<syntax::ast::LitKind> : std::hash::Hash`
[00:59:37]
[00:59:37] error[E0599]: no method named `hash` found for type `rustc::hir::UnOp` in the current scope
[00:59:37]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:535:21
[00:59:37]     |
[00:59:37] 535 |                 lop.hash(&mut self.s);
[00:59:37]     |                     ^^^^
[00:59:37]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `syntax::ast::LitKind`
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:110:51
[00:59:38]     |
[00:59:38] 110 |             (&ExprLit(ref l), &ExprLit(ref r)) => l.node == r.node,
[00:59:38]     |                                                   ^^^^^^^^^^^^^^^^
[00:59:38]     |
[00:59:38]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::LitKind`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `&rustc::hir::PathSegment`
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:121:36
[00:59:38]     |
[00:59:38] 121 |                 !self.ignore_fn && l_path == r_path && self.eq_exprs(l_args, r_args)
[00:59:38]     |                                    ^^^^^^^^^^^^^^^^
[00:59:38]     |
[00:59:38]     = note: an implementation of `std::cmp::PartialEq` might be missing for `&rustc::hir::PathSegment`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::VisibilityKind`
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/internal_lints.rs:123:49
[00:59:38]     |
[00:59:38] 123 |             } else if is_lint_array_type(ty) && item.vis.node == VisibilityKind::Inherited && item.name == "ARRAY" {
[00:59:38]     |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:38]     |
[00:59:38]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::VisibilityKind`
[00:59:38]
[00:59:38] error[E0599]: no method named `hash` found for type `rustc::hir::BlockCheckMode` in the current scope
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:339:17
[00:59:38]     |
[00:59:38] 339 |         b.rules.hash(&mut self.s);
[00:59:38]     |                 ^^^^
[00:59:38]
[00:59:38] error[E0599]: no method named `hash` found for type `&syntax::codemap::Spanned<rustc::hir::BinOp_>` in the current scope
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:376:19
[00:59:38]     |
[00:59:38] 376 |                 o.hash(&mut self.s);
[00:59:38]     |                   ^^^^
[00:59:38]     |
[00:59:38]     = note: the method `hash` exists but the following trait bounds were not satisfied:
[00:59:38]             `syntax::codemap::Spanned<rustc::hir::BinOp_> : std::hash::Hash`
[00:59:38]             `&syntax::codemap::Spanned<rustc::hir::BinOp_> : std::hash::Hash`
[00:59:38]             `syntax::codemap::Spanned<rustc::hir::BinOp_> : std::hash::Hash`
[00:59:38]
[00:59:38] error[E0599]: no method named `hash` found for type `rustc::hir::BinOp_` in the current scope
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:388:25
[00:59:38]     |
[00:59:38] 388 |                 op.node.hash(&mut self.s);
[00:59:38]     |                         ^^^^
[00:59:38]
[00:59:38] error[E0599]: no method named `hash` found for type `rustc::hir::CaptureClause` in the current scope
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:422:21
[00:59:38]     |
[00:59:38] 422 |                 cap.hash(&mut self.s);
[00:59:38]     |                     ^^^^
[00:59:38]
[00:59:38] error[E0599]: no method named `hash` found for type `&syntax::ptr::P<syntax::codemap::Spanned<syntax::ast::LitKind>>` in the current scope
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:453:19
[00:59:38]     |
[00:59:38] 453 |                 l.hash(&mut self.s);
[00:59:38]     |                   ^^^^
[00:59:38]     |
[00:59:38]     = note: the method `hash` exists but the following trait bounds were not satisfied:
[00:59:38]             `syntax::ptr::P<syntax::codemap::Spanned<syntax::ast::LitKind>> : std::hash::Hash`
[00:59:38]             `&syntax::ptr::P<syntax::codemap::Spanned<syntax::ast::LitKind>> : std::hash::Hash`
[00:59:38]             `syntax::ptr::P<syntax::codemap::Spanned<syntax::ast::LitKind>> : std::hash::Hash`
[00:59:38]             `syntax::codemap::Spanned<syntax::ast::LitKind> : std::hash::Hash`
[00:59:38]
[00:59:38] error[E0599]: no method named `hash` found for type `rustc::hir::UnOp` in the current scope
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/hir_utils.rs:535:21
[00:59:38]     |
[00:59:38] 535 |                 lop.hash(&mut self.s);
[00:59:38]     |                     ^^^^
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::VisibilityKind`
[00:59:38]    --> tools/clippy/clippy_lints/src/utils/internal_lints.rs:123:49
[00:59:38]     |
[00:59:38] 123 |             } else if is_lint_array_type(ty) && item.vis.node == VisibilityKind::Inherited && item.name == "ARRAY" {
[00:59:38]     |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:38]     |
[00:59:38]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::VisibilityKind`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::VisibilityKind`
[00:59:38]   --> tools/clippy/clippy_lints/src/enum_glob_use.rs:47:12
[00:59:38]    |
[00:59:38] 47 |         if item.vis.node == VisibilityKind::Public {
[00:59:38]    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:38]    |
[00:59:38]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::VisibilityKind`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `syntax::ast::VisibilityKind`
[00:59:38]    --> tools/clippy/clippy_lints/src/enum_variants.rs:265:24
[00:59:38]     |
[00:59:38] 265 |                     if item.vis.node == VisibilityKind::Public {
[00:59:38]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:38]     |
[00:59:38]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::VisibilityKind`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PatKind`
[00:59:38]   --> tools/clippy/clippy_lints/src/if_let_redundant_pattern_matching.rs:51:87
[00:59:38]    |
[00:59:38] 51 |                     PatKind::TupleStruct(ref path, ref pats, _) if pats.len() == 1 && pats[0].node == PatKind::Wild => {
[00:59:38]    |                                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:38]    |
[00:59:38]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::VisibilityKind`
[00:59:38]   --> tools/clippy/clippy_lints/src/enum_glob_use.rs:47:12
[00:59:38]    |
[00:59:38] 47 |         if item.vis.node == VisibilityKind::Public {
[00:59:38]    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:38]    |
[00:59:38]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::VisibilityKind`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `syntax::ast::VisibilityKind`
[00:59:38]    --> tools/clippy/clippy_lints/src/enum_variants.rs:265:24
[00:59:38]     |
[00:59:38] 265 |                     if item.vis.node == VisibilityKind::Public {
[00:59:38]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:38]     |
[00:59:38]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::VisibilityKind`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `&rustc::hir::Expr`
[00:59:38]     --> tools/clippy/clippy_lints/src/loops.rs:1958:12
[00:59:38]      |
[00:59:38] 1958 |         if expr == self.end_expr {
[00:59:38]      |            ^^^^^^^^^^^^^^^^^^^^^
[00:59:38]      |
[00:59:38]      = note: an implementation of `std::cmp::PartialEq` might be missing for `&rustc::hir::Expr`
[00:59:38]
[00:59:38] error[E0369]: binary operation `==` cannot be applied to type `[rustc::hir::PathSegment]`
[00:59:38]    --> tools/clippy/clippy_lints/src/map_clone.rs:111:34
[00:59:38]     |
[00:59:38] 111 |             !path.is_global() && path.segments[..] == arg_segment
[00:59:38]     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:38]     |
[00:59:38]     = note: an implementation of `std::cmp::PartialEq` might be missing for `[rustc::hir::PathSegment]`
[00:59:38]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]   --> tools/clippy/clippy_lints/src/if_let_redundant_pattern_matching.rs:51:87
[00:59:39]    |
[00:59:39] 51 |                     PatKind::TupleStruct(ref path, ref pats, _) if pats.len() == 1 && pats[0].node == PatKind::Wild => {
[00:59:39]    |                                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/matches.rs:224:8
[00:59:39]     |
[00:59:39] 224 |     if arms[1].pats[0].node == PatKind::Wild {
[00:59:39]     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `!=` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/matches.rs:268:39
[00:59:39]     |
[00:59:39] 268 |             if inner.iter().any(|pat| pat.node != PatKind::Wild) {
[00:59:39]     |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/matches.rs:367:47
[00:59:39]     |
[00:59:39] 367 |                     if inner.iter().any(|pat| pat.node == PatKind::Wild);
[00:59:39]     |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::VisibilityKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/methods.rs:843:43
[00:59:39]     |
[00:59:39] 843 |                             let lint = if item.vis.node == hir::VisibilityKind::Public {
[00:59:39]     |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::VisibilityKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `&rustc::hir::Ty`
[00:59:39]     --> tools/clippy/clippy_lints/src/methods.rs:2050:55
[00:59:39]      |
[00:59:39] 2050 |         let is_actually_self = |ty| is_self_ty(ty) || ty == self_ty;
[00:59:39]      |                                                       ^^^^^^^^^^^^^
[00:59:39]      |
[00:59:39]      = note: an implementation of `std::cmp::PartialEq` might be missing for `&rustc::hir::Ty`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::Ty_`
[00:59:39]     --> tools/clippy/clippy_lints/src/methods.rs:2179:54
[00:59:39]      |
[00:59:39] 2179 |             (OutType::Unit, &hir::Return(ref ty)) if ty.node == hir::TyTup(vec![].into()) => true,
[00:59:39]      |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]      |
[00:59:39]      = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::Ty_`
[00:59:39]
[00:59:39] error[E0369]: binary operation `!=` cannot be applied to type `rustc::hir::Ty_`
[00:59:39]     --> tools/clippy/clippy_lints/src/methods.rs:2181:53
[00:59:39]      |
[00:59:39] 2181 |             (OutType::Any, &hir::Return(ref ty)) if ty.node != hir::TyTup(vec![].into()) => true,
[00:59:39]      |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]      |
[00:59:39]      = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::Ty_`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc.rs:421:16
[00:59:39]     |
[00:59:39] 421 |             if right.node == PatKind::Wild {
[00:59:39]     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::Expr`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc.rs:545:69
[00:59:39]     |
[00:59:39] 545 |             ExprAssign(_, ref rhs) | ExprAssignOp(_, _, ref rhs) => **rhs == *expr,
[00:59:39]     |                                                                     ^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::Expr`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `syntax::ast::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc_early.rs:216:20
[00:59:39]     |
[00:59:39] 216 |                 if field.node.pat.node == PatKind::Wild {
[00:59:39]     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `!=` cannot be applied to type `syntax::ast::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc_early.rs:234:24
[00:59:39]     |
[00:59:39] 234 |                     if field.node.pat.node != PatKind::Wild {
[00:59:39]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `syntax::ast::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc_early.rs:241:24
[00:59:39]     |
[00:59:39] 241 |                     if field.node.pat.node == PatKind::Wild {
[00:59:39]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `&rustc::hir::Expr`
[00:59:39]     --> tools/clippy/clippy_lints/src/loops.rs:1958:12
[00:59:39]      |
[00:59:39] 1958 |         if expr == self.end_expr {
[00:59:39]      |            ^^^^^^^^^^^^^^^^^^^^^
[00:59:39]      |
[00:59:39]      = note: an implementation of `std::cmp::PartialEq` might be missing for `&rustc::hir::Expr`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `[rustc::hir::PathSegment]`
[00:59:39]    --> tools/clippy/clippy_lints/src/map_clone.rs:111:34
[00:59:39]     |
[00:59:39] 111 |             !path.is_global() && path.segments[..] == arg_segment
[00:59:39]     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `[rustc::hir::PathSegment]`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/matches.rs:224:8
[00:59:39]     |
[00:59:39] 224 |     if arms[1].pats[0].node == PatKind::Wild {
[00:59:39]     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `!=` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/matches.rs:268:39
[00:59:39]     |
[00:59:39] 268 |             if inner.iter().any(|pat| pat.node != PatKind::Wild) {
[00:59:39]     |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/matches.rs:367:47
[00:59:39]     |
[00:59:39] 367 |                     if inner.iter().any(|pat| pat.node == PatKind::Wild);
[00:59:39]     |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PathSegment`
[00:59:39]   --> tools/clippy/clippy_lints/src/overflow_check_conditional.rs:40:16
[00:59:39]    |
[00:59:39] 40 |             if path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0];
[00:59:39]    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PathSegment`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PathSegment`
[00:59:39]   --> tools/clippy/clippy_lints/src/overflow_check_conditional.rs:40:58
[00:59:39]    |
[00:59:39] 40 |             if path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0];
[00:59:39]    |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PathSegment`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PathSegment`
[00:59:39]   --> tools/clippy/clippy_lints/src/overflow_check_conditional.rs:65:16
[00:59:39]    |
[00:59:39] 65 |             if path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0];
[00:59:39]    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PathSegment`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PathSegment`
[00:59:39]   --> tools/clippy/clippy_lints/src/overflow_check_conditional.rs:65:58
[00:59:39]    |
[00:59:39] 65 |             if path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0];
[00:59:39]    |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PathSegment`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::VisibilityKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/methods.rs:843:43
[00:59:39]     |
[00:59:39] 843 |                             let lint = if item.vis.node == hir::VisibilityKind::Public {
[00:59:39]     |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::VisibilityKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `syntax::ptr::P<[rustc::hir::PathSegment]>`
[00:59:39]    --> tools/clippy/clippy_lints/src/ranges.rs:121:24
[00:59:39]     |
[00:59:39] 121 |                     if iter_path.segments == len_path.segments;
[00:59:39]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ptr::P<[rustc::hir::PathSegment]>`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `&rustc::hir::Ty`
[00:59:39]     --> tools/clippy/clippy_lints/src/methods.rs:2050:55
[00:59:39]      |
[00:59:39] 2050 |         let is_actually_self = |ty| is_self_ty(ty) || ty == self_ty;
[00:59:39]      |                                                       ^^^^^^^^^^^^^
[00:59:39]      |
[00:59:39]      = note: an implementation of `std::cmp::PartialEq` might be missing for `&rustc::hir::Ty`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::Ty_`
[00:59:39]     --> tools/clippy/clippy_lints/src/methods.rs:2179:54
[00:59:39]      |
[00:59:39] 2179 |             (OutType::Unit, &hir::Return(ref ty)) if ty.node == hir::TyTup(vec![].into()) => true,
[00:59:39]      |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]      |
[00:59:39]      = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::Ty_`
[00:59:39]
[00:59:39] error[E0369]: binary operation `!=` cannot be applied to type `rustc::hir::Ty_`
[00:59:39]     --> tools/clippy/clippy_lints/src/methods.rs:2181:53
[00:59:39]      |
[00:59:39] 2181 |             (OutType::Any, &hir::Return(ref ty)) if ty.node != hir::TyTup(vec![].into()) => true,
[00:59:39]      |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]      |
[00:59:39]      = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::Ty_`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc.rs:421:16
[00:59:39]     |
[00:59:39] 421 |             if right.node == PatKind::Wild {
[00:59:39]     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::Expr`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc.rs:545:69
[00:59:39]     |
[00:59:39] 545 |             ExprAssign(_, ref rhs) | ExprAssignOp(_, _, ref rhs) => **rhs == *expr,
[00:59:39]     |                                                                     ^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::Expr`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `syntax::ast::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc_early.rs:216:20
[00:59:39]     |
[00:59:39] 216 |                 if field.node.pat.node == PatKind::Wild {
[00:59:39]     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `!=` cannot be applied to type `syntax::ast::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc_early.rs:234:24
[00:59:39]     |
[00:59:39] 234 |                     if field.node.pat.node != PatKind::Wild {
[00:59:39]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `syntax::ast::PatKind`
[00:59:39]    --> tools/clippy/clippy_lints/src/misc_early.rs:241:24
[00:59:39]     |
[00:59:39] 241 |                     if field.node.pat.node == PatKind::Wild {
[00:59:39]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ast::PatKind`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PathSegment`
[00:59:39]   --> tools/clippy/clippy_lints/src/overflow_check_conditional.rs:40:16
[00:59:39]    |
[00:59:39] 40 |             if path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0];
[00:59:39]    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PathSegment`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PathSegment`
[00:59:39]   --> tools/clippy/clippy_lints/src/overflow_check_conditional.rs:40:58
[00:59:39]    |
[00:59:39] 40 |             if path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0];
[00:59:39]    |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PathSegment`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PathSegment`
[00:59:39]   --> tools/clippy/clippy_lints/src/overflow_check_conditional.rs:65:16
[00:59:39]    |
[00:59:39] 65 |             if path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0];
[00:59:39]    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PathSegment`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `rustc::hir::PathSegment`
[00:59:39]   --> tools/clippy/clippy_lints/src/overflow_check_conditional.rs:65:58
[00:59:39]    |
[00:59:39] 65 |             if path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0];
[00:59:39]    |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]    |
[00:59:39]    = note: an implementation of `std::cmp::PartialEq` might be missing for `rustc::hir::PathSegment`
[00:59:39]
[00:59:39] error[E0369]: binary operation `==` cannot be applied to type `syntax::ptr::P<[rustc::hir::PathSegment]>`
[00:59:39]    --> tools/clippy/clippy_lints/src/ranges.rs:121:24
[00:59:39]     |
[00:59:39] 121 |                     if iter_path.segments == len_path.segments;
[00:59:39]     |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:39]     |
[00:59:39]     = note: an implementation of `std::cmp::PartialEq` might be missing for `syntax::ptr::P<[rustc::hir::PathSegment]>`
[00:59:39]
[00:59:40] error: aborting due to 31 previous errors

@Manishearth
Copy link
Member

Why remove it from LitKind? It doesn't contain idents. Same thing for Spanned.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 14, 2018

I don't think complexity wise it makes sense to recreate these impls by hand inside clippy. I will reintroduce the minimally required set of impls (at least for types like Spanned and LitKind, which have a straight forward behaviour that doesn't have footguns)

@Manishearth
Copy link
Member

Also ISTM the bug here is that you're using == where you shouldn't be, I don't think this warrants removing the Eq impls. We can work around this but it's not ideal and it's certainly going to be more brittle.

@petrochenkov
Copy link
Contributor Author

Why remove it from LitKind? It doesn't contain idents. Same thing for Spanned.

This PR simply removed everything that's not used during x.py test.
If clippy needs partialeq/eq/hash impls for something trivial enough, please re-add them and send a PR.
I wanted to make sure that clippy builds, but it compared so many things that shouldn't actually be compared with == that I left it.

@Manishearth
Copy link
Member

I wanted to make sure that clippy builds, but it compared so many things that shouldn't actually be compared with == that I left it.

🙁 can you explain what these cases are?

@oli-obk
Copy link
Contributor

oli-obk commented Jul 14, 2018

I initially thought "oh my god we can never get clippy to work in a sensible way after this". And I'm very sorry for having thought that and not first considered the full implications. Clippy's comparisons were absolutely useless in some situations. I fixed them by using our SpanlessEq #52388

@eddyb
Copy link
Member

eddyb commented Jul 14, 2018

@Manishearth In general comparing ASTs is a bad idea, what you want is to pattern-match them except Rust makes this very hard around Box and Vec (although if we use Box<[T]> couldn't we pattern-match using box [...]? has someone considered this before? it seems like the best of all worlds, and with match ergonomics we can maybe even remove the box keyword).
Sadly there isn't much we can do for pattern-matching Symbol with a string literal.

I didn't realize clippy already had some machinery (the SpanlessEq that @oli-obk mentioned), but some uses of it should still be some form of pattern-matching and/or logic or fuzzy unification.

@Manishearth
Copy link
Member

Yes, many of the cases here should be pattern matching, but I don't think that's true for all

For example, what if you want to compare vectors like path.segments? Or, what if you wish to compare two AST nodes -- this can't be pattern matched since you do not know at compile time what the other node is.

Pattern matching works for the simple cases, this falls apart for anything even slightly more complicated.

@eddyb
Copy link
Member

eddyb commented Jul 14, 2018

what if you want to compare vectors like path.segments?

I have a suggestion for that, box [...] patterns, they might work (assuming nothing actually uses Vec inside the AST/HIR).

this can't be pattern matched since you do not know at compile time what the other node is.

That's where the second part, "logic or fuzzy unification", comes in.
You can't compare the ASTs, you have to unify them, ignoring as much irrelevant information as possible. SpanlessEq does some of this, but arguably it could go farther.
Besides, wouldn't using the PartialEq derived implementation compare IDs thus never match unless you're comparing the exact same nodes? In which case you can compare the IDs yourself.

@Manishearth
Copy link
Member

Yeah, there are many cases where the nodes are involved so we can't use them, but this PR went much further and removed it from things which actually have decent PartialEq impls.

@eddyb
Copy link
Member

eddyb commented Jul 14, 2018

To drive the point home, @oli-obk added 7 new uses of SpanlessEq, but only this one is legitimate: rust-lang/rust-clippy@1e9f076#diff-9ea97f7d0afe941e7c587d5638653b2eR2051
The other ones should either be pattern-matches, or should be comparing Def::Local resolutions instead of the paths that resolve to variables, or were wrong all along because they wanted to compare expressions for identity, for which they should've compared IDs instead.

And even this one is only legitimate because it "unifies" types, which should be done on Ty, ideally, not on HIR (but I can't tell at a glance how easy it would be, if even possible, to get Tys here).
Speaking of unification, if two hir::Tys, both from source, are compared, chances are they might want to use proper unification, handling inference variables, generic parameters, etc.

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.

9 participants