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

Prepare 1.28.0: step 2 #4098

Merged
merged 4 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ members, so we're happy to have him on board to help address Windows-specific is
* feat(cli/rustup-mode): support more books in `rustup doc` by @rami3l in https://github.com/rust-lang/rustup/pull/4071
* docs: update channel toolchain syntax by @kyle-leonhard in https://github.com/rust-lang/rustup/pull/4074
* fix(cli/rustup-mode): remove `.num_args()` when `.value_delimiter(',')` is present by @rami3l in https://github.com/rust-lang/rustup/pull/4076
* Upgrade to rustls-platform-verifier 0.4 by @djc in https://github.com/rust-lang/rustup/pull/4087
* Upgrade thiserror to 2 by @djc in https://github.com/rust-lang/rustup/pull/4088
* fix: add missing close body tag by @Rustin170506 in https://github.com/rust-lang/rustup/pull/4090
* Upgrade to opentelemetry 0.27 by @djc in https://github.com/rust-lang/rustup/pull/4089
* feat: add nushell support by @LittleJianCH in https://github.com/rust-lang/rustup/pull/4078
* Add aliases for remove/uninstall/unset commands by @joshtriplett in https://github.com/rust-lang/rustup/pull/4093
* chore(deps): update remove-dir-all to 1.0 by @rbtcollins in https://github.com/rust-lang/rustup/pull/4095
* Prepare 1.28.0 release by @djc in https://github.com/rust-lang/rustup/pull/4079

