From 57bfbfa8979771a1054adad4ad0be46c531e1be0 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Tue, 19 Dec 2023 18:09:46 +0300 Subject: [PATCH 01/12] don't build `rust-analyzer-proc-macro-srv` on def config Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/tool.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 9942f00a0562b..8e3941dbedaca 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -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<'_>) { From bccac41db7cc894aeb9487bc97bc52698143145e Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Tue, 19 Dec 2023 18:27:08 +0300 Subject: [PATCH 02/12] update `build.tools` in config.example.toml Signed-off-by: onur-ozkan --- config.example.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config.example.toml b/config.example.toml index 14e0b9d521fde..f6e7eff3752ba 100644 --- a/config.example.toml +++ b/config.example.toml @@ -323,6 +323,7 @@ change-id = 118703 # "rustdoc", # "rustfmt", # "rust-analyzer", +# "rust-analyzer-proc-macro-srv", # "analysis", # "src", # "rust-demangler", # if profiler = true From 4ba1487e157c3d67ccac4e75b4a335494cbb3b3a Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Tue, 19 Dec 2023 18:28:41 +0300 Subject: [PATCH 03/12] implement remapper for build paths In config.toml we use `rust-analyzer-proc-macro-srv` for building `rust-analyzer-proc-macro-srv`, however, when we attempt to build it from the terminal, this cannot be used because we need to use the actual path, which is `proc-macro-srv-cli`. Remapping should end this confusion with improving the development experience. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/builder.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index 28761a7ee4b26..df8e3e8fd2349 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -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(kind: Kind) -> StepDescription { StepDescription { @@ -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| { From add2bde88787d904a6dbbec29cb44309930c4583 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 7 Dec 2023 18:31:35 -0800 Subject: [PATCH 04/12] Add release notes for 1.75.0 --- RELEASES.md | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index a18b5264bbd6b..76832fabbd976 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,128 @@ +Version 1.75.0 (2023-12-28) +========================== + + + +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/) +- [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/) + + + +Compiler +-------- + +- [Match usize/isize exhaustively with half-open ranges.](https://github.com/rust-lang/rust/pull/116692/) +- [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/) +- 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. + + + +Libraries +--------- + +- [Override `Waker::clone_from` to avoid cloning `Waker`s unnecessarily.](https://github.com/rust-lang/rust/pull/96979/) +- [Implement `BufRead` for `VecDeque`.](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/) +- [Don't panic in `::write`](https://github.com/rust-lang/rust/pull/115460/) +- [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/) + + + +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) + + + +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) + + + +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 discrimant if it is a C-like variant.](https://github.com/rust-lang/rust/pull/116142/) + + + +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/) + + + +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-cratelift` as rustup component on the nightly channel.](https://github.com/rust-lang/rust/pull/81746/) + Version 1.74.1 (2023-12-07) =========================== From 35a1189ca7b49a7d3016110be1d00494c5588d9c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 8 Dec 2023 14:17:57 -0800 Subject: [PATCH 05/12] Fix a release note typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: León Orell Valerian Liehr --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 76832fabbd976..9e007132dd1ff 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -97,7 +97,7 @@ 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 discrimant if it is a C-like variant.](https://github.com/rust-lang/rust/pull/116142/) +- [Show enum discriminant if it is a C-like variant.](https://github.com/rust-lang/rust/pull/116142/) From 6ca466ed1d8288fa427fb2f981be0e38b2e7e4ec Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 8 Dec 2023 14:18:58 -0800 Subject: [PATCH 06/12] Move exhaustive usize matching to lang --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 9e007132dd1ff..9554671d53a2d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -8,6 +8,7 @@ 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/) @@ -19,7 +20,6 @@ Language Compiler -------- -- [Match usize/isize exhaustively with half-open ranges.](https://github.com/rust-lang/rust/pull/116692/) - [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/) From c274a350df499bb9f6e35240169a0c37c5b8d3e9 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 16 Dec 2023 15:49:26 -0800 Subject: [PATCH 07/12] Fix a release note typo Co-authored-by: Mark Rousskov --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 9554671d53a2d..ba1824da08cff 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -121,7 +121,7 @@ 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-cratelift` as rustup component on the nightly channel.](https://github.com/rust-lang/rust/pull/81746/) +- [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) =========================== From 4897d5eccf642d701263d8d3ae63d9276810a494 Mon Sep 17 00:00:00 2001 From: surechen Date: Wed, 20 Dec 2023 15:06:36 +0800 Subject: [PATCH 08/12] Simple modification of diagnostic information fixes #119067 --- compiler/rustc_ast_passes/messages.ftl | 6 ++--- compiler/rustc_ast_passes/src/errors.rs | 4 ++-- compiler/rustc_ast_passes/src/feature_gate.rs | 7 +++--- tests/rustdoc-ui/bounded-hr-lifetime.rs | 2 +- tests/rustdoc-ui/bounded-hr-lifetime.stderr | 2 +- tests/ui/bounds-lifetime.rs | 6 ++--- tests/ui/bounds-lifetime.stderr | 6 ++--- .../binder/bounds-on-closure-type-binders.rs | 14 ++++++++++++ .../bounds-on-closure-type-binders.stderr | 14 ++++++++++++ .../higher-ranked/higher-lifetime-bounds.rs | 22 +++++++++---------- .../higher-lifetime-bounds.stderr | 22 +++++++++---------- .../recover/recover-fn-ptr-with-generics.rs | 2 +- .../recover-fn-ptr-with-generics.stderr | 2 +- .../bounds-on-type-binders.rs | 14 ++++++++++++ .../bounds-on-type-binders.stderr | 8 +++++++ 15 files changed, 91 insertions(+), 40 deletions(-) create mode 100644 tests/ui/closures/binder/bounds-on-closure-type-binders.rs create mode 100644 tests/ui/closures/binder/bounds-on-closure-type-binders.stderr create mode 100644 tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.rs create mode 100644 tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.stderr diff --git a/compiler/rustc_ast_passes/messages.ftl b/compiler/rustc_ast_passes/messages.ftl index 790b583134c0d..1c5ad820bd63b 100644 --- a/compiler/rustc_ast_passes/messages.ftl +++ b/compiler/rustc_ast_passes/messages.ftl @@ -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 diff --git a/compiler/rustc_ast_passes/src/errors.rs b/compiler/rustc_ast_passes/src/errors.rs index 4283fc7c07d1f..304c5c1bde97f 100644 --- a/compiler/rustc_ast_passes/src/errors.rs +++ b/compiler/rustc_ast_passes/src/errors.rs @@ -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, } diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 142cdd15e64ac..1cc9309c45c01 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -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), @@ -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 }); } } } diff --git a/tests/rustdoc-ui/bounded-hr-lifetime.rs b/tests/rustdoc-ui/bounded-hr-lifetime.rs index b2e000b975740..d6c90f552a286 100644 --- a/tests/rustdoc-ui/bounded-hr-lifetime.rs +++ b/tests/rustdoc-ui/bounded-hr-lifetime.rs @@ -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 { } diff --git a/tests/rustdoc-ui/bounded-hr-lifetime.stderr b/tests/rustdoc-ui/bounded-hr-lifetime.stderr index d7c4e8c380c53..c936e4022ef64 100644 --- a/tests/rustdoc-ui/bounded-hr-lifetime.stderr +++ b/tests/rustdoc-ui/bounded-hr-lifetime.stderr @@ -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, diff --git a/tests/ui/bounds-lifetime.rs b/tests/ui/bounds-lifetime.rs index e3e635a4e8405..f26976066ac3d 100644 --- a/tests/ui/bounds-lifetime.rs +++ b/tests/ui/bounds-lifetime.rs @@ -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 Fn(); //~ ERROR only lifetime parameters can be used in this context diff --git a/tests/ui/bounds-lifetime.stderr b/tests/ui/bounds-lifetime.stderr index bbae835d87544..de9b9e01242ce 100644 --- a/tests/ui/bounds-lifetime.stderr +++ b/tests/ui/bounds-lifetime.stderr @@ -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(); diff --git a/tests/ui/closures/binder/bounds-on-closure-type-binders.rs b/tests/ui/closures/binder/bounds-on-closure-type-binders.rs new file mode 100644 index 0000000000000..099047251ca56 --- /dev/null +++ b/tests/ui/closures/binder/bounds-on-closure-type-binders.rs @@ -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 || -> () {}; + //~^ ERROR bounds cannot be used in this context + //~| ERROR late-bound type parameter not allowed on closures +} diff --git a/tests/ui/closures/binder/bounds-on-closure-type-binders.stderr b/tests/ui/closures/binder/bounds-on-closure-type-binders.stderr new file mode 100644 index 0000000000000..9cb921f66314c --- /dev/null +++ b/tests/ui/closures/binder/bounds-on-closure-type-binders.stderr @@ -0,0 +1,14 @@ +error: bounds cannot be used in this context + --> $DIR/bounds-on-closure-type-binders.rs:11:20 + | +LL | let _ = for || -> () {}; + | ^^^^^ + +error: late-bound type parameter not allowed on closures + --> $DIR/bounds-on-closure-type-binders.rs:11:17 + | +LL | let _ = for || -> () {}; + | ^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/higher-ranked/higher-lifetime-bounds.rs b/tests/ui/higher-ranked/higher-lifetime-bounds.rs index f3393347d90dc..f1de1d1cf5395 100644 --- a/tests/ui/higher-ranked/higher-lifetime-bounds.rs +++ b/tests/ui/higher-ranked/higher-lifetime-bounds.rs @@ -6,7 +6,7 @@ fn bar1<'a, 'b>( x: &'a i32, y: &'b i32, f: for<'xa, 'xb: 'xa+'xa> fn(&'xa i32, &'xb i32) -> &'xa i32) - //~^ ERROR lifetime bounds cannot be used in this context + //~^ ERROR bounds cannot be used in this context { // If the bound in f's type would matter, the call below would (have to) // be rejected. @@ -14,7 +14,7 @@ fn bar1<'a, 'b>( } fn bar2<'a, 'b, F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>( - //~^ ERROR lifetime bounds cannot be used in this context + //~^ ERROR bounds cannot be used in this context x: &'a i32, y: &'b i32, f: F) @@ -29,7 +29,7 @@ fn bar3<'a, 'b, F>( y: &'b i32, f: F) where F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32 - //~^ ERROR lifetime bounds cannot be used in this context + //~^ ERROR bounds cannot be used in this context { // If the bound in f's type would matter, the call below would (have to) // be rejected. @@ -41,7 +41,7 @@ fn bar4<'a, 'b, F>( y: &'b i32, f: F) where for<'xa, 'xb: 'xa> F: Fn(&'xa i32, &'xb i32) -> &'xa i32 - //~^ ERROR lifetime bounds cannot be used in this context + //~^ ERROR bounds cannot be used in this context { // If the bound in f's type would matter, the call below would (have to) // be rejected. @@ -49,21 +49,21 @@ fn bar4<'a, 'b, F>( } struct S1 Fn(&'xa i32, &'xb i32) -> &'xa i32>(F); -//~^ ERROR lifetime bounds cannot be used in this context +//~^ ERROR bounds cannot be used in this context struct S2(F) where F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32; -//~^ ERROR lifetime bounds cannot be used in this context +//~^ ERROR bounds cannot be used in this context struct S3(F) where for<'xa, 'xb: 'xa> F: Fn(&'xa i32, &'xb i32) -> &'xa i32; -//~^ ERROR lifetime bounds cannot be used in this context +//~^ ERROR bounds cannot be used in this context struct S_fnty(for<'xa, 'xb: 'xa> fn(&'xa i32, &'xb i32) -> &'xa i32); -//~^ ERROR lifetime bounds cannot be used in this context +//~^ ERROR bounds cannot be used in this context type T1 = Box Fn(&'xa i32, &'xb i32) -> &'xa i32>; -//~^ ERROR lifetime bounds cannot be used in this context +//~^ ERROR bounds cannot be used in this context fn main() { let _ : Option fn(&'xa i32, &'xb i32) -> &'xa i32> = None; - //~^ ERROR lifetime bounds cannot be used in this context + //~^ ERROR bounds cannot be used in this context let _ : Option Fn(&'xa i32, &'xb i32) -> &'xa i32>> = None; - //~^ ERROR lifetime bounds cannot be used in this context + //~^ ERROR bounds cannot be used in this context } diff --git a/tests/ui/higher-ranked/higher-lifetime-bounds.stderr b/tests/ui/higher-ranked/higher-lifetime-bounds.stderr index bc6d2288cdfc4..de83d8bccdbef 100644 --- a/tests/ui/higher-ranked/higher-lifetime-bounds.stderr +++ b/tests/ui/higher-ranked/higher-lifetime-bounds.stderr @@ -1,64 +1,64 @@ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:8:22 | LL | f: for<'xa, 'xb: 'xa+'xa> fn(&'xa i32, &'xb i32) -> &'xa i32) | ^^^ ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:16:34 | LL | fn bar2<'a, 'b, F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>( | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:31:28 | LL | where F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32 | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:43:25 | LL | where for<'xa, 'xb: 'xa> F: Fn(&'xa i32, &'xb i32) -> &'xa i32 | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:51:28 | LL | struct S1 Fn(&'xa i32, &'xb i32) -> &'xa i32>(F); | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:53:40 | LL | struct S2(F) where F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32; | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:55:37 | LL | struct S3(F) where for<'xa, 'xb: 'xa> F: Fn(&'xa i32, &'xb i32) -> &'xa i32; | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:58:29 | LL | struct S_fnty(for<'xa, 'xb: 'xa> fn(&'xa i32, &'xb i32) -> &'xa i32); | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:61:33 | LL | type T1 = Box Fn(&'xa i32, &'xb i32) -> &'xa i32>; | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:65:34 | LL | let _ : Option fn(&'xa i32, &'xb i32) -> &'xa i32> = None; | ^^^ -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/higher-lifetime-bounds.rs:67:42 | LL | let _ : Option Fn(&'xa i32, &'xb i32) -> &'xa i32>> = None; diff --git a/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs b/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs index 31de418be5f70..76c56a715d2a4 100644 --- a/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs +++ b/tests/ui/parser/recover/recover-fn-ptr-with-generics.rs @@ -21,7 +21,7 @@ fn main() { let _: extern fn<'a: 'static>(); //~^ ERROR function pointer types may not have generic parameters - //~| ERROR lifetime bounds cannot be used in this context + //~| ERROR bounds cannot be used in this context let _: for<'any> extern "C" fn<'u>(); //~^ ERROR function pointer types may not have generic parameters diff --git a/tests/ui/parser/recover/recover-fn-ptr-with-generics.stderr b/tests/ui/parser/recover/recover-fn-ptr-with-generics.stderr index 069fcffe9a0df..6b6cb2d6bdde7 100644 --- a/tests/ui/parser/recover/recover-fn-ptr-with-generics.stderr +++ b/tests/ui/parser/recover/recover-fn-ptr-with-generics.stderr @@ -100,7 +100,7 @@ error[E0412]: cannot find type `T` in this scope LL | type Identity = fn(T) -> T; | ^ not found in this scope -error: lifetime bounds cannot be used in this context +error: bounds cannot be used in this context --> $DIR/recover-fn-ptr-with-generics.rs:22:26 | LL | let _: extern fn<'a: 'static>(); diff --git a/tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.rs b/tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.rs new file mode 100644 index 0000000000000..2535eb99c59b6 --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.rs @@ -0,0 +1,14 @@ +// check-fail + +#![allow(incomplete_features)] +#![feature(non_lifetime_binders)] + +trait Trait {} + +trait Trait2 +where + for ():, +{ //~^ ERROR bounds cannot be used in this context +} + +fn main() {} diff --git a/tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.stderr b/tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.stderr new file mode 100644 index 0000000000000..0a2f4cea61493 --- /dev/null +++ b/tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.stderr @@ -0,0 +1,8 @@ +error: bounds cannot be used in this context + --> $DIR/bounds-on-type-binders.rs:10:12 + | +LL | for ():, + | ^^^^^ + +error: aborting due to 1 previous error + From d9842a2060459394c77e8e8c39624b6afcfae8f5 Mon Sep 17 00:00:00 2001 From: Leo Howell Date: Thu, 21 Dec 2023 13:53:11 +0800 Subject: [PATCH 09/12] Fix name error in aarch64_apple_watchos tier 3 target --- compiler/rustc_target/src/spec/targets/aarch64_apple_watchos.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/targets/aarch64_apple_watchos.rs b/compiler/rustc_target/src/spec/targets/aarch64_apple_watchos.rs index b62666dcc7efa..c2cf2c4e96d52 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_apple_watchos.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_apple_watchos.rs @@ -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(), From c3ede70d35e326818b562b57f43df1d82204eedb Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 21 Dec 2023 12:17:49 +0100 Subject: [PATCH 10/12] Update sysinfo version to 0.30.0 --- src/bootstrap/Cargo.lock | 10 +++++----- src/bootstrap/Cargo.toml | 2 +- src/bootstrap/src/utils/metrics.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index f8e6d629ba347..63190fc318020 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -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" @@ -620,9 +620,9 @@ 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", @@ -630,7 +630,7 @@ dependencies = [ "ntapi", "once_cell", "rayon", - "winapi", + "windows", ] [[package]] diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 077d1954b7b9e..225eccca40f77 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -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] diff --git a/src/bootstrap/src/utils/metrics.rs b/src/bootstrap/src/utils/metrics.rs index 174f374224c02..697dd2f3505f6 100644 --- a/src/bootstrap/src/utils/metrics.rs +++ b/src/bootstrap/src/utils/metrics.rs @@ -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. // From 73cd2df422c08e2d659e38b4b7494fffb05228c2 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Thu, 21 Dec 2023 13:26:15 +0100 Subject: [PATCH 11/12] apply last suggestions from code review --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index ba1824da08cff..3fb74b52292c1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -24,6 +24,7 @@ Compiler - [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/) @@ -43,7 +44,6 @@ Libraries - [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/) -- [Don't panic in `::write`](https://github.com/rust-lang/rust/pull/115460/) - [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/) From 1f141dc0b8635f17ce31d72e3328ad2b0dd6b084 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 21 Dec 2023 16:08:14 +0300 Subject: [PATCH 12/12] add a new change in change-tracker Signed-off-by: onur-ozkan --- src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 8b53a61542e40..1eadc036b5e6e 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -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.", + }, ];