danmar/cppcheck 3132
static analysis of C/C++ code
manage cargo cache (${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively
simple lossless crusher tries to reduce FLIFs in size by recompressing them with different parameters
karolherbst/Gamekeeper-Framework 2
Library for hooking up game stores and merging them into one single library
matthiaskrgr/cargo-rebuild-check 2
checks installed rust crates for missing library links and can auto-rebuild if necessary
matthiaskrgr/clippy_crashfinder 2
crate to run clippy against all crates in the local cargo cache
I4-Projektseminar-HHU-2016/seminar-project-matthiaskrgr 0
seminar-project-matthiaskrgr created by GitHub Classroom
karolherbst/Gamekeeper-Files 0
Runtime files needed for Gamekeeper
issue commentrust-lang/rust
tuple_fields called on non-tuple
duplicate of https://github.com/rust-lang/rust/issues/77993
comment created time in 19 hours
pull request commentrust-lang/rust
Clippy already has a lint for panic!("{}") https://rust-lang.github.io/rust-clippy/master/index.html#panic_params (not sure about assert! though..)
comment created time in 2 days
push eventmatthiaskrgr/cargo-cache
commit sha 5e33be0cf1f587135ff232450d481e48d0407d11
Cargo.toml: make sure deps are sorted alphabetically
push time in 3 days
push eventmatthiaskrgr/cargo-cache
commit sha f0f23aabe58660751b1e83d6ce2f0328eb855c1c
update deps
push time in 3 days
push eventmatthiaskrgr/cargo-cache
commit sha 0bd16be12a8f161eee75d324801163ebd9b6edea
formatting
push time in 3 days
push eventmatthiaskrgr/cargo-cache
commit sha aaf1eedd5126bb6df4561cf4ca19144c8addc71f
perf: don't create owned Strings just for calling .contains('x') on them
push time in 3 days
issue commentrust-lang/rust
ICE: tuple_fields called on non-tuple: ./compiler/rustc_middle/src/hir/place.rs
Cargo-bisetc-rustc points to 93deabce03dc10a80244f5da3e3819452744da2a / https://github.com/rust-lang/rust/pull/77873
comment created time in 5 days
issue commentrust-lang/rust
ICE: tuple_fields called on non-tuple: ./compiler/rustc_middle/src/hir/place.rs
Reduced code from another project that also triggers this ICE:
async fn test() -> Result<(), Box<dyn std::error::Error>> {
macro!();
Ok(())
}
comment created time in 5 days
issue openedrust-lang/rust
ICE: tuple_fields called on non-tuple: ./compiler/rustc_middle/src/hir/place.rs
<!-- Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->
Code
code is ./compiler/rustc_middle/src/hir/place.rs @ 7f587168102498a488abf608a86c7fdfa62fb7bb
<code>
Meta
<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. -->
rustc --version --verbose:
rustc 1.49.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.49.0-dev
LLVM version: 11.0
Error output
error[E0432]: unresolved import `crate::ty`
--> ./compiler/rustc_middle/src/hir/place.rs:1:5
|
1 | use crate::ty;
| ^^^^^^^--
| | |
| | help: a similar name exists in the module: `Ty`
| no `ty` in the root
error[E0433]: failed to resolve: maybe a missing crate `rustc_target`?
--> ./compiler/rustc_middle/src/hir/place.rs:5:5
|
5 | use rustc_target::abi::VariantIdx;
| ^^^^^^^^^^^^ maybe a missing crate `rustc_target`?
error[E0432]: unresolved import `rustc_hir`
--> ./compiler/rustc_middle/src/hir/place.rs:4:5
|
4 | use rustc_hir::HirId;
| ^^^^^^^^^ maybe a missing crate `rustc_hir`?
error: cannot find derive macro `TyEncodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:7:51
|
7 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `TyDecodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:7:64
|
7 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `HashStable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:7:77
|
7 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^
error: cannot find derive macro `TyEncodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:19:51
|
19 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `TyDecodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:19:64
|
19 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `HashStable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:19:77
|
19 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^
error: cannot find derive macro `TyEncodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:39:51
|
39 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `TyDecodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:39:64
|
39 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `HashStable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:39:77
|
39 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^
error: cannot find derive macro `TyEncodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:51:45
|
51 | #[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `TyDecodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:51:58
|
51 | #[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `HashStable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:51:71
|
51 | #[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^
error: cannot find derive macro `TyEncodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:64:45
|
64 | #[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `TyDecodable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:64:58
|
64 | #[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^^
error: cannot find derive macro `HashStable` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:64:71
|
64 | #[derive(Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
| ^^^^^^^^^^
error[E0412]: cannot find type `VariantIdx` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:28:16
|
28 | Field(u32, VariantIdx),
| ^^^^^^^^^^ not found in this scope
error[E0412]: cannot find type `Ty` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:42:13
|
42 | pub ty: Ty<'tcx>,
| ^^ not found in this scope
error[E0412]: cannot find type `Ty` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:54:18
|
54 | pub base_ty: Ty<'tcx>,
| ^^ not found in this scope
error[E0412]: cannot find type `Ty` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:76:18
|
76 | base_ty: Ty<'tcx>,
| ^^ not found in this scope
error[E0412]: cannot find type `Ty` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:94:53
|
94 | pub fn deref_tys(&self) -> impl Iterator<Item = Ty<'tcx>> + '_ {
| ^^ not found in this scope
error[E0412]: cannot find type `Ty` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:105:25
|
105 | pub fn ty(&self) -> Ty<'tcx> {
| ^^ not found in this scope
error[E0412]: cannot find type `Ty` in this scope
--> ./compiler/rustc_middle/src/hir/place.rs:111:68
|
111 | pub fn ty_before_projection(&self, projection_index: usize) -> Ty<'tcx> {
| ^^ not found in this scope
error[E0601]: `main` function not found in crate `place`
--> ./compiler/rustc_middle/src/hir/place.rs:1:1
|
1 | / use crate::ty;
2 | | use crate::ty::Ty;
3 | |
4 | | use rustc_hir::HirId;
... |
114 | | }
115 | | }
| |_^ consider adding a `main` function to `./compiler/rustc_middle/src/hir/place.rs`
error: internal compiler error: compiler/rustc_middle/src/ty/sty.rs:2124:18: tuple_fields called on non-tuple
thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-dev running on x86_64-unknown-linux-gnu
error: aborting due to 27 previous errors
Some errors have detailed explanations: E0412, E0432, E0433, E0601.
For more information about an error, try `rustc --explain E0412`.
<!--
Include a backtrace in the code block by setting RUST_BACKTRACE=1 in your
environment. E.g. RUST_BACKTRACE=1 cargo build.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>
error: internal compiler error: compiler/rustc_middle/src/ty/sty.rs:2124:18: tuple_fields called on non-tuple
thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
stack backtrace:
0: 0x7f93bc5e04bd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1b767c39a5e95889
1: 0x7f93bc65385f - core::fmt::write::h171574b7e83e4159
2: 0x7f93bc5db6b5 - std::io::Write::write_fmt::h367f0713939149e7
3: 0x7f93bc5bb2dd - std::panicking::default_hook::{{closure}}::h8d2944ffa3ea5b5c
4: 0x7f93bc5bafe3 - std::panicking::default_hook::h417561cd3584a74e
5: 0x7f93bd5adad8 - rustc_driver::report_ice::h7f907413f380ab0c
6: 0x7f93bc5bba44 - std::panicking::rust_panic_with_hook::h177ff2dd6f6c5a3a
7: 0x7f93c037a48d - std::panicking::begin_panic::{{closure}}::h41c30b7d59c1ab83
8: 0x7f93c037a366 - std::sys_common::backtrace::__rust_end_short_backtrace::h9b4b887fe950ed7b
9: 0x7f93c037a45f - std::panicking::begin_panic::h2d5e952ff02cd303
10: 0x7f93c035f280 - rustc_errors::HandlerInner::bug::h54226bb6464c1bbe
11: 0x7f93c035dd80 - rustc_errors::Handler::bug::h9c85e7413fc614bd
12: 0x7f93bfd1a744 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::hc8c879fae76cec68
13: 0x7f93bfd03beb - rustc_middle::ty::context::tls::with_opt::{{closure}}::h1ee402a0368750e9
14: 0x7f93bfd03b3a - rustc_middle::ty::context::tls::with_opt::h0b6e4a7db95180c0
15: 0x7f93bfd1a669 - rustc_middle::util::bug::opt_span_bug_fmt::h9e8f475e44875520
16: 0x7f93bfd1a5de - rustc_middle::util::bug::bug_fmt::hb53735ed1a0e40a3
17: 0x7f93bfff9fe6 - rustc_middle::ty::sty::<impl rustc_middle::ty::TyS>::tuple_fields::hb1ebf2fff134a3a7
18: 0x7f93bdf7b632 - <rustc_trait_selection::opaque_types::ConstrainOpaqueTypeRegionVisitor<OP> as rustc_middle::ty::fold::TypeVisitor>::visit_ty::h01e7fbbc634050bd
19: 0x7f93bdf4381b - rustc_middle::ty::fold::TypeFoldable::visit_with::h89367421b2d9b62d
20: 0x7f93bdf7b68b - <rustc_trait_selection::opaque_types::ConstrainOpaqueTypeRegionVisitor<OP> as rustc_middle::ty::fold::TypeVisitor>::visit_ty::h01e7fbbc634050bd
21: 0x7f93be0e49b4 - <rustc_infer::infer::InferCtxt as rustc_trait_selection::opaque_types::InferCtxtExt>::constrain_opaque_types::h030521a243b98e15
22: 0x7f93be0131be - rustc_typeck::check::regionck::RegionCtxt::visit_fn_body::ha1d50d9c7b0b26de
23: 0x7f93be24bbf5 - rustc_hir::intravisit::walk_expr::hd9b61c2e865b355d
24: 0x7f93be013f05 - <rustc_typeck::check::regionck::RegionCtxt as rustc_hir::intravisit::Visitor>::visit_expr::h5d9582afe4a90429
25: 0x7f93be24ba0d - rustc_hir::intravisit::walk_expr::hd9b61c2e865b355d
26: 0x7f93be013f05 - <rustc_typeck::check::regionck::RegionCtxt as rustc_hir::intravisit::Visitor>::visit_expr::h5d9582afe4a90429
27: 0x7f93be013f05 - <rustc_typeck::check::regionck::RegionCtxt as rustc_hir::intravisit::Visitor>::visit_expr::h5d9582afe4a90429
28: 0x7f93be01316d - rustc_typeck::check::regionck::RegionCtxt::visit_fn_body::ha1d50d9c7b0b26de
29: 0x7f93be2c2314 - rustc_typeck::check::regionck::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::regionck_fn::h962b154ec40bba78
30: 0x7f93be087dc4 - rustc_infer::infer::InferCtxtBuilder::enter::h0bfbb1500ae865a9
31: 0x7f93be2c5deb - rustc_typeck::check::typeck::hb09642c9af5e80c9
32: 0x7f93c01d3a85 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h57f4225023d78b56
33: 0x7f93bfb90344 - rustc_data_structures::stack::ensure_sufficient_stack::h71466b197f75449b
34: 0x7f93c00ab2c3 - rustc_query_system::query::plumbing::get_query_impl::h9360744ca1554fcf
35: 0x7f93bfcf71c7 - rustc_middle::ty::context::TyCtxt::typeck_opt_const_arg::h2d84bcba4b6a916a
36: 0x7f93be6f6b88 - rustc_mir_build::thir::cx::Cx::new::hccb17ee027ff76f8
37: 0x7f93be649728 - rustc_infer::infer::InferCtxtBuilder::enter::hb2e57772975e2b6a
38: 0x7f93be6c9843 - rustc_mir_build::build::mir_built::h67c74896e86647aa
39: 0x7f93be9af671 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_built>::compute::hab082082a34c2a66
40: 0x7f93be80d592 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h4f2d7a4f42060b81
41: 0x7f93be7c3651 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::hb3cb65dbe2e759d9
42: 0x7f93beb1c85c - rustc_query_system::query::plumbing::get_query_impl::h605fe8d0d7bd6b92
43: 0x7f93bea9ee8f - rustc_mir::transform::check_unsafety::unsafety_check_result::hb95b5ba5b034d78c
44: 0x7f93be9c7dd5 - core::ops::function::FnOnce::call_once::h6e90cec670018759
45: 0x7f93be7ba9ae - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::unsafety_check_result>::compute::h152644ff7a03cdd3
46: 0x7f93be807967 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h280484e180fb4db4
47: 0x7f93be7c693f - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::he829055f694efc53
48: 0x7f93beafe7f8 - rustc_query_system::query::plumbing::get_query_impl::h41c1bf045ca18433
49: 0x7f93beb9f55d - rustc_query_system::query::plumbing::ensure_query_impl::h86c0638fa615d35e
50: 0x7f93be97c255 - rustc_mir::transform::mir_const::hdeb59516dc5aaff7
51: 0x7f93be7b9611 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_const>::compute::h71b8dfe9e2067e93
52: 0x7f93be80d592 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h4f2d7a4f42060b81
53: 0x7f93be7c3651 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::hb3cb65dbe2e759d9
54: 0x7f93beb1c85c - rustc_query_system::query::plumbing::get_query_impl::h605fe8d0d7bd6b92
55: 0x7f93be97f418 - rustc_mir::transform::mir_promoted::he979c564ee05d4ea
56: 0x7f93be9afb51 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_promoted>::compute::h092e01bedcd3549c
57: 0x7f93be81186e - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h979aaf5f3b5750e4
58: 0x7f93be7c3997 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::hba4807a6a5016e2c
59: 0x7f93beb9ce35 - rustc_query_system::query::plumbing::get_query_impl::hfeddd0a9eec98c42
60: 0x7f93bea75c94 - rustc_mir::borrow_check::mir_borrowck::h7c6e60de406657c1
61: 0x7f93be9c7ea5 - core::ops::function::FnOnce::call_once::h73be7b98bfa4558f
62: 0x7f93be145abe - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute::h3da8bb2f97c9a422
63: 0x7f93bdf8af82 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h44ec7da1ac743b22
64: 0x7f93bdf57b5f - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::h779a44164ac87397
65: 0x7f93be1b72cd - rustc_query_system::query::plumbing::get_query_impl::had8ea137560d0ac3
66: 0x7f93be2c9ec5 - rustc_typeck::collect::type_of::type_of::h044fbee69942caec
67: 0x7f93be14550f - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::type_of>::compute::h997915d7c4a1b6ad
68: 0x7f93bdf94513 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hc90b97085c9ce79e
69: 0x7f93bdf59d85 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::haadc1467f2e67bc8
70: 0x7f93be16b6cd - rustc_query_system::query::plumbing::get_query_impl::h2c99a7423ad0a9fb
71: 0x7f93be26c498 - rustc_typeck::check::check::check_item_type::hcc025041b3995db8
72: 0x7f93bdf6ad69 - rustc_middle::hir::map::Map::visit_item_likes_in_module::h90978f22ba1ebf3d
73: 0x7f93be2759fd - rustc_typeck::check::check::check_mod_item_types::h74b4e4a96dd67240
74: 0x7f93bdf5117e - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_item_types>::compute::h2799a561a93c2553
75: 0x7f93bdf87b52 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h2a25f28c9bf78af6
76: 0x7f93bdfa4594 - rustc_data_structures::stack::ensure_sufficient_stack::ha0c669f9d949c5f8
77: 0x7f93be16e0be - rustc_query_system::query::plumbing::get_query_impl::h2f050535db18ce4a
78: 0x7f93be1f8f3e - rustc_query_system::query::plumbing::ensure_query_impl::h96e25221e74cb65c
79: 0x7f93be042380 - rustc_typeck::check_crate::h2f3d09a5c21b8584
80: 0x7f93bd8ff030 - rustc_interface::passes::analysis::h81d211764a272d26
81: 0x7f93bd544522 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::h1a58c8624477b89e
82: 0x7f93bd5585b2 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h62cc43b86c88c41d
83: 0x7f93bd54471f - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::h1a866b1492cf42e8
84: 0x7f93bd6c94d1 - rustc_query_system::query::plumbing::get_query_impl::hcbdd933478ab0e9e
85: 0x7f93bd5610ff - std::sys_common::backtrace::__rust_begin_short_backtrace::h724ca6f06aa5850a
86: 0x7f93bd6d274e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hff6c249ae73bdeba
87: 0x7f93bc5c270a - std::sys::unix::thread::Thread::new::thread_start::h92d814023fa5e376
88: 0x7f93b91053e9 - start_thread
89: 0x7f93bc3ca293 - __GI___clone
90: 0x0 - <unknown>
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-dev running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [typeck] type-checking `Place::<'tcx>::deref_tys`
#1 [mir_built] building MIR for `Place::<'tcx>::deref_tys`
#2 [unsafety_check_result] unsafety-checking `Place::<'tcx>::deref_tys`
#3 [mir_const] processing MIR for `Place::<'tcx>::deref_tys`
#4 [mir_promoted] processing `Place::<'tcx>::deref_tys`
#5 [mir_borrowck] borrow-checking `Place::<'tcx>::deref_tys`
#6 [type_of] computing type of `Place<'tcx>::deref_tys::{opaque#0}`
#7 [check_mod_item_types] checking item types in top-level module
#8 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 27 previous errors
Some errors have detailed explanations: E0412, E0432, E0433, E0601.
For more information about an error, try `rustc --explain E0412`.
</p> </details>
created time in 5 days
issue commentrust-lang/rust-clippy
CLIPPY_FLAGS to pass options to clippy/ enable disable lints via env vars
Yeah, looks like RUSTFLAGS="-Aclippy::needless_return" cargo clippy no longer throws errors! :tada:
comment created time in 5 days
issue commentrust-analyzer/rust-analyzer
RA reports syntax error on if inside let
Looks like this works fine now. Feel free to close, unless you want to add some sort of test for this to RA.
comment created time in 5 days
issue commentmozilla/sccache
sccache: error: Server startup failed: Address already in use (os error 98)
Seems to be working, indeed. Thanks!
comment created time in 5 days
issue closedmozilla/sccache
sccache: error: Server startup failed: Address already in use (os error 98)
In the last 2(?) weeks I saw this error happening A LOT, mostly while compiling rustc.
sccache: error: Server startup failed: Address already in use (os error 98)
error: could not compile `rustc_symbol_mangling`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
sccache: error: Server startup failed: Address already in use (os error 98)
sccache: error: Server startup failed: Address already in use (os error 98)
This did not happen previously and it's quite annoying.
closed time in 5 days
matthiaskrgrissue openedrust-lang/rust-clippy
FP same_functions_in_if_condition with cfg!() with macro as condition
I tried this code:
#![warn(clippy::same_functions_in_if_condition)]
pub fn main() {
let os = if cfg!(target_os = "macos") {
"macos"
} else if cfg!(target_os = "windows") {
"windows"
} else {
"linux"
};
println!("{}", os);
}
This will boil down to something like ... if false { "macos" } else if false { "windows" } else { "linux" } on linux, the lint should probably just ignore exprs that originate from macros?
current warning:
warning: this `if` has the same function call as a previous `if`
--> src/main.rs:5:15
|
5 | } else if cfg!(target_os = "windows") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![warn(clippy::same_functions_in_if_condition)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: same as this
--> src/main.rs:3:17
|
3 | let os = if cfg!(target_os = "macos") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Meta
clippy 0.0.212 (8dae8cd 2020-10-12)
created time in 7 days
push eventmatthiaskrgr/cargo-cache
commit sha cc7cf75d6849a2fc1386b32fc48280573eed8660
run cargo update to get rid of bad crossbeam-channel version 0.4.3 cargo-audit reported this: error: Vulnerable crates found! ID: RUSTSEC-2020-0052 Crate: crossbeam-channel Version: 0.4.3 Date: 2020-06-26 URL: https://rustsec.org/advisories/RUSTSEC-2020-0052 Title: Undefined Behavior in bounded channel Solution: upgrade to >= 0.4.4 Dependency tree: crossbeam-channel 0.4.3 └── rayon-core 1.8.0 └── rayon 1.4.0 ├── remove_dir_all 0.6.0 └── cargo-cache 0.5.1 warning: 1 warning found Crate: crossbeam-channel Version: 0.4.3 Warning: package has been yanked! error: 1 vulnerability found! warning: 1 warning found!
push time in 8 days
pull request commentrust-lang/highfive
clippy: remove matthiaskrgr from reviewer group
https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/taking.20a.20break
comment created time in 12 days
PR opened rust-lang/highfive
I don't have the capacity to work a lot on clippy right now.
pr created time in 12 days
create barnchmatthiaskrgr/highfive
branch : matthiaskrgr-review-group
created branch time in 12 days
Github hooks to provide an encouraging atmosphere for new contributors
fork in 12 days
push eventmatthiaskrgr/cargo-cache
commit sha 894bc626d8b6d4ec61d33642bc6b54762da7cad3
Generalize backup scripts
commit sha 3cefd2e864e5ae28cf3a9c079c5f901a00f78f41
Merge pull request #91 from Spaceface16518/master Generalize backup scripts
push time in 12 days
PR merged matthiaskrgr/cargo-cache
This will make contributing to the project easier because the utilities will work for most everyone out of the box.
I didn't know if I had to make a changelog entry for this, but if I do, feel free mention that in a review. Thanks!
pr closed time in 12 days
issue commentrust-lang/rust
ICE issue-36839.rs could not fully normalize `<() as Foo>::Bar` with --emit=mir
The crash is repro'able in stable now.
comment created time in 13 days
issue closedrust-lang/rust
ICE: issue-37725.rs -Zmir-opt-level=2 --emit mir
<!-- Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
--> interestingly this one only crashes with -Zmir-opt-level=2 AND --emit mir
Code
./src/test/ui/issues/issue-37725.rs
// build-pass
#![allow(dead_code)]
trait Foo {
fn foo(&self);
}
fn foo<'a>(s: &'a mut ()) where &'a mut (): Foo {
s.foo();
}
fn main() {}
Meta
<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. -->
rustc --version --verbose:
rustc 1.49.0-nightly (98edd1fbf 2020-10-06)
binary: rustc
commit-hash: 98edd1fbf8a68977a2a7c1312eb1ebff80515a92
commit-date: 2020-10-06
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0
Error output
error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<&mut () as Foo>)` during codegen
|
= note: delayed at compiler/rustc_trait_selection/src/traits/codegen/mod.rs:65:32
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-nightly (98edd1fbf 2020-10-06) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z mir-opt-level=2
<!--
Include a backtrace in the code block by setting RUST_BACKTRACE=1 in your
environment. E.g. RUST_BACKTRACE=1 cargo build.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>
error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<&mut () as Foo>)` during codegen
|
= note: delayed at compiler/rustc_trait_selection/src/traits/codegen/mod.rs:65:32
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
stack backtrace:
0: 0x7fdf59d2b0b0 - std::backtrace_rs::backtrace::libunwind::trace::h622bab51c72c4e69
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
1: 0x7fdf59d2b0b0 - std::backtrace_rs::backtrace::trace_unsynchronized::h7e820b882ebd41ee
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/../../backtrace/src/backtrace/mod.rs:66
2: 0x7fdf59d2b0b0 - std::sys_common::backtrace::_print_fmt::h64d46258114db92f
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:79
3: 0x7fdf59d2b0b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h47111d0c1b5f0da5
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:58
4: 0x7fdf59d9a07c - core::fmt::write::h1857a60b204f1b6a
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/core/src/fmt/mod.rs:1080
5: 0x7fdf59d1d052 - std::io::Write::write_fmt::h4604516fed3e5731
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/io/mod.rs:1516
6: 0x7fdf59d2fe7d - std::sys_common::backtrace::_print::h785e7a78d5ef272c
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:61
7: 0x7fdf59d2fe7d - std::sys_common::backtrace::print::h108047ac5c4555d5
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:48
8: 0x7fdf59d2fe7d - std::panicking::default_hook::{{closure}}::h1d0c271f0d087ebf
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:208
9: 0x7fdf59d2fb28 - std::panicking::default_hook::h692753e26f11b7b7
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:227
10: 0x7fdf5a5bd3e8 - rustc_driver::report_ice::h767ab601e5f63209
11: 0x7fdf59d306c6 - std::panicking::rust_panic_with_hook::h74ddc20305301cd9
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:581
12: 0x7fdf59d30249 - std::panicking::begin_panic_handler::{{closure}}::h1a9ca6427ceee1d0
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:484
13: 0x7fdf59d2b54c - std::sys_common::backtrace::__rust_end_short_backtrace::h97e27b7ab754adde
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:153
14: 0x7fdf59d30209 - rust_begin_unwind
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:483
15: 0x7fdf59d301bb - std::panicking::begin_panic_fmt::h45d0f154d1dd3395
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:437
16: 0x7fdf5d5d9281 - rustc_errors::HandlerInner::flush_delayed::h4e44ea29efc5a508
17: 0x7fdf5d5d5be1 - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::hc2218eb325dc8425
18: 0x7fdf5a60ad76 - core::ptr::drop_in_place::he652386dc31d9e30
19: 0x7fdf5a60cbc6 - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h60c7e2432b201062
20: 0x7fdf5a5e66fd - core::ptr::drop_in_place::h2f4d4236293b18c7
21: 0x7fdf5a5e0dea - rustc_span::with_source_map::h23e56868796f6dc3
22: 0x7fdf5a615ed2 - rustc_interface::interface::create_compiler_and_run::h9a8debbb19483b80
23: 0x7fdf5a5f4d0a - scoped_tls::ScopedKey<T>::set::hacc47b1cdb25a215
24: 0x7fdf5a618611 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3d5db7946c19f316
25: 0x7fdf5a59618e - core::ops::function::FnOnce::call_once{{vtable.shim}}::he1a30fa4d30a2178
26: 0x7fdf59d3efda - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h588ce842808b3fd0
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/alloc/src/boxed.rs:1042
27: 0x7fdf59d3efda - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h46bc655f05471a92
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/alloc/src/boxed.rs:1042
28: 0x7fdf59d3efda - std::sys::unix::thread::Thread::new::thread_start::hb4b79d379b730058
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys/unix/thread.rs:87
29: 0x7fdf59c3b3e9 - start_thread
30: 0x7fdf59b58293 - __GI___clone
31: 0x0 - <unknown>
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-nightly (98edd1fbf 2020-10-06) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z mir-opt-level=2
query stack during panic:
end of query stack
</p> </details>
closed time in 13 days
matthiaskrgrissue commentrust-lang/rust
ICE: issue-37725.rs -Zmir-opt-level=2 --emit mir
oops, dupe of #73021
comment created time in 13 days
issue openedrust-lang/rust
ICE: issue-37725.rs -Zmir-opt-level=2 --emit mir
<!-- Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
--> interestingly this one only crashes with -Zmir-opt-level=2 AND --emit mir
Code
./src/test/ui/issues/issue-37725.rs
// build-pass
#![allow(dead_code)]
trait Foo {
fn foo(&self);
}
fn foo<'a>(s: &'a mut ()) where &'a mut (): Foo {
s.foo();
}
fn main() {}
Meta
<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. -->
rustc --version --verbose:
rustc 1.49.0-nightly (98edd1fbf 2020-10-06)
binary: rustc
commit-hash: 98edd1fbf8a68977a2a7c1312eb1ebff80515a92
commit-date: 2020-10-06
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0
Error output
error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<&mut () as Foo>)` during codegen
|
= note: delayed at compiler/rustc_trait_selection/src/traits/codegen/mod.rs:65:32
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-nightly (98edd1fbf 2020-10-06) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z mir-opt-level=2
<!--
Include a backtrace in the code block by setting RUST_BACKTRACE=1 in your
environment. E.g. RUST_BACKTRACE=1 cargo build.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>
error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<&mut () as Foo>)` during codegen
|
= note: delayed at compiler/rustc_trait_selection/src/traits/codegen/mod.rs:65:32
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
stack backtrace:
0: 0x7fdf59d2b0b0 - std::backtrace_rs::backtrace::libunwind::trace::h622bab51c72c4e69
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
1: 0x7fdf59d2b0b0 - std::backtrace_rs::backtrace::trace_unsynchronized::h7e820b882ebd41ee
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/../../backtrace/src/backtrace/mod.rs:66
2: 0x7fdf59d2b0b0 - std::sys_common::backtrace::_print_fmt::h64d46258114db92f
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:79
3: 0x7fdf59d2b0b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h47111d0c1b5f0da5
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:58
4: 0x7fdf59d9a07c - core::fmt::write::h1857a60b204f1b6a
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/core/src/fmt/mod.rs:1080
5: 0x7fdf59d1d052 - std::io::Write::write_fmt::h4604516fed3e5731
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/io/mod.rs:1516
6: 0x7fdf59d2fe7d - std::sys_common::backtrace::_print::h785e7a78d5ef272c
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:61
7: 0x7fdf59d2fe7d - std::sys_common::backtrace::print::h108047ac5c4555d5
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:48
8: 0x7fdf59d2fe7d - std::panicking::default_hook::{{closure}}::h1d0c271f0d087ebf
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:208
9: 0x7fdf59d2fb28 - std::panicking::default_hook::h692753e26f11b7b7
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:227
10: 0x7fdf5a5bd3e8 - rustc_driver::report_ice::h767ab601e5f63209
11: 0x7fdf59d306c6 - std::panicking::rust_panic_with_hook::h74ddc20305301cd9
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:581
12: 0x7fdf59d30249 - std::panicking::begin_panic_handler::{{closure}}::h1a9ca6427ceee1d0
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:484
13: 0x7fdf59d2b54c - std::sys_common::backtrace::__rust_end_short_backtrace::h97e27b7ab754adde
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:153
14: 0x7fdf59d30209 - rust_begin_unwind
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:483
15: 0x7fdf59d301bb - std::panicking::begin_panic_fmt::h45d0f154d1dd3395
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:437
16: 0x7fdf5d5d9281 - rustc_errors::HandlerInner::flush_delayed::h4e44ea29efc5a508
17: 0x7fdf5d5d5be1 - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::hc2218eb325dc8425
18: 0x7fdf5a60ad76 - core::ptr::drop_in_place::he652386dc31d9e30
19: 0x7fdf5a60cbc6 - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h60c7e2432b201062
20: 0x7fdf5a5e66fd - core::ptr::drop_in_place::h2f4d4236293b18c7
21: 0x7fdf5a5e0dea - rustc_span::with_source_map::h23e56868796f6dc3
22: 0x7fdf5a615ed2 - rustc_interface::interface::create_compiler_and_run::h9a8debbb19483b80
23: 0x7fdf5a5f4d0a - scoped_tls::ScopedKey<T>::set::hacc47b1cdb25a215
24: 0x7fdf5a618611 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3d5db7946c19f316
25: 0x7fdf5a59618e - core::ops::function::FnOnce::call_once{{vtable.shim}}::he1a30fa4d30a2178
26: 0x7fdf59d3efda - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h588ce842808b3fd0
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/alloc/src/boxed.rs:1042
27: 0x7fdf59d3efda - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h46bc655f05471a92
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/alloc/src/boxed.rs:1042
28: 0x7fdf59d3efda - std::sys::unix::thread::Thread::new::thread_start::hb4b79d379b730058
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys/unix/thread.rs:87
29: 0x7fdf59c3b3e9 - start_thread
30: 0x7fdf59b58293 - __GI___clone
31: 0x0 - <unknown>
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-nightly (98edd1fbf 2020-10-06) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z mir-opt-level=2
query stack during panic:
end of query stack
</p> </details>
created time in 13 days
issue openedrust-lang/rust
ice with -Zmir-opt-level=2 issue-50865-private-impl-trait/auxiliary/lib.rs
<!-- Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->
Code
./src/test/ui/issues/issue-50865-private-impl-trait/auxiliary/lib.rs
#![crate_type = "lib"]
pub fn bar<P>( // Error won't happen if "bar" is not generic
_baz: P,
) {
hide_foo()();
}
fn hide_foo() -> impl Fn() { // Error won't happen if "iterate" hasn't impl Trait or has generics
foo
}
fn foo() { // Error won't happen if "foo" isn't used in "iterate" or has generics
}
Meta
<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. -->
rustc --version --verbose:
rustc 1.49.0-nightly (98edd1fbf 2020-10-06)
binary: rustc
commit-hash: 98edd1fbf8a68977a2a7c1312eb1ebff80515a92
commit-date: 2020-10-06
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0
Error output
error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<impl std::ops::Fn<()> as std::ops::Fn<()>>)` during codegen
|
= note: delayed at compiler/rustc_trait_selection/src/traits/codegen/mod.rs:65:32
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-nightly (98edd1fbf 2020-10-06) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z mir-opt-level=2
<!--
Include a backtrace in the code block by setting RUST_BACKTRACE=1 in your
environment. E.g. RUST_BACKTRACE=1 cargo build.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>
error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<impl std::ops::Fn<()> as std::ops::Fn<()>>)` during codegen
|
= note: delayed at compiler/rustc_trait_selection/src/traits/codegen/mod.rs:65:32
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
stack backtrace:
0: 0x7f0f02a6f0b0 - std::backtrace_rs::backtrace::libunwind::trace::h622bab51c72c4e69
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
1: 0x7f0f02a6f0b0 - std::backtrace_rs::backtrace::trace_unsynchronized::h7e820b882ebd41ee
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/../../backtrace/src/backtrace/mod.rs:66
2: 0x7f0f02a6f0b0 - std::sys_common::backtrace::_print_fmt::h64d46258114db92f
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:79
3: 0x7f0f02a6f0b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h47111d0c1b5f0da5
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:58
4: 0x7f0f02ade07c - core::fmt::write::h1857a60b204f1b6a
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/core/src/fmt/mod.rs:1080
5: 0x7f0f02a61052 - std::io::Write::write_fmt::h4604516fed3e5731
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/io/mod.rs:1516
6: 0x7f0f02a73e7d - std::sys_common::backtrace::_print::h785e7a78d5ef272c
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:61
7: 0x7f0f02a73e7d - std::sys_common::backtrace::print::h108047ac5c4555d5
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:48
8: 0x7f0f02a73e7d - std::panicking::default_hook::{{closure}}::h1d0c271f0d087ebf
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:208
9: 0x7f0f02a73b28 - std::panicking::default_hook::h692753e26f11b7b7
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:227
10: 0x7f0f033013e8 - rustc_driver::report_ice::h767ab601e5f63209
11: 0x7f0f02a746c6 - std::panicking::rust_panic_with_hook::h74ddc20305301cd9
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:581
12: 0x7f0f02a74249 - std::panicking::begin_panic_handler::{{closure}}::h1a9ca6427ceee1d0
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:484
13: 0x7f0f02a6f54c - std::sys_common::backtrace::__rust_end_short_backtrace::h97e27b7ab754adde
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys_common/backtrace.rs:153
14: 0x7f0f02a74209 - rust_begin_unwind
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:483
15: 0x7f0f02a741bb - std::panicking::begin_panic_fmt::h45d0f154d1dd3395
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/panicking.rs:437
16: 0x7f0f0631d281 - rustc_errors::HandlerInner::flush_delayed::h4e44ea29efc5a508
17: 0x7f0f06319be1 - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::hc2218eb325dc8425
18: 0x7f0f0334ed76 - core::ptr::drop_in_place::he652386dc31d9e30
19: 0x7f0f03350bc6 - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h60c7e2432b201062
20: 0x7f0f0332a6fd - core::ptr::drop_in_place::h2f4d4236293b18c7
21: 0x7f0f03324dea - rustc_span::with_source_map::h23e56868796f6dc3
22: 0x7f0f03359ed2 - rustc_interface::interface::create_compiler_and_run::h9a8debbb19483b80
23: 0x7f0f03338d0a - scoped_tls::ScopedKey<T>::set::hacc47b1cdb25a215
24: 0x7f0f0335c611 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3d5db7946c19f316
25: 0x7f0f032da18e - core::ops::function::FnOnce::call_once{{vtable.shim}}::he1a30fa4d30a2178
26: 0x7f0f02a82fda - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h588ce842808b3fd0
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/alloc/src/boxed.rs:1042
27: 0x7f0f02a82fda - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h46bc655f05471a92
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/alloc/src/boxed.rs:1042
28: 0x7f0f02a82fda - std::sys::unix::thread::Thread::new::thread_start::hb4b79d379b730058
at /rustc/98edd1fbf8a68977a2a7c1312eb1ebff80515a92/library/std/src/sys/unix/thread.rs:87
29: 0x7f0f0297f3e9 - start_thread
30: 0x7f0f0289c293 - __GI___clone
31: 0x0 - <unknown>
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.49.0-nightly (98edd1fbf 2020-10-06) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z mir-opt-level=2
query stack during panic:
end of query stack
</p> </details>
created time in 13 days
push eventmatthiaskrgr/cargo-cache
commit sha 634f4c64dfbefa10d8c287ed649f2757cddb3a08
Replace dependency dirs with dirs-next
commit sha 3e804acba4967b044e90231ca04141d4f97b86ab
Replace usages of dirs with dirs-next
commit sha 74b74f10a1c80647d4847ff95275c2e56060bb26
Clean up error handling around dirs-next usage
commit sha 0745adef54c73d6c1da9400c94635bf35d2b4480
Use constant instead of runtime variable for cache name
commit sha a6f7d091003ec9a5797bbaeea9ddf904046125af
Reorganize flow of sccache search function This flow more clearly conveys the intention of the function. First, we look for an env variable with the directory. If there isn't one, we look for the default location. If everything fails, we report that we can't find an sccache directory.
commit sha f2553ebec7fa1bd9a7604ac98270b57054ea9ba2
Correct github link on dirs-next dependency
commit sha c2bfb28bd2868b76dad2938ebbb34a913e9146af
Summarize changes in CHANGELOG
commit sha 05e57d36b95fed4df85792ce3a00c50bcf4bd40a
Merge pull request #89 from Spaceface16518/dirs-next Dependency dirs is deprecated; use dirs-next
push time in 13 days
PR merged matthiaskrgr/cargo-cache
Change dependency from dirs to dirs-next in manifest files and modify usage of dirs library to use dirs-next library.
The reddit post about the change states that dirs-next is a drop in replacement. I could have just aliased dirs-next to dirs in Cargo.toml, but I actually changed the usage from dirs to dirs-next.
- let mut cache_dir: Option<PathBuf> = dirs::cache_dir();
+ let mut cache_dir: Option<PathBuf> = dirs_next::cache_dir();
pr closed time in 13 days
Pull request review commentmatthiaskrgr/cargo-cache
Dependency dirs is deprecated; use dirs-next
cfg-if = { version = "0.1.10" } # if cfg(..) { ... } chrono = { version = "0.4.11", optional = true } # compare dates etc # https://github.com/soc/dirs-rs-dirs = { version = "3.0.1", optional = true } # get cache dirs to look for sccache cache+dirs-next = { version = "1.0.1", optional = true } # get cache dirs to look for sccache cache
The link to the github repo of the project needs to be updated as well.
comment created time in 14 days
issue commentmatthiaskrgr/cargo-cache
alt reg: add support to only clean up a single registry
Hi!
So, the stuff about the registry indices is inside src/cache.
I tried to split up everything so that there is a "Supercache" (this is similar to the ~/.cargo/registry/cache directory) and a "subcache" which represents a single registry (such as ~/.cargo/registry/cache/github.com-1ecc6299db9ec823, the default crates.io registry, or an alternative registry (~/.cargo/registry/cache/dl.cloudsmith.io-0aaaba6a806079f8).
You can find the supercache and subcache traits here: https://github.com/matthiaskrgr/cargo-cache/blob/master/src/cache/caches.rs
All the subcache-structs should have a name field which is derived from the registry-directory name. IIRC it will be "github.com" for the default crates.io registry and dl.cloudsmith.io for my cloudsmith test registry.
For removing only from a specified registry I would add a new --registry= cmdline flag to specify a registry to remove. (this could also be a comma-seperated list of registries to remove, like --registry="github.com,cloudsmith").
Then --autoclean, --autoclean-expensive, --keep-duplicate-crates, --remove-dir, --remove-if-younger/older-thanas well as the clean-unref and the trim subcommands need to be tweaked to touch specified registries if the --registry flag was passed.
The commandline/clap interface is mostly defined here https://github.com/matthiaskrgr/cargo-cache/blob/master/src/cli.rs, most of the conditional logic happens in main.rs though.
The most tricky part will be to find all the places where stuff is being removed (git grep remove_) and add some kind of filter that keeps certain registries alive.
For example --autoclean is implemented here: https://github.com/matthiaskrgr/cargo-cache/blob/master/src/main.rs#L386
currently it just blindly removes ~/.cargo/registry/src and ~/.cargo/git/checkouts.
We can ignore the .git repo, but we need to restrict it here to only remove a the specified registry.
the cargo_cache is just a struct holding directory paths, we would actually need the Cache here which is registry_sources_caches variable.
We need to bring the SubCache trait into scope and then we can access the registries one by one via registry_sources_caches.caches().iter().for_each(|x| println!("{}", x.name()));
(the .caches() returns a vec of Paths, each path is the directory of a subcache aka a registry.)
This will print the names of each registry that is found.
You can add .filter() to only match wanted registries and the pass these along for removal:
Concept diff:
diff --git a/src/main.rs b/src/main.rs
index 1329460..9c1f7da 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -74,6 +74,7 @@ cfg_if::cfg_if! {
// use
use crate::cache::caches::{Cache, RegistrySuperCache};
+ use crate::cache::caches::RegistrySubCache;
use clap::value_t;
use std::process;
use std::time::SystemTime;
@@ -384,26 +385,28 @@ fn main() {
}
if config.is_present("autoclean") || config.is_present("autoclean-expensive") {
- // clean the registry sources and git checkouts
- let reg_srcs = &cargo_cache.registry_sources;
+ // clean the registry sources and git checkoutsname
+ // let reg_srcs = &cargo_cache.registry_sources;
let git_checkouts = &cargo_cache.git_checkouts;
+ // collect the registries to remove,
+ let mut paths_to_be_removed: Vec<&std::path::PathBuf> = registry_sources_caches
+ .caches()
+ .iter()
+ /*.filter( only match wanted registries )*/
+ .map(|subcache| subcache.path())
+ .collect();
+
+ paths_to_be_removed.push(git_checkouts);
+
// depending on the size of the cache and the system (SSD, HDD...) this can take a few seconds.
println!("\nClearing cache...");
- for dir in &[reg_srcs, git_checkouts] {
- let size = cumulative_dir_size(dir);
- if dir.is_dir() {
- remove_file(
- dir,
- config.is_present("dry-run"),
- &mut size_changed,
- None,
- &DryRunMessage::Default,
- Some(size.dir_size),
- );
- }
+ for dir in paths_to_be_removed {
+ println!("removing: {:?}", dir.display());
+ /* remove */
}
+ return;
}
if config.is_present("keep-duplicate-crates") {
It would make sense to also have a command which lists all registries and their names cargo cache --list-registries? at some point.
Oh and currently the function that tries to figure out the name of a cache/registry removes the hash from the git repo (git grep "fn get_cache_name"). In order to disambiguate between different registries on the same host, it should probably be modified to not throw away the hash.
I hope this helps and is not too confusing, feel free to bombard me with questions. :sweat_smile: :D
comment created time in 19 days
pull request commentrust-lang/rust-clippy
Hmm, it seems the rustfmt commit 5e667d326f929a0770c1e56cd0a921dfb16400e2 has not yet landed inside the rustfmt submodule of the rustc repo.
comment created time in 25 days
pull request commentrust-lang/rust-clippy
Argh, apparently editing a comment that contains @bors try will retrigger bors, sorry :/
comment created time in 25 days
Pull request review commentrust-lang/rust-clippy
+use crate::utils::span_lint;++use rustc_data_structures::fx::FxHashSet;+use rustc_hir::{Expr, ExprKind};+use rustc_lint::{LateContext, LateLintPass};+use rustc_session::{declare_tool_lint, impl_lint_pass};+use rustc_span::Symbol;++declare_clippy_lint! {+ /// **What it does:** Lints for specific trait methods defined in clippy.toml+ ///+ /// **Why is this bad?** Some methods are undesirable in certain contexts,+ /// and it would be beneficial to lint for them as needed.+ ///+ /// **Known problems:** None.+ ///+ /// **Example:**+ ///+ /// ```rust,ignore+ /// // example code where clippy issues a warning+ /// foo.bad_method(); // Foo is disallowed+ /// ```+ /// Use instead:+ /// ```rust,ignore+ /// // example code which does not raise clippy warning+ /// goodStruct.bad_method(); // not disallowed+ /// ```+ pub DISALLOWED_METHOD,+ nursery,+ "used disallowed method call"+}++#[derive(Clone, Debug)]+pub struct DisallowedMethod {+ disallowed: FxHashSet<Vec<Symbol>>,+}++impl DisallowedMethod {+ pub fn new(disallowed: &FxHashSet<String>) -> Self {+ Self {+ disallowed: disallowed+ .iter()+ .map(|s| s.split("::").map(|seg| Symbol::intern(seg)).collect::<Vec<_>>())+ .collect(),+ }+ }+}++impl_lint_pass!(DisallowedMethod => [DISALLOWED_METHOD]);++impl<'tcx> LateLintPass<'tcx> for DisallowedMethod {+ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {+ if let ExprKind::MethodCall(_path, _, _args, _) = &expr.kind {+ let def_id = cx.typeck_results().type_dependent_def_id(expr.hir_id).unwrap();++ let method_call = cx.get_def_path(def_id);+ if self.disallowed.contains(&method_call) {+ span_lint(+ cx,+ DISALLOWED_METHOD,+ expr.span,+ &format!(+ "Use of a disallowed method `{}`",+ method_call+ .iter()+ .map(|s| s.to_ident_string())+ .collect::<Vec<_>>()+ .join("::"),
Making this a variable and using the var inside the format!() is clearer imo.
comment created time in 25 days
Pull request review commentrust-lang/rust-clippy
+use crate::utils::span_lint;++use rustc_data_structures::fx::FxHashSet;+use rustc_hir::{Expr, ExprKind};+use rustc_lint::{LateContext, LateLintPass};+use rustc_session::{declare_tool_lint, impl_lint_pass};+use rustc_span::Symbol;++declare_clippy_lint! {+ /// **What it does:** Lints for specific trait methods defined in clippy.toml+ ///+ /// **Why is this bad?** Some methods are undesirable in certain contexts,+ /// and it would be beneficial to lint for them as needed.+ ///+ /// **Known problems:** None.+ ///+ /// **Example:**+ ///+ /// ```rust,ignore+ /// // example code where clippy issues a warning+ /// foo.bad_method(); // Foo is disallowed+ /// ```+ /// Use instead:+ /// ```rust,ignore+ /// // example code which does not raise clippy warning+ /// goodStruct.bad_method(); // not disallowed+ /// ```+ pub DISALLOWED_METHOD,+ nursery,+ "used disallowed method call"
This could be the same as the lint message: "use of disallowed method call"
comment created time in 25 days
Pull request review commentrust-lang/rust-clippy
+use crate::utils::span_lint;++use rustc_data_structures::fx::FxHashSet;+use rustc_hir::{Expr, ExprKind};+use rustc_lint::{LateContext, LateLintPass};+use rustc_session::{declare_tool_lint, impl_lint_pass};+use rustc_span::Symbol;++declare_clippy_lint! {+ /// **What it does:** Lints for specific trait methods defined in clippy.toml+ ///+ /// **Why is this bad?** Some methods are undesirable in certain contexts,+ /// and it would be beneficial to lint for them as needed.+ ///+ /// **Known problems:** None.+ ///+ /// **Example:**+ ///+ /// ```rust,ignore+ /// // example code where clippy issues a warning+ /// foo.bad_method(); // Foo is disallowed+ /// ```+ /// Use instead:+ /// ```rust,ignore+ /// // example code which does not raise clippy warning+ /// goodStruct.bad_method(); // not disallowed+ /// ```+ pub DISALLOWED_METHOD,+ nursery,+ "used disallowed method call"+}++#[derive(Clone, Debug)]+pub struct DisallowedMethod {+ disallowed: FxHashSet<Vec<Symbol>>,+}++impl DisallowedMethod {+ pub fn new(disallowed: &FxHashSet<String>) -> Self {+ Self {+ disallowed: disallowed+ .iter()+ .map(|s| s.split("::").map(|seg| Symbol::intern(seg)).collect::<Vec<_>>())+ .collect(),+ }+ }+}++impl_lint_pass!(DisallowedMethod => [DISALLOWED_METHOD]);++impl<'tcx> LateLintPass<'tcx> for DisallowedMethod {+ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {+ if let ExprKind::MethodCall(_path, _, _args, _) = &expr.kind {+ let def_id = cx.typeck_results().type_dependent_def_id(expr.hir_id).unwrap();++ let method_call = cx.get_def_path(def_id);+ if self.disallowed.contains(&method_call) {+ span_lint(+ cx,+ DISALLOWED_METHOD,+ expr.span,+ &format!(+ "Use of a disallowed method `{}`",
lint messages should not be capitalized
comment created time in 25 days
pull request commentrust-lang/rust-clippy
I bors will try on windows, too? @bors try
comment created time in 25 days
push eventmatthiaskrgr/rust-clippy
commit sha d3b2c67c5d0c1c883929e635c04025056cbb4102
single_char_push_str lint using insert_str() on single-char literals and suggest insert() changelog: single_char_push_str: lint using string.insert_str() with single char literals and suggests string.insert() with a char Fixes #6026
commit sha c9050a9867fbbd6c601e3cf2036527015de5b728
handle macros returning Strings in single_char_push_str and single_char_insert_str
commit sha 956a847260fd588bcd7209d0cdffa2f2496f3a84
get_hint_if_single_char_arg: fix bug where multi-char letters are not detected properly
push time in a month
push eventmatthiaskrgr/rust-clippy
commit sha e49a29933be3bd988ccb75b053f480d9c99a7ff5
Working map_err_ignore lint
commit sha 202a80c927412a548180eca5990ee764d76ed643
Added tests for map_err, ignored map_err lint on drop_ref tests
commit sha 337729137bdec31b55665653ef0cf7dc124b0eaa
Ran cargo dev update_lints
commit sha 2387f68e437bf2ff5f117f63936257ce64052cfa
Removed map_err suggestion in lint, and updated lint documentation example
commit sha c31d4730b0d40c62934839405d0c25e2ffa3fad1
update example to be more idiomatic
commit sha 4f1c4a99d4d98f1acea3c9c7cc55355aa46119aa
Fixed typo in lint and test
commit sha d719b485434eac557e65bf55cca79e63f7b83d5b
Move map_err_ignore from style to pedantic
commit sha 6211599ccafee5b2429bfb1bbeb48ead32a48484
Extend invalid_atomic_ordering to detect misuse of compare_exchange{,_weak}
commit sha 61671a2268903e1b5c28fcb3c713c27e84ea3e9b
Detect fetch_update misuse in invalid_atomic_ordering too
commit sha 159178e5d4a023f3945b504b49d3742b40453fee
Separate compare_exchange and compare_exchange_weak uitests
commit sha b65745545f410b31c5ecdd33a8299a65da578af2
Use AtomicU8 in ordering example so all operations can be demonstrated
commit sha 4b5326b0d62104801f0b33c4d8f3749d93eebc02
Address small review comments
commit sha 3a072131da2e574e914073af6d72360ead735781
Ah, right, rerun the scripts
commit sha 09f7a377a663043c6f63ded70436ac0969e4abc7
Add comments to the invalid_atomic_ordering example
commit sha d1f0f04a488d027fdf91e08cdf25df00fb677205
New lint: `manual-strip` Add a new lint, `manual-strip`, that suggests using the `str::strip_prefix` and `str::strip_suffix` methods introduced in Rust 1.45 when the same functionality is performed 'manually'. Closes #5734
commit sha 15244a88df5cfd475df010ad945474c658749192
Fix `manual-strip` dogfood errors
commit sha f82e84c8943e70300ad1f4de46d8d7bd889c6bde
Auto merge of #5998 - deg4uss3r:master, r=yaahc Add map_err_ignore lint In a large code base a lot of times errors are ignored by using something like: ```rust foo.map_err(|_| Some::Enum)?; ``` This drops the original error in favor of a enum that will not have the original error's context. This lint helps catch throwing away the original error in favor of an enum without its context. --- *Please keep the line below* changelog: Added map_err_ignore lint
commit sha 1b5317f68b2b55803d5051e9945f9a33817fccef
Add rc_buffer lint for Rc<String> and other buffer types
commit sha 2dd7175d60e070c7ee2b4609bdb17eae16e381f0
Apply rc_buffer lint to Arc<T>
commit sha 4d73ccaa9419b393b9c94f977ec0e158897feeb3
clarify margin of error in wording of float comparison operator lint messages
push time in a month
Pull request review commentrust-lang/rust-clippy
single_char_insert_str: lint using insert_str() on single-char literals and suggest insert()
fn main() { string.push('\x52'); string.push('\u{0052}'); string.push('a');++ get_string!().push_str("ö");
Ah good point! I added the fix.
comment created time in a month
pull request commentrust-lang/rust-clippy
Revert: or_fun_call should lint calls to `const fn`s with no args
How urgent is this, should this be included in https://github.com/rust-lang/rust/pull/77144 ? (pr was not approved yet)
comment created time in a month
pull request commentrust-lang/rust-clippy
Revert: or_fun_call should lint calls to `const fn`s with no args
Ok :+1:
@bors r+
comment created time in a month
pull request commentrust-lang/rust-clippy
Revert: or_fun_call should lint calls to `const fn`s with no args
Just making sure I understood correctly;
The changes that are being reverted here were based on the assumption that const fns were always evaluated at compiletime BUT this is wrong because they are only evaluated at compile time if called from a const context (such as const var bindings)?
comment created time in a month
pull request commentrust-lang/rust-clippy
Fix a FP in `explicit_counter_loop`
Thanks! @bors r+
comment created time in a month
pull request commentrust-lang/rust
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
comment created time in a month
push eventmatthiaskrgr/rust
commit sha e5447a22222ecc6a650e75282cb9931b910854b2
Fix #76432 Only insert StorageDeads if we actually removed one. Fixes an issue where we added StorageDead to a place with no StorageLive
commit sha c100e726c10fe9d212a58a5494126409e7d0e10b
Stabilize intra-doc links
commit sha 63d5beec43ff7721928821cd83f9790188b03276
Move intra-doc-links documentation out of unstable section
commit sha bc06674774e6457046e41a48dc3e8be8c5496f11
Mention super/crate/self in docs
commit sha f072e4a7322e8e2b16410e3225e1afc15d132e36
Mention URL fragments
commit sha 2a98409634ec38547d03512898192b5bdce15f3d
Fill out docs on intra-doc resolution failure lint
commit sha 4e0eb0b73ba2defaf0f3c2152e9daa5c18d1603f
Update src/doc/rustdoc/src/linking-to-items-by-name.md Co-authored-by: Joshua Nelson <[email protected]>
commit sha 175e30539d5ee9364a26f89f8a03a60b53690684
Update src/doc/rustdoc/src/linking-to-items-by-name.md Co-authored-by: Joshua Nelson <[email protected]>
commit sha 51c1351f7b9366a295dce5d63c2fd387170d5c34
Resolve some conflicts
commit sha 6f1fa2b16376f586285453045788519df527a1b2
Fix lint name in docs
commit sha 792b2ea5812a06fe3d362ae36025998af66199ee
Update src/doc/rustdoc/src/lints.md Co-authored-by: Joshua Nelson <[email protected]>
commit sha ff1a9e406bfccefedb6c4f2cabc0c4d59ac947d4
Fix underflow when calculating the number of no-op jumps folded When removing unwinds to no-op blocks and folding jumps to no-op blocks, remove the unwind target first. Otherwise we cannot determine if target has been already folded or not. Previous implementation incorrectly assumed that all resume targets had been folded already, occasionally resulting in an underflow: remove_noop_landing_pads: removed 18446744073709551613 jumps and 3 landing pads
commit sha 6928041c0a992093a7752ae3c04090caebcd4515
Update src/doc/rustdoc/src/linking-to-items-by-name.md Co-authored-by: Joshua Nelson <[email protected]>
commit sha f05b47ccdfa63f8b4b9fb47a9aa92381801d3ff1
Don't download/sync llvm-project submodule if download-ci-llvm is set llvm-project takes > 1GB storage space and a long time to download. It's better to not download it unless needed.
commit sha 1146c39da74b3875e6667aeeafde2773644dc8b6
cache types during normalization
commit sha d4039c55c9ef392261aeaba6c14ae81f5098139a
wip emit errors during AbstractConst building
commit sha 30cbc9729654c66b9f54779d18f023e47112cdf2
words
commit sha 389b7ff19074988a3855bbc5ba7b19eb903a6fb4
Do not link LLVM tools to LLVM dylib unless rustc is Previously we would have some platforms where LLVM was linked to rustc statically, but to the LLVM tools dynamically. That meant we were distributing two copies of LLVM: one as a separate dylib and one statically linked in to librustc_driver.
commit sha 16047d46a10813a25e956e659b8861cc67c20cd2
fix typo in docs and comments
commit sha db74e1f1e3e5c7497bb9af68814497c8df1fd0b8
Add cfg(target_has_atomic_equal_alignment). This is needed for Atomic::from_mut.
push time in a month
issue commentrust-lang/rust
rustbuild: "changelog-seen = 1" breaks config.toml
Apparently the script wants it at the beginning of the toml file, the warning message should says so :roll_eyes:
comment created time in a month
issue openedrust-lang/rust
rustbuild: "changelog-seen = 1" breaks config.toml
warning: x.py has made several changes recently you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `changelog-seen = 1` to `config.toml`
So I skipped through the changelog and added changelog-seen = 1 to the end of my config toml but this broke x.py:
failed to parse TOML configuration 'config.toml': unknown fieldchangelog-seen, expected one ofsign-folder,gpg-password-file,upload-addr,src-tarball,missing-toolsfor keydistat line 522 column 1
created time in a month
issue commentrust-lang/rust
llvm segfaults during bootstrap of rustc_middle in stage 1
Still crashes after llvm update in https://github.com/rust-lang/rust/pull/77063
comment created time in a month
Pull request review commentrust-lang/rust
impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let res = match bin_op { Eq => l == r, Ne => l != r,- Lt => l < r,+ Lt => !l & r, // equals l < r
Alright, I removed changes from the pr. Sprinkling the rustc code with clippy allow attributes is probably something most people would object though.
comment created time in a month
push eventmatthiaskrgr/rust
commit sha 27c90b881df93b53fd3f24dcbfed116379c2fc69
initial implementation of OpenOptions to c_int
commit sha eb3906be4ad375cc6b83cd6a6e0116817db22575
Fix typo get openoptions function name Co-authored-by: Ivan Tham <[email protected]>
commit sha 1bc0627607262cc60a7692b16e205f30fc88b89f
Add as_flag function to the OpenOptionsExt struct
commit sha 2c9e27b759a9e9feeb943fb855e32d7383d1dcc6
Merge branch 'convert-openoptions-cint' of github.com:FedericoPonzi/rust into convert-openoptions-cint
commit sha 7c1e5c1dcd25c945f619eda289f639dbe2b002da
Update OpenOptions::as_flags docs, and minor styling
commit sha 321b680fe66d1be04cd67fac75ff7f148fd117fe
Update docs of OpenOptions::as_flags
commit sha 70292d45060ee2b8829e2af0be54d5a76696cd1d
Sets as_flags as unstable
commit sha 63dbfb3c30c96449eb1e0236b4f6fa5d60bdf609
Start of moving some functionality to separate files
commit sha bfe5bc9cb93445c7e2818db684de2bf1d84a06c7
Formatter moved one use statement
commit sha 6fd80e35e03f0acf48c065d6682600d32b27915f
Moved another struct and used pub(super) to be explicit
commit sha 3e770645aade4b7e34898a9f102bd5e4d5589f32
Moved a struct only need by util into util
commit sha c190f66060ee3ae4aa84a1c291b3a95ce77e6dc8
Moved GatherLocalsVisitor to its own file
commit sha c8162c22ebce04a7a70739cb09b913ee162c4d0a
Moved the FnCtxt struct to its own file
commit sha 45fdf97d1131324b32510ab012825ccf600e947a
Removed util.rs Per suggestion of @oli-obk. This file was rather short and joining it did not cause mod.rs to become significantly bigger.
commit sha 7995d5cda4cd5154def40770f4527e7867f37c1a
Moved Inherited struct to own file
commit sha b1e93796797624f33ea4f0f8563d002f28234d7d
Formatted use statements for fewer lines
commit sha 428a8c6eae7eadc08e8048929050818829ea7b4d
Moved the Diverges struct to its own file
commit sha f896ddfc737d9ba9be22f60e8194986a6dc589ad
Moved the Expectation enum to its own file
commit sha 99e2e7075c0e32644498dd0bb64aae9a76ecfbce
Moved all functions prefixed with 'check' to a separate file
commit sha fe6fc555acd51bd7ba8755d9fbc7060feb67be25
Add a changelog for x.py - Add a changelog and instructions for updating it - Use `changelog-seen` in `config.toml` and `VERSION` in bootstrap to determine whether the changelog has been read - Nag people if they haven't read the x.py changelog + Print message twice to make sure it's seen - Give different error messages depending on whether the version needs to be updated or added
push time in a month
pull request commentrust-lang/rust-clippy
Fix a FP in `explicit_counter_loop`
Shouldn't we keep some tests where the counters are incremented at the start of the loop?
comment created time in a month
Pull request review commentrust-lang/rust
impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let res = match bin_op { Eq => l == r, Ne => l != r,- Lt => l < r,+ Lt => !l & r, // equals l < r Le => l <= r,- Gt => l > r,+ Gt => l & !r, // equals l > r
Hm. To me true & !false is easier to understand than true > false.
comment created time in a month
push eventmatthiaskrgr/rust
commit sha c5975e9b6c5781b3b7300b7921c14b060086e1c1
Reduce duplicate in liballoc reserve error handling
commit sha 28db5214d2c48e7a58cf79b9e272097260910a33
More implementations of Write for immutable refs Fixes #73836
commit sha ec7f9b927f1896c7f29c602d6b0f961c891d0941
Deduplicates io::Write implementations
commit sha 8f27e3cb1b4140d9124d60df0850ef734e73b884
Make some methods of `Pin` unstable const Make the following methods unstable const under the `const_pin` feature: - `new` - `new_unchecked` - `into_inner` - `into_inner_unchecked` - `get_ref` - `into_ref` Also adds tests for these methods in a const context. Tracking issue: #76654
commit sha eede953c283c7bbe903a0e8abb44c923baf5cfac
Only get ImplKind::Impl once
commit sha ed6c7efd87f17a7d9282f4bc7341cb5cbda8db4d
Use enum for status of non-const ops
commit sha c3607bd7dd323a898b8cc9d2c603dfd14172c73c
Use helper function for searching `allow_internal_unstable`
commit sha e4edc161f20ccbc77fffb7ceb60ebb6102cbd747
Give name to extra `Span` in `LiveDrop` error
commit sha 81b3b66487c7001a0dbadf7f9af41ad714702533
Error if an unstable const eval feature is used in a stable const fn
commit sha 1e1257b8f87d1e3073020df27765dc57fcf2c0cd
Bless `miri-unleashed` tests `const_mut_refs` doesn't actually work in a `const` or `static`
commit sha abc71677da866fd36c70790e768f36d2f809c493
Test that `const_precise_live_drops` can't be depended upon stably
commit sha 7e24136996fd412ba2890952d5f0ddffb3cb7370
Pass --target to lint docs Otherwise, we may not have a standard library built for the native "host" target of the rustc being run.
commit sha bd4e0af0b54afc91903c282740e25ee6135224c8
Build rustdoc for cross-compiled targets This isn't an issue for most folks who use x.py dist, which will directly depend on this. But for x.py build, if we don't properly set target here rustdoc will not be built. Currently, there is not a default-on step for generating a rustc for a given target either, so we will fail to build a rustc as well.
commit sha 363aff0a9d0b85285b7501cb04dd8263d29d273a
Add test for x.py build cross-compilation
commit sha e3c6e46168758642f0bab64da374f93ed21b1cd0
Make some methods of `Pin<&mut T>` unstable const Make the following methods unstable const under the `const_pin` feature: - `into_ref` - `get_mut` - `get_unchecked_mut`
commit sha f7d5080ec3c21c5418649a1c5b3f830ff37734f1
don't take `TyCtxt` by reference
commit sha a219ad64a6ee025b9a5c83de390280f818cd81c6
extend `is_ty_or_ty_ctxt` to self types
commit sha 67f319c30bed5c83ae3b4872109999a8a574f29e
take `TyCtxt` by value
commit sha 2a00dda90258576e3adf5ecae0437a8fe6fadbcf
miri: correctly deal with `ConstKind::Bound`
commit sha 67342304253d8af47fe4453fbe2396b627620431
do not ICE on `ty::Bound` in Layout::compute
push time in a month
issue openedrust-lang/rust-clippy
FP explicit_counter_loop: var incremented before usage
<!-- Thank you for filing a bug report! 🐛 Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. -->
I tried this code:
pub fn main() {
let mut i = 0;
let v = vec!["a", "b", "c"];
for x in &v {
i += 1;
println!("{}", i)
}
}
explicit_counter_loop will trigger here and suggest to use .iter().enumerate().
The problem is that we increment BEFORE using (and not at the end of the loop) so the first iteration will print 1 and not 0 as it would with .enumerate().
This newly suggested code is off by one as can be seen here:
pub fn main() {
let mut i = 0;
let v = vec!["a", "b", "c"];
for (x, _) in v.iter().enumerate() {
i += 1;
println!("i is {} but x is {}", i, x)
}
}
i is 1 but x is 0
i is 2 but x is 1
i is 3 but x is 2
clippy 0.0.212 (fb1dc34 2020-09-21)
created time in a month
Pull request review commentrust-lang/rust
impl<'a> State<'a> { { self.rbox(0, b); let len = elts.len();- let mut i = 0;- for elt in elts {+ for (i, elt) in elts.iter().enumerate() { self.maybe_print_comment(get_span(elt).hi()); op(self, elt);- i += 1; if i < len { self.s.word(","); self.maybe_print_trailing_comment(get_span(elt), Some(get_span(&elts[i]).hi()));
oh right! Thanks.
comment created time in a month
Pull request review commentrust-lang/rust
impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let res = match bin_op { Eq => l == r, Ne => l != r,- Lt => l < r,+ Lt => !l & r, // equals l < r Le => l <= r,- Gt => l > r,+ Gt => l & !r, // equals l > r
The assembly is the same, (one of the functions even gets removed in the example because its identical to the other one) https://godbolt.org/z/czfczr
comment created time in a month
PR opened rust-lang/rust
commits stand alone and can be reviewed one by one
pr created time in a month
issue openedrust-lang/rust-clippy
FP mut_range_bound: range bound modified inside enclosing loop
In this code we first create the mut range bound, and mutate it in another loop which means the loop that actually uses the range is executed several times with different bounds (even if it is true that inside the usage of the range, changing the index has no effect on the inner loop.
fn main() {
let mut i = 3;
while i < 1000 { // this invalidates the lint warning
for x in i..9 { // this will be unaffected by the i+=4 but we modify i AND LOOP AGAIN!
i += 4; // lint warns about this
}
if i > 12 {
return;
}
}
}
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=30343889f1b8be663adb15c2d8184c2a
The lint should probably only fire if range bound variable and the range bounds usage are in the same scope?
Meta
clippy 0.0.212 (1fd5b9d 2020-09-20)
created time in a month
issue commentrust-lang/rust-clippy
Use rust-project.json instead of patching Cargo.toml
Hm, right now, ra is broke for me anyway, see https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Fixing.20sysroot.20loading
comment created time in a month
issue commentrust-lang/rust-clippy
Use rust-project.json instead of patching Cargo.toml
Mhh, it seems that 76856 did not help, RA does not automatically find rustc sources in clippy, at least when I tried.
cc https://github.com/rust-analyzer/rust-analyzer/issues/3517
I found compiler sources at ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler.
We could perhaps use that (and use master toolchain sources) instead of some kind of path to a local repo at least...
comment created time in a month
pull request commentrust-lang/rust-clippy
single_char_insert_str: lint using insert_str() on single-char literals and suggest insert()
I made it a separate lint because this way users could disable push_str and insert_str independently but it's probably better to just make it one lint since the patterns are so similar.
comment created time in a month
pull request commentrust-lang/rust
make replace_prefix only take &str as arguments
ah, well I did include the other pr in this one to avoid merge conflicts later down the road
comment created time in a month
pull request commentrust-lang/rust
make replace_prefix only take &str as arguments
r? @lcnr
comment created time in a month
pull request commentrust-lang/rust
use if let instead of single match arm expressions
r? @Dylan-DPC
comment created time in a month
issue commentrust-lang/rust
ICE resolving non-existent PartialEq::Eq from match of const
Still crashing (obviously on nightly, beta and stable by now...).
warning: variant is never constructed: `Some`
--> src/main.rs:5:5
|
5 | Some(*const T), // Can also use PhantomData<T>
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: Error finalizing incremental compilation session directory `/tmp/a/target/debug/incremental/a-3ibewktm5f4s7/s-frdnn34p4t-5wozmt-working`: No such file or directory (os error 2)
warning: 2 warnings emitted
error: internal compiler error: broken MIR in DefId(0:6 ~ a[e6bb]::foo[0]) (NoSolution): could not prove TraitPredicate(<[O<B>] as std::cmp::PartialEq>)
|
= note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:258:27
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:961:13
stack backtrace:
0: 0x7fb253922b30 - std::backtrace_rs::backtrace::libunwind::trace::he85dfb3ae4206056
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
1: 0x7fb253922b30 - std::backtrace_rs::backtrace::trace_unsynchronized::h1ad28094d7b00c21
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/../../backtrace/src/backtrace/mod.rs:66
2: 0x7fb253922b30 - std::sys_common::backtrace::_print_fmt::h901b54610713cd21
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/sys_common/backtrace.rs:79
3: 0x7fb253922b30 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb0ad78ee1571f7e0
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/sys_common/backtrace.rs:58
4: 0x7fb253990e7c - core::fmt::write::h1857a60b204f1b6a
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/core/src/fmt/mod.rs:1080
5: 0x7fb253914f07 - std::io::Write::write_fmt::hf7b7d7b243f84a36
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/io/mod.rs:1517
6: 0x7fb253927880 - std::sys_common::backtrace::_print::hd093978a5287b8ff
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/sys_common/backtrace.rs:61
7: 0x7fb253927880 - std::sys_common::backtrace::print::h20f46787581d56d7
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/sys_common/backtrace.rs:48
8: 0x7fb253927880 - std::panicking::default_hook::{{closure}}::h486cbb4b82ffc357
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/panicking.rs:208
9: 0x7fb253927538 - std::panicking::default_hook::h4190c9e3edd4d591
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/panicking.rs:227
10: 0x7fb2541bb8d4 - rustc_driver::report_ice::h0baa69c9fa359ad1
11: 0x7fb2539280b6 - std::panicking::rust_panic_with_hook::h72e78719cdda225c
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/panicking.rs:581
12: 0x7fb253927c39 - std::panicking::begin_panic_handler::{{closure}}::h8bd07dbd34150a96
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/panicking.rs:484
13: 0x7fb253922fbc - std::sys_common::backtrace::__rust_end_short_backtrace::hdb6b3066ad29028a
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/sys_common/backtrace.rs:153
14: 0x7fb253927bf9 - rust_begin_unwind
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/panicking.rs:483
15: 0x7fb253927bab - std::panicking::begin_panic_fmt::hc19e75fd2b7bc39b
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/panicking.rs:437
16: 0x7fb2572fd471 - rustc_errors::HandlerInner::flush_delayed::hc01570dc9a0301e8
17: 0x7fb2572f9dd1 - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::h2fa2449267c97abc
18: 0x7fb2541df306 - core::ptr::drop_in_place::h3ccf454d686c35e3
19: 0x7fb2541e9d36 - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h9871ec79020d3d08
20: 0x7fb2541cdb4d - core::ptr::drop_in_place::h37be4f3688653901
21: 0x7fb2541bfd31 - rustc_span::with_source_map::he9a81669cd160b82
22: 0x7fb2541eebd8 - rustc_interface::interface::create_compiler_and_run::h06c2389085f2a79e
23: 0x7fb2541c02aa - rustc_span::with_session_globals::h3a06e50e1db00721
24: 0x7fb2541f148d - std::sys_common::backtrace::__rust_begin_short_backtrace::h6f73648415d0d9ce
25: 0x7fb2541621ce - core::ops::function::FnOnce::call_once{{vtable.shim}}::h213be4bbd07cfb62
26: 0x7fb25393796a - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h1080dfe0ef616bdf
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/alloc/src/boxed.rs:1042
27: 0x7fb25393796a - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hd2747e1f2d5cec32
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/alloc/src/boxed.rs:1042
28: 0x7fb25393796a - std::sys::unix::thread::Thread::new::thread_start::hd0f336b4ef6808a7
at /rustc/f68e08933d8f519a9655934fedebbc509661b219/library/std/src/sys/unix/thread.rs:87
29: 0x7fb2538343e9 - start_thread
30: 0x7fb253751293 - __GI___clone
31: 0x0 - <unknown>
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.48.0-nightly (f68e08933 2020-09-19) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
error: could not compile `a`
```
comment created time in a month
pull request commentrust-lang/rust
Validate constants during `const_eval_raw`
Looks like this introduced some perf regressions https://perf.rust-lang.org/compare.html?start=10b3595ba6a4c658c9dea105488fc562c815e434&end=5e449b9adff463455743291b0c1f76feec092992&stat=instructions:u
comment created time in a month
pull request commentrust-lang/rust-clippy
Forbid redundant_pattern_matching triggering in macros
Mmh, looks like a test is failing: https://github.com/rust-lang/rust-clippy/pull/6069/checks?check_run_id=1139967161#step:10:138
comment created time in a month
Pull request review commentrust-lang/rust-clippy
Add new lint `unnecessary_wrap`
+use crate::utils::{+ is_type_diagnostic_item, match_qpath, multispan_sugg_with_applicability, paths, return_ty, snippet,+ span_lint_and_then,+};+use if_chain::if_chain;+use rustc_errors::Applicability;+use rustc_hir::intravisit::{FnKind, NestedVisitorMap, Visitor};+use rustc_hir::*;+use rustc_lint::{LateContext, LateLintPass};+use rustc_middle::{hir::map::Map, ty::subst::GenericArgKind};+use rustc_session::{declare_lint_pass, declare_tool_lint};+use rustc_span::Span;++declare_clippy_lint! {+ /// **What it does:** Checks for private functions that only return `Ok` or `Some`.+ ///+ /// **Why is this bad?** It is not meaningful to wrap values when no `None` or `Err` is returned.+ ///+ /// **Known problems:** Since this lint changes function type signature, you may need to+ /// adjust some codes at callee side.+ ///+ /// **Example:**+ ///+ /// ```rust+ /// pub fn get_cool_number(a: bool, b: bool) -> Option<i32> {+ /// if a && b {+ /// return Some(50);+ /// }+ /// if a {+ /// Some(0)+ /// } else {+ /// Some(10)+ /// }+ /// }+ /// ```+ /// Use instead:+ /// ```rust+ /// pub fn get_cool_number(a: bool, b: bool) -> i32 {+ /// if a && b {+ /// return 50;+ /// }+ /// if a {+ /// 0+ /// } else {+ /// 10+ /// }+ /// }+ /// ```
public functions should not be linted, so the example code should not be pub fns :)
comment created time in a month
Pull request review commentrust-lang/rust-clippy
Add new lint `unnecessary_wrap`
+// run-rustfix++#![warn(clippy::unnecessary_wrap)]+#![allow(clippy::no_effect)]+#![allow(clippy::needless_return)]+#![allow(clippy::if_same_then_else)]+#![allow(dead_code)]++// should be linted+fn func1(a: bool, b: bool) -> Option<i32> {+ if a && b {+ return Some(42);+ }+ if a {+ Some(-1);+ Some(2)+ } else {+ return Some(1337);+ }+}++// public fns should not be linted+pub fn func2(a: bool) -> Option<i32> {+ if a {+ Some(1)+ } else {+ Some(1)+ }+}++// should not be linted+fn func3(a: bool) -> Option<i32> {+ if a {+ Some(1)+ } else {+ None+ }+}++// should be linted+fn func4() -> Option<i32> {+ Some(1)+}++// should be linted+fn func5() -> Result<i32, ()> {+ Ok(1)+}+
a test function that always Err or None might be useful as well.
comment created time in a month
push eventmatthiaskrgr/rust
commit sha 00d537dcd03f9ff5ebdf8b86e039dbdb0a7f850c
deny(unsafe_op_in_unsafe_fn) in libstd/path.rs
commit sha 0f2bd56b29857453835e47abbe96a80b175632d1
lint/ty: move fns to avoid abstraction violation This commit moves `transparent_newtype_field` and `is_zst` to `LateContext` where they are used, rather than being on the `VariantDef` and `TyS` types. Signed-off-by: David Wood <[email protected]>
commit sha 6092828d1f432bb313818e7cfab961c0e494f69e
Add `[T; N]: TryFrom<Vec<T>>` This is very similar to the existing `Box<[T; N]>: TryFrom<Box<[T]>>`, but allows avoiding the `shrink_to_fit` if you have a vector and not a boxed slice.
commit sha f8376b59d1391a5191a561c44067355f1a99c7c0
shim: monomorphic `FnPtrShim`s during construction This commit adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`) - as substitutions will no longer occur during codegen, function pointer shims can now be polymorphic without incurring double substitutions. Signed-off-by: David Wood <[email protected]>
commit sha 6cb671628393e292d5e68e6367f80488ace46532
Add test for checking if-let or-patterns
commit sha 2c8a4c8f73e8b36e72b15e7f97ef29ad36c15e17
Nightly is currently 1.48
commit sha 685f04220ee584f00f60e5ff9d7aca16351c5399
Clean up vec benches bench_in_place style
commit sha 3d89ee9586354e736cfe4a472d8aaa507d10f77c
Typo fix Thanks, Amanieu Co-authored-by: Amanieu d'Antras <[email protected]>
commit sha caeb5544ecd9dba4d67b68b8c1b32d8132c6d5f2
do not inline black_box when building for Miri
commit sha 4b5cd544d1268df8f95424a7dc77ce6c852bac56
use black_box instead of local optimziation barriers in const tests where possible
commit sha 47668edb64ed1f8676cfcb4c9ccb6fe018f660c5
Separate feature flags Co-authored-by: Ivan Tham <[email protected]>
commit sha 284b16913aa6fccdf7b14edc3bb2693aadd39919
add missing feature flag
commit sha daa62d9081bfeeb0f438f88eb69082c227a5c221
Add as_str() and AsRef to string::Drain.
commit sha 673284058b53992cfd66c04b9db8e551a0dc9996
Show remaining data in string::Drain's Debug impl.
commit sha f5bb523e94b431c35b495b6ad6ae94495b653a5f
Add AsRef<[u8]> for String's Drain.
commit sha f2a32909e0649eb589406ddac63597ba34273c95
Mark AsRef impls for String's Drain as stable. Trait implementations effectively can't be #[unstable].
commit sha 829019d4043a6e9dd1305113f43b30fc8415893d
Disable AsRef implementations for String's Drain. Since trait implementations cannot be unstable, we should only add them when the as_str feature gets stabilized. Until then, only `.as_str()` is available (behind a feature gate).
commit sha 91f7d761e762d0d9f47cf61cf5d942fd93eaf2a8
also assert ScalarMaybeUninit size
commit sha f567287f9f35e4d4781213bddc5770e270f48d0a
don't convert types to the same type with try_into (clippy::useless_conversion)
commit sha de0d55cb3c197b13d90922c8998bf90399f3b8a2
library/panic_unwind: Add UNWIND_DATA_REG for RISC-V 32-bit Signed-off-by: Alistair Francis <[email protected]>
push time in a month
pull request commentrust-lang/rust
Warn-by-default lint for unused borrows
How similar is this to clippys needless_borrow lint? https://rust-lang.github.io/rust-clippy/master/#needless_borrow
comment created time in a month
push eventmatthiaskrgr/rust
commit sha 40dddd33059344b546a11f150c0ec63e797f021c
use matches!() macro for simple if let conditions
push time in a month
Pull request review commentrust-lang/rust
use matches!() macro for simple if let conditions
impl<'a, 'tcx> Builder<'a, 'tcx> { ); } StmtKind::Let { remainder_scope, init_scope, pattern, initializer, lint_level } => {- let ignores_expr_result =- if let PatKind::Wild = *pattern.kind { true } else { false };+ let ignores_expr_result = matches!(*pattern.kind, PatKind::Wild);
This one is actually needed
error[E0308]: mismatched types
--> compiler/rustc_mir_build/src/build/block.rs:99:70
|
99 | let ignores_expr_result = matches!(pattern.kind, PatKind::Wild);
| ------------ ^^^^^^^^^^^^^ expected struct `std::boxed::Box`, found enum `thir::pattern::PatKind`
| |
| this expression has type `std::boxed::Box<thir::pattern::PatKind<'_>>`
|
::: compiler/rustc_mir_build/src/thir/pattern/mod.rs:121:5
|
121 | Wild,
| ---- unit variant defined here
|
= note: expected struct `std::boxed::Box<thir::pattern::PatKind<'_>>`
found enum `thir::pattern::PatKind<'_>`
```
comment created time in a month
push eventmatthiaskrgr/rust
commit sha 6d316b7e89ea8ed65fc47ed60fc52d44fdf4b3f1
use matches!() macro for simple if let conditions
push time in a month
PR opened rust-lang/rust
use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
pr created time in a month