[pr#3985]: https://github.com/rust-lang/rustup/pull/3985
[pr#4028]: https://github.com/rust-lang/rustup/pull/4028
Expand Down
10 changes: 5 additions & 5 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUSTUP_QUIET=no
# NOTICE: If you change anything here, please make the same changes in setup_mode.rs
usage() {
cat <<EOF
rustup-init 1.27.1 (a8e4f5c64 2024-04-24)
rustup-init 1.28.0 (b6fdf2fa8 2024-11-25)

The installer for rustup

Expand Down Expand Up @@ -154,8 +154,8 @@ main() {
ensure downloader "$_url" "$_file" "$_arch"
ensure chmod u+x "$_file"
if [ ! -x "$_file" ]; then
err "Cannot execute $_file (likely because of mounting /tmp as noexec)."
err "Please copy the file to a location where you can execute binaries and run ./rustup-init${_ext}."
err "Cannot execute $_file (likely because of mounting /tmp as noexec)."
err "Please copy the file to a location where you can execute binaries and run ./rustup-init${_ext}."
exit 1
fi

Expand Down Expand Up @@ -508,7 +508,7 @@ get_architecture() {
err "This host is running an x32 userland, for which no native toolchain is provided."
err "You will have to install multiarch compatibility with i686 or amd64."
err "To do so, set the RUSTUP_CPUTYPE environment variable set to i686 or amd64 and re-run this script."
err "You will be able to add an x32 target after installation by running \`rustup target add x86_64-unknown-linux-gnux32\`."
err "You will be able to add an x32 target after installation by running \`rustup target add x86_64-unknown-linux-gnux32\`."
exit 1
}; else
_cputype=i686
Expand Down Expand Up @@ -588,7 +588,7 @@ check_cmd() {
}

assert_nz() {
if [ -z "$1" ]; then
if [ -z "$1" ]; then
err "assert_nz $2"
exit 1
fi
Expand Down
6 changes: 3 additions & 3 deletions src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub(crate) struct InstallOpts<'a> {
pub targets: &'a [&'a str],
}

impl<'a> InstallOpts<'a> {
impl InstallOpts<'_> {
fn install(self, cfg: &mut Cfg<'_>) -> Result<Option<ToolchainDesc>> {
let Self {
default_host_triple,
Expand Down Expand Up @@ -508,9 +508,9 @@ pub(crate) async fn install(
)
})?;

if !process
if process
.var_os("RUSTUP_INIT_SKIP_EXISTENCE_CHECKS")
.map_or(false, |s| s == "yes")
.is_none_or(|s| s != "yes")
{
check_existence_of_rustc_or_cargo_in_path(no_prompt, process)?;
check_existence_of_settings_file(process)?;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/self_update/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(crate) fn do_anti_sudo_check(no_prompt: bool, process: &Process) -> Result<u
// test runner should set this, nothing else
if process
.var_os("RUSTUP_INIT_SKIP_SUDO_CHECK")
.map_or(false, |s| s == "yes")
.is_some_and(|s| s == "yes")
{
return fallback();
}
Expand Down
6 changes: 3 additions & 3 deletions src/cli/self_update/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ fn _apply_new_path(new_path: Option<HSTRING>) -> Result<()> {
HWND_BROADCAST,
WM_SETTINGCHANGE,
0 as WPARAM,
"Environment\0".as_ptr() as LPARAM,
c"Environment".as_ptr() as LPARAM,
SMTO_ABORTIFHUNG,
5000,
ptr::null_mut(),
Expand Down Expand Up @@ -774,7 +774,7 @@ pub struct RegistryGuard<'a> {
}

#[cfg(any(test, feature = "test"))]
impl<'a> RegistryGuard<'a> {
impl RegistryGuard<'_> {
pub fn new(id: &'static RegistryValueId) -> Result<Self> {
Ok(Self {
_locked: REGISTRY_LOCK.lock(),
Expand All @@ -785,7 +785,7 @@ impl<'a> RegistryGuard<'a> {
}

#[cfg(any(test, feature = "test"))]
impl<'a> Drop for RegistryGuard<'a> {
impl Drop for RegistryGuard<'_> {
fn drop(&mut self) {
self.id.set(self.prev.as_ref()).unwrap();
}
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ pub(crate) fn dist_root_server(process: &Process) -> Result<String> {
})
}

impl<'a> Debug for Cfg<'a> {
impl Debug for Cfg<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let Self {
profile_override,
Expand Down
10 changes: 5 additions & 5 deletions src/diskio/threaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl<'a> Threaded<'a> {
}
}

impl<'a> Executor for Threaded<'a> {
impl Executor for Threaded<'_> {
fn dispatch(&self, item: Item) -> Box<dyn Iterator<Item = CompletedIo> + '_> {
// Yield any completed work before accepting new work - keep memory
// pressure under control
Expand Down Expand Up @@ -351,7 +351,7 @@ impl<'a> Executor for Threaded<'a> {
}
}

impl<'a> Drop for Threaded<'a> {
impl Drop for Threaded<'_> {
fn drop(&mut self) {
// We are not permitted to fail - consume but do not handle the items.
self.join().for_each(drop);
Expand All @@ -363,7 +363,7 @@ struct JoinIterator<'a, 'b> {
consume_sentinel: bool,
}

impl<'a, 'b> JoinIterator<'a, 'b> {
impl JoinIterator<'_, '_> {
fn inner<T: Iterator<Item = Task>>(&self, mut iter: T) -> Option<CompletedIo> {
loop {
let task_o = iter.next();
Expand All @@ -387,7 +387,7 @@ impl<'a, 'b> JoinIterator<'a, 'b> {
}
}

impl<'a, 'b> Iterator for JoinIterator<'a, 'b> {
impl Iterator for JoinIterator<'_, '_> {
type Item = CompletedIo;

fn next(&mut self) -> Option<CompletedIo> {
Expand All @@ -404,7 +404,7 @@ struct SubmitIterator<'a, 'b> {
item: Cell<Option<Item>>,
}

impl<'a, 'b> Iterator for SubmitIterator<'a, 'b> {
impl Iterator for SubmitIterator<'_, '_> {
type Item = CompletedIo;

fn next(&mut self) -> Option<CompletedIo> {
Expand Down
8 changes: 4 additions & 4 deletions src/dist/component/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ fn unpack_without_first_dir<R: Read>(
Ok(())
}

impl<'a> Package for TarPackage<'a> {
impl Package for TarPackage<'_> {
fn contains(&self, component: &str, short_name: Option<&str>) -> bool {
self.0.contains(component, short_name)
}
Expand Down Expand Up @@ -571,7 +571,7 @@ impl<'a> TarGzPackage<'a> {
}
}

impl<'a> Package for TarGzPackage<'a> {
impl Package for TarGzPackage<'_> {
fn contains(&self, component: &str, short_name: Option<&str>) -> bool {
self.0.contains(component, short_name)
}
Expand Down Expand Up @@ -609,7 +609,7 @@ impl<'a> TarXzPackage<'a> {
}
}

impl<'a> Package for TarXzPackage<'a> {
impl Package for TarXzPackage<'_> {
fn contains(&self, component: &str, short_name: Option<&str>) -> bool {
self.0.contains(component, short_name)
}
Expand Down Expand Up @@ -647,7 +647,7 @@ impl<'a> TarZStdPackage<'a> {
}
}

impl<'a> Package for TarZStdPackage<'a> {
impl Package for TarZStdPackage<'_> {
fn contains(&self, component: &str, short_name: Option<&str>) -> bool {
self.0.contains(component, short_name)
}
Expand Down
2 changes: 1 addition & 1 deletion src/dist/component/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl<'a> Transaction<'a> {

/// If a Transaction is dropped without being committed, the changes
/// are automatically rolled back.
impl<'a> Drop for Transaction<'a> {
impl Drop for Transaction<'_> {
fn drop(&mut self) {
if !self.committed {
(self.notify_handler)(Notification::RollingBack);
Expand Down
2 changes: 1 addition & 1 deletion src/dist/manifestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Manifestation {
/// may be either a freshly-downloaded one, or the same one used
/// for the previous install), as well as lists of extension
/// components to add and remove.

///
/// From that it schedules a list of components to install and
/// to uninstall to bring the installation up to date. It
/// downloads the components' packages. Then in a Transaction
Expand Down
2 changes: 1 addition & 1 deletion src/dist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ impl TargetTriple {
let mut ret: libc::c_int = 0;
let mut size = std::mem::size_of::<libc::c_int>() as libc::size_t;
let err = libc::sysctlbyname(
b"sysctl.proc_translated\0".as_ptr().cast(),
c"sysctl.proc_translated".as_ptr().cast(),
(&mut ret) as *mut _ as *mut libc::c_void,
&mut size,
std::ptr::null_mut(),
Expand Down
4 changes: 2 additions & 2 deletions src/dist/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<'a> From<temp::Notification<'a>> for Notification<'a> {
}
}

impl<'a> Notification<'a> {
impl Notification<'_> {
pub(crate) fn level(&self) -> NotificationLevel {
use self::Notification::*;
match self {
Expand Down Expand Up @@ -84,7 +84,7 @@ impl<'a> Notification<'a> {
}
}

impl<'a> Display for Notification<'a> {
impl Display for Notification<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::result::Result<(), fmt::Error> {
use self::Notification::*;
match self {
Expand Down
12 changes: 6 additions & 6 deletions src/dist/temp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ pub(crate) struct Dir<'a> {
path: PathBuf,
}

impl<'a> ops::Deref for Dir<'a> {
impl ops::Deref for Dir<'_> {
type Target = Path;

fn deref(&self) -> &Path {
self.path.as_path()
}
}

impl<'a> Drop for Dir<'a> {
impl Drop for Dir<'_> {
fn drop(&mut self) {
if raw::is_directory(&self.path) {
let n = Notification::DirectoryDeletion(
Expand All @@ -51,15 +51,15 @@ pub struct File<'a> {
path: PathBuf,
}

impl<'a> ops::Deref for File<'a> {
impl ops::Deref for File<'_> {
type Target = Path;

fn deref(&self) -> &Path {
self.path.as_path()
}
}

impl<'a> Drop for File<'a> {
impl Drop for File<'_> {
fn drop(&mut self) {
if raw::is_file(&self.path) {
let n = Notification::FileDeletion(&self.path, fs::remove_file(&self.path));
Expand All @@ -77,7 +77,7 @@ pub enum Notification<'a> {
DirectoryDeletion(&'a Path, io::Result<()>),
}

impl<'a> Notification<'a> {
impl Notification<'_> {
pub(crate) fn level(&self) -> NotificationLevel {
use self::Notification::*;
match self {
Expand All @@ -93,7 +93,7 @@ impl<'a> Notification<'a> {
}
}

impl<'a> Display for Notification<'a> {
impl Display for Notification<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::result::Result<(), fmt::Error> {
use self::Notification::*;
match self {
Expand Down
2 changes: 1 addition & 1 deletion src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub(crate) enum InstallMethod<'a> {
Dist(DistOptions<'a>),
}

impl<'a> InstallMethod<'a> {
impl InstallMethod<'_> {
// Install a toolchain
#[tracing::instrument(level = "trace", err(level = "trace"), skip_all)]
pub(crate) async fn install(&self) -> Result<UpdateStatus> {
Expand Down
4 changes: 2 additions & 2 deletions src/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<'a> From<temp::Notification<'a>> for Notification<'a> {
}
}

impl<'a> Notification<'a> {
impl Notification<'_> {
pub(crate) fn level(&self) -> NotificationLevel {
use self::Notification::*;
match self {
Expand Down Expand Up @@ -84,7 +84,7 @@ impl<'a> Notification<'a> {
}
}

impl<'a> Display for Notification<'a> {
impl Display for Notification<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::result::Result<(), fmt::Error> {
use self::Notification::*;
match self {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ async fn download_file_(
// Keep the curl env var around for a bit
let use_curl_backend = process
.var_os("RUSTUP_USE_CURL")
.map_or(false, |it| it != "0");
.is_some_and(|it| it != "0");
let use_rustls = process
.var_os("RUSTUP_USE_RUSTLS")
.map_or(true, |it| it != "0");
.is_none_or(|it| it != "0");
let (backend, notification) = if use_curl_backend {
(Backend::Curl, Notification::UsingCurl)
} else {
Expand Down Expand Up @@ -648,7 +648,7 @@ impl<'a> FileReaderWithProgress<'a> {
}
}

impl<'a> io::Read for FileReaderWithProgress<'a> {
impl io::Read for FileReaderWithProgress<'_> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
match self.fh.read(buf) {
Ok(nbytes) => {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum Notification<'a> {
RenameInUse(&'a Path, &'a Path),
}

impl<'a> Notification<'a> {
impl Notification<'_> {
pub(crate) fn level(&self) -> NotificationLevel {
use self::Notification::*;
match self {
Expand All @@ -67,7 +67,7 @@ impl<'a> Notification<'a> {
}
}

impl<'a> Display for Notification<'a> {
impl Display for Notification<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::result::Result<(), fmt::Error> {
use self::Notification::*;
match self {
Expand Down