mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +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
|
- name: zig version
|
||||||
run: zig version
|
run: zig version
|
||||||
|
|
||||||
- name: install rust nightly 1.71.0
|
- name: install rust nightly 1.72.0
|
||||||
run: rustup install nightly-2023-05-28
|
run: rustup install nightly-2023-07-09
|
||||||
|
|
||||||
- name: set up llvm 16
|
- name: set up llvm 16
|
||||||
run: |
|
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\
|
cd crates\compiler\builtins\bitcode\
|
||||||
zig build test
|
zig build test
|
||||||
|
|
||||||
- name: install rust nightly 1.71.0
|
- name: install rust nightly 1.72.0
|
||||||
run: rustup install nightly-2023-05-28
|
run: rustup install nightly-2023-07-09
|
||||||
|
|
||||||
- name: set up llvm 16
|
- name: set up llvm 16
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
VERSION 0.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
|
WORKDIR /earthbuild
|
||||||
|
|
||||||
prep-debian:
|
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`
|
// on windows, we need the nightly toolchain so we can use `-Z export-executable-symbols`
|
||||||
// using `+nightly` only works when running cargo through rustup
|
// using `+nightly` only works when running cargo through rustup
|
||||||
let mut cmd = rustup();
|
let mut cmd = rustup();
|
||||||
cmd.args(["run", "nightly-2023-05-28", "cargo"]);
|
cmd.args(["run", "nightly-2023-07-09", "cargo"]);
|
||||||
|
|
||||||
cmd
|
cmd
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -594,7 +594,7 @@ pub fn desugar_expr<'a>(
|
||||||
|
|
||||||
// line_info is an option so that we can lazily calculate it.
|
// 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.
|
// 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));
|
*line_info = Some(LineInfo::new(src));
|
||||||
}
|
}
|
||||||
let line_col = line_info.as_ref().unwrap().convert_pos(region.start());
|
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::generic64::{storage::StorageManager, Assembler, CallConv, RegTrait};
|
||||||
use crate::{
|
use crate::{
|
||||||
pointer_layouts, single_register_floats, single_register_int_builtins,
|
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 {
|
pub fn merge_instructions_without_line_numbers(instructions: capstone::Instructions) -> String {
|
||||||
instructions
|
instructions
|
||||||
.iter()
|
.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::generic64::{storage::StorageManager, Assembler, CallConv, RegTrait};
|
||||||
use crate::{
|
use crate::{
|
||||||
pointer_layouts, single_register_floats, single_register_int_builtins,
|
pointer_layouts, single_register_floats, single_register_int_builtins,
|
||||||
|
|
|
@ -2971,20 +2971,7 @@ impl Clone for U4 {
|
||||||
target_arch = "x86_64"
|
target_arch = "x86_64"
|
||||||
))]
|
))]
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
let mut answer = unsafe {
|
*self
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3260,20 +3247,7 @@ impl Clone for U3 {
|
||||||
target_arch = "x86_64"
|
target_arch = "x86_64"
|
||||||
))]
|
))]
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
let mut answer = unsafe {
|
*self
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3549,20 +3523,7 @@ impl Clone for U1 {
|
||||||
target_arch = "x86_64"
|
target_arch = "x86_64"
|
||||||
))]
|
))]
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
let mut answer = unsafe {
|
*self
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3553,20 +3553,7 @@ impl Clone for U1 {
|
||||||
target_arch = "x86_64"
|
target_arch = "x86_64"
|
||||||
))]
|
))]
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
let mut answer = unsafe {
|
*self
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,10 @@ mod glue_cli_run {
|
||||||
|
|
||||||
let test_name_str = stringify!($test_name);
|
let test_name_str = stringify!($test_name);
|
||||||
|
|
||||||
// TODO after #5924 is fixed; remove this if
|
// TODO after #5924 is fixed; remove this
|
||||||
if !(cfg!(target_os = "linux") && (test_name_str == "nullable_unwrapped" || test_name_str == "nullable_wrapped")) {
|
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());
|
let out = run_app(&dir.join("app.roc"), std::iter::empty());
|
||||||
|
|
||||||
assert!(out.status.success());
|
assert!(out.status.success());
|
||||||
|
|
|
@ -361,7 +361,7 @@ impl RocStr {
|
||||||
let ptr = if len < big_string.capacity() {
|
let ptr = if len < big_string.capacity() {
|
||||||
// We happen to have excess capacity already, so we will be able
|
// We happen to have excess capacity already, so we will be able
|
||||||
// to write the terminator into the first byte of excess capacity.
|
// 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 {
|
} else {
|
||||||
// We always have an allocation that's even bigger than necessary,
|
// We always have an allocation that's even bigger than necessary,
|
||||||
// because the refcount bytes take up more than the 1B needed for
|
// 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
|
// IMPORTANT: Must use ptr::copy instead of ptr::copy_nonoverlapping
|
||||||
// because the regions definitely overlap!
|
// 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
|
alloc_ptr
|
||||||
};
|
};
|
||||||
|
@ -388,7 +388,7 @@ impl RocStr {
|
||||||
// The backing list was not unique, so we can't mutate it in-place.
|
// 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
|
// ask for `len + 1` to store the original string and the terminator
|
||||||
with_stack_bytes(len + 1, |alloc_ptr: *mut u8| {
|
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
|
// memcpy the bytes into the stack allocation
|
||||||
std::ptr::copy_nonoverlapping(elem_ptr, alloc_ptr, len);
|
std::ptr::copy_nonoverlapping(elem_ptr, alloc_ptr, len);
|
||||||
|
|
|
@ -255,9 +255,9 @@ mod tests {
|
||||||
decode_u32(&[0xff, 0xff, 0xff, 0xff, 0x0f]),
|
decode_u32(&[0xff, 0xff, 0xff, 0xff, 0x0f]),
|
||||||
Ok((u32::MAX, MAX_SIZE_ENCODED_U32))
|
Ok((u32::MAX, MAX_SIZE_ENCODED_U32))
|
||||||
);
|
);
|
||||||
assert!(matches!(decode_u32(&[0x80; 6]), Err(_)));
|
assert!(decode_u32(&[0x80; 6]).is_err());
|
||||||
assert!(matches!(decode_u32(&[0x80; 2]), Err(_)));
|
assert!(decode_u32(&[0x80; 2]).is_err());
|
||||||
assert!(matches!(decode_u32(&[]), Err(_)));
|
assert!(decode_u32(&[]).is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.71.1"
|
channel = "1.72.1"
|
||||||
|
|
||||||
profile = "default"
|
profile = "default"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.71.1"
|
channel = "1.72.1"
|
||||||
|
|
||||||
profile = "default"
|
profile = "default"
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# How to update version:
|
# How to update version:
|
||||||
# - update `channel = "RUST_VERSION"`
|
# - update `channel = "RUST_VERSION"`
|
||||||
# - update `channel = "RUST_VERSION"` in examples/platform-switching/rust-platform/rust-toolchain.toml
|
# - 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
|
# - update FROM rust:RUST_VERSION-slim-buster in Earthfile
|
||||||
# - to update the nightly version:
|
# - 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
|
# - 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 .github/workflows/windows_release_build.yml
|
||||||
# - update nightly-OLD_DATE in crates/compiler/build/src/link.rs
|
# - 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"
|
profile = "default"
|
||||||
components = [
|
components = [
|
||||||
# for usages of rust-analyzer or similar tools inside `nix develop`
|
# for usages of rust-analyzer or similar tools inside `nix develop`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue