Skip to content

Commit

Permalink
Auto merge of #119190 - matthiaskrgr:rollup-jvl8vkj, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Rollup of 5 pull requests

Successful merges:

 - #118729 (Add release notes for 1.75.0)
 - #119124 (don't build `rust-analyzer-proc-macro-srv` on def config )
 - #119154 (Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders)
 - #119176 (Fix name error in aarch64_apple_watchos tier 3 target)
 - #119182 (Update sysinfo version to 0.30.0)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Dec 21, 2023
2 parents 767453e + 6516e59 commit 3d0e6be
Show file tree
Hide file tree
Showing 24 changed files with 252 additions and 53 deletions.
125 changes: 125 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,128 @@
Version 1.75.0 (2023-12-28)
==========================

<a id="1.75.0-Language"></a>

Language
--------

- [Stabilize `async fn` and return-position `impl Trait` in traits.](https://github.com/rust-lang/rust/pull/115822/)
- [Allow function pointer signatures containing `&mut T` in `const` contexts.](https://github.com/rust-lang/rust/pull/116015/)
- [Match `usize`/`isize` exhaustively with half-open ranges.](https://github.com/rust-lang/rust/pull/116692/)
- [Guarantee that `char` has the same size and alignment as `u32`.](https://github.com/rust-lang/rust/pull/116894/)
- [Document that the null pointer has the 0 address.](https://github.com/rust-lang/rust/pull/116988/)
- [Allow partially moved values in `match`.](https://github.com/rust-lang/rust/pull/103208/)
- [Add notes about non-compliant FP behavior on 32bit x86 targets.](https://github.com/rust-lang/rust/pull/113053/)
- [Stabilize ratified RISC-V target features.](https://github.com/rust-lang/rust/pull/116485/)

<a id="1.75.0-Compiler"></a>

Compiler
--------

- [Rework negative coherence to properly consider impls that only partly overlap.](https://github.com/rust-lang/rust/pull/112875/)
- [Bump `COINDUCTIVE_OVERLAP_IN_COHERENCE` to deny, and warn in dependencies.](https://github.com/rust-lang/rust/pull/116493/)
- [Consider alias bounds when computing liveness in NLL.](https://github.com/rust-lang/rust/pull/116733/)
- [Add the V (vector) extension to the `riscv64-linux-android` target spec.](https://github.com/rust-lang/rust/pull/116618/)
- [Automatically enable cross-crate inlining for small functions](https://github.com/rust-lang/rust/pull/116505)
- Add several new tier 3 targets:
- [`csky-unknown-linux-gnuabiv2hf`](https://github.com/rust-lang/rust/pull/117049/)
- [`i586-unknown-netbsd`](https://github.com/rust-lang/rust/pull/117170/)
- [`mipsel-unknown-netbsd`](https://github.com/rust-lang/rust/pull/117356/)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

<a id="1.75.0-Libraries"></a>

Libraries
---------

- [Override `Waker::clone_from` to avoid cloning `Waker`s unnecessarily.](https://github.com/rust-lang/rust/pull/96979/)
- [Implement `BufRead` for `VecDeque<u8>`.](https://github.com/rust-lang/rust/pull/110604/)
- [Implement `FusedIterator` for `DecodeUtf16` when the inner iterator does.](https://github.com/rust-lang/rust/pull/110729/)
- [Implement `Not, Bit{And,Or}{,Assign}` for IP addresses.](https://github.com/rust-lang/rust/pull/113747/)
- [Implement `Default` for `ExitCode`.](https://github.com/rust-lang/rust/pull/114589/)
- [Guarantee representation of None in NPO](https://github.com/rust-lang/rust/pull/115333/)
- [Document when atomic loads are guaranteed read-only.](https://github.com/rust-lang/rust/pull/115577/)
- [Broaden the consequences of recursive TLS initialization.](https://github.com/rust-lang/rust/pull/116172/)
- [Windows: Support sub-millisecond sleep.](https://github.com/rust-lang/rust/pull/116461/)
- [Fix generic bound of `str::SplitInclusive`'s `DoubleEndedIterator` impl](https://github.com/rust-lang/rust/pull/100806/)
- [Fix exit status / wait status on non-Unix `cfg(unix)` platforms.](https://github.com/rust-lang/rust/pull/115108/)

<a id="1.75.0-Stabilized-APIs"></a>

Stabilized APIs
---------------

- [`Atomic*::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.from_ptr)
- [`FileTimes`](https://doc.rust-lang.org/stable/std/fs/struct.FileTimes.html)
- [`FileTimesExt`](https://doc.rust-lang.org/stable/std/os/windows/fs/trait.FileTimesExt.html)
- [`File::set_modified`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.set_modified)
- [`File::set_times`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.set_times)
- [`IpAddr::to_canonical`](https://doc.rust-lang.org/stable/core/net/enum.IpAddr.html#method.to_canonical)
- [`Ipv6Addr::to_canonical`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.to_canonical)
- [`Option::as_slice`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.as_slice)
- [`Option::as_mut_slice`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.as_mut_slice)
- [`pointer::byte_add`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_add)
- [`pointer::byte_offset`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_offset)
- [`pointer::byte_offset_from`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_offset_from)
- [`pointer::byte_sub`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.byte_sub)
- [`pointer::wrapping_byte_add`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_add)
- [`pointer::wrapping_byte_offset`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_offset)
- [`pointer::wrapping_byte_sub`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.wrapping_byte_sub)

These APIs are now stable in const contexts:

- [`Ipv6Addr::to_ipv4_mapped`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.to_ipv4_mapped)
- [`MaybeUninit::assume_init_read`](https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html#method.assume_init_read)
- [`MaybeUninit::zeroed`](https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html#method.zeroed)
- [`mem::discriminant`](https://doc.rust-lang.org/stable/core/mem/fn.discriminant.html)
- [`mem::zeroed`](https://doc.rust-lang.org/stable/core/mem/fn.zeroed.html)

<a id="1.75.0-Cargo"></a>

Cargo
-----

- [Add new packages to `[workspace.members]` automatically.](https://github.com/rust-lang/cargo/pull/12779/)
- [Allow version-less `Cargo.toml` manifests.](https://github.com/rust-lang/cargo/pull/12786/)
- [Make browser links out of HTML file paths.](https://github.com/rust-lang/cargo/pull/12889)

<a id="1.75.0-Rustdoc"></a>

Rustdoc
-------

- [Accept less invalid Rust in rustdoc.](https://github.com/rust-lang/rust/pull/117450/)
- [Document lack of object safety on affected traits.](https://github.com/rust-lang/rust/pull/113241/)
- [Hide `#[repr(transparent)]` if it isn't part of the public ABI.](https://github.com/rust-lang/rust/pull/115439/)
- [Show enum discriminant if it is a C-like variant.](https://github.com/rust-lang/rust/pull/116142/)

<a id="1.75.0-Compatibility-Notes"></a>

Compatibility Notes
-------------------

- [FreeBSD targets now require at least version 12.](https://github.com/rust-lang/rust/pull/114521/)
- [Formally demote tier 2 MIPS targets to tier 3.](https://github.com/rust-lang/rust/pull/115238/)
- [Make misalignment a hard error in `const` contexts.](https://github.com/rust-lang/rust/pull/115524/)
- [Fix detecting references to packed unsized fields.](https://github.com/rust-lang/rust/pull/115583/)
- [Remove support for compiler plugins.](https://github.com/rust-lang/rust/pull/116412/)

<a id="1.75.0-Internal-Changes"></a>

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.

- [Optimize `librustc_driver.so` with BOLT.](https://github.com/rust-lang/rust/pull/116352/)
- [Enable parallel rustc front end in dev and nightly builds.](https://github.com/rust-lang/rust/pull/117435/)
- [Distribute `rustc-codegen-cranelift` as rustup component on the nightly channel.](https://github.com/rust-lang/rust/pull/81746/)

Version 1.74.1 (2023-12-07)
===========================

Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_ast_passes/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ ast_passes_fn_without_body =
free function without a body
.suggestion = provide a definition for the function
ast_passes_forbidden_bound =
bounds cannot be used in this context
ast_passes_forbidden_default =
`default` is only allowed on items in trait impls
.label = `default` because of this
ast_passes_forbidden_lifetime_bound =
lifetime bounds cannot be used in this context
ast_passes_forbidden_non_lifetime_param =
only lifetime parameters can be used in this context
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ pub struct TraitFnConst {
}

#[derive(Diagnostic)]
#[diag(ast_passes_forbidden_lifetime_bound)]
pub struct ForbiddenLifetimeBound {
#[diag(ast_passes_forbidden_bound)]
pub struct ForbiddenBound {
#[primary_span]
pub spans: Vec<Span>,
}
Expand Down
7 changes: 4 additions & 3 deletions compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ impl<'a> PostExpansionVisitor<'a> {
}

fn check_late_bound_lifetime_defs(&self, params: &[ast::GenericParam]) {
// Check only lifetime parameters are present and that the lifetime
// parameters that are present have no bounds.
// Check only lifetime parameters are present and that the
// generic parameters that are present have no bounds.
let non_lt_param_spans = params.iter().filter_map(|param| match param.kind {
ast::GenericParamKind::Lifetime { .. } => None,
_ => Some(param.ident.span),
Expand All @@ -164,10 +164,11 @@ impl<'a> PostExpansionVisitor<'a> {
non_lt_param_spans,
crate::fluent_generated::ast_passes_forbidden_non_lifetime_param
);

for param in params {
if !param.bounds.is_empty() {
let spans: Vec<_> = param.bounds.iter().map(|b| b.span()).collect();
self.sess.emit_err(errors::ForbiddenLifetimeBound { spans });
self.sess.emit_err(errors::ForbiddenBound { spans });
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::spec::{Target, TargetOptions};
pub fn target() -> Target {
let base = opts("watchos", Arch::Arm64);
Target {
llvm_target: "aarch-apple-watchos".into(),
llvm_target: "aarch64-apple-watchos".into(),
pointer_width: 64,
data_layout: "e-m:o-i64:64-i128:128-n32:64-S128".into(),
arch: "aarch64".into(),
Expand Down
1 change: 1 addition & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@
# "rustdoc",
# "rustfmt",
# "rust-analyzer",
# "rust-analyzer-proc-macro-srv",
# "analysis",
# "src",
# "rust-demangler", # if profiler = true
Expand Down
10 changes: 5 additions & 5 deletions src/bootstrap/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ dependencies = [

[[package]]
name = "once_cell"
version = "1.12.0"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"

[[package]]
name = "opener"
Expand Down Expand Up @@ -620,17 +620,17 @@ dependencies = [

[[package]]
name = "sysinfo"
version = "0.26.7"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c375d5fd899e32847b8566e10598d6e9f1d9b55ec6de3cdf9e7da4bdc51371bc"
checksum = "c68492e7268037de59ae153d7efb79546cf94a18a9548235420d3d8d2436b4b1"
dependencies = [
"cfg-if",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
"rayon",
"winapi",
"windows",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ walkdir = "2"
xz2 = "0.1"

# Dependencies needed by the build-metrics feature
sysinfo = { version = "0.26.0", optional = true }
sysinfo = { version = "0.30.0", optional = true }

# Solaris doesn't support flock() and thus fd-lock is not option now
[target.'cfg(not(target_os = "solaris"))'.dependencies]
Expand Down
13 changes: 8 additions & 5 deletions src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,14 @@ impl Step for RustAnalyzerProcMacroSrv {
// Allow building `rust-analyzer-proc-macro-srv` both as part of the `rust-analyzer` and as a stand-alone tool.
run.path("src/tools/rust-analyzer")
.path("src/tools/rust-analyzer/crates/proc-macro-srv-cli")
.default_condition(builder.config.tools.as_ref().map_or(true, |tools| {
tools
.iter()
.any(|tool| tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv")
}))
.default_condition(
builder.config.extended
&& builder.config.tools.as_ref().map_or(true, |tools| {
tools.iter().any(|tool| {
tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv"
})
}),
)
}

fn make_run(run: RunConfig<'_>) {
Expand Down
14 changes: 14 additions & 0 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,18 @@ impl PathSet {
}
}

const PATH_REMAP: &[(&str, &str)] = &[("rust-analyzer-proc-macro-srv", "proc-macro-srv-cli")];

fn remap_paths(paths: &mut Vec<&Path>) {
for path in paths.iter_mut() {
for &(search, replace) in PATH_REMAP {
if path.to_str() == Some(search) {
*path = Path::new(replace)
}
}
}
}

impl StepDescription {
fn from<S: Step>(kind: Kind) -> StepDescription {
StepDescription {
Expand Down Expand Up @@ -361,6 +373,8 @@ impl StepDescription {
let mut paths: Vec<_> =
paths.into_iter().map(|p| p.strip_prefix(".").unwrap_or(p)).collect();

remap_paths(&mut paths);

// Handle all test suite paths.
// (This is separate from the loop below to avoid having to handle multiple paths in `is_suite_path` somehow.)
paths.retain(|path| {
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Info,
summary: "Removed rust.run_dsymutil and dist.gpg_password_file config options, as they were unused.",
},
ChangeInfo {
change_id: 119124,
severity: ChangeSeverity::Warning,
summary: "rust-analyzer-proc-macro-srv is no longer enabled by default. To build it, you must either enable it in the configuration or explicitly invoke it with x.py.",
},
];
2 changes: 1 addition & 1 deletion src/bootstrap/src/utils/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::cell::RefCell;
use std::fs::File;
use std::io::BufWriter;
use std::time::{Duration, Instant, SystemTime};
use sysinfo::{CpuExt, System, SystemExt};
use sysinfo::System;

// Update this number whenever a breaking change is made to the build metrics.
//
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/bounded-hr-lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
pub fn hrlt<'b, 'c>()
where
for<'a: 'b + 'c> &'a (): std::fmt::Debug,
//~^ ERROR lifetime bounds cannot be used in this context
//~^ ERROR bounds cannot be used in this context
{
}
2 changes: 1 addition & 1 deletion tests/rustdoc-ui/bounded-hr-lifetime.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: lifetime bounds cannot be used in this context
error: bounds cannot be used in this context
--> $DIR/bounded-hr-lifetime.rs:6:13
|
LL | for<'a: 'b + 'c> &'a (): std::fmt::Debug,
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/bounds-lifetime.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type A = for<'b, 'a: 'b> fn(); //~ ERROR lifetime bounds cannot be used in this context
type B = for<'b, 'a: 'b,> fn(); //~ ERROR lifetime bounds cannot be used in this context
type C = for<'b, 'a: 'b +> fn(); //~ ERROR lifetime bounds cannot be used in this context
type A = for<'b, 'a: 'b> fn(); //~ ERROR bounds cannot be used in this context
type B = for<'b, 'a: 'b,> fn(); //~ ERROR bounds cannot be used in this context
type C = for<'b, 'a: 'b +> fn(); //~ ERROR bounds cannot be used in this context
type D = for<'a, T> fn(); //~ ERROR only lifetime parameters can be used in this context
type E = dyn for<T, U> Fn(); //~ ERROR only lifetime parameters can be used in this context

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/bounds-lifetime.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error: lifetime bounds cannot be used in this context
error: bounds cannot be used in this context
--> $DIR/bounds-lifetime.rs:1:22
|
LL | type A = for<'b, 'a: 'b> fn();
| ^^

error: lifetime bounds cannot be used in this context
error: bounds cannot be used in this context
--> $DIR/bounds-lifetime.rs:2:22
|
LL | type B = for<'b, 'a: 'b,> fn();
| ^^

error: lifetime bounds cannot be used in this context
error: bounds cannot be used in this context
--> $DIR/bounds-lifetime.rs:3:22
|
LL | type C = for<'b, 'a: 'b +> fn();
Expand Down
14 changes: 14 additions & 0 deletions tests/ui/closures/binder/bounds-on-closure-type-binders.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// check-fail

#![allow(incomplete_features)]
#![feature(non_lifetime_binders)]
#![feature(closure_lifetime_binder)]

trait Trait {}

fn main() {
// Regression test for issue #119067
let _ = for<T: Trait> || -> () {};
//~^ ERROR bounds cannot be used in this context
//~| ERROR late-bound type parameter not allowed on closures
}
14 changes: 14 additions & 0 deletions tests/ui/closures/binder/bounds-on-closure-type-binders.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: bounds cannot be used in this context
--> $DIR/bounds-on-closure-type-binders.rs:11:20
|
LL | let _ = for<T: Trait> || -> () {};
| ^^^^^

error: late-bound type parameter not allowed on closures
--> $DIR/bounds-on-closure-type-binders.rs:11:17
|
LL | let _ = for<T: Trait> || -> () {};
| ^

error: aborting due to 2 previous errors

Loading

0 comments on commit 3d0e6be

Please sign in to comment.