Skip to content

Downgrade unnested_or_patterns to pedantic #5705

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Jun 11, 2020

Even with #5704 fixed, I don't believe it is a safe bet that if someone is using or-patterns anywhere in a codebase then they want to use it as much as possible in the whole codebase. I think it would be reasonable to reevaluate after the feature is stable. I feel that a warn-by-default lint suggesting use of an unstable feature, even if already being used in one place, is questionable.

changelog: Remove unnested_or_patterns from default set of enabled lints

@rust-highfive
Copy link

r? @flip1995

(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 11, 2020
Copy link
Member

@matthiaskrgr matthiaskrgr left a comment

Choose a reason for hiding this comment

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

I think the original idea was to stabilize or-patterns rather quickly and auto-apply the lint to the rustc codebase afterwards, but there has not been much progress lately rust-lang/rust#54883

@flip1995
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 11, 2020

📌 Commit 56f25e3 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Jun 11, 2020

⌛ Testing commit 56f25e3 with merge 918eb91...

bors added a commit that referenced this pull request Jun 11, 2020
Downgrade unnested_or_patterns to pedantic

Even with #5704 fixed, I don't believe it is a safe bet that if someone is using or-patterns anywhere in a codebase then they want to use it as much as possible in the whole codebase. I think it would be reasonable to reevaluate after the feature is stable. I feel that a warn-by-default lint suggesting use of an unstable feature, even if already being used in one place, is questionable.

changelog: Remove unnested_or_patterns from default set of enabled lints
@bors
Copy link
Contributor

bors commented Jun 11, 2020

💔 Test failed - checks-action_test

@matthiaskrgr
Copy link
Member

Let's see if that's spurious, can't reproduce locally.
@bors retry

@bors
Copy link
Contributor

bors commented Jun 11, 2020

⌛ Testing commit 56f25e3 with merge 2c60566...

bors added a commit that referenced this pull request Jun 11, 2020
Downgrade unnested_or_patterns to pedantic

Even with #5704 fixed, I don't believe it is a safe bet that if someone is using or-patterns anywhere in a codebase then they want to use it as much as possible in the whole codebase. I think it would be reasonable to reevaluate after the feature is stable. I feel that a warn-by-default lint suggesting use of an unstable feature, even if already being used in one place, is questionable.

changelog: Remove unnested_or_patterns from default set of enabled lints
@bors
Copy link
Contributor

bors commented Jun 11, 2020

💔 Test failed - checks-action_test

@matthiaskrgr
Copy link
Member

It seems the ICE only happens when using master-bootstrapped clippy:


error: internal compiler error: src/librustc_traits/normalize_erasing_regions.rs:37: could not fully normalize `<A as sealed::SimdArray>::Tuple`

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:907:9
stack backtrace:
   0:     0x7f96bea9c925 - backtrace::backtrace::libunwind::trace::hc3f32ba24d88242a
                               at /cargo/registry/src/github.heygears.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x7f96bea9c925 - backtrace::backtrace::trace_unsynchronized::h1f075597100358e7
                               at /cargo/registry/src/github.heygears.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x7f96bea9c925 - std::sys_common::backtrace::_print_fmt::h4397782fec59f199
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x7f96bea9c925 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h39652f0242246c81
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x7f96beada03c - core::fmt::write::h540ac4a6a1232abc
                               at src/libcore/fmt/mod.rs:1076
   5:     0x7f96bea8f0a3 - std::io::Write::write_fmt::haa03b5883ee9e297
                               at src/libstd/io/mod.rs:1537
   6:     0x7f96beaa1940 - std::sys_common::backtrace::_print::ha6d9bdf9f438acec
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x7f96beaa1940 - std::sys_common::backtrace::print::ha1fba17a8e5f6bc7
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f96beaa1940 - std::panicking::default_hook::{{closure}}::hbf9fcecd42c17d90
                               at src/libstd/panicking.rs:198
   9:     0x7f96beaa168c - std::panicking::default_hook::h39b8550780094336
                               at src/libstd/panicking.rs:218
  10:     0x560a14f1bdf1 - clippy_driver::report_clippy_ice::h53e9da04250b481d
  11:     0x7f96beaa1fec - std::panicking::rust_panic_with_hook::hc8b48ce48004c103
                               at src/libstd/panicking.rs:481
  12:     0x7f96c1cc87b3 - std::panicking::begin_panic::h95722cc59b6e3794
  13:     0x7f96c1d02b20 - rustc_errors::HandlerInner::bug::h5bfed072aae04207
  14:     0x7f96c1d014d0 - rustc_errors::Handler::bug::hebc74f10bfc461e9
  15:     0x7f96c18a9132 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h4ecbd6ff07dab04a
  16:     0x7f96c18a0d4b - rustc_middle::ty::context::tls::with_opt::{{closure}}::h010d60b10caf3ee3
  17:     0x7f96c18a0c99 - rustc_middle::ty::context::tls::with_opt::hc3dbf59e8a94a69b
  18:     0x7f96c18a9048 - rustc_middle::util::bug::opt_span_bug_fmt::hb950822486c5caf0
  19:     0x7f96c18a8fb2 - rustc_middle::util::bug::bug_fmt::h5421afa74c2816a6
  20:     0x7f96bf8c20d5 - rustc_middle::ty::context::GlobalCtxt::enter_local::h5b5daab03a252cd2
  21:     0x7f96bf8d4ae4 - rustc_traits::normalize_erasing_regions::normalize_generic_arg_after_erasing_regions::hbe61374e0bb1469a
  22:     0x7f96c1685a0d - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::normalize_generic_arg_after_erasing_regions>::compute::hd6ca318a6eee2419
  23:     0x7f96c16cd897 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h79eb9df4debc217f
  24:     0x7f96c1a49cc1 - rustc_data_structures::stack::ensure_sufficient_stack::h60b223278340c933
  25:     0x7f96c1771b99 - rustc_query_system::query::plumbing::get_query_impl::ha319a77ad4706b25
  26:     0x7f96c188dcfc - rustc_middle::ty::normalize_erasing_regions::<impl rustc_middle::ty::context::TyCtxt>::normalize_erasing_regions::he9eb313fbc603328
  27:     0x7f96c1998573 - rustc_middle::ty::AdtDef::transparent_newtype_field::h074af332489d3f1a
  28:     0x7f96c1102ed0 - rustc_lint::types::ImproperCTypesVisitor::check_type_for_ffi::h790bf2eba77c3ef3
  29:     0x7f96c11035e9 - rustc_lint::types::ImproperCTypesVisitor::check_type_for_ffi_and_report_errors::hc48fa49f3a546177
  30:     0x7f96c1103958 - <rustc_lint::types::ImproperCTypes as rustc_lint::passes::LateLintPass>::check_foreign_item::h9f012be962d187b2
  31:     0x7f96c10bd688 - rustc_hir::intravisit::walk_item::hcd4d7380da6cacf4
  32:     0x7f96c10d8bac - rustc_hir::intravisit::Visitor::visit_nested_item::h705afc865bb5a15c
  33:     0x7f96c10b7aed - rustc_hir::intravisit::walk_mod::h3061eb01d66677d1
  34:     0x7f96c10dc263 - rustc_lint::late::late_lint_mod::h4d80d1a900687ef1
  35:     0x7f96bf3d8f7e - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::lint_mod>::compute::h1dade90b8fabbe80
  36:     0x7f96bf427847 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::haa9f1b173151097b
  37:     0x7f96bf38aa43 - rustc_data_structures::stack::ensure_sufficient_stack::hf75a2bdb5d03f69b
  38:     0x7f96bf47d40f - rustc_query_system::query::plumbing::get_query_impl::hdbb67257f85c32ad
  39:     0x7f96bf480eee - rustc_query_system::query::plumbing::ensure_query_impl::hd02607e27889bd6a
  40:     0x7f96bf3daf63 - rustc_session::utils::<impl rustc_session::session::Session>::time::h3ff91e6c2be51354
  41:     0x7f96bf3cd294 - std::panicking::try::he6c4554c89ab274c
  42:     0x7f96bf44b21e - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::heda542005203a7a3
  43:     0x7f96bf3dccd8 - rustc_session::utils::<impl rustc_session::session::Session>::time::h953b2a6122dd0bf9
  44:     0x7f96bf37a380 - rustc_interface::passes::analysis::h9a9d199d8946ba60
  45:     0x7f96bf1b0fb2 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::h6d7d93402e422347
  46:     0x7f96bf233c87 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hd0f8a3bcebb065fc
  47:     0x7f96bf230290 - rustc_query_system::query::plumbing::get_query_impl::hb874f9326611d7cb
  48:     0x7f96bf1b179f - rustc_middle::ty::context::tls::enter_global::hcbe8e0c475345462
  49:     0x7f96bf1b9334 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h55badd9f75c333bd
  50:     0x7f96bf22a993 - rustc_span::with_source_map::hf3b5471559edcc21
  51:     0x7f96bf1bb348 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h55ff29da2a5c2a37
  52:     0x7f96bf1aef3d - scoped_tls::ScopedKey<T>::set::had32e8b13d36f022
  53:     0x7f96bf1bbd76 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3431cd11b4be957a
  54:     0x7f96bf19906e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hbaadc09a2b64a29e
  55:     0x7f96beab194a - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h54527dd7ea0101d8
                               at /rustc/3ddf48053e83f4949d00dcaf6eb8d9e28fc6bb95/src/liballoc/boxed.rs:1076
  56:     0x7f96beab194a - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h731fd1bfc62ba945
                               at /rustc/3ddf48053e83f4949d00dcaf6eb8d9e28fc6bb95/src/liballoc/boxed.rs:1076
  57:     0x7f96beab194a - std::sys::unix::thread::Thread::new::thread_start::h62c1349f59256f0d
                               at src/libstd/sys/unix/thread.rs:87
  58:     0x7f96be9c7422 - start_thread
  59:     0x7f96be8dcbf3 - __GI___clone
  60:                0x0 - <unknown>

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.0.212 (34607917f 2020-06-11)

query stack during panic:
#0 [normalize_generic_arg_after_erasing_regions] normalizing `<A as sealed::SimdArray>::Tuple`
#1 [lint_mod] linting module `codegen::bit_manip`
#2 [analysis] running analysis passes on this crate
end of query stack

@matthiaskrgr
Copy link
Member

There's already an upstream ticket ❤️ rust-lang/rust#73249

@matthiaskrgr
Copy link
Member

A fix is in progress: rust-lang/rust#73257
But it looks like we'll need a rustup sync in the meantime.

@matthiaskrgr matthiaskrgr added S-waiting-on-bors Status: The marked PR was approved and is only waiting bors and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jun 11, 2020
@flip1995
Copy link
Member

@bors rollup

bors added a commit that referenced this pull request Jun 23, 2020
Rollup of 9 pull requests

Successful merges:

 - #5178 (clippy-driver: pass all args to rustc if --rustc is present)
 - #5705 (Downgrade unnested_or_patterns to pedantic)
 - #5709 (Fix ICE in consts::binop)
 - #5710 (typo)
 - #5712 (Remove `bar` from blacklisted names)
 - #5713 (Use lints in Clippy that are enabled in rustc bootstrap)
 - #5716 (Fix typo in wildcard_imports)
 - #5724 (redundant_pattern_matching: avoid non-`const fn` calls in const contexts)
 - #5726 (Fix typo)

Failed merges:

r? @ghost

changelog: rollup
@bors bors merged commit 1f39eeb into rust-lang:master Jun 23, 2020
@dtolnay dtolnay deleted the orpat branch October 7, 2020 02:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: The marked PR was approved and is only waiting bors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants