Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to Rust 1.78.0 #23676

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { stringify } from "jsr:@std/yaml@^0.221/stringify";
// Bump this number when you want to purge the cache.
// Note: the tools/release/01_bump_crate_versions.ts script will update this version
// automatically via regex, so ensure that this line maintains this format.
const cacheVersion = 93;
const cacheVersion = 94;

const ubuntuX86Runner = "ubuntu-22.04";
const ubuntuX86XlRunner = "ubuntu-22.04-xl";
Expand Down Expand Up @@ -59,7 +59,7 @@ const prCacheKeyPrefix =
`${cacheVersion}-cargo-target-\${{ matrix.os }}-\${{ matrix.arch }}-\${{ matrix.profile }}-\${{ matrix.job }}-`;

// Note that you may need to add more version to the `apt-get remove` line below if you change this
const llvmVersion = 17;
const llvmVersion = 18;
const installPkgsCommand =
`sudo apt-get install --no-install-recommends clang-${llvmVersion} lld-${llvmVersion} clang-tools-${llvmVersion} clang-format-${llvmVersion} clang-tidy-${llvmVersion}`;
const sysRootStep = {
Expand All @@ -71,7 +71,7 @@ export DEBIAN_FRONTEND=noninteractive
sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
# Remove older clang before we install
sudo apt-get -qq remove \
'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' > /dev/null 2> /dev/null
'clang-1*' 'llvm-1*' 'lld-1*' > /dev/null 2> /dev/null

# Install clang-XXX, lld-XXX, and debootstrap.
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${llvmVersion} main" |
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,17 @@ jobs:
# to complete.
sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
# Remove older clang before we install
sudo apt-get -qq remove 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' > /dev/null 2> /dev/null
sudo apt-get -qq remove 'clang-1*' 'llvm-1*' 'lld-1*' > /dev/null 2> /dev/null

# Install clang-XXX, lld-XXX, and debootstrap.
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-17.list
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" |
sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-jammy-18.list
curl https://apt.llvm.org/llvm-snapshot.gpg.key |
gpg --dearmor |
sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
sudo apt-get update
# this was unreliable sometimes, so try again if it fails
sudo apt-get install --no-install-recommends clang-17 lld-17 clang-tools-17 clang-format-17 clang-tidy-17 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install --no-install-recommends clang-17 lld-17 clang-tools-17 clang-format-17 clang-tidy-17
sudo apt-get install --no-install-recommends clang-18 lld-18 clang-tools-18 clang-format-18 clang-tidy-18 || echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install --no-install-recommends clang-18 lld-18 clang-tools-18 clang-format-18 clang-tidy-18
# Fix alternatives
(yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

Expand Down Expand Up @@ -305,8 +305,8 @@ jobs:
CARGO_PROFILE_RELEASE_LTO=false
RUSTFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-17
-C link-arg=-fuse-ld=lld-17
-C linker=clang-18
-C link-arg=-fuse-ld=lld-18
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
Expand All @@ -316,16 +316,16 @@ jobs:
__1
RUSTDOCFLAGS<<__1
-C linker-plugin-lto=true
-C linker=clang-17
-C link-arg=-fuse-ld=lld-17
-C linker=clang-18
-C link-arg=-fuse-ld=lld-18
-C link-arg=-ldl
-C link-arg=-Wl,--allow-shlib-undefined
-C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
-C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
--cfg tokio_unstable
$RUSTFLAGS
__1
CC=/usr/bin/clang-17
CC=/usr/bin/clang-18
CFLAGS=-flto=thin $CFLAGS
" > $GITHUB_ENV
- name: Remove macOS cURL --ipv4 flag
Expand Down Expand Up @@ -367,8 +367,8 @@ jobs:
path: |-
~/.cargo/registry/index
~/.cargo/registry/cache
key: '93-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '93-cargo-home-${{ matrix.os }}-${{ matrix.arch }}'
key: '94-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
restore-keys: '94-cargo-home-${{ matrix.os }}-${{ matrix.arch }}'
if: '!(matrix.skip)'
- name: Restore cache build output (PR)
uses: actions/cache/restore@v4
Expand All @@ -380,7 +380,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
restore-keys: '93-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
restore-keys: '94-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
- name: Apply and update mtime cache
if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))'
uses: ./.github/mtime_cache
Expand Down Expand Up @@ -669,7 +669,7 @@ jobs:
!./target/*/gn_out
!./target/*/*.zip
!./target/*/*.tar.gz
key: '93-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
key: '94-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
publish-canary:
name: publish canary
runs-on: ubuntu-22.04
Expand Down
2 changes: 1 addition & 1 deletion cli/lsp/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@ impl ConfigTree {
);
}
}
self.first_folder = settings.first_folder.clone();
self.first_folder.clone_from(&settings.first_folder);
self.scopes = Arc::new(scopes);
}

Expand Down
6 changes: 3 additions & 3 deletions cli/lsp/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ impl LspResolver {
node_resolver = create_node_resolver(npm_resolver.as_ref());
}
} else {
npm_resolver = self.npm_resolver.clone();
node_resolver = self.node_resolver.clone();
npm_resolver.clone_from(&self.npm_resolver);
node_resolver.clone_from(&self.node_resolver);
}
let graph_resolver = create_graph_resolver(
config_data,
Expand Down Expand Up @@ -527,7 +527,7 @@ impl RedirectResolver {
}
};
for (specifier, mut entry) in chain {
entry.destination = destination.clone();
entry.destination.clone_from(&destination);
self.entries.insert(specifier, Some(Arc::new(entry)));
}
destination
Expand Down
11 changes: 7 additions & 4 deletions cli/lsp/tsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@ impl TsServer {
}
None => None,
};
*self.inspector_server.lock() = maybe_inspector_server.clone();
self
.inspector_server
.lock()
.clone_from(&maybe_inspector_server);
// TODO(bartlomieju): why is the join_handle ignored here? Should we store it
// on the `TsServer` struct.
let receiver = self.receiver.lock().take().unwrap();
Expand Down Expand Up @@ -1718,7 +1721,7 @@ fn display_parts_to_string(
"linkName" => {
if let Some(link) = current_link.as_mut() {
link.name = Some(part.text.clone());
link.target = part.target.clone();
link.target.clone_from(&part.target);
}
}
"linkText" => {
Expand Down Expand Up @@ -2271,7 +2274,7 @@ impl RenameLocations {
let asset_or_doc = language_server.get_asset_or_document(&specifier)?;

// ensure TextDocumentEdit for `location.file_name`.
if text_document_edit_map.get(&uri).is_none() {
if !text_document_edit_map.contains_key(&uri) {
text_document_edit_map.insert(
uri.clone(),
lsp::TextDocumentEdit {
Expand Down Expand Up @@ -3633,7 +3636,7 @@ impl CompletionEntry {
.check_specifier(&import_specifier, specifier)
.or_else(|| relative_specifier(specifier, &import_specifier))
{
display_source = new_module_specifier.clone();
display_source.clone_from(&new_module_specifier);
if new_module_specifier != import_data.module_specifier {
specifier_rewrite =
Some((import_data.module_specifier, new_module_specifier));
Expand Down
1 change: 1 addition & 0 deletions cli/ops/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub fn op_restore_test_permissions(

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
#[allow(dead_code)]
struct TestRegisterResult {
id: usize,
origin: String,
Expand Down
2 changes: 1 addition & 1 deletion cli/tools/bench/reporters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl BenchReporter for ConsoleReporter {
fn report_register(&mut self, _desc: &BenchDescription) {}

fn report_wait(&mut self, desc: &BenchDescription) {
self.name = desc.name.clone();
self.name.clone_from(&desc.name);

match &desc.group {
None => {}
Expand Down
4 changes: 3 additions & 1 deletion cli/util/file_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ where
deno_core::unsync::spawn(async move {
loop {
let received_changed_paths = watcher_receiver.recv().await;
*changed_paths_.borrow_mut() = received_changed_paths.clone();
changed_paths_
.borrow_mut()
.clone_from(&received_changed_paths);

match *watcher_.restart_mode.lock() {
WatcherRestartMode::Automatic => {
Expand Down
2 changes: 1 addition & 1 deletion ext/kv/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn canonicalize_path(path: &Path) -> Result<PathBuf, AnyError> {
} else {
names_stack.push(path.to_str().unwrap().to_string());
let current_dir = current_dir()?;
path = current_dir.clone();
path.clone_from(&current_dir);
}
}
Err(err) => return Err(err.into()),
Expand Down
2 changes: 1 addition & 1 deletion ext/node/ops/os/cpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub fn cpu_info() -> Option<Vec<CpuInfo>> {

cpu.times.irq = 0;

cpu.model = model.clone();
cpu.model.clone_from(&model);
cpu.speed = cpu_speed / 1000000;
}

Expand Down
15 changes: 8 additions & 7 deletions runtime/permissions/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use std::hash::Hash;
use std::path::Path;
use std::path::PathBuf;
use std::str::FromStr;
use std::string::ToString;
use std::sync::Arc;
use which::which;

Expand Down Expand Up @@ -615,9 +614,11 @@ impl<T: Descriptor + Hash> UnaryPermission<T> {
}
}
perms.flag_denied_global = self.flag_denied_global;
perms.flag_denied_list = self.flag_denied_list.clone();
perms.flag_denied_list.clone_from(&self.flag_denied_list);
perms.prompt_denied_global = self.prompt_denied_global;
perms.prompt_denied_list = self.prompt_denied_list.clone();
perms
.prompt_denied_list
.clone_from(&self.prompt_denied_list);
perms.prompt = self.prompt;

Ok(perms)
Expand Down Expand Up @@ -864,11 +865,11 @@ impl From<PathBuf> for RunDescriptor {
}
}

impl ToString for RunDescriptor {
fn to_string(&self) -> String {
impl fmt::Display for RunDescriptor {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
RunDescriptor::Name(s) => s.clone(),
RunDescriptor::Path(p) => p.to_string_lossy().to_string(),
RunDescriptor::Name(s) => write!(f, "{}", s),
RunDescriptor::Path(p) => write!(f, "{}", p.to_string_lossy()),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.77.2"
channel = "1.78.0"
components = ["rustfmt", "clippy"]