From 937b5c459464e39e2c541a48b9c8118ca6b98b46 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 4 Jul 2024 17:09:36 +0300 Subject: [PATCH 1/6] remove leading space on `frame-pointers` Leading spaces in config options cause `configure` script to fail. Signed-off-by: onur-ozkan --- config.example.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.example.toml b/config.example.toml index 679abcdc7771b..ae5f991263b55 100644 --- a/config.example.toml +++ b/config.example.toml @@ -609,7 +609,7 @@ # Forces frame pointers to be used with `-Cforce-frame-pointers`. # This can be helpful for profiling at a small performance cost. -# frame-pointers = false +#frame-pointers = false # Indicates whether stack protectors should be used # via the unstable option `-Zstack-protector`. From 335bdd4eec418f3572ef532e111979681e14602c Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 4 Jul 2024 17:04:16 +0300 Subject: [PATCH 2/6] handle ci-rustc incompatible options during config parse This change ensures that `config.toml` does not use CI rustc incompatible options when CI rustc is enabled. This is necessary because some options can change compiler's behavior in certain scenarios. The list may not be complete, but should be a good first step as it's better than nothing! Signed-off-by: onur-ozkan --- src/bootstrap/src/core/config/config.rs | 125 ++++++++++++++++++++++-- 1 file changed, 118 insertions(+), 7 deletions(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 948f97e746f42..29bdb3be2ada9 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -33,7 +33,7 @@ macro_rules! check_ci_llvm { assert!( $name.is_none(), "setting {} is incompatible with download-ci-llvm.", - stringify!($name) + stringify!($name).replace("_", "-") ); }; } @@ -1547,7 +1547,15 @@ impl Config { let mut lld_enabled = None; let mut is_user_configured_rust_channel = false; + if let Some(rust) = toml.rust { + config.download_rustc_commit = + config.download_ci_rustc_commit(rust.download_rustc.clone()); + + if config.download_rustc_commit.is_some() { + check_incompatible_options_for_ci_rustc(&rust); + } + let Rust { optimize: optimize_toml, debug: debug_toml, @@ -1595,7 +1603,7 @@ impl Config { new_symbol_mangling, profile_generate, profile_use, - download_rustc, + download_rustc: _, lto, validate_mir_opts, frame_pointers, @@ -1605,11 +1613,7 @@ impl Config { } = rust; is_user_configured_rust_channel = channel.is_some(); - set(&mut config.channel, channel); - - config.download_rustc_commit = config.download_ci_rustc_commit(download_rustc); - - // FIXME: handle download-rustc incompatible options. + set(&mut config.channel, channel.clone()); debug = debug_toml; debug_assertions = debug_assertions_toml; @@ -2591,6 +2595,113 @@ impl Config { } } +/// Checks the CI rustc incompatible options by destructuring the `Rust` instance +/// and makes sure that no rust options from config.toml are missed. +fn check_incompatible_options_for_ci_rustc(rust: &Rust) { + macro_rules! err { + ($name:expr) => { + assert!( + $name.is_none(), + "ERROR: Setting `rust.{}` is incompatible with `rust.download-rustc`.", + stringify!($name).replace("_", "-") + ); + }; + } + + macro_rules! warn { + ($name:expr) => { + if $name.is_some() { + println!( + "WARNING: `rust.{}` has no effect with `rust.download-rustc`.", + stringify!($name).replace("_", "-") + ); + } + }; + } + + let Rust { + // Following options are the CI rustc incompatible ones. + optimize, + debug_logging, + debuginfo_level_rustc, + llvm_tools, + llvm_bitcode_linker, + lto, + stack_protector, + strip, + lld_mode, + jemalloc, + rpath, + channel, + description, + incremental, + default_linker, + + // Rest of the options can simply be ignored. + debug: _, + codegen_units: _, + codegen_units_std: _, + debug_assertions: _, + debug_assertions_std: _, + overflow_checks: _, + overflow_checks_std: _, + debuginfo_level: _, + debuginfo_level_std: _, + debuginfo_level_tools: _, + debuginfo_level_tests: _, + split_debuginfo: _, + backtrace: _, + parallel_compiler: _, + musl_root: _, + verbose_tests: _, + optimize_tests: _, + codegen_tests: _, + omit_git_hash: _, + dist_src: _, + save_toolstates: _, + codegen_backends: _, + lld: _, + deny_warnings: _, + backtrace_on_ice: _, + verify_llvm_ir: _, + thin_lto_import_instr_limit: _, + remap_debuginfo: _, + test_compare_mode: _, + llvm_libunwind: _, + control_flow_guard: _, + ehcont_guard: _, + new_symbol_mangling: _, + profile_generate: _, + profile_use: _, + download_rustc: _, + validate_mir_opts: _, + frame_pointers: _, + } = rust; + + // There are two kinds of checks for CI rustc incompatible options: + // 1. Checking an option that may change the compiler behaviour/output. + // 2. Checking an option that have no effect on the compiler behaviour/output. + // + // If the option belongs to the first category, we call `err` macro for a hard error; + // otherwise, we just print a warning with `warn` macro. + err!(optimize); + err!(debug_logging); + err!(debuginfo_level_rustc); + err!(default_linker); + err!(rpath); + err!(strip); + err!(stack_protector); + err!(lld_mode); + err!(llvm_tools); + err!(llvm_bitcode_linker); + err!(jemalloc); + err!(lto); + + warn!(channel); + warn!(description); + warn!(incremental); +} + fn set(field: &mut T, val: Option) { if let Some(v) = val { *field = v; From e2c15fe03bcfec07233e8c61dfbb652602c07100 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sun, 14 Jul 2024 00:41:05 +0300 Subject: [PATCH 3/6] use std for file mtime and atime modifications Since 1.75 std provides an interface to set access and modified times on files. This change replaces the external dependency previously used for these operations with the corresponding std functions. Signed-off-by: onur-ozkan --- src/bootstrap/Cargo.lock | 1 - src/bootstrap/Cargo.toml | 1 - src/bootstrap/src/core/build_steps/compile.rs | 7 ++++--- src/bootstrap/src/core/download.rs | 8 ++++++-- src/bootstrap/src/lib.rs | 11 +++++++---- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index c095127da1404..de0924c0f4236 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -48,7 +48,6 @@ dependencies = [ "clap_complete", "cmake", "fd-lock", - "filetime", "home", "ignore", "junction", diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index df7b5b881931f..f723407c3ce31 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -44,7 +44,6 @@ build_helper = { path = "../tools/build_helper" } clap = { version = "4.4", default-features = false, features = ["std", "usage", "help", "derive", "error-context"] } clap_complete = "4.4" fd-lock = "4.0" -filetime = "0.2" home = "0.5" ignore = "0.4" libc = "0.2" diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 11a7a40453516..df463966d2055 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -33,7 +33,6 @@ use crate::utils::helpers::{ }; use crate::LLVM_TOOLS; use crate::{CLang, Compiler, DependencyType, GitRepo, Mode}; -use filetime::FileTime; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Std { @@ -2160,9 +2159,11 @@ pub fn strip_debug(builder: &Builder<'_>, target: TargetSelection, path: &Path) return; } - let previous_mtime = FileTime::from_last_modification_time(&path.metadata().unwrap()); + let previous_mtime = t!(t!(path.metadata()).modified()); command("strip").capture().arg("--strip-debug").arg(path).run(builder); + let file = t!(fs::File::open(path)); + // After running `strip`, we have to set the file modification time to what it was before, // otherwise we risk Cargo invalidating its fingerprint and rebuilding the world next time // bootstrap is invoked. @@ -2175,5 +2176,5 @@ pub fn strip_debug(builder: &Builder<'_>, target: TargetSelection, path: &Path) // In the second invocation of bootstrap, Cargo will see that the mtime of librustc_driver.so // is greater than the mtime of rustc-main, and will rebuild rustc-main. That will then cause // everything else (standard library, future stages...) to be rebuilt. - t!(filetime::set_file_mtime(path, previous_mtime)); + t!(file.set_modified(previous_mtime)); } diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs index a7f4bb0cf146c..d01a910e815de 100644 --- a/src/bootstrap/src/core/download.rs +++ b/src/bootstrap/src/core/download.rs @@ -702,9 +702,13 @@ download-rustc = false // time `rustc_llvm` build script ran. However, the timestamps of the // files in the tarball are in the past, so it doesn't trigger a // rebuild. - let now = filetime::FileTime::from_system_time(std::time::SystemTime::now()); + let now = std::time::SystemTime::now(); + let file_times = fs::FileTimes::new().set_accessed(now).set_modified(now); + let llvm_config = llvm_root.join("bin").join(exe("llvm-config", self.build)); - t!(filetime::set_file_times(llvm_config, now, now)); + let llvm_config_file = t!(File::open(llvm_config)); + + t!(llvm_config_file.set_times(file_times)); if self.should_fix_bins_and_dylibs() { let llvm_lib = llvm_root.join("lib"); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index f16afb2979651..4b30b460f262c 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -30,7 +30,6 @@ use std::time::SystemTime; use build_helper::ci::{gha, CiEnv}; use build_helper::exit; -use filetime::FileTime; use sha2::digest::Digest; use termcolor::{ColorChoice, StandardStream, WriteColor}; use utils::channel::GitInfo; @@ -1693,9 +1692,13 @@ impl Build { panic!("failed to copy `{}` to `{}`: {}", src.display(), dst.display(), e) } t!(fs::set_permissions(dst, metadata.permissions())); - let atime = FileTime::from_last_access_time(&metadata); - let mtime = FileTime::from_last_modification_time(&metadata); - t!(filetime::set_file_times(dst, atime, mtime)); + + let file_times = fs::FileTimes::new() + .set_accessed(t!(metadata.accessed())) + .set_modified(t!(metadata.modified())); + + let dst_file = t!(fs::File::open(dst)); + t!(dst_file.set_times(file_times)); } } From 99a5964b737bd78b471cca5da39e0d0f54e9eb36 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 13 Jul 2024 16:56:13 -0700 Subject: [PATCH 4/6] Fix minor typos in std::process doc on Win argv --- library/std/src/process.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index f351dab78dc1a..fc86578a5ff2f 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -96,9 +96,9 @@ //! child processes must agree on how the commandline string is encoded. //! //! Most programs use the standard C run-time `argv`, which in practice results -//! in consistent argument handling. However some programs have their own way of +//! in consistent argument handling. However, some programs have their own way of //! parsing the commandline string. In these cases using [`arg`] or [`args`] may -//! result in the child process seeing a different array of arguments then the +//! result in the child process seeing a different array of arguments than the //! parent process intended. //! //! Two ways of mitigating this are: From 8f73091166546dd3641d046979d608643b64cbea Mon Sep 17 00:00:00 2001 From: Boxy Date: Sun, 14 Jul 2024 04:52:15 +0100 Subject: [PATCH 5/6] Add 1.80 release notes Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- RELEASES.md | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 305da6a3550e9..9e658568dc9a1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,161 @@ +Version 1.80 (2024-07-25) +========================== + + + +Language +-------- +- [Document maximum allocation size](https://github.com/rust-lang/rust/pull/116675/) +- [Allow zero-byte offsets and ZST read/writes on arbitrary pointers](https://github.com/rust-lang/rust/pull/117329/) +- [Support C23's variadics without a named parameter](https://github.com/rust-lang/rust/pull/124048/) +- [Stabilize `exclusive_range_pattern` feature](https://github.com/rust-lang/rust/pull/124459/) +- [Guarantee layout and ABI of `Result` in some scenarios](https://github.com/rust-lang/rust/pull/124870) + + + +Compiler +-------- +- [Update cc crate to v1.0.97 allowing additional spectre mitigations on MSVC targets](https://github.com/rust-lang/rust/pull/124892/) +- [Allow field reordering on types marked `repr(packed(1))`](https://github.com/rust-lang/rust/pull/125360/) +- [Add a lint against never type fallback affecting unsafe code](https://github.com/rust-lang/rust/pull/123939/) +- [Disallow cast with trailing braced macro in let-else](https://github.com/rust-lang/rust/pull/125049/) +- [Expand `for_loops_over_fallibles` lint to lint on fallibles behind references.](https://github.com/rust-lang/rust/pull/125156/) +- [self-contained linker: retry linking without `-fuse-ld=lld` on CCs that don't support it](https://github.com/rust-lang/rust/pull/125417/) +- [Do not parse CVarArgs (`...`) as a type in trait bounds](https://github.com/rust-lang/rust/pull/125863/) +- Improvements to LLDB formatting [#124458](https://github.com/rust-lang/rust/pull/124458) [#124500](https://github.com/rust-lang/rust/pull/124500) +- [For the wasm32-wasip2 target default to PIC and do not use `-fuse-ld=lld`](https://github.com/rust-lang/rust/pull/124858/) +- [Add x86_64-unknown-linux-none as a tier 3 target](https://github.com/rust-lang/rust/pull/125023/) +- [Lint on `foo.into_iter()` resolving to `&Box<[T]>: IntoIterator`](https://github.com/rust-lang/rust/pull/124097/) + + + +Libraries +--------- +- [Add `size_of` and `size_of_val` and `align_of` and `align_of_val` to the prelude](https://github.com/rust-lang/rust/pull/123168/) +- [Abort a process when FD ownership is violated](https://github.com/rust-lang/rust/pull/124210/) +- [io::Write::write_fmt: panic if the formatter fails when the stream does not fail](https://github.com/rust-lang/rust/pull/125012/) +- [Panic if `PathBuf::set_extension` would add a path separator](https://github.com/rust-lang/rust/pull/125070/) +- [Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr} methods](https://github.com/rust-lang/rust/pull/121571/) +- [Update `c_char` on AIX to use the correct type](https://github.com/rust-lang/rust/pull/122986/) +- [`offset_of!` no longer returns a temporary](https://github.com/rust-lang/rust/pull/124484/) +- [Handle sigma in `str.to_lowercase` correctly](https://github.com/rust-lang/rust/pull/124773/) +- [Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB](https://github.com/rust-lang/rust/pull/126059/) + + + +Stabilized APIs +--------------- +- [`impl Default for Rc`](https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3CCStr%3E) +- [`impl Default for Rc`](https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3Cstr%3E) +- [`impl Default for Rc<[T]>`](https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3C%5BT%5D%3E) +- [`impl Default for Arc`](https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3Cstr%3E) +- [`impl Default for Arc`](https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3CCStr%3E) +- [`impl Default for Arc<[T]>`](https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3C%5BT%5D%3E) +- [`impl IntoIterator for Box<[T]>`](https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-IntoIterator-for-Box%3C%5BI%5D,+A%3E) +- [`impl FromIterator for Box`](https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-FromIterator%3CString%3E-for-Box%3Cstr%3E) +- [`impl FromIterator for Box`](https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-FromIterator%3Cchar%3E-for-Box%3Cstr%3E) +- [`LazyCell`](https://doc.rust-lang.org/beta/core/cell/struct.LazyCell.html) +- [`LazyLock`](https://doc.rust-lang.org/beta/std/sync/struct.LazyLock.html) +- [`Duration::div_duration_f32`](https://doc.rust-lang.org/beta/std/time/struct.Duration.html#method.div_duration_f32) +- [`Duration::div_duration_f64`](https://doc.rust-lang.org/beta/std/time/struct.Duration.html#method.div_duration_f64) +- [`Option::take_if`](https://doc.rust-lang.org/beta/std/option/enum.Option.html#method.take_if) +- [`Seek::seek_relative`](https://doc.rust-lang.org/beta/std/io/trait.Seek.html#method.seek_relative) +- [`BinaryHeap::as_slice`](https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.as_slice) +- [`NonNull::offset`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.offset) +- [`NonNull::byte_offset`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_offset) +- [`NonNull::add`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.add) +- [`NonNull::byte_add`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_add) +- [`NonNull::sub`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.sub) +- [`NonNull::byte_sub`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_sub) +- [`NonNull:offset_from`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.offset_from) +- [`NonNull::byte_offset_from`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_offset_from) +- [`NonNull::read`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read) +- [`NonNull::read_volatile`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read_volatile) +- [`NonNull::read_unaligned`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read_unaligned) +- [`NonNull::write`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write) +- [`NonNull::write_volatile`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_volatile) +- [`NonNull::write_unaligned`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_unaligned) +- [`NonNull::write_bytes`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_bytes) +- [`NonNull::copy_to`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_to) +- [`NonNull::copy_to_nonoverlapping`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_to_nonoverlapping) +- [`NonNull::copy_from`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_from) +- [`NonNull::copy_from_nonoverlapping`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_from_nonoverlapping) +- [`NonNull::replace`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.replace) +- [`NonNull::swap`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.swap) +- [`NonNull::drop_in_place`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.drop_in_place) +- [`NonNull::align_offset`](https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.align_offset) +- [`<[T]>::split_at_checked`](https://doc.rust-lang.org/beta/std/primitive.slice.html#method.split_at_checked) +- [`<[T]>::split_at_mut_checked`](https://doc.rust-lang.org/beta/std/primitive.slice.html#method.split_at_mut_checked) +- [`str::split_at_checked`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.split_at_checked) +- [`str::split_at_mut_checked`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.split_at_mut_checked) +- [`str::trim_ascii`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii) +- [`str::trim_ascii_start`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii_start) +- [`str::trim_ascii_end`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii_end) +- [`<[AsciiChar]>::trim_ascii`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii) +- [`<[AsciiChar]>::trim_ascii_start`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii_start) +- [`<[AsciiChar]>::trim_ascii_end`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii_end) +- [`Ipv4Addr::BITS`](https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#associatedconstant.BITS) +- [`Ipv4Addr::to_bits`](https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#method.to_bits) +- [`Ipv4Addr::from_bits`](https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#method.from_bits) +- [`Ipv6Addr::BITS`](https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#associatedconstant.BITS) +- [`Ipv6Addr::to_bits`](https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#method.to_bits) +- [`Ipv6Addr::from_bits`](https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#method.from_bits) +- [`Vec::<[T; N]>::into_flattened`](https://doc.rust-lang.org/beta/alloc/vec/struct.Vec.html#method.into_flattened) +- [`<[[T; N]]>::as_flattened`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.as_flattened) +- [`<[[T; N]]>::as_flattened_mut`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.as_flattened_mut) + +These APIs are now stable in const contexts: + +- [`<[T]>::last_chunk`](https://doc.rust-lang.org/beta/core/primitive.slice.html#method.last_chunk) +- [`BinaryHeap::new`](https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.new) + + + +Cargo +----- +- [Stabilize `-Zcheck-cfg` as always enabled](https://github.com/rust-lang/cargo/pull/13571/) +- [Warn, rather than fail publish, if a target is excluded](https://github.com/rust-lang/cargo/pull/13713/) +- [Add special `check-cfg` lint config for the `unexpected_cfgs` lint](https://github.com/rust-lang/cargo/pull/13913/) +- [Stabilize `cargo update --precise `](https://github.com/rust-lang/cargo/pull/13974/) +- [Don't change file permissions on `Cargo.toml` when using `cargo add`](https://github.com/rust-lang/cargo/pull/13898/) +- [Support using `cargo fix` on IPv6-only networks](https://github.com/rust-lang/cargo/pull/13907/) + + + +Rustdoc +----- + +- [Allow searching for references](https://github.com/rust-lang/rust/pull/124148/) +- [Stabilize `custom_code_classes_in_docs` feature](https://github.com/rust-lang/rust/pull/124577/) +- [fix: In cross-crate scenarios show enum variants on type aliases of enums](https://github.com/rust-lang/rust/pull/125300/) + + + +Compatibility Notes +------------------- +- [rustfmt estimates line lengths differently when using non-ascii characters](https://github.com/rust-lang/rustfmt/issues/6203) +- [Type aliases are now handled correctly in orphan check](https://github.com/rust-lang/rust/pull/117164/) +- [Allow instructing rustdoc to read from stdin via `-`](https://github.com/rust-lang/rust/pull/124611/) +- [`std::env::{set_var, remove_var}` can no longer be converted to safe function pointers and no longer implement the `Fn` family of traits](https://github.com/rust-lang/rust/pull/124636) +- [Warn (or error) when `Self` constructor from outer item is referenced in inner nested item](https://github.com/rust-lang/rust/pull/124187/) +- [Turn `indirect_structural_match` and `pointer_structural_match` lints into hard errors](https://github.com/rust-lang/rust/pull/124661/) +- [Make `where_clause_object_safety` lint a regular object safety violation](https://github.com/rust-lang/rust/pull/125380/) +- [Turn `proc_macro_back_compat` lint into a hard error.](https://github.com/rust-lang/rust/pull/125596/) +- [Detect unused structs even when implementing private traits](https://github.com/rust-lang/rust/pull/122382/) +- [`std::sync::ReentrantLockGuard` is no longer `Sync` if `T: !Sync`](https://github.com/rust-lang/rust/pull/125527) which means [`std::io::StdoutLock` and `std::io::StderrLock` are no longer Sync](https://github.com/rust-lang/rust/issues/127340) + + + +Internal Changes +---------------- + +These changes do not affect any public interfaces of Rust, but they represent +significant improvements to the performance or internals of rustc and related +tools. + +- Misc improvements to size of generated html by rustdoc e.g. [#124738](https://github.com/rust-lang/rust/pull/124738/) and [#123734](https://github.com/rust-lang/rust/pull/123734/) +- [MSVC targets no longer depend on libc](https://github.com/rust-lang/rust/pull/124050/) + Version 1.79.0 (2024-06-13) ========================== From 2dd5369eda4337f44a8bb666bfd38b2c5e3b0fde Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 14 Jul 2024 08:18:03 +0200 Subject: [PATCH 6/6] clarify the meaning of the version number for accepted/removed features --- compiler/rustc_feature/src/accepted.rs | 4 ++++ compiler/rustc_feature/src/lib.rs | 4 ++++ compiler/rustc_feature/src/removed.rs | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index f082cc2b5699a..e671c7682391e 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -42,6 +42,10 @@ declare_features! ( // feature-group-start: accepted features // ------------------------------------------------------------------------- + // Note that the version indicates when it got *stabilized*. + // When moving an unstable feature here, set the version number to + // `CURRENT RUSTC VERSION` with ` ` replaced by `_`. + /// Allows `#[target_feature(...)]` on aarch64 platforms (accepted, aarch64_target_feature, "1.61.0", Some(44839)), /// Allows using the `efiapi` ABI. diff --git a/compiler/rustc_feature/src/lib.rs b/compiler/rustc_feature/src/lib.rs index bf42936431837..e9d3ce0a07494 100644 --- a/compiler/rustc_feature/src/lib.rs +++ b/compiler/rustc_feature/src/lib.rs @@ -31,6 +31,10 @@ use std::num::NonZero; #[derive(Debug, Clone)] pub struct Feature { pub name: Symbol, + /// For unstable features: the version the feature was added in. + /// For accepted features: the version the feature got stabilized in. + /// For removed features we are inconsistent; sometimes this is the + /// version it got added, sometimes the version it got removed. pub since: &'static str, issue: Option>, } diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs index f13aa506c1ec0..80a108d2fc87f 100644 --- a/compiler/rustc_feature/src/removed.rs +++ b/compiler/rustc_feature/src/removed.rs @@ -32,6 +32,12 @@ declare_features! ( // feature-group-start: removed features // ------------------------------------------------------------------------- + // Note that the version indicates when it got *removed*. + // When moving an unstable feature here, set the version number to + // `CURRENT RUSTC VERSION` with ` ` replaced by `_`. + // (But not all features below do this properly; many indicate the + // version they got originally added in.) + /// Allows using the `amdgpu-kernel` ABI. (removed, abi_amdgpu_kernel, "1.77.0", Some(51575), None), (removed, advanced_slice_patterns, "1.0.0", Some(62254),