From c52d952a6aae3c850dba192a79662b990eb8dc11 Mon Sep 17 00:00:00 2001 From: Maybe Lapkin Date: Thu, 28 Nov 2024 20:31:08 +0100 Subject: [PATCH 1/3] add instructions for generating `flake.lock` to `envrc-flake` Previous setup instructions did not work without. (i.e. the envrc would not do anything, `nix flake show..` would provide unhelpful error) --- src/tools/nix-dev-shell/envrc-flake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/nix-dev-shell/envrc-flake b/src/tools/nix-dev-shell/envrc-flake index 218d88d8721fa..9def420f05cb4 100644 --- a/src/tools/nix-dev-shell/envrc-flake +++ b/src/tools/nix-dev-shell/envrc-flake @@ -1,7 +1,7 @@ # If you want to use this as an .envrc file to create a shell with necessery components # to develop rustc, use the following command in the root of the rusr checkout: # -# ln -s ./src/tools/nix-dev-shell/envrc-flake ./.envrc && echo .envrc >> .git/info/exclude +# ln -s ./src/tools/nix-dev-shell/envrc-flake ./.envrc && nix flake update --flake ./src/tools/nix-dev-shell && echo .envrc >> .git/info/exclude if nix flake show path:./src/tools/nix-dev-shell &> /dev/null; then use flake path:./src/tools/nix-dev-shell From 33f13f2ab575bb9d702217f25b9ea45fc527bbf2 Mon Sep 17 00:00:00 2001 From: Maybe Lapkin Date: Thu, 28 Nov 2024 20:34:30 +0100 Subject: [PATCH 2/3] ignore `/build` instead of `build/` in gitignore this does two things: 1. allows making `build` a symlink (which is not considered a directory by git, thus removal of trailing `/`). 2. removes the need to special case `rustc_mir_build/src/build` (leading `/` makes git only ignore the `build` in the root) --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 948133cd76e4c..ce9db8b861d04 100644 --- a/.gitignore +++ b/.gitignore @@ -46,8 +46,7 @@ no_llvm_build /inst/ /llvm/ /mingw-build/ -build/ -!/compiler/rustc_mir_build/src/build/ +/build /build-rust-analyzer/ /dist/ /unicode-downloads From 8e7734978245522cbbd14e53e08e888faf031ded Mon Sep 17 00:00:00 2001 From: Maybe Lapkin Date: Thu, 28 Nov 2024 21:54:27 +0100 Subject: [PATCH 3/3] fix a comment with uneven number of backticks in rustc_mir_build this is funny though! apparently tidy parsed `.gitignore`, but did not recognize unignore lines (`!...`), so tidy was ignoring `rustc_mir_build` this whole time (at least for some lints?). --- compiler/rustc_mir_build/src/build/expr/as_rvalue.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs index 3f89e337781e5..c66af118453e5 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs @@ -231,7 +231,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { if range.start <= range.end { BinOp::BitAnd } else { BinOp::BitOr }; let mut comparer = |range: u128, bin_op: BinOp| -> Place<'tcx> { - // We can use `ty::TypingEnv::fully_monomorphized()`` here + // We can use `ty::TypingEnv::fully_monomorphized()` here // as we only need it to compute the layout of a primitive. let range_val = Const::from_bits( this.tcx,