]> git.lizzy.rs Git - rust.git/blob - scripts/setup_rust_fork.sh
Force deprecation warning that was promoted to an error back to a warning
[rust.git] / scripts / setup_rust_fork.sh
1 #!/bin/bash
2 set -e
3
4 ./build.sh
5 source build/config.sh
6
7 echo "[SETUP] Rust fork"
8 git clone https://github.com/rust-lang/rust.git || true
9 pushd rust
10 git fetch
11 git checkout -- .
12 git checkout "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
13
14 git apply - <<EOF
15 diff --git a/Cargo.toml b/Cargo.toml
16 index 5bd1147cad5..10d68a2ff14 100644
17 --- a/Cargo.toml
18 +++ b/Cargo.toml
19 @@ -111,5 +111,7 @@ rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
20  rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
21  rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
22
23 +compiler_builtins = { path = "../build_sysroot/compiler-builtins" }
24 +
25  [patch."https://github.com/rust-lang/rust-clippy"]
26  clippy_lints = { path = "src/tools/clippy/clippy_lints" }
27 diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
28 index d95b5b7f17f..00b6f0e3635 100644
29 --- a/library/alloc/Cargo.toml
30 +++ b/library/alloc/Cargo.toml
31 @@ -8,7 +8,7 @@ edition = "2018"
32
33  [dependencies]
34  core = { path = "../core" }
35 -compiler_builtins = { version = "0.1.39", features = ['rustc-dep-of-std'] }
36 +compiler_builtins = { version = "0.1.42", features = ['rustc-dep-of-std', 'no-asm'] }
37
38  [dev-dependencies]
39  rand = "0.7"
40 EOF
41
42 cat > config.toml <<EOF
43 [llvm]
44 ninja = false
45
46 [build]
47 rustc = "$(pwd)/../build/bin/cg_clif"
48 cargo = "$(rustup which cargo)"
49 full-bootstrap = true
50 local-rebuild = true
51
52 [rust]
53 codegen-backends = ["cranelift"]
54 deny-warnings = false
55 EOF
56 popd