File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,15 @@ transparently:
180
180
#[cfg_attr(feature = " cargo-clippy" , allow(needless_lifetimes))]
181
181
```
182
182
183
+ ## Updating rustc
184
+
185
+ Sometimes, rustc moves forward without clippy catching up. Therefore updating
186
+ rustc may leave clippy a non-functional state until we fix the resulting
187
+ breakage.
188
+
189
+ You can use the [ rust-update] ( rust-update ) script to update rustc only if
190
+ clippy would also update correctly.
191
+
183
192
## License
184
193
185
194
Licensed under [ MPL] ( https://www.mozilla.org/MPL/2.0/ ) .
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ if [ " $1 " = ' -h' ] ; then
4
+ echo ' Updates rustc & clippy'
5
+ echo ' It first checks if clippy would compile at currentl nightly and if so, it updates.'
6
+ echo ' Options:'
7
+ echo ' -h: This help message'
8
+ echo ' -f: Skips the check and just updates'
9
+ exit
10
+ fi
11
+
12
+ set -ex
13
+
14
+ renice -n 10 -p $$
15
+
16
+ export CARGO_INCREMENTAL=0
17
+ export RUSTFLAGS=' -C target-cpu=native'
18
+
19
+ try_out () {
20
+ export RUSTUP_HOME=$HOME /.rustup-attempt
21
+ test -d $RUSTUP_HOME || (rustup toolchain add nightly && rustup default nightly)
22
+ rustup update
23
+ cargo +nightly install --force clippy
24
+ unset RUSTUP_HOME
25
+ export RUSTUP_HOME
26
+ }
27
+
28
+ [ " $1 " = ' -f' ] || try_out
29
+
30
+ rustup update
31
+ cargo +nightly install --force clippy
You can’t perform that action at this time.
0 commit comments