mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Merge pull request #6333 from roc-lang/rust-1-72-upgrade
Rust 1.72 upgrade
This commit is contained in:
commit
1c62a41fad
16 changed files with 35 additions and 75 deletions
4
.github/workflows/windows_release_build.yml
vendored
4
.github/workflows/windows_release_build.yml
vendored
|
@ -29,8 +29,8 @@ jobs:
|
|||
- name: zig version
|
||||
run: zig version
|
||||
|
||||
- name: install rust nightly 1.71.0
|
||||
run: rustup install nightly-2023-05-28
|
||||
- name: install rust nightly 1.72.0
|
||||
run: rustup install nightly-2023-07-09
|
||||
|
||||
- name: set up llvm 16
|
||||
run: |
|
||||
|
|
4
.github/workflows/windows_tests.yml
vendored
4
.github/workflows/windows_tests.yml
vendored
|
@ -37,8 +37,8 @@ jobs:
|
|||
cd crates\compiler\builtins\bitcode\
|
||||
zig build test
|
||||
|
||||
- name: install rust nightly 1.71.0
|
||||
run: rustup install nightly-2023-05-28
|
||||
- name: install rust nightly 1.72.0
|
||||
run: rustup install nightly-2023-07-09
|
||||
|
||||
- name: set up llvm 16
|
||||
run: |
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
VERSION 0.6
|
||||
FROM rust:1.71.1-slim-buster # make sure to update rust-toolchain.toml too so that everything uses the same rust version
|
||||
FROM rust:1.72.1-slim-buster # make sure to update rust-toolchain.toml too so that everything uses the same rust version
|
||||
WORKDIR /earthbuild
|
||||
|
||||
prep-debian:
|
||||
|
|
|
@ -537,7 +537,7 @@ pub fn rebuild_host(
|
|||
// on windows, we need the nightly toolchain so we can use `-Z export-executable-symbols`
|
||||
// using `+nightly` only works when running cargo through rustup
|
||||
let mut cmd = rustup();
|
||||
cmd.args(["run", "nightly-2023-05-28", "cargo"]);
|
||||
cmd.args(["run", "nightly-2023-07-09", "cargo"]);
|
||||
|
||||
cmd
|
||||
} else {
|
||||
|
|
|
@ -594,7 +594,7 @@ pub fn desugar_expr<'a>(
|
|||
|
||||
// line_info is an option so that we can lazily calculate it.
|
||||
// That way it there are no `dbg` statements, we never pay the cast of scanning the source an extra time.
|
||||
if matches!(line_info, None) {
|
||||
if line_info.is_none() {
|
||||
*line_info = Some(LineInfo::new(src));
|
||||
}
|
||||
let line_col = line_info.as_ref().unwrap().convert_pos(region.start());
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#![allow(clippy::redundant_closure_call)]
|
||||
//|> clippy false positive: https://github.com/rust-lang/rust-clippy/issues/1553
|
||||
|
||||
use crate::generic64::{storage::StorageManager, Assembler, CallConv, RegTrait};
|
||||
use crate::{
|
||||
pointer_layouts, single_register_floats, single_register_int_builtins,
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#![allow(clippy::redundant_closure_call)]
|
||||
//|> clippy false positive: https://github.com/rust-lang/rust-clippy/issues/1553
|
||||
|
||||
pub fn merge_instructions_without_line_numbers(instructions: capstone::Instructions) -> String {
|
||||
instructions
|
||||
.iter()
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#![allow(clippy::redundant_closure_call)]
|
||||
//|> clippy false positive: https://github.com/rust-lang/rust-clippy/issues/1553
|
||||
|
||||
use crate::generic64::{storage::StorageManager, Assembler, CallConv, RegTrait};
|
||||
use crate::{
|
||||
pointer_layouts, single_register_floats, single_register_int_builtins,
|
||||
|
|
|
@ -2971,20 +2971,7 @@ impl Clone for U4 {
|
|||
target_arch = "x86_64"
|
||||
))]
|
||||
fn clone(&self) -> Self {
|
||||
let mut answer = unsafe {
|
||||
match self.discriminant() {
|
||||
discriminant_U4::None => core::mem::transmute::<core::mem::MaybeUninit<U4>, U4>(
|
||||
core::mem::MaybeUninit::uninit(),
|
||||
),
|
||||
discriminant_U4::Some => Self {
|
||||
Some: self.Some.clone(),
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
answer.set_discriminant(self.discriminant());
|
||||
|
||||
answer
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3260,20 +3247,7 @@ impl Clone for U3 {
|
|||
target_arch = "x86_64"
|
||||
))]
|
||||
fn clone(&self) -> Self {
|
||||
let mut answer = unsafe {
|
||||
match self.discriminant() {
|
||||
discriminant_U3::None => core::mem::transmute::<core::mem::MaybeUninit<U3>, U3>(
|
||||
core::mem::MaybeUninit::uninit(),
|
||||
),
|
||||
discriminant_U3::Some => Self {
|
||||
Some: self.Some.clone(),
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
answer.set_discriminant(self.discriminant());
|
||||
|
||||
answer
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3549,20 +3523,7 @@ impl Clone for U1 {
|
|||
target_arch = "x86_64"
|
||||
))]
|
||||
fn clone(&self) -> Self {
|
||||
let mut answer = unsafe {
|
||||
match self.discriminant() {
|
||||
discriminant_U1::None => core::mem::transmute::<core::mem::MaybeUninit<U1>, U1>(
|
||||
core::mem::MaybeUninit::uninit(),
|
||||
),
|
||||
discriminant_U1::Some => Self {
|
||||
Some: self.Some.clone(),
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
answer.set_discriminant(self.discriminant());
|
||||
|
||||
answer
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3553,20 +3553,7 @@ impl Clone for U1 {
|
|||
target_arch = "x86_64"
|
||||
))]
|
||||
fn clone(&self) -> Self {
|
||||
let mut answer = unsafe {
|
||||
match self.discriminant() {
|
||||
discriminant_U1::None => core::mem::transmute::<core::mem::MaybeUninit<U1>, U1>(
|
||||
core::mem::MaybeUninit::uninit(),
|
||||
),
|
||||
discriminant_U1::Some => Self {
|
||||
Some: self.Some.clone(),
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
answer.set_discriminant(self.discriminant());
|
||||
|
||||
answer
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,10 @@ mod glue_cli_run {
|
|||
|
||||
let test_name_str = stringify!($test_name);
|
||||
|
||||
// TODO after #5924 is fixed; remove this if
|
||||
if !(cfg!(target_os = "linux") && (test_name_str == "nullable_unwrapped" || test_name_str == "nullable_wrapped")) {
|
||||
// TODO after #5924 is fixed; remove this
|
||||
let skip_on_linux = ["closures", "option", "nullable_wrapped"];
|
||||
|
||||
if !(cfg!(target_os = "linux") && (skip_on_linux.contains(&test_name_str))) {
|
||||
let out = run_app(&dir.join("app.roc"), std::iter::empty());
|
||||
|
||||
assert!(out.status.success());
|
||||
|
|
|
@ -361,7 +361,7 @@ impl RocStr {
|
|||
let ptr = if len < big_string.capacity() {
|
||||
// We happen to have excess capacity already, so we will be able
|
||||
// to write the terminator into the first byte of excess capacity.
|
||||
big_string.ptr_to_first_elem() as *mut u8
|
||||
big_string.ptr_to_first_elem()
|
||||
} else {
|
||||
// We always have an allocation that's even bigger than necessary,
|
||||
// because the refcount bytes take up more than the 1B needed for
|
||||
|
@ -376,7 +376,7 @@ impl RocStr {
|
|||
//
|
||||
// IMPORTANT: Must use ptr::copy instead of ptr::copy_nonoverlapping
|
||||
// because the regions definitely overlap!
|
||||
ptr::copy(big_string.ptr_to_first_elem() as *mut u8, alloc_ptr, len);
|
||||
ptr::copy(big_string.ptr_to_first_elem(), alloc_ptr, len);
|
||||
|
||||
alloc_ptr
|
||||
};
|
||||
|
@ -388,7 +388,7 @@ impl RocStr {
|
|||
// The backing list was not unique, so we can't mutate it in-place.
|
||||
// ask for `len + 1` to store the original string and the terminator
|
||||
with_stack_bytes(len + 1, |alloc_ptr: *mut u8| {
|
||||
let elem_ptr = big_string.ptr_to_first_elem() as *mut u8;
|
||||
let elem_ptr = big_string.ptr_to_first_elem();
|
||||
|
||||
// memcpy the bytes into the stack allocation
|
||||
std::ptr::copy_nonoverlapping(elem_ptr, alloc_ptr, len);
|
||||
|
|
|
@ -255,9 +255,9 @@ mod tests {
|
|||
decode_u32(&[0xff, 0xff, 0xff, 0xff, 0x0f]),
|
||||
Ok((u32::MAX, MAX_SIZE_ENCODED_U32))
|
||||
);
|
||||
assert!(matches!(decode_u32(&[0x80; 6]), Err(_)));
|
||||
assert!(matches!(decode_u32(&[0x80; 2]), Err(_)));
|
||||
assert!(matches!(decode_u32(&[]), Err(_)));
|
||||
assert!(decode_u32(&[0x80; 6]).is_err());
|
||||
assert!(decode_u32(&[0x80; 2]).is_err());
|
||||
assert!(decode_u32(&[]).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[toolchain]
|
||||
channel = "1.71.1"
|
||||
channel = "1.72.1"
|
||||
|
||||
profile = "default"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[toolchain]
|
||||
channel = "1.71.1"
|
||||
channel = "1.72.1"
|
||||
|
||||
profile = "default"
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# How to update version:
|
||||
# - update `channel = "RUST_VERSION"`
|
||||
# - update `channel = "RUST_VERSION"` in examples/platform-switching/rust-platform/rust-toolchain.toml
|
||||
# - update `channel = "RUST_VERSION"` in examples/glue/rust-platform/rust-toolchain.toml
|
||||
# - update FROM rust:RUST_VERSION-slim-buster in Earthfile
|
||||
# - to update the nightly version:
|
||||
# - Find the latest nightly release that matches RUST_VERSION here: https://github.com/oxalica/rust-overlay/tree/master/manifests/nightly/2023
|
||||
|
@ -10,9 +11,9 @@
|
|||
# - update nightly-OLD_DATE in .github/workflows/windows_release_build.yml
|
||||
# - update nightly-OLD_DATE in crates/compiler/build/src/link.rs
|
||||
|
||||
channel = "1.71.1" # check ^^^ when changing this
|
||||
channel = "1.72.1" # check ^^^ when changing this
|
||||
#
|
||||
# channel = "nightly-2023-05-28" # 1.71.0 nightly to be able to use unstable features
|
||||
# channel = "nightly-2023-07-09" # 1.72.0 nightly to be able to use unstable features
|
||||
profile = "default"
|
||||
components = [
|
||||
# for usages of rust-analyzer or similar tools inside `nix develop`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue