profile
viewpoint

danmar/cppcheck 2971

static analysis of C/C++ code

matthiaskrgr/cargo-cache 257

manage cargo cache (${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively

FLIF-hub/flifcrush 40

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

pull request commentrust-lang/rust

Remove two fields from `SubstFolder`.

That's strange, I don't think I am in the reviewers list/have r+ powers 😅

nnethercote

comment created time in a day

pull request commentrust-lang/rust

Remove two fields from `SubstFolder`.

Did you mean to r? matthewjasper perhaps?

nnethercote

comment created time in a day

push eventmatthiaskrgr/cargo

Matthias Krüger

commit sha f23b91190ccb103d8041a14e2a715095dcae0ce7

use sort_by_key() instead of comparing by keys manually replace format!() macro by String::from() use eprintln() instead of manually writing to std::io::stderr

view details

push time in a day

pull request commentrust-lang/rust-clippy

Add derive_ord_xor_partial_ord lint

Tests around tests/ui-toml/conf_deprecated_key/clippy.toml are failing for some reason.

Ryan1729

comment created time in 2 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha 21249c81ffcea87ecea48e0fd64d06a251a691ab

changelog: bump to git

view details

push time in 3 days

created tagmatthiaskrgr/cargo-cache

tag0.5.0

manage cargo cache (${CARGO_HOME}, ~/.cargo/), print sizes of dirs and remove dirs selectively

created time in 3 days

PR opened rust-lang/cargo

cargo login: make login message less ambiguous

The previous message "please visit https://crates.io/me and paste the API Token below" Had me waiting for a token to appear in the command line which I would then paste into the website. Rephrase to "please paste the api token found on https://crates.io/me below" to clarify where to paste from and where to paste to.

+1 -1

0 comment

1 changed file

pr created time in 3 days

create barnchmatthiaskrgr/cargo

branch : cargo_login_message

created branch time in 3 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha b0af6761dd6dd6c9fb578fbc94b729127db27c24

forgot to update cargo lock... :-/

view details

push time in 3 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha a2d8866c54009a972ba23a1ef09e45b93ac65c6c

bump version from 0.4.3 to 0.5.0

view details

push time in 3 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha 878ecede11a19aad6e7470f5403c08f0a18787d8

readme: add sc and clean-unref subcommands to key-features

view details

push time in 3 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha 2b24314b51e156bd9a4fd1497239dedbeed5e97b

release checklist: remove "--document-private-items" from rustdoc call

view details

push time in 3 days

issue openedrust-lang/rust

ICE: glacier 65918.rs with -Zmir-opt-level=2

<!-- 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 from glaciers 65918.rs, original ticket: https://github.com/rust-lang/rust/issues/65918 The code still ICEs when checking with -Zmir-opt-level=2

#![feature(type_alias_impl_trait)]

use std::marker::PhantomData;

/* copied Index and TryFrom for convinience (and simplicity) */
trait MyIndex<T> {
    type O;
    fn my_index(self) -> Self::O;
}
trait MyFrom<T>: Sized {
    type Error;
    fn my_from(value: T) -> Result<Self, Self::Error>;
}

/* MCVE starts here */
trait F {}
impl F for () {}
type DummyT<T> = impl F;
fn _dummy_t<T>() -> DummyT<T> {}

struct Phantom1<T>(PhantomData<T>);
struct Phantom2<T>(PhantomData<T>);
struct Scope<T>(Phantom2<DummyT<T>>);

impl<T> Scope<T> {
    fn new() -> Self {
        unimplemented!()
    }
}

impl<T> MyFrom<Phantom2<T>> for Phantom1<T> {
    type Error = ();
    fn my_from(_: Phantom2<T>) -> Result<Self, Self::Error> {
        unimplemented!()
    }
}

impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<Phantom1<T>> for Scope<U> {
    type O = T;
    fn my_index(self) -> Self::O {
        MyFrom::my_from(self.0).ok().unwrap()
    }
}

fn main() {
    let _pos: Phantom1<DummyT<()>> = Scope::new().my_index();
}

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. --> repo is @ 12799ad60ca66b664699a0145f5ac5ccc399d4b8

Error output

error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<T as MyFrom<Phantom2<impl F>>>)` during codegen
  |
  = note: delayed at /home/matthias/vcs/github/rust/src/librustc_session/session.rs:436:27

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:366:17
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.47.0-dev 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(<T as MyFrom<Phantom2<impl F>>>)` during codegen
  |
  = note: delayed at /home/matthias/vcs/github/rust/src/librustc_session/session.rs:436:27

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:366:17
stack backtrace:
   0:     0x7f0523b945a0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he42d29a748bbbd1e
   1:     0x7f0523c32a1c - core::fmt::write::hc3de054a6627b208
   2:     0x7f0523bb3753 - std::io::Write::write_fmt::h0f31a08a1acea6c9
   3:     0x7f0523bad080 - std::panicking::default_hook::{{closure}}::h500bdbd0f32aff44
   4:     0x7f0523baccbd - std::panicking::default_hook::h0dc2e03bf7be0812
   5:     0x7f0524c9be69 - rustc_driver::report_ice::h39a24bccd856358c
   6:     0x7f0523bad706 - std::panicking::rust_panic_with_hook::h8248fec3d52a4e49
   7:     0x7f052760554e - std::panicking::begin_panic::h6ec4b207f043b463
   8:     0x7f05275d273e - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::h8580a5b14d9a09b5
   9:     0x7f0524b16046 - core::ptr::drop_in_place::h8e2a841ebc57267b
  10:     0x7f0524b1a700 - core::ptr::drop_in_place::hb3d9f649584de58e
  11:     0x7f0524b21e9d - core::ptr::drop_in_place::hf58666ccabfba218
  12:     0x7f0524aea720 - rustc_interface::interface::create_compiler_and_run::ha17d896c1829f0ee
  13:     0x7f0524c5c0de - scoped_tls::ScopedKey<T>::set::he92bf0fa18655a94
  14:     0x7f0524b0315c - std::sys_common::backtrace::__rust_begin_short_backtrace::h04546cabc08d32c7
  15:     0x7f0524c6773e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h9dd17cde02219cce
  16:     0x7f0523baec38 - std::sys::unix::thread::Thread::new::thread_start::h66120da06ca148b6
  17:     0x7f05209af422 - start_thread
  18:     0x7f05239b2bf3 - __clone
  19:                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.47.0-dev 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 3 days

issue openedrust-lang/rust

hang: issue-55608-captures-empty-region.rs with -Zmir-opt-level=2

<!-- 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/impl-trait/issues/issue-55608-captures-empty-region.rs

// This used to ICE because it creates an `impl Trait` that captures a
// hidden empty region.

// check-pass

fn server() -> impl FilterBase2 {
    segment2(|| { loop { } }).map2(|| "")
}

trait FilterBase2 {
    fn map2<F>(self, _fn: F) -> Map2<F> where Self: Sized { loop { } }
}

struct Map2<F> { _func: F }

impl<F> FilterBase2 for Map2<F> { }

fn segment2<F>(_fn: F) -> Map2<F> where F: Fn() -> Result<(), ()> {
    loop { }
}

fn main() { server(); }

Meta

repo @ 12799ad60ca66b664699a0145f5ac5ccc399d4b8

Error output

Rustc simply hangs when running build/x86_64-unknown-linux-gnu/stage1/bin/rustc ./src/test/ui/impl-trait/issues/issue-55608-captures-empty-region.rs -Zmir-opt-level=2

created time in 3 days

pull request commentrust-lang/cargo

clippy fixes, use matches! macro in more places

Hm, I can't reproduce any test failure locally. :/

matthiaskrgr

comment created time in 4 days

issue openedmatthiaskrgr/cargo-cache

option to remove unused registry indices

Inspired by https://github.com/rust-lang/cargo/issues/8572

created time in 4 days

pull request commentrust-lang/cargo

clippy fixes, use matches! macro in more places

r? @ehuss

matthiaskrgr

comment created time in 4 days

push eventmatthiaskrgr/cargo

Matthias Krüger

commit sha d19be43ba1f5b055a94de9b2e95a0be5ff7d674f

use sort_by_key() instead of comparing by keys manually replace format!() macro by String::from() use eprintln() instead of manually writing to std::io::stderr

view details

push time in 4 days

PR opened rust-lang/cargo

clippy fixes, use matches! macro in more places
+41 -81

0 comment

11 changed files

pr created time in 4 days

create barnchmatthiaskrgr/cargo

branch : clippy_v16

created branch time in 4 days

PR opened rust-lang/rust

submodules: update cargo from 974eb438d to 2d5c2381e

Changes:

Use the same index location on nightly as beta
relax deprecated diagnostic message check
Don't print to raw stderr in test
Emit the `test` field in cargo metadata

r? @ehuss

Trying to get the fix to the registry-index-hash upstream soonish.

+1 -1

0 comment

1 changed file

pr created time in 4 days

push eventmatthiaskrgr/rust

flip1995

commit sha f7acea2683c6124854bfe20e7127e4dfba344d3e

Register redundant_field_names and non_expressive_names as early passes

view details

flip1995

commit sha 485229c4a3d6a2fbe40f5a6976a33144a27497c6

Fix fallout in redundant_field_names

view details

flip1995

commit sha efd3dcff97f67f376e354c047133ce9044c52991

Fix fallout in similar_names

view details

Eduardo Broto

commit sha bb37a0f948b02e6434dbe3ea615960052d37f784

Avoid triggering similar names on code from expansion

view details

Trevor Spiteri

commit sha 6dfe144bdd4413ac55cbb2ad2edfb1daa0c4bf15

stabilize const_nonzero_int_methods

view details

Trevor Spiteri

commit sha 9739b512a892628534e730ffcd9756b3218c8de8

stabilize some const_checked_int_methods

view details

Trevor Spiteri

commit sha c1c674c2dbfe3f6dc47d11368c1b5ee4ab008799

stabilize const_saturating_int_methods

view details

Trevor Spiteri

commit sha 056d925167318636fcf975c8ffb81efebdc9bca3

stabilize const_int_sign

view details

Trevor Spiteri

commit sha 2a84e313df095fd0e81b9348b68bd9b1d1caa551

stabilize const_ascii_ctype_on_intrinsics

view details

Adam Perry

commit sha d275739c09f266479d6db388cbf55ba6ca791b9d

Derive common traits for panic::Location. Add documentation about the host/target behavior of Location::file.

view details

Andrey Zgarbul

commit sha 7d4a92d4f8dc03409984695d78893fffdd3ff1f9

remove LengthAtMost32 on AsRef/Borrow impl for array

view details

Roman Proskuryakov

commit sha eff62069ad602090e8d27b83cffd9e77479ed4be

Remove the usage of the LengthAtMost32 trait

view details

Roman Proskuryakov

commit sha 4ad40a8737ab4ffaf6352ec4560fd86cb0b4ade8

Remove LengthAtMost32

view details

Roman Proskuryakov

commit sha 44dd95e4d008e9edc112dc1a599eac028889e015

Fix copypaste in test into-iter-impls-length-33 (const generic 32 -> 33)

view details

Roman Proskuryakov

commit sha 8fc7d47c8c43dab634aff15908ab42ca056dda07

Fix array docs (remove mentions about 0 to 32 where possible)

view details

Guillaume Gomez

commit sha 2ba68f1888401577b1f60d8868fdac5a895ba698

Clean up E0719 explanation

view details

Guillaume Gomez

commit sha 633d1a5af96db7eccb8aeeb07ff31b06aaf07b5f

Clean up E0720 explanation

view details

Brian Warner

commit sha 201999ccfd18a9debe1f186f30f40659ebc6b933

improve advice in iter_nth_zero The "use .next()" replacement advice is on the last line of the code snippet, where it is vulnerable to truncation. Display that advice at the beginning instead. closes #5783

view details

Michael Wright

commit sha d067d0352bfc5a6979f477bc96c969b040437618

Add test for `needless_range_loop` issue Closes #2277 This was fixed when we fixed #2542.

view details

flip1995

commit sha 6f25adbd5a1600653e8edf8de7135c397d73c07a

Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup

view details

push time in 4 days

create barnchmatthiaskrgr/rust

branch : cmp_true

created branch time in 5 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha b27cc9add1ab6a3b1c527f120adf5464c2fd28a7

retry

view details

push time in 5 days

create barnchmatthiaskrgr/cargo-cache

branch : ci_failure_filecreation

created branch time in 5 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha ccee699852b7531992f93fcd2fb9cd6033742c0d

changelog: fix mislabeled cmdline flag

view details

push time in 6 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha 7d4c9a8dc962c981b281e3a859e36c3f0e728d1b

clean-unref: fix printing of error (don't debug-print)

view details

push time in 6 days

pull request commentrust-lang/rust-clippy

Add derive_ord_xor_partial_ord lint

@bors retry

Ryan1729

comment created time in 7 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha d242e98a06df4c7c7e3654b53600996308f275cf

changelog: mention #84 (improve tests and build on NixOS)

view details

push time in 7 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha a46464a7c4f00ebf128af9f5dd96d236091d0800

cargo update

view details

push time in 7 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha ef2f7cfb73fdf68fe81cf1957f9101239f128fd4

remove redundant import

view details

push time in 7 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha ca389c506bd84a691c84eb1fcf08f1b3e0818198

tests: use cargo_metadata to obtain the target dir of cargo-cache

view details

Matthias Krüger

commit sha d7cf897e07ce619371f9807a116682f5f012de02

bin_path(): refactor to use PathBufs and use cargo_metadata to get target dir

view details

push time in 7 days

pull request commentrust-lang/rust-clippy

Add derive_ord_xor_partial_ord lint

Thanks! @bors r+

Ryan1729

comment created time in 7 days

PR opened rust-lang/rustfmt

Bump rustc-ap-* crates to 671.0.0
+47 -47

0 comment

2 changed files

pr created time in 8 days

create barnchmatthiaskrgr/rustfmt

branch : rustup_

created branch time in 8 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha eed295533f2ec40a4cec4810a35aef06af296ccb

deps: update cargo-metadata: 0.10.0 -> 0.11.0

view details

push time in 9 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha ec15461444ba074314b0757b948af9869fb9b292

deps: update cargo-metadata: 0.10.0 -> 0.11.0

view details

push time in 9 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha 0545da37bbe7dd053f7749f5eb730687a5b48247

run cargo update

view details

push time in 9 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha b98399b2cccee63a8632549c9a26551d65c4b3d0

allow clippy::option_if_let_else

view details

push time in 9 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha bc00086e5245f9d47296a21dd667281720f51b41

ci: clippy: fail build on any kind of warnings

view details

push time in 9 days

PR closed rust-lang/rust

submodules: update rustfmt and rls S-waiting-on-review
+115 -57

8 comments

3 changed files

matthiaskrgr

pr closed time in 10 days

pull request commentrust-lang/rust

submodules: update rustfmt and rls

https://github.com/rust-lang/rust/pull/74760

matthiaskrgr

comment created time in 10 days

pull request commentrust-lang/rust

submodules: update rustfmt and rls

Ah yes, I updated to the master branch, will fix in a bit.

matthiaskrgr

comment created time in 11 days

pull request commentrust-lang/rust

submodules: update rustfmt and rls

Mmh according to the cargo.lock, there are now two rustfmt-nightly versions with this pr..??

matthiaskrgr

comment created time in 11 days

pull request commentrust-lang/rust

submodules: update rustfmt and rls

Apparently rustfmt depends on dunce now which is licensed under CC0-1.0 and triggered CI failure. I see there already is another exception for the same license, should I add an exception for dunce as well?

    ("constant_time_eq", "CC0-1.0"),        // rustfmt
matthiaskrgr

comment created time in 11 days

PR opened rust-lang/rust

submodules: update rustfmt and rls
+115 -57

0 comment

3 changed files

pr created time in 11 days

push eventmatthiaskrgr/rust

Manish Goregaokar

commit sha 9a659c54e5c139d8d9a3e374b44c46bbd89788f8

Rollup merge of #73845 - CAD97:weak-as-unsized-ptr, r=RalfJung Use &raw in A|Rc::as_ptr This PR uses `&raw` for offsetting `*mut [A]RcInner<T> -> *mut T`. Additionally, this updates the implementation of `Weak::as_ptr` to support unsized `T`, though it does not yet relax the bounds of `Weak::as_ptr`/`into_raw`/`from_raw` to accept unsized `T`.

view details

Manish Goregaokar

commit sha 6339abd338607ab1513899f11303ced1a7c3d57f

Rollup merge of #73861 - GuillaumeGomez:create-e0767, r=Dylan-DPC Create E0768 r? @Dylan-DPC

view details

Manish Goregaokar

commit sha d46de1052d3edcc6538adf6d5fc8f87ab6fcf209

Rollup merge of #73881 - pierwill:pierwill-citations, r=jonas-schievink Standardize bibliographic citations in rustc API docs See #73877.

view details

Manish Goregaokar

commit sha 9d0ca3806ff5a3faee2299b6a1a2248d180aae4e

Rollup merge of #73925 - eduardosm:improve-pr72617-comments, r=RalfJung Improve comments from #72617, as suggested by RalfJung r? @RalfJung

view details

Manish Goregaokar

commit sha 60cad20b41d93c94c247cd32873e5c176effc7d2

Rollup merge of #73949 - wesleywiser:simplify_try_fixes, r=oli-obk [mir-opt] Fix mis-optimization and other issues with the SimplifyArmIdentity pass This does not yet attempt re-enabling the pass, but it does resolve a number of issues with the pass. r? @oli-obk I believe this closes #73223.

view details

Manish Goregaokar

commit sha 70c4b2ff6098b06229c1c04ea4f8e7cd0b8cdd19

Rollup merge of #73984 - pierwill:pierwill-tarjan, r=jonas-schievink Edit docs for rustc_data_structures::graph::scc - Add newline to provide concise module summary - Add wikipedia link - Italicize O notation

view details

Manish Goregaokar

commit sha e4c505b8792dc5593f37e23e2fb145d99b2a8619

Rollup merge of #73985 - e00E:fix-getting-started-link, r=jonas-schievink Fix "getting started" link The previous link is 404.

view details

Manish Goregaokar

commit sha e005c972554bd6a6d3e28697788637f0062fe150

Rollup merge of #73997 - rust-lang:lcnr-patch-1, r=jonas-schievink fix typo r? @Dylan-DPC

view details

Manish Goregaokar

commit sha d69a8468fa56199037d96b39f9827a5fb3302c12

Rollup merge of #73999 - eddyb:svv-prereq, r=Mark-Simulacrum Bump mingw-check CI image from Ubuntu 16.04 to 18.04. I chose 18.04 because we use it for other builders, and it's enough to get a version of MinGW that can build `libssh2-sys`. This is a prereq for #73902, where `libssh2-sys` shows up as an indirect dependency of `x.py check src/tools/semverver` (through `src/tools/cargo`, which we don't currently `x.py check` because it's not in-tree). See also https://github.com/rust-lang/rust/pull/73902#issuecomment-652414502. r? @Mark-Simulacrum cc @mati865

view details

bors

commit sha dbf3ae7c3beb5b493375bf76152e490b8cc81d1c

Auto merge of #74019 - Manishearth:rollup-2st3jsk, r=Manishearth Rollup of 12 pull requests Successful merges: - #73140 (Fallback to xml.etree.ElementTree) - #73670 (Add `format_args_capture` feature) - #73693 (Use exhaustive match in const_prop.rs) - #73845 (Use &raw in A|Rc::as_ptr) - #73861 (Create E0768) - #73881 (Standardize bibliographic citations in rustc API docs) - #73925 (Improve comments from #72617, as suggested by RalfJung) - #73949 ([mir-opt] Fix mis-optimization and other issues with the SimplifyArmIdentity pass) - #73984 (Edit docs for rustc_data_structures::graph::scc) - #73985 (Fix "getting started" link) - #73997 (fix typo) - #73999 (Bump mingw-check CI image from Ubuntu 16.04 to 18.04.) Failed merges: - #74000 (add `lazy_normalization_consts` feature gate) r? @ghost

view details

JarredAllen

commit sha c8f700ea697f74ef8f86891b050c859cf457e3ab

Fixed compile errors

view details

bors

commit sha 0cd7ff7ddfb75a38dca81ad3e76b1e984129e939

Auto merge of #72978 - matklad:ship-rust-analyzer, r=Mark-Simulacrum ship rust analyzer This successfully builds rust-analyzer as a part of rust repo. I haven't yet added required changes to dist.rs -- seems like I just have to copy-paste quite a bit of code I don't really understand :-)

view details

Bastian Kauschke

commit sha 7a3081baaf81c1d924f3143479ec0c4a8f1e62b7

add `lazy_normalization_consts` feature gate

view details

Tomasz Miąsko

commit sha 8900502a887d98a8f5a6b8774f1c756e89d4c29f

Remove unnecessary release from Arc::try_unwrap The thread that recovers the unique access to Arc inner value (e.g., drop when ref-count strong reaches zero, successful try_unwrap), ensures that other operations on Arc inner value happened before by synchronizing with release operations performed when decrementing the reference counter. When try_unwrap succeeds, the current thread recovers the unique access to Arc inner value, so release is unnecessary.

view details

Bastian Kauschke

commit sha 20d6941be7039eb7fad9a4f893792a77d65bc792

ConstCx to LocalDefId

view details

Bastian Kauschke

commit sha dbcabc248c0e035f916a5f4bb64b714640a5c338

instantiate_opaque_types LocalDefId

view details

Bastian Kauschke

commit sha f5305c3d16fb8221463ef604a1ea5ac11506ba6d

nit Co-authored-by: varkor <github@varkor.com>

view details

Oliver Scherer

commit sha 66fb778acc512213b8883101f275a7fa44c9b75d

Make `rustc_peek` a safe intrinsic

view details

Oliver Scherer

commit sha 394b8cdfb7734a6dcb10b392c5b83e1b3d9521d3

Match on `Symbol` instead of `&str` for type-checking intrinsics.

view details

Yuki Okushi

commit sha dcbe85abad8ddd3a39fcafe70a884db4e71f0b03

Explain exhaustive matching on {usize,isize} maximum values

view details

push time in 11 days

issue openedrust-lang/cargo

-Zminimal-versions hangs (takes >2 hours) to resolve dep graph

I have a Cargo.toml with around 1000 dependencies from one of the devs. When I run cargo update -Zminimal-versions on the crate, Resolving dependency graph... was not done after more than 2 hours.

cargo 1.46.0-nightly (4f74d9b2a 2020-07-08)

Cargo.toml.txt

created time in 12 days

push eventmatthiaskrgr/rls

Matthias Krüger

commit sha 53cd420122fd474326416db0371b4d0fd4f14324

deps: update racer and cargo

view details

push time in 12 days

PR opened rust-lang/rls

deps: update racer and cargo

fixes rls build with latest master toolchain

+49 -48

0 comment

2 changed files

pr created time in 12 days

create barnchmatthiaskrgr/rls

branch : rustup_5

created branch time in 12 days

pull request commentrust-lang/rust-clippy

Use `(std::)f64::EPSILON` in the examples as suggested in the lints

@bors retry

JohnTitor

comment created time in 13 days

pull request commentrust-lang/rust-clippy

Update Usage section of README.md

@bors retry

flip1995

comment created time in 13 days

issue commentrust-lang/rust-clippy

Run clippy panic

Thanks for the report. Is the code you run clippy on available somehow?

emacsist

comment created time in 13 days

issue openedrust-lang/rust

diagnostics: rustc displays confusing Ok(#[stable(feature = "rust1", since = "1.0.0")] T) if wrong match binding is used

If I have a function that returns Result<(), i32> and try to match on it with Ok() instead of Ok(()) or Ok(_), I get an error:

error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 1 field
   --> src/main.rs:7:9
    |
7   |         Ok() => {}
    |         ^^^^ expected 1 field, found 0
    |
   ::: /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/result.rs:250:5
    |
250 |     Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
    |     --------------------------------------------------- tuple variant defined here
    |
help: missing parenthesis
    |
7   |         Ok(()) => {}
    |           ^  ^

error: aborting due to previous error

The Ok(#[stable(feature = "rust1", since = "1.0.0")] T), comes from std but I think it can look very confusing to beginners, a simple Ok(T) would be much clearer here imo.

code:

fn a() -> Result<(), i32> {
    Ok(())
}

fn main() {
    match a() {
        Ok() => {} // should be: Ok(()) or Ok(_)
        Err(_) => {}
    }
}

created time in 13 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha ccb5ccd020e7d83812af35dfed11d03ce525abb9

sc: initial support of printing sizes

view details

Matthias Krüger

commit sha e7291ab138b4790b40d9fa5c426560907d39203b

rename display.rs to tables.rs

view details

Matthias Krüger

commit sha dbe51c53e4f58bc84eece2215581fd988869c66d

rename format_2_row_table to two_row_table

view details

Matthias Krüger

commit sha 74d196c83409c4976c4808f1dae2076ce2b920bd

move format_table function from top_items::common::format_table to tables::format_table

view details

Matthias Krüger

commit sha d3af605a5753e190421045e5ed46a371d2c24319

tables: add comments to understand how the function works

view details

Matthias Krüger

commit sha 1de7f5746a73796e012913af7527930a3b12fbde

sccache: properly include total size per day in the table

view details

Matthias Krüger

commit sha b944ecb3ac88ab81f7d4ecfcd6bd1c5455bd1617

changelog: update

view details

Matthias Krüger

commit sha a9acf22641e672e1ba0db5918a98978582ff0e14

run cargo fmt

view details

Matthias Krüger

commit sha 10850272f79751fe115e071af30ba450713244ea

sc: print percentage

view details

Matthias Krüger

commit sha 60ac504afafed349bb42e5260535227b3e55d46a

sccache: rename "Total Size" column to "Size"

view details

Matthias Krüger

commit sha 7b40dc97cbb4266eeab449c53c49ce4c892034ec

sccache: add some padding to cells, make table looks a bit nicer

view details

Matthias Krüger

commit sha e891c9ba2e11f80af995d4dee33735f2a4add291

sccache: print summary

view details

Matthias Krüger

commit sha 2012d0e677942b47d4bb91e5f46fc363a5be9cdd

make sccache_dir() return proper Result instead of Option and pass it through sccache_dir()

view details

Matthias Krüger

commit sha c0194fbfbcf09e53e422b033629aff56a227c825

tests: use cargo_metadata to obtain the target dir of cargo-cache

view details

Matthias Krüger

commit sha d7b0212f9cd714b9a7370f200cfebe81112bc596

bin_path(): refactor to use PathBufs and use cargo_metadata to get target dir

view details

Matthias Krüger

commit sha f978a6ba4df2db1c16ba6c2398b40f0a9c834488

no_cargo_home test: I incorrectly assumed that there would always be a .cargo home to fall back to which might not be the case when running tests in a sandboxed env.

view details

Matthias Krüger

commit sha 717731db6e2597a6ca63dc36c561ea23dae94742

disable test if offline_tests features is enabled

view details

Matthias Krüger

commit sha 464ab98fc5c2483363bd39ee899ca10212a237b6

add function that tries to find out if a system is NixOS

view details

push time in 13 days

issue commentrust-lang/rust-clippy

FP useless_conversion: into_iter() cannot be removed if it provides mutability

    let mut lines = string.lines();
    if Some("oneline") == lines.next() {

works but clippy did not see that this requires lines to be mutable.

matthiaskrgr

comment created time in 13 days

issue openedrust-lang/rust-clippy

FP useless_conversion into_iter() cannot be removed if it provides mutability

<!-- 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:

I expected to see this happen: explanation

Instead, this happened: explanation

Meta

  • cargo clippy -V: e.g. clippy 0.0.212 (f455e46 2020-06-20)
  • rustc -Vv:
    rustc 1.46.0-nightly (f455e46ea 2020-06-20)
    binary: rustc
    commit-hash: f455e46eae1a227d735091091144601b467e1565
    commit-date: 2020-06-20
    host: x86_64-unknown-linux-gnu
    release: 1.46.0-nightly
    LLVM version: 10.0
    

<!-- Include a backtrace in the code block by setting RUST_BACKTRACE=1 in your environment. E.g. RUST_BACKTRACE=1 cargo clippy. --> <details><summary>Backtrace</summary> <p>

<backtrace>

</p> </details>

created time in 13 days

issue commentmatthiaskrgr/cargo-cache

Target directory is not always inferred from build and may not exist under target/debug or target/release

I asked on #nixos on freenode and apparently I can read /etc/os-release to find out if a system is nixos or not.

Sample file: https://paste.infinisil.com/Nk0hknbUPU

NAME=NixOS
ID=nixos
VERSION="20.09pre-git (Nightingale)"
VERSION_CODENAME=nightingale
VERSION_ID="20.09pre-git"
PRETTY_NAME="NixOS 20.09 (Nightingale)"
LOGO="nix-snowflake"
...

src: https://github.com/NixOS/nixpkgs/blob/8b6e9818a5079102299c0ed54bae35bc27d9538c/nixos/modules/misc/version.nix#L99-L115

evanjs

comment created time in 13 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha 2012d0e677942b47d4bb91e5f46fc363a5be9cdd

make sccache_dir() return proper Result instead of Option and pass it through sccache_dir()

view details

push time in 13 days

PR opened rust-analyzer/rust-analyzer

assists: change_return_type_to_result: clarify assist description

I had a -> Option<PathBuf> fn, which I wanted to change to Result<PathBuf, _>, but despite advertising to do so, the assist did not change the result type to Result<PathBuf, _> but instead just wrapped it in a Result: <Result<Option<PathBuf>, _>.

I changed the assist description to "Wrap return type in Result" to clarify that the assist only wraps the preexisting type and does not do any actual Option-to-Result refactoring.

+1 -1

0 comment

1 changed file

pr created time in 13 days

create barnchmatthiaskrgr/rust-analyzer

branch : crttr_assist

created branch time in 13 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha e891c9ba2e11f80af995d4dee33735f2a4add291

sccache: print summary

view details

push time in 14 days

issue commentrust-lang/rust

Ztime-passes: columns not always seperated

When building cargo with RUSTFLAGS="-Ztime-passes" cargo build -j 1, some of the deps miss the space.

matthiaskrgr

comment created time in 14 days

issue commentrust-lang/rust

yet another (random?) bootstrap ICE

I've had a couple of incremental ICEs while bootstrapping already, so all of these are "wontfix" essentially?

I can close them if you want. :)

matthiaskrgr

comment created time in 14 days

issue commentrust-lang/rust

yet another (random?) bootstrap ICE

Mmh, probably, but I'm a bit confused because my config says no (I think?)

# Whether to always use incremental compilation when building rustc
#incremental = false
matthiaskrgr

comment created time in 15 days

issue openedrust-lang/rust

yet another (random?) bootstrap ICE

Switched from f9a3086363f to b52522ade1f and ran x.py build

Error output

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/matthias/vcs/github/rust/src/librustc_serialize/leb128.rs:32:28

<!-- 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>

   Compiling rustc-std-workspace-core v1.99.0 (/home/matthias/vcs/github/rust/src/tools/rustc-std-workspace-core)
   Compiling compiler_builtins v0.1.32
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/matthias/vcs/github/rust/src/librustc_serialize/leb128.rs:32:28
stack backtrace:
   0:     0x7f10d0070db0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h83efe194f8f67d3b
   1:     0x7f10d011101d - core::fmt::write::h71e0e6b4a0b91726
   2:     0x7f10d008f373 - std::io::Write::write_fmt::h9acb17a3af64e59b
   3:     0x7f10d00891e0 - std::panicking::default_hook::{{closure}}::ha3a007e0a475f5f8
   4:     0x7f10d0088f0a - std::panicking::default_hook::h3e2776b40b51d009
   5:     0x7f10d10870a9 - rustc_driver::report_ice::hcc3e0d217ce3a8da
   6:     0x7f10d0089866 - std::panicking::rust_panic_with_hook::h3d208397660b52cb
   7:     0x7f10d008941b - rust_begin_unwind
   8:     0x7f10d0110ca1 - core::panicking::panic_fmt::hfe9d003ed2cdba83
   9:     0x7f10d0110c62 - core::panicking::panic_bounds_check::hf7ae89aee69774be
  10:     0x7f10d28b3bbd - <rustc_metadata::rmeta::CrateRoot as rustc_serialize::serialize::Decodable>::decode::{{closure}}::h9ed33838b860c6b7
  11:     0x7f10d2a319ea - rustc_metadata::rmeta::decoder::MetadataBlob::get_root::ha9dc3a881feb0be9
  12:     0x7f10d2977340 - rustc_metadata::locator::CrateLocator::extract_one::h9d45d1e03d492e33
  13:     0x7f10d29765c1 - rustc_metadata::locator::CrateLocator::extract_lib::h6bd5e02cb2260b2f
  14:     0x7f10d2974f38 - rustc_metadata::locator::CrateLocator::maybe_load_library_crate::he126d93e0d90384b
  15:     0x7f10d2a41fda - rustc_metadata::creader::CrateLoader::load::h8c65ff58e7d50588
  16:     0x7f10d2a3e279 - rustc_metadata::creader::CrateLoader::maybe_resolve_crate::h7488e299773998bd
  17:     0x7f10d2a448ef - rustc_metadata::creader::CrateLoader::maybe_process_path_extern::h02a680e27eda735e
  18:     0x7f10d1c0601b - rustc_resolve::Resolver::extern_prelude_get::h808b5917671b019f
  19:     0x7f10d1beb6f4 - rustc_resolve::macros::<impl rustc_resolve::Resolver>::early_resolve_ident_in_lexical_scope::h925e3cde52793bf1
  20:     0x7f10d1c03330 - rustc_resolve::Resolver::resolve_path_with_ribs::{{closure}}::h4aa771f271bc8944
  21:     0x7f10d1c01537 - rustc_resolve::Resolver::resolve_path_with_ribs::h1d51748faeae7ffd
  22:     0x7f10d1c7553c - rustc_resolve::imports::ImportResolver::resolve_imports::h9811c70b32c29ca1
  23:     0x7f10d1be79ee - rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::resolve_imports::h9b7ff2506c56c3d9
  24:     0x7f10d2abdb46 - rustc_expand::expand::MacroExpander::fully_expand_fragment::h5f93b71605422611
  25:     0x7f10d2abd25f - rustc_expand::expand::MacroExpander::expand_crate::hf2b05a6b0b5cb181
  26:     0x7f10d12167f6 - rustc_session::utils::<impl rustc_session::session::Session>::time::he0064eb5905428c7
  27:     0x7f10d11f9593 - rustc_interface::passes::configure_and_expand_inner::h24b47a33e353f74a
  28:     0x7f10d128db62 - rustc_interface::passes::configure_and_expand::{{closure}}::h8a4e3d96144df778
  29:     0x7f10d123ed70 - rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new::h27c331f5c2ab078e
  30:     0x7f10d12038f5 - rustc_interface::queries::Queries::expansion::h8d015b8a15fbaddf
  31:     0x7f10d0ef77cf - rustc_interface::interface::create_compiler_and_run::hf00f2cd943ef0644
  32:     0x7f10d105038e - scoped_tls::ScopedKey<T>::set::hc6dc2a30d87f2d9d
  33:     0x7f10d0f1301c - std::sys_common::backtrace::__rust_begin_short_backtrace::h476bd6fe2bb1f0c5
  34:     0x7f10d0f15bae - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7e7edf9922c2d557
  35:     0x7f10d008a858 - std::sys::unix::thread::Thread::new::thread_start::he0f3ee1260f07274
  36:     0x7f10cce8c422 - start_thread
  37:     0x7f10cfe8fbf3 - __clone
  38:                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.47.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z save-analysis -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C codegen-units=4 -C debuginfo=0 -C target-cpu=native -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C embed-bitcode=yes --crate-type rlib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `rustc-std-workspace-core`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "4" "--release" "--features" "panic-unwind backtrace profiler compiler-builtins-c" "--manifest-path" "/home/matthias/vcs/github/rust/src/libtest/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit code: 101
failed to run: /home/matthias/vcs/github/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:00:02

</p> </details>

created time in 15 days

issue commentrust-lang/rust

cannot install rust-src component for nightly-2020-07-21

Getting the same with rust-toolchain-installer-master: error: unsupported tar entry: Symlink

ehuss

comment created time in 15 days

issue commentrust-lang/rust

rustc panics when run on a directory

What is the name of the directory? What command did you use? When I do mkdir a; rustc a I only get

error: couldn't read a: Is a directory (os error 21)

error: aborting due to previous error
yujiri8

comment created time in 15 days

issue commentrust-lang/rust

ICE with the `@ ..` binding pattern

reduced:

pub enum E {
	A(u8, u8),
}

pub fn fun(arg: E) {
	match arg {
		A(x @ ..) => {x}
	};
}
r1fl

comment created time in 16 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha 60ac504afafed349bb42e5260535227b3e55d46a

sccache: rename "Total Size" column to "Size"

view details

Matthias Krüger

commit sha 7b40dc97cbb4266eeab449c53c49ce4c892034ec

sccache: add some padding to cells, make table looks a bit nicer

view details

push time in 16 days

pull request commentrust-lang/rust

std: Switch from libbacktrace to gimli

perf.rlo results look quite bad: https://perf.rust-lang.org/compare.html?start=d3df8512d2c2afc6d2e7d8b5b951dd7f2ad77b02&end=1fa54ad9680cc82e7301f8ed4e9b7402dfd6ce0e&stat=instructions%3Au

alexcrichton

comment created time in 16 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha 10850272f79751fe115e071af30ba450713244ea

sc: print percentage

view details

push time in 16 days

pull request commentrust-lang/rust-clippy

redundant_closure_call - don't lint when used more than once

Thanks! @bors r+

montrivo

comment created time in 16 days

Pull request review commentrust-lang/rust-clippy

redundant_closure_call - don't lint when used more than once

+use crate::utils::{snippet_with_applicability, span_lint, span_lint_and_then};+use if_chain::if_chain;+use rustc_ast::ast;+use rustc_ast::visit as ast_visit;+use rustc_ast::visit::Visitor as AstVisitor;+use rustc_errors::Applicability;+use rustc_hir as hir;+use rustc_hir::intravisit as hir_visit;+use rustc_hir::intravisit::Visitor as HirVisitor;+use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};+use rustc_middle::hir::map::Map;+use rustc_middle::lint::in_external_macro;+use rustc_session::{declare_lint_pass, declare_tool_lint};++declare_clippy_lint! {+    /// **What it does:** Detects closures called in the same expression where they+    /// are defined.+    ///+    /// **Why is this bad?** It is unnecessarily adding to the expression's+    /// complexity.+    ///+    /// **Known problems:** None.+    ///+    /// **Example:**+    /// ```rust,ignore+    /// // Bad+    /// let a = (|| 42)()+    ///+    /// // Good+    /// let a = 42+    /// ```+    pub REDUNDANT_CLOSURE_CALL,+    complexity,+    "throwaway closures called in the expression they are defined"+}++declare_lint_pass!(RedundantClosureCall => [REDUNDANT_CLOSURE_CALL]);++// Used to find `return` statements or equivalents e.g., `?`+struct ReturnVisitor {+    found_return: bool,+}++impl ReturnVisitor {+    #[must_use]+    fn new() -> Self {+        Self { found_return: false }+    }+}++impl<'ast> ast_visit::Visitor<'ast> for ReturnVisitor {+    fn visit_expr(&mut self, ex: &'ast ast::Expr) {+        if let ast::ExprKind::Ret(_) = ex.kind {+            self.found_return = true;+        } else if let ast::ExprKind::Try(_) = ex.kind {+            self.found_return = true;+        }++        ast_visit::walk_expr(self, ex)+    }+}++impl EarlyLintPass for RedundantClosureCall {+    fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) {+        if in_external_macro(cx.sess(), expr.span) {+            return;+        }+        if_chain! {+            if let ast::ExprKind::Call(ref paren, _) = expr.kind;+            if let ast::ExprKind::Paren(ref closure) = paren.kind;+            if let ast::ExprKind::Closure(_, _, _, ref decl, ref block, _) = closure.kind;+            then {+                let mut visitor = ReturnVisitor::new();+                visitor.visit_expr(block);+                if !visitor.found_return {+                    span_lint_and_then(+                        cx,+                        REDUNDANT_CLOSURE_CALL,+                        expr.span,+                        "Try not to call a closure in the expression where it is declared.",+                        |diag| {+                            if decl.inputs.is_empty() {+                                let mut app = Applicability::MachineApplicable;+                                let hint =+                                    snippet_with_applicability(cx, block.span, "..", &mut app).into_owned();+                                diag.span_suggestion(expr.span, "Try doing something like: ", hint, app);+                            }+                        },+                    );+                }+            }+        }+    }+}++impl<'tcx> LateLintPass<'tcx> for RedundantClosureCall {+    fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx hir::Block<'_>) {+        fn count_closure_usage<'tcx>(block: &'tcx hir::Block<'_>, path: &'tcx hir::Path<'tcx>) -> usize {+            struct ClosureUsageCount<'tcx> {+                path: &'tcx hir::Path<'tcx>,+                count: usize,+            };+            impl<'tcx> hir_visit::Visitor<'tcx> for ClosureUsageCount<'tcx> {+                type Map = Map<'tcx>;++                fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {+                    if_chain! {+                        if let hir::ExprKind::Call(ref closure, _) = expr.kind;+                        if let hir::ExprKind::Path(hir::QPath::Resolved(_, ref path)) = closure.kind;+                        if self.path.segments[0].ident == path.segments[0].ident+                            && self.path.res == path.res;+                        then {+                            self.count += 1;+                        }+                    }+                    hir_visit::walk_expr(self, expr);+                }++                fn nested_visit_map(&mut self) -> hir_visit::NestedVisitorMap<Self::Map> {+                    hir_visit::NestedVisitorMap::None+                }+            };+            let mut closure_usage_count = ClosureUsageCount { path, count: 0 };+            closure_usage_count.visit_block(block);+            closure_usage_count.count+        }++        for w in block.stmts.windows(2) {+            if_chain! {+                if let hir::StmtKind::Local(ref local) = w[0].kind;+                if let Option::Some(ref t) = local.init;+                if let hir::ExprKind::Closure(..) = t.kind;+                if let hir::PatKind::Binding(_, _, ident, _) = local.pat.kind;+                if let hir::StmtKind::Semi(ref second) = w[1].kind;+                if let hir::ExprKind::Assign(_, ref call, _) = second.kind;+                if let hir::ExprKind::Call(ref closure, _) = call.kind;+                if let hir::ExprKind::Path(hir::QPath::Resolved(_, ref path)) = closure.kind;+                if ident == path.segments[0].ident;+                if  count_closure_usage(block, path) == 1;+                then {+                    span_lint(+                        cx,+                        REDUNDANT_CLOSURE_CALL,+                        second.span,+                        "Closure called just once immediately after it was declared",

same here: (Closure -> closure)

Tests will also need to be updated to the new message output!

montrivo

comment created time in 16 days

Pull request review commentrust-lang/rust-clippy

redundant_closure_call - don't lint when used more than once

+use crate::utils::{snippet_with_applicability, span_lint, span_lint_and_then};+use if_chain::if_chain;+use rustc_ast::ast;+use rustc_ast::visit as ast_visit;+use rustc_ast::visit::Visitor as AstVisitor;+use rustc_errors::Applicability;+use rustc_hir as hir;+use rustc_hir::intravisit as hir_visit;+use rustc_hir::intravisit::Visitor as HirVisitor;+use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};+use rustc_middle::hir::map::Map;+use rustc_middle::lint::in_external_macro;+use rustc_session::{declare_lint_pass, declare_tool_lint};++declare_clippy_lint! {+    /// **What it does:** Detects closures called in the same expression where they+    /// are defined.+    ///+    /// **Why is this bad?** It is unnecessarily adding to the expression's+    /// complexity.+    ///+    /// **Known problems:** None.+    ///+    /// **Example:**+    /// ```rust,ignore+    /// // Bad+    /// let a = (|| 42)()+    ///+    /// // Good+    /// let a = 42+    /// ```+    pub REDUNDANT_CLOSURE_CALL,+    complexity,+    "throwaway closures called in the expression they are defined"+}++declare_lint_pass!(RedundantClosureCall => [REDUNDANT_CLOSURE_CALL]);++// Used to find `return` statements or equivalents e.g., `?`+struct ReturnVisitor {+    found_return: bool,+}++impl ReturnVisitor {+    #[must_use]+    fn new() -> Self {+        Self { found_return: false }+    }+}++impl<'ast> ast_visit::Visitor<'ast> for ReturnVisitor {+    fn visit_expr(&mut self, ex: &'ast ast::Expr) {+        if let ast::ExprKind::Ret(_) = ex.kind {+            self.found_return = true;+        } else if let ast::ExprKind::Try(_) = ex.kind {+            self.found_return = true;+        }++        ast_visit::walk_expr(self, ex)+    }+}++impl EarlyLintPass for RedundantClosureCall {+    fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) {+        if in_external_macro(cx.sess(), expr.span) {+            return;+        }+        if_chain! {+            if let ast::ExprKind::Call(ref paren, _) = expr.kind;+            if let ast::ExprKind::Paren(ref closure) = paren.kind;+            if let ast::ExprKind::Closure(_, _, _, ref decl, ref block, _) = closure.kind;+            then {+                let mut visitor = ReturnVisitor::new();+                visitor.visit_expr(block);+                if !visitor.found_return {+                    span_lint_and_then(+                        cx,+                        REDUNDANT_CLOSURE_CALL,+                        expr.span,+                        "Try not to call a closure in the expression where it is declared.",+                        |diag| {+                            if decl.inputs.is_empty() {+                                let mut app = Applicability::MachineApplicable;+                                let hint =+                                    snippet_with_applicability(cx, block.span, "..", &mut app).into_owned();+                                diag.span_suggestion(expr.span, "Try doing something like: ", hint, app);

Lint message should not be capitalized as per the rustc dev guide.

Could you fix that while you are at it?

montrivo

comment created time in 16 days

Pull request review commentrust-lang/rust-clippy

redundant_closure_call - don't lint when used more than once

+use crate::utils::{snippet_with_applicability, span_lint, span_lint_and_then};+use if_chain::if_chain;+use rustc_ast::ast;+use rustc_ast::visit as ast_visit;+use rustc_ast::visit::Visitor as AstVisitor;+use rustc_errors::Applicability;+use rustc_hir as hir;+use rustc_hir::intravisit as hir_visit;+use rustc_hir::intravisit::Visitor as HirVisitor;+use rustc_lint::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};+use rustc_middle::hir::map::Map;+use rustc_middle::lint::in_external_macro;+use rustc_session::{declare_lint_pass, declare_tool_lint};++declare_clippy_lint! {+    /// **What it does:** Detects closures called in the same expression where they+    /// are defined.+    ///+    /// **Why is this bad?** It is unnecessarily adding to the expression's+    /// complexity.+    ///+    /// **Known problems:** None.+    ///+    /// **Example:**+    /// ```rust,ignore+    /// // Bad+    /// let a = (|| 42)()+    ///+    /// // Good+    /// let a = 42+    /// ```+    pub REDUNDANT_CLOSURE_CALL,+    complexity,+    "throwaway closures called in the expression they are defined"+}++declare_lint_pass!(RedundantClosureCall => [REDUNDANT_CLOSURE_CALL]);++// Used to find `return` statements or equivalents e.g., `?`+struct ReturnVisitor {+    found_return: bool,+}++impl ReturnVisitor {+    #[must_use]+    fn new() -> Self {+        Self { found_return: false }+    }+}++impl<'ast> ast_visit::Visitor<'ast> for ReturnVisitor {+    fn visit_expr(&mut self, ex: &'ast ast::Expr) {+        if let ast::ExprKind::Ret(_) = ex.kind {+            self.found_return = true;+        } else if let ast::ExprKind::Try(_) = ex.kind {+            self.found_return = true;+        }++        ast_visit::walk_expr(self, ex)+    }+}++impl EarlyLintPass for RedundantClosureCall {+    fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &ast::Expr) {+        if in_external_macro(cx.sess(), expr.span) {+            return;+        }+        if_chain! {+            if let ast::ExprKind::Call(ref paren, _) = expr.kind;+            if let ast::ExprKind::Paren(ref closure) = paren.kind;+            if let ast::ExprKind::Closure(_, _, _, ref decl, ref block, _) = closure.kind;+            then {+                let mut visitor = ReturnVisitor::new();+                visitor.visit_expr(block);+                if !visitor.found_return {+                    span_lint_and_then(+                        cx,+                        REDUNDANT_CLOSURE_CALL,+                        expr.span,+                        "Try not to call a closure in the expression where it is declared.",+                        |diag| {+                            if decl.inputs.is_empty() {+                                let mut app = Applicability::MachineApplicable;+                                let hint =+                                    snippet_with_applicability(cx, block.span, "..", &mut app).into_owned();+                                diag.span_suggestion(expr.span, "Try doing something like: ", hint, app);+                            }+                        },+                    );+                }+            }+        }+    }+}++impl<'tcx> LateLintPass<'tcx> for RedundantClosureCall {+    fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx hir::Block<'_>) {+        fn count_closure_usage<'tcx>(block: &'tcx hir::Block<'_>, path: &'tcx hir::Path<'tcx>) -> usize {+            struct ClosureUsageCount<'tcx> {+                path: &'tcx hir::Path<'tcx>,+                count: usize,+            };+            impl<'tcx> hir_visit::Visitor<'tcx> for ClosureUsageCount<'tcx> {+                type Map = Map<'tcx>;++                fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {+                    if_chain! {+                        if let hir::ExprKind::Call(ref closure, _) = expr.kind;+                        if let hir::ExprKind::Path(hir::QPath::Resolved(_, ref path)) = closure.kind;+                        if self.path.segments[0].ident == path.segments[0].ident+                            && self.path.res == path.res;+                        then {+                            self.count += 1;+                        }+                    }+                    hir_visit::walk_expr(self, expr);+                }++                fn nested_visit_map(&mut self) -> hir_visit::NestedVisitorMap<Self::Map> {+                    hir_visit::NestedVisitorMap::None+                }+            };+            let mut closure_usage_count = ClosureUsageCount { path, count: 0 };+            closure_usage_count.visit_block(block);+            closure_usage_count.count+        }++        for w in block.stmts.windows(2) {+            if_chain! {+                if let hir::StmtKind::Local(ref local) = w[0].kind;+                if let Option::Some(ref t) = local.init;+                if let hir::ExprKind::Closure(..) = t.kind;+                if let hir::PatKind::Binding(_, _, ident, _) = local.pat.kind;+                if let hir::StmtKind::Semi(ref second) = w[1].kind;+                if let hir::ExprKind::Assign(_, ref call, _) = second.kind;+                if let hir::ExprKind::Call(ref closure, _) = call.kind;+                if let hir::ExprKind::Path(hir::QPath::Resolved(_, ref path)) = closure.kind;+                if ident == path.segments[0].ident;+                if  count_closure_usage(block, path) == 1;

nit: double space (rustfmt does not catch this because of the if_chain! macro unfortunately.

montrivo

comment created time in 16 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha a9acf22641e672e1ba0db5918a98978582ff0e14

run cargo fmt

view details

push time in 17 days

push eventmatthiaskrgr/cargo-cache

Matthias Krüger

commit sha ccb5ccd020e7d83812af35dfed11d03ce525abb9

sc: initial support of printing sizes

view details

Matthias Krüger

commit sha e7291ab138b4790b40d9fa5c426560907d39203b

rename display.rs to tables.rs

view details

Matthias Krüger

commit sha dbe51c53e4f58bc84eece2215581fd988869c66d

rename format_2_row_table to two_row_table

view details

Matthias Krüger

commit sha 74d196c83409c4976c4808f1dae2076ce2b920bd

move format_table function from top_items::common::format_table to tables::format_table

view details

Matthias Krüger

commit sha d3af605a5753e190421045e5ed46a371d2c24319

tables: add comments to understand how the function works

view details

Matthias Krüger

commit sha 1de7f5746a73796e012913af7527930a3b12fbde

sccache: properly include total size per day in the table

view details

Matthias Krüger

commit sha b944ecb3ac88ab81f7d4ecfcd6bd1c5455bd1617

changelog: update

view details

push time in 17 days

pull request commentrust-lang/rust

Rollup of 18 pull requests

Manishearth

comment created time in 18 days

pull request commentrust-lang/rust

Rollup of 18 pull requests

Looks like something in here had quite the perf impact https://perf.rust-lang.org/compare.html?start=39d5a61f2e4e237123837f5162cc275c2fd7e625&end=d3df8512d2c2afc6d2e7d8b5b951dd7f2ad77b02&stat=instructions:u

Manishearth

comment created time in 18 days

issue commentrust-lang/rust

const generics lifetime ICE

Could this be a duplicate of #73375 ?

lcnr

comment created time in 19 days

PR opened rust-lang/cargo

clippy cleanups

Fixes a couple of clippy warnings. Ignores clippy::collapsible_if warnings in the future (iirc there were not desired) clippy::redundant_clone is enabled by default by clippy already.

+11 -11

0 comment

6 changed files

pr created time in 19 days

create barnchmatthiaskrgr/cargo

branch : clippy_v15

created branch time in 19 days

issue closedrust-lang/rust-clippy

unnecessary_sort_by suggests broken code

I tried this code:

#[derive(Ord, PartialOrd, Eq, PartialEq)]
struct A<'a> {
    name: &'a str,
}

impl A<'_> {
    fn name(&self) -> &str {
        &self.name
    }
}

fn main() {
    let a = A { name: "" };
    let b = A { name: "" };
    let mut v = vec![a, b];
    v.sort_by(|a, b| a.name().cmp(b.name()))
}

Clippy suggested

warning: use Vec::sort_by_key here instead
  --> src/main.rs:16:5
   |
16 |     v.sort_by(|a, b| a.name().cmp(b.name()))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v.sort_by_key(|&a| a.name())`
   |
   = note: `#[warn(clippy::unnecessary_sort_by)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by

warning: 1 warning emitted

but the suggestion does not compile:

error[E0507]: cannot move out of a shared reference
  --> src/main.rs:16:20
   |
16 |     v.sort_by_key(|&a| a.name())
   |                    ^-
   |                    ||
   |                    |data moved here
   |                    |move occurs because `a` has type `A<'_>`, which does not implement the `Copy` trait
   |                    help: consider removing the `&`: `a`

error[E0515]: cannot return value referencing local variable `a`
  --> src/main.rs:16:24
   |
16 |     v.sort_by_key(|&a| a.name())
   |                        -^^^^^^^
   |                        |
   |                        returns a value referencing data owned by the current function
   |                        `a` is borrowed here

error: aborting due to 2 previous errors

Meta

  • cargo clippy -V: e.g. clippy 0.0.212 (346aec9 2020-07-11)
  • rustc -Vv:
    rustc 1.46.0-nightly (346aec9b0 2020-07-11)
    

binary: rustc commit-hash: 346aec9b02f3c74f3fce97fd6bda24709d220e49 commit-date: 2020-07-11 host: x86_64-unknown-linux-gnu release: 1.46.0-nightly LLVM version: 10.0


closed time in 19 days

matthiaskrgr

issue commentrust-lang/rust-clippy

unnecessary_sort_by suggests broken code

Looks like https://github.com/rust-lang/rust-clippy/issues/5754 :/

matthiaskrgr

comment created time in 19 days

issue openedrust-lang/rust-clippy

unnecessary_sort_by suggests broken code

I tried this code:

#[derive(Ord, PartialOrd, Eq, PartialEq)]
struct A<'a> {
    name: &'a str,
}

impl A<'_> {
    fn name(&self) -> &str {
        &self.name
    }
}

fn main() {
    let a = A { name: "" };
    let b = A { name: "" };
    let mut v = vec![a, b];
    v.sort_by(|a, b| a.name().cmp(b.name()))
}

Clippy suggested

warning: use Vec::sort_by_key here instead
  --> src/main.rs:16:5
   |
16 |     v.sort_by(|a, b| a.name().cmp(b.name()))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v.sort_by_key(|&a| a.name())`
   |
   = note: `#[warn(clippy::unnecessary_sort_by)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by

warning: 1 warning emitted

but the suggestion does not compile:

error[E0507]: cannot move out of a shared reference
  --> src/main.rs:16:20
   |
16 |     v.sort_by_key(|&a| a.name())
   |                    ^-
   |                    ||
   |                    |data moved here
   |                    |move occurs because `a` has type `A<'_>`, which does not implement the `Copy` trait
   |                    help: consider removing the `&`: `a`

error[E0515]: cannot return value referencing local variable `a`
  --> src/main.rs:16:24
   |
16 |     v.sort_by_key(|&a| a.name())
   |                        -^^^^^^^
   |                        |
   |                        returns a value referencing data owned by the current function
   |                        `a` is borrowed here

error: aborting due to 2 previous errors

Meta

  • cargo clippy -V: e.g. clippy 0.0.212 (346aec9 2020-07-11)
  • rustc -Vv:
    rustc 1.46.0-nightly (346aec9b0 2020-07-11)
    

binary: rustc commit-hash: 346aec9b02f3c74f3fce97fd6bda24709d220e49 commit-date: 2020-07-11 host: x86_64-unknown-linux-gnu release: 1.46.0-nightly LLVM version: 10.0


created time in 19 days

PR opened rust-lang/rust-clippy

fix typos (found by codespell)

changelog: none

+15 -15

0 comment

15 changed files

pr created time in 19 days

create barnchmatthiaskrgr/rust-clippy

branch : typos_2

created branch time in 19 days

issue commentrust-lang/rust

Compiler switch to list bound checks

Perhaps the index_slicing clippy lint partially covers this?

leonardo-m

comment created time in 19 days

issue commentmatthiaskrgr/cargo-cache

Target directory is not always inferred from build and may not exist under target/debug or target/release

I could probably add a target_path() function (just like the bin_path() function) that checks if we are on nixos (maybe there's some special env flag set?) and if yes, chose a different directory that has write access as target directory, otherwise default to target directory.

evanjs

comment created time in 19 days

issue openedrust-lang/rust

bootstrap: index out of bounds: the len is 1 but the index is 1', src/librustc_metadata/rmeta/decoder.rs:341:61

This happened while bootstrapping std, rustc @ 7e11379f3b4c376fbb9a6c4d44f3286ccc28d149

Error output

Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling std v0.0.0 (/home/matthias/vcs/github/rust/src/libstd)
thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 1', src/librustc_metadata/rmeta/decoder.rs:341:61

<!-- 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>

Updating only changed submodules
Submodules updated in 0.03 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.19s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.17s
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling std v0.0.0 (/home/matthias/vcs/github/rust/src/libstd)
thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 1', src/librustc_metadata/rmeta/decoder.rs:341:61
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: rustc_driver::report_ice
   6: std::panicking::rust_panic_with_hook
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::panicking::panic_bounds_check
  10: rustc_metadata::rmeta::decoder::__ty_decoder_impl::<impl rustc_serialize::serialize::SpecializedDecoder<rustc_span::def_id::CrateNum> for rustc_metadata::rmeta::decoder::DecodeContext>::specialized_decode
  11: <T as rustc_serialize::serialize::Decodable>::decode
  12: rustc_serialize::serialize::Decoder::read_option
  13: rustc_metadata::rmeta::decoder::__ty_decoder_impl::<impl rustc_serialize::serialize::SpecializedDecoder<&rustc_middle::ty::sty::Const> for rustc_metadata::rmeta::decoder::DecodeContext>::specialized_decode
  14: rustc_metadata::rmeta::decoder::__ty_decoder_impl::<impl rustc_serialize::serialize::SpecializedDecoder<&rustc_middle::ty::TyS> for rustc_metadata::rmeta::decoder::DecodeContext>::specialized_decode
  15: rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::get_type
  16: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::type_of
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  18: rustc_query_system::query::plumbing::get_query_impl
  19: rustc_middle::ty::trait_def::trait_impls_of_provider::{{closure}}
  20: rustc_middle::ty::trait_def::trait_impls_of_provider
  21: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::trait_impls_of>::compute
  22: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  23: rustc_query_system::query::plumbing::get_query_impl
  24: rustc_middle::ty::trait_def::<impl rustc_middle::ty::context::TyCtxt>::all_impls
  25: rustc_trait_selection::traits::specialize::specialization_graph_provider
  26: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::specialization_graph_of>::compute
  27: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  28: rustc_query_system::query::plumbing::get_query_impl
  29: rustc_middle::ty::trait_def::TraitDef::ancestors
  30: rustc_typeck::impl_wf_check::min_specialization::check_min_specialization
  31: <rustc_typeck::impl_wf_check::ImplWfCheck as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item
  32: rustc_middle::hir::map::Map::visit_item_likes_in_module
  33: rustc_typeck::impl_wf_check::check_mod_impl_wf
  34: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_impl_wf>::compute
  35: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  36: rustc_query_system::query::plumbing::get_query_impl
  37: rustc_query_system::query::plumbing::ensure_query_impl
  38: rustc_typeck::impl_wf_check::impl_wf_check
  39: rustc_typeck::check_crate
  40: rustc_interface::passes::analysis
  41: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  42: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  43: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
  44: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
  45: rustc_query_system::query::plumbing::get_query_impl
  46: rustc_middle::ty::context::tls::enter_global
  47: rustc_interface::interface::create_compiler_and_run
  48: rustc_ast::attr::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.46.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z save-analysis -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C prefer-dynamic -C opt-level=3 -C embed-bitcode=no -C codegen-units=4 -C debuginfo=0 -C target-cpu=native -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C embed-bitcode=yes --crate-type dylib --crate-type rlib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
sccache: Compile terminated by signal 6====================>           ] 31/38: std
error: could not compile `std`.

To learn more, run the command again with --verbose.
command did not execute successfully: "/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "4" "--release" "--features" "panic-unwind backtrace profiler compiler-builtins-c" "--manifest-path" "/home/matthias/vcs/github/rust/src/libtest/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit code: 101
failed to run: /home/matthias/vcs/github/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:00:01

</p> </details>

created time in 21 days

issue commentrust-lang/rust

The `rustc_middle` crate is too big, which hurts compile times for the compiler itself

The efforts to split up rustc_middle did reduce its compiletime from ~20 to ~15 minutes on my system IIRC, but right now it seems to be (back?) at 22 minutes.

nnethercote

comment created time in 21 days

issue openedrust-lang/rust

ICE: bound-normalization-pass.rs with -Zsave-analysis: cannot be placed in TypeckTables with hir_owner

<!-- 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 from ./src/test/ui/impl-trait/bound-normalization-pass.rs

#![feature(impl_trait_in_bindings)]

mod impl_trait_in_bindings {
    struct Foo;

    trait FooLike { type Output; }

    impl FooLike for Foo {
        type Output = u32;
    }

    trait Trait {
        type Assoc;
    }

    fn foo<T: Trait<Assoc=u32>>() {
        let _: impl FooLike<Output=T::Assoc> = Foo;
    }
}

fn main() {}

Meta

repo is at 567ad7455d5f25f6b38d2fded1cb621e0c34a48b

Error output

warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
 --> ./src/test/ui/impl-trait/bound-normalization-pass.rs:1:12
  |
1 | #![feature(impl_trait_in_bindings)]
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information

warning: struct is never constructed: `Foo`
 --> ./src/test/ui/impl-trait/bound-normalization-pass.rs:4:12
  |
4 |     struct Foo;
  |            ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `foo`
  --> ./src/test/ui/impl-trait/bound-normalization-pass.rs:16:8
   |
16 |     fn foo<T: Trait<Assoc=u32>>() {
   |        ^^^

error: internal compiler error: src/librustc_middle/ty/context.rs:205:13: node type T::Assoc (hir_id=HirId { owner: DefId(0:14 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0]::{{opaque}}[0]), local_id: 1 }) with HirId::owner DefId(0:14 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0]::{{opaque}}[0]) cannot be placed in TypeckTables with hir_owner DefId(0:12 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:916: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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.46.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

error: aborting due to previous error; 3 warnings emitted

<!-- 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: src/librustc_middle/ty/context.rs:205:13: node type T::Assoc (hir_id=HirId { owner: DefId(0:14 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0]::{{opaque}}[0]), local_id: 1 }) with HirId::owner DefId(0:14 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0]::{{opaque}}[0]) cannot be placed in TypeckTables with hir_owner DefId(0:12 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:916:9
stack backtrace:
   0:     0x7faf0969b1c8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h452b6396b264f28c
   1:     0x7faf096eb95d - core::fmt::write::h657c0023317a8e5f
   2:     0x7faf09683455 - std::io::Write::write_fmt::haed1c27064617598
   3:     0x7faf096c0540 - std::panicking::default_hook::{{closure}}::h7e5c28cdf5e29ae6
   4:     0x7faf096c026a - std::panicking::default_hook::h5564c3f415dda0e2
   5:     0x7faf0a64bcd9 - rustc_driver::report_ice::h0989ef95a2487a9e
   6:     0x7faf096c0bc6 - std::panicking::rust_panic_with_hook::heba90bd5191496ac
   7:     0x7faf0ce5b7f3 - std::panicking::begin_panic::hcef7cb40099863f5
   8:     0x7faf0ce58ed0 - rustc_errors::HandlerInner::bug::h59aa3e9b5f5516a6
   9:     0x7faf0ce57860 - rustc_errors::Handler::bug::he7489805580a6712
  10:     0x7faf0c915ca8 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h19919efaba95980b
  11:     0x7faf0c9134a3 - rustc_middle::ty::context::tls::with_opt::{{closure}}::hc9a96bc98e3ca66d
  12:     0x7faf0c912fd9 - rustc_middle::ty::context::tls::with_opt::he7403f4d464bc79e
  13:     0x7faf0c915bc7 - rustc_middle::util::bug::opt_span_bug_fmt::h62767bdbaedcb039
  14:     0x7faf0c915b3c - rustc_middle::util::bug::bug_fmt::h2de8835c540a5bf0
  15:     0x7faf0cadd96b - rustc_middle::ty::context::validate_hir_id_for_typeck_tables::{{closure}}::h558abebdc630793c
  16:     0x7faf0cae8ef9 - rustc_middle::ty::context::tls::with::{{closure}}::h7805b93f94dea590
  17:     0x7faf0cae8ee0 - rustc_middle::ty::context::tls::with_context::{{closure}}::h54431fc1c98f5a99
  18:     0x7faf0cade1d8 - rustc_middle::ty::context::TypeckTables::type_dependent_def::ha117131041b4087b
  19:     0x7faf0cade05b - rustc_middle::ty::context::TypeckTables::qpath_res::he121d406bbe250d4
  20:     0x7faf0a70cac6 - rustc_save_analysis::SaveContext::get_path_res::h33a868405209c7ec
  21:     0x7faf0a6ac275 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_ty::h83e010d48ebcb749
  22:     0x7faf0a67978d - rustc_hir::intravisit::walk_generic_args::h82bfa5149fea66c3
  23:     0x7faf0a67c76a - rustc_hir::intravisit::walk_item::h1214a19c1ab8d928
  24:     0x7faf0a67d55d - rustc_hir::intravisit::walk_stmt::hfb608461f62b27ad
  25:     0x7faf0a67c08f - rustc_hir::intravisit::walk_expr::h81101427f8d38241
  26:     0x7faf0a6a8327 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_item::h97b7fa73ed294718
  27:     0x7faf0a6a6c51 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_item::h97b7fa73ed294718
  28:     0x7faf0a6a3721 - rustc_save_analysis::dump_visitor::DumpVisitor::process_crate::hf2a7c0eb46ca6337
  29:     0x7faf0a61b2b1 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h1cdae784c8ea7438
  30:     0x7faf0a4b6311 - rustc_session::utils::<impl rustc_session::session::Session>::time::h0b7baeeed7ea4774
  31:     0x7faf0a61a73b - rustc_middle::ty::context::tls::enter_global::hb0942f7d70d658ed
  32:     0x7faf0a4b9a74 - rustc_interface::interface::create_compiler_and_run::hd4e4c7ee144acf28
  33:     0x7faf0a61729e - scoped_tls::ScopedKey<T>::set::h6463f931b3e3941e
  34:     0x7faf0a4d53dc - std::sys_common::backtrace::__rust_begin_short_backtrace::h2a12ef3f60008590
  35:     0x7faf0a4d82be - core::ops::function::FnOnce::call_once{{vtable.shim}}::h8f177575de1afee8
  36:     0x7faf096c3168 - std::sys::unix::thread::Thread::new::thread_start::hb21db09729478797
  37:     0x7faf064df422 - start_thread
  38:     0x7faf094e2bf3 - __GI___clone
  39:                0x0 - <unknown>

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.46.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

query stack during panic:
end of query stack
error: aborting due to previous error; 3 warnings emitted

</p> </details>

created time in 21 days

PR opened rust-lang/rust-clippy

fix phrase in new_lint issue template

changelog: none

+1 -1

0 comment

1 changed file

pr created time in 24 days

create barnchmatthiaskrgr/rust-clippy

branch : new_lint_issue_templ

created branch time in 24 days

issue closedmatthiaskrgr/cargo-cache

cargo cache --autoclean --dry-run does not print anything

it should print what dirs are going to be cleaned out!

closed time in 24 days

matthiaskrgr
more