| author | bors <bors@rust-lang.org> 2026-06-30 23:49:17 UTC |
| committer | bors <bors@rust-lang.org> 2026-06-30 23:49:17 UTC |
| log | 17aa77551e89d5e80d4b506c9a32fc151264b8e4 |
| tree | d0b6bb978181f8f1e17eb7a00e0419ab57f9f8c0 |
| parent | f46ec5218fe7829ac18323b5ee0b409a63169f27 |
| parent | 16cad037de1771e0bad551699b1dd8d6e1cae6cd |
Rollup of 7 pull requests
Successful merges:
- rust-lang/rust#156379 (lint on `core::ffi::c_void` as a return type)
- rust-lang/rust#157347 (Implement `Box::as_non_null()`.)
- rust-lang/rust#157650 (rustc_target: Add OpenEmbedded/Yocto Linux base targets)
- rust-lang/rust#158569 ([rustdoc] Fix handling of inlining of `no_inline` of foreign items)
- rust-lang/rust#158573 (stabilize `feature(atomic_from_mut)`)
- rust-lang/rust#158614 (Fix error message when rejecting implicit stage != 2 in CI)
- rust-lang/rust#158616 (Remove dependency from `rustc_metadata` on `rustc_incremental`)34 files changed, 598 insertions(+), 118 deletions(-)
Cargo.lock-1| ... | ... | @@ -4392,7 +4392,6 @@ dependencies = [ |
| 4392 | 4392 | "rustc_fs_util", |
| 4393 | 4393 | "rustc_hir", |
| 4394 | 4394 | "rustc_hir_pretty", |
| 4395 | "rustc_incremental", | |
| 4396 | 4395 | "rustc_index", |
| 4397 | 4396 | "rustc_macros", |
| 4398 | 4397 | "rustc_middle", |
compiler/rustc_codegen_ssa/src/back/write.rs+10-8| ... | ... | @@ -15,9 +15,7 @@ use rustc_errors::{ |
| 15 | 15 | }; |
| 16 | 16 | use rustc_fs_util::link_or_copy; |
| 17 | 17 | use rustc_hir::find_attr; |
| 18 | use rustc_incremental::{ | |
| 19 | copy_cgu_workproduct_to_incr_comp_cache_dir, in_incr_comp_dir, in_incr_comp_dir_sess, | |
| 20 | }; | |
| 18 | use rustc_incremental::{copy_cgu_workproduct_to_incr_comp_cache_dir, in_incr_comp_dir_sess}; | |
| 21 | 19 | use rustc_macros::{Decodable, Encodable}; |
| 22 | 20 | use rustc_metadata::fs::copy_to_stdout; |
| 23 | 21 | use rustc_middle::bug; |
| ... | ... | @@ -884,20 +882,24 @@ fn execute_copy_from_cache_work_item( |
| 884 | 882 | let mut links_from_incr_cache = Vec::new(); |
| 885 | 883 | |
| 886 | 884 | let mut load_from_incr_comp_dir = |output_path: PathBuf, saved_path: &str| { |
| 887 | let source_file = in_incr_comp_dir(incr_comp_session_dir, saved_path); | |
| 885 | let source_file_in_incr_comp_dir = incr_comp_session_dir.join(saved_path); | |
| 888 | 886 | debug!( |
| 889 | 887 | "copying preexisting module `{}` from {:?} to {}", |
| 890 | 888 | module.name, |
| 891 | source_file, | |
| 889 | source_file_in_incr_comp_dir, | |
| 892 | 890 | output_path.display() |
| 893 | 891 | ); |
| 894 | match link_or_copy(&source_file, &output_path) { | |
| 892 | match link_or_copy(&source_file_in_incr_comp_dir, &output_path) { | |
| 895 | 893 | Ok(_) => { |
| 896 | links_from_incr_cache.push(source_file); | |
| 894 | links_from_incr_cache.push(source_file_in_incr_comp_dir); | |
| 897 | 895 | Some(output_path) |
| 898 | 896 | } |
| 899 | 897 | Err(error) => { |
| 900 | dcx.emit_err(errors::CopyPathBuf { source_file, output_path, error }); | |
| 898 | dcx.emit_err(errors::CopyPathBuf { | |
| 899 | source_file: source_file_in_incr_comp_dir, | |
| 900 | output_path, | |
| 901 | error, | |
| 902 | }); | |
| 901 | 903 | None |
| 902 | 904 | } |
| 903 | 905 | } |
compiler/rustc_incremental/src/lib.rs+2-2| ... | ... | @@ -10,8 +10,8 @@ mod diagnostics; |
| 10 | 10 | mod persist; |
| 11 | 11 | |
| 12 | 12 | pub use persist::{ |
| 13 | copy_cgu_workproduct_to_incr_comp_cache_dir, finalize_session_directory, in_incr_comp_dir, | |
| 14 | in_incr_comp_dir_sess, load_query_result_cache, save_work_product_index, setup_dep_graph, | |
| 13 | copy_cgu_workproduct_to_incr_comp_cache_dir, finalize_session_directory, in_incr_comp_dir_sess, | |
| 14 | load_query_result_cache, save_work_product_index, setup_dep_graph, | |
| 15 | 15 | }; |
| 16 | 16 | use rustc_middle::util::Providers; |
| 17 | 17 |
compiler/rustc_incremental/src/persist/fs.rs+1-9| ... | ... | @@ -184,15 +184,7 @@ fn lock_file_path(session_dir: &Path) -> PathBuf { |
| 184 | 184 | /// Returns the path for a given filename within the incremental compilation directory |
| 185 | 185 | /// in the current session. |
| 186 | 186 | pub fn in_incr_comp_dir_sess(sess: &Session, file_name: &str) -> PathBuf { |
| 187 | in_incr_comp_dir(&sess.incr_comp_session_dir(), file_name) | |
| 188 | } | |
| 189 | ||
| 190 | /// Returns the path for a given filename within the incremental compilation directory, | |
| 191 | /// not necessarily from the current session. | |
| 192 | /// | |
| 193 | /// To ensure the file is part of the current session, use [`in_incr_comp_dir_sess`]. | |
| 194 | pub fn in_incr_comp_dir(incr_comp_session_dir: &Path, file_name: &str) -> PathBuf { | |
| 195 | incr_comp_session_dir.join(file_name) | |
| 187 | sess.incr_comp_session_dir().join(file_name) | |
| 196 | 188 | } |
| 197 | 189 | |
| 198 | 190 | /// Allocates the private session directory. |
compiler/rustc_incremental/src/persist/mod.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ mod load; |
| 10 | 10 | mod save; |
| 11 | 11 | mod work_product; |
| 12 | 12 | |
| 13 | pub use fs::{finalize_session_directory, in_incr_comp_dir, in_incr_comp_dir_sess}; | |
| 13 | pub use fs::{finalize_session_directory, in_incr_comp_dir_sess}; | |
| 14 | 14 | pub use load::{load_query_result_cache, setup_dep_graph}; |
| 15 | 15 | pub(crate) use save::save_dep_graph; |
| 16 | 16 | pub use save::save_work_product_index; |
compiler/rustc_lint/src/c_void_returns.rs created+89| ... | ... | @@ -0,0 +1,89 @@ |
| 1 | use rustc_abi::ExternAbi; | |
| 2 | use rustc_hir::def::Res; | |
| 3 | use rustc_hir::def_id::LocalDefId; | |
| 4 | use rustc_hir::intravisit::FnKind; | |
| 5 | use rustc_hir::{self as hir, LangItem}; | |
| 6 | use rustc_session::{declare_lint, declare_lint_pass}; | |
| 7 | use rustc_span::Span; | |
| 8 | ||
| 9 | use crate::lints::{CVoidReturn, ExternCVoidReturn}; | |
| 10 | use crate::{LateContext, LateLintPass, LintContext}; | |
| 11 | ||
| 12 | declare_lint! { | |
| 13 | /// The `c_void_returns` lint detects the use of [`core::ffi::c_void`] as a return type. | |
| 14 | /// | |
| 15 | /// ### Example | |
| 16 | /// | |
| 17 | /// ```rust | |
| 18 | /// use std::ffi::c_void; | |
| 19 | /// | |
| 20 | /// unsafe extern "C" { | |
| 21 | /// fn foo() -> c_void; | |
| 22 | /// } | |
| 23 | /// ``` | |
| 24 | /// | |
| 25 | /// {{produces}} | |
| 26 | /// | |
| 27 | /// ### Explanation | |
| 28 | /// | |
| 29 | /// `c_void` is designed for use through a [`pointer`], equivalent to C's `void*` type. It is a | |
| 30 | /// mistake to use it directly as a return type, and calling `extern` functions declared as such | |
| 31 | /// may result in undefined behavior. C functions that return `void` must be declared to return | |
| 32 | /// [`()`] in Rust (omitting the return type implicitly returns `()`). | |
| 33 | /// | |
| 34 | /// [`core::ffi::c_void`]: https://doc.rust-lang.org/core/ffi/enum.c_void.html | |
| 35 | /// [`pointer`]: https://doc.rust-lang.org/core/primitive.pointer.html | |
| 36 | /// [`()`]: https://doc.rust-lang.org/core/primitive.unit.html | |
| 37 | pub C_VOID_RETURNS, | |
| 38 | Warn, | |
| 39 | "detects use of `c_void` as a return type" | |
| 40 | } | |
| 41 | ||
| 42 | declare_lint_pass!(CVoidReturns => [C_VOID_RETURNS]); | |
| 43 | ||
| 44 | impl<'tcx> LateLintPass<'tcx> for CVoidReturns { | |
| 45 | fn check_fn( | |
| 46 | &mut self, | |
| 47 | cx: &LateContext<'tcx>, | |
| 48 | fn_kind: FnKind<'tcx>, | |
| 49 | decl: &'tcx hir::FnDecl<'tcx>, | |
| 50 | _: &'tcx hir::Body<'tcx>, | |
| 51 | _: Span, | |
| 52 | _: LocalDefId, | |
| 53 | ) { | |
| 54 | check_decl( | |
| 55 | cx, | |
| 56 | decl, | |
| 57 | !matches!(fn_kind, FnKind::ItemFn(.., hir::FnHeader { abi: ExternAbi::Rust, .. })), | |
| 58 | ); | |
| 59 | } | |
| 60 | ||
| 61 | fn check_foreign_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ForeignItem<'tcx>) { | |
| 62 | if let hir::ForeignItemKind::Fn(sig, ..) = item.kind { | |
| 63 | check_decl(cx, sig.decl, true); | |
| 64 | } | |
| 65 | } | |
| 66 | ||
| 67 | fn check_ty(&mut self, cx: &LateContext<'tcx>, ty: &'tcx hir::Ty<'tcx, hir::AmbigArg>) { | |
| 68 | if let hir::TyKind::FnPtr(fn_ptr_ty) = ty.kind { | |
| 69 | check_decl(cx, fn_ptr_ty.decl, fn_ptr_ty.abi != ExternAbi::Rust); | |
| 70 | } | |
| 71 | } | |
| 72 | } | |
| 73 | ||
| 74 | fn check_decl(cx: &LateContext<'_>, decl: &hir::FnDecl<'_>, is_extern: bool) { | |
| 75 | if let hir::FnRetTy::Return(output_ty) = decl.output | |
| 76 | && let hir::TyKind::Path(qpath) = output_ty.kind | |
| 77 | && let Res::Def(.., def_id) = cx.qpath_res(&qpath, output_ty.hir_id) | |
| 78 | && cx.tcx.is_lang_item(def_id, LangItem::CVoid) | |
| 79 | { | |
| 80 | let suggestion = | |
| 81 | cx.sess().source_map().span_extend_to_prev_char(decl.output.span(), ')', true); | |
| 82 | ||
| 83 | if is_extern { | |
| 84 | cx.emit_span_lint(C_VOID_RETURNS, decl.output.span(), ExternCVoidReturn { suggestion }); | |
| 85 | } else { | |
| 86 | cx.emit_span_lint(C_VOID_RETURNS, decl.output.span(), CVoidReturn { suggestion }); | |
| 87 | } | |
| 88 | } | |
| 89 | } |
compiler/rustc_lint/src/lib.rs+3| ... | ... | @@ -32,6 +32,7 @@ mod async_closures; |
| 32 | 32 | mod async_fn_in_trait; |
| 33 | 33 | mod autorefs; |
| 34 | 34 | pub mod builtin; |
| 35 | mod c_void_returns; | |
| 35 | 36 | mod context; |
| 36 | 37 | mod dangling; |
| 37 | 38 | mod default_could_be_derived; |
| ... | ... | @@ -86,6 +87,7 @@ use async_closures::AsyncClosureUsage; |
| 86 | 87 | use async_fn_in_trait::AsyncFnInTrait; |
| 87 | 88 | use autorefs::*; |
| 88 | 89 | use builtin::*; |
| 90 | use c_void_returns::*; | |
| 89 | 91 | use dangling::*; |
| 90 | 92 | use default_could_be_derived::DefaultCouldBeDerived; |
| 91 | 93 | use deref_into_dyn_supertrait::*; |
| ... | ... | @@ -269,6 +271,7 @@ late_lint_methods!( |
| 269 | 271 | LifetimeSyntax: LifetimeSyntax, |
| 270 | 272 | InternalEqTraitMethodImpls: InternalEqTraitMethodImpls, |
| 271 | 273 | ImplicitProvenanceCasts: ImplicitProvenanceCasts, |
| 274 | CVoidReturns: CVoidReturns, | |
| 272 | 275 | ] |
| 273 | 276 | ] |
| 274 | 277 | ); |
compiler/rustc_lint/src/lints.rs+27| ... | ... | @@ -614,6 +614,33 @@ pub(crate) enum BuiltinSpecialModuleNameUsed { |
| 614 | 614 | Main, |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | // c_void_return.rs | |
| 618 | #[derive(Diagnostic)] | |
| 619 | #[diag("`c_void` should not be used as a return type")] | |
| 620 | #[help("returning `()` in Rust is equivalent to returning `void` in C")] | |
| 621 | pub(crate) struct CVoidReturn { | |
| 622 | #[suggestion( | |
| 623 | "remove the return type to implicitly return `()`", | |
| 624 | code = "", | |
| 625 | applicability = "maybe-incorrect" | |
| 626 | )] | |
| 627 | pub suggestion: Span, | |
| 628 | } | |
| 629 | ||
| 630 | // c_void_return.rs | |
| 631 | #[derive(Diagnostic)] | |
| 632 | #[diag("declarations returning `c_void` are not compatible with C functions returning `void`")] | |
| 633 | #[help("returning `()` in Rust is equivalent to returning `void` in C")] | |
| 634 | #[note("`c_void` is only used through raw pointers for compatibility with `void` pointers")] | |
| 635 | pub(crate) struct ExternCVoidReturn { | |
| 636 | #[suggestion( | |
| 637 | "remove the return type to implicitly return `()`", | |
| 638 | code = "", | |
| 639 | applicability = "maybe-incorrect" | |
| 640 | )] | |
| 641 | pub suggestion: Span, | |
| 642 | } | |
| 643 | ||
| 617 | 644 | // deref_into_dyn_supertrait.rs |
| 618 | 645 | #[derive(Diagnostic)] |
| 619 | 646 | #[diag("this `Deref` implementation is covered by an implicit supertrait coercion")] |
compiler/rustc_metadata/Cargo.toml-1| ... | ... | @@ -18,7 +18,6 @@ rustc_feature = { path = "../rustc_feature" } |
| 18 | 18 | rustc_fs_util = { path = "../rustc_fs_util" } |
| 19 | 19 | rustc_hir = { path = "../rustc_hir" } |
| 20 | 20 | rustc_hir_pretty = { path = "../rustc_hir_pretty" } |
| 21 | rustc_incremental = { path = "../rustc_incremental" } | |
| 22 | 21 | rustc_index = { path = "../rustc_index" } |
| 23 | 22 | rustc_macros = { path = "../rustc_macros" } |
| 24 | 23 | rustc_middle = { path = "../rustc_middle" } |
compiler/rustc_metadata/src/rmeta/encoder.rs+4-4| ... | ... | @@ -2472,10 +2472,10 @@ pub fn encode_metadata(tcx: TyCtxt<'_>, path: &Path, ref_path: Option<&Path>) { |
| 2472 | 2472 | && tcx.dep_graph.try_mark_green(tcx, &dep_node).is_some() |
| 2473 | 2473 | { |
| 2474 | 2474 | let saved_path = &work_product.saved_files["rmeta"]; |
| 2475 | let incr_comp_session_dir = tcx.sess.incr_comp_session_dir_opt().unwrap(); | |
| 2476 | let source_file = rustc_incremental::in_incr_comp_dir(&incr_comp_session_dir, saved_path); | |
| 2477 | debug!("copying preexisting metadata from {source_file:?} to {path:?}"); | |
| 2478 | match rustc_fs_util::link_or_copy(&source_file, path) { | |
| 2475 | let incr_comp_session_dir = tcx.sess.incr_comp_session_dir(); | |
| 2476 | let source_file_in_incr_dir = &incr_comp_session_dir.join(saved_path); | |
| 2477 | debug!("copying preexisting metadata from {source_file_in_incr_dir:?} to {path:?}"); | |
| 2478 | match rustc_fs_util::link_or_copy(&source_file_in_incr_dir, path) { | |
| 2479 | 2479 | Ok(_) => {} |
| 2480 | 2480 | Err(err) => tcx.dcx().emit_fatal(FailCreateFileEncoder { err }), |
| 2481 | 2481 | }; |
compiler/rustc_target/src/spec/mod.rs+6| ... | ... | @@ -1825,6 +1825,12 @@ supported_targets! { |
| 1825 | 1825 | ("x86_64-unknown-linux-gnuasan", x86_64_unknown_linux_gnuasan), |
| 1826 | 1826 | ("x86_64-unknown-linux-gnumsan", x86_64_unknown_linux_gnumsan), |
| 1827 | 1827 | ("x86_64-unknown-linux-gnutsan", x86_64_unknown_linux_gnutsan), |
| 1828 | ||
| 1829 | ("aarch64-oe-linux-gnu", aarch64_oe_linux_gnu), | |
| 1830 | ("armv7-oe-linux-gnueabihf", armv7_oe_linux_gnueabihf), | |
| 1831 | ("i686-oe-linux-gnu", i686_oe_linux_gnu), | |
| 1832 | ("riscv64-oe-linux-gnu", riscv64_oe_linux_gnu), | |
| 1833 | ("x86_64-oe-linux-gnu", x86_64_oe_linux_gnu), | |
| 1828 | 1834 | } |
| 1829 | 1835 | |
| 1830 | 1836 | /// Cow-Vec-Str: Cow<'static, [Cow<'static, str>]> |
compiler/rustc_target/src/spec/targets/aarch64_oe_linux_gnu.rs created+17| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | use crate::spec::{Target, TargetMetadata}; | |
| 2 | ||
| 3 | pub(crate) fn target() -> Target { | |
| 4 | let mut base = super::aarch64_unknown_linux_gnu::target(); | |
| 5 | ||
| 6 | base.metadata = TargetMetadata { | |
| 7 | description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+) for yocto".into()), | |
| 8 | tier: Some(3), | |
| 9 | host_tools: Some(false), | |
| 10 | std: Some(true), | |
| 11 | }; | |
| 12 | ||
| 13 | base.llvm_target = "aarch64-oe-linux-gnu".into(); | |
| 14 | base.options.linker = Some("aarch64-oe-linux-gcc".into()); | |
| 15 | ||
| 16 | base | |
| 17 | } |
compiler/rustc_target/src/spec/targets/armv7_oe_linux_gnueabihf.rs created+17| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | use crate::spec::{Target, TargetMetadata}; | |
| 2 | ||
| 3 | pub(crate) fn target() -> Target { | |
| 4 | let mut base = super::armv7_unknown_linux_gnueabihf::target(); | |
| 5 | ||
| 6 | base.metadata = TargetMetadata { | |
| 7 | description: Some("Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17) for yocto".into()), | |
| 8 | tier: Some(3), | |
| 9 | host_tools: Some(false), | |
| 10 | std: Some(true), | |
| 11 | }; | |
| 12 | ||
| 13 | base.llvm_target = "armv7-oe-linux-gnueabihf".into(); | |
| 14 | base.options.linker = Some("arm-oe-linux-gnueabi-gcc".into()); | |
| 15 | ||
| 16 | base | |
| 17 | } |
compiler/rustc_target/src/spec/targets/i686_oe_linux_gnu.rs created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | use crate::spec::{Target, TargetMetadata}; | |
| 2 | ||
| 3 | pub(crate) fn target() -> Target { | |
| 4 | let mut base = super::i686_unknown_linux_gnu::target(); | |
| 5 | ||
| 6 | base.metadata = TargetMetadata { | |
| 7 | description: Some("32-bit Linux (kernel 3.2, glibc 2.17+) for yocto".into()), | |
| 8 | tier: Some(3), | |
| 9 | host_tools: Some(false), | |
| 10 | std: Some(true), | |
| 11 | }; | |
| 12 | ||
| 13 | base.llvm_target = "i686-oe-linux-gnu".into(); | |
| 14 | ||
| 15 | base.options.linker = Some("i686-oe-linux-gcc".into()); | |
| 16 | ||
| 17 | base.options.cpu = "core2".into(); | |
| 18 | base.options.features = "+sse3".into(); | |
| 19 | ||
| 20 | base | |
| 21 | } |
compiler/rustc_target/src/spec/targets/riscv64_oe_linux_gnu.rs created+17| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | use crate::spec::{Target, TargetMetadata}; | |
| 2 | ||
| 3 | pub(crate) fn target() -> Target { | |
| 4 | let mut base = super::riscv64gc_unknown_linux_gnu::target(); | |
| 5 | ||
| 6 | base.metadata = TargetMetadata { | |
| 7 | description: Some("RISC-V Linux (kernel 4.20, glibc 2.29) for yocto".into()), | |
| 8 | tier: Some(3), | |
| 9 | host_tools: Some(false), | |
| 10 | std: Some(true), | |
| 11 | }; | |
| 12 | ||
| 13 | base.llvm_target = "riscv64-oe-linux-gnu".into(); | |
| 14 | base.options.linker = Some("riscv64-oe-linux-gcc".into()); | |
| 15 | ||
| 16 | base | |
| 17 | } |
compiler/rustc_target/src/spec/targets/x86_64_oe_linux_gnu.rs created+17| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | use crate::spec::{Target, TargetMetadata}; | |
| 2 | ||
| 3 | pub(crate) fn target() -> Target { | |
| 4 | let mut base = super::x86_64_unknown_linux_gnu::target(); | |
| 5 | ||
| 6 | base.metadata = TargetMetadata { | |
| 7 | description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+) for yocto".into()), | |
| 8 | tier: Some(3), | |
| 9 | host_tools: Some(false), | |
| 10 | std: Some(true), | |
| 11 | }; | |
| 12 | ||
| 13 | base.llvm_target = "x86_64-oe-linux-gnu".into(); | |
| 14 | base.options.linker = Some("x86_64-oe-linux-gcc".into()); | |
| 15 | ||
| 16 | base | |
| 17 | } |
library/alloc/src/boxed.rs+48-2| ... | ... | @@ -1753,7 +1753,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> { |
| 1753 | 1753 | /// |
| 1754 | 1754 | /// This method guarantees that for the purpose of the aliasing model, this method |
| 1755 | 1755 | /// does not materialize a reference to the underlying memory, and thus the returned pointer |
| 1756 | /// will remain valid when mixed with other calls to [`as_ptr`] and [`as_mut_ptr`]. | |
| 1756 | /// will remain valid when mixed with other calls to [`as_ptr`], [`as_mut_ptr`], and [`as_non_null`]. | |
| 1757 | 1757 | /// Note that calling other methods that materialize references to the memory |
| 1758 | 1758 | /// may still invalidate this pointer. |
| 1759 | 1759 | /// See the example below for how this guarantee can be used. |
| ... | ... | @@ -1776,6 +1776,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> { |
| 1776 | 1776 | /// |
| 1777 | 1777 | /// [`as_mut_ptr`]: Self::as_mut_ptr |
| 1778 | 1778 | /// [`as_ptr`]: Self::as_ptr |
| 1779 | /// [`as_non_null`]: Self::as_non_null | |
| 1780 | #[must_use] | |
| 1779 | 1781 | #[stable(feature = "box_as_ptr", since = "CURRENT_RUSTC_VERSION")] |
| 1780 | 1782 | #[rustc_never_returns_null_ptr] |
| 1781 | 1783 | #[rustc_as_ptr] |
| ... | ... | @@ -1797,7 +1799,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> { |
| 1797 | 1799 | /// |
| 1798 | 1800 | /// This method guarantees that for the purpose of the aliasing model, this method |
| 1799 | 1801 | /// does not materialize a reference to the underlying memory, and thus the returned pointer |
| 1800 | /// will remain valid when mixed with other calls to [`as_ptr`] and [`as_mut_ptr`]. | |
| 1802 | /// will remain valid when mixed with other calls to [`as_ptr`], [`as_mut_ptr`], and [`as_non_null`]. | |
| 1801 | 1803 | /// Note that calling other methods that materialize mutable references to the memory, |
| 1802 | 1804 | /// as well as writing to this memory, may still invalidate this pointer. |
| 1803 | 1805 | /// See the example below for how this guarantee can be used. |
| ... | ... | @@ -1823,6 +1825,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> { |
| 1823 | 1825 | /// |
| 1824 | 1826 | /// [`as_mut_ptr`]: Self::as_mut_ptr |
| 1825 | 1827 | /// [`as_ptr`]: Self::as_ptr |
| 1828 | /// [`as_non_null`]: Self::as_non_null | |
| 1829 | #[must_use] | |
| 1826 | 1830 | #[stable(feature = "box_as_ptr", since = "CURRENT_RUSTC_VERSION")] |
| 1827 | 1831 | #[rustc_never_returns_null_ptr] |
| 1828 | 1832 | #[rustc_as_ptr] |
| ... | ... | @@ -1833,6 +1837,48 @@ impl<T: ?Sized, A: Allocator> Box<T, A> { |
| 1833 | 1837 | &raw const **b |
| 1834 | 1838 | } |
| 1835 | 1839 | |
| 1840 | /// Returns a `NonNull` pointer to the `Box`'s contents. | |
| 1841 | /// | |
| 1842 | /// The caller must ensure that the `Box` outlives the pointer this | |
| 1843 | /// function returns, or else it will end up dangling. | |
| 1844 | /// | |
| 1845 | /// This method guarantees that for the purpose of the aliasing model, this method | |
| 1846 | /// does not materialize a reference to the underlying memory, and thus the returned pointer | |
| 1847 | /// will remain valid when mixed with other calls to [`as_ptr`], [`as_mut_ptr`], and [`as_non_null`]. | |
| 1848 | /// Note that calling other methods that materialize references to the memory | |
| 1849 | /// may still invalidate this pointer. | |
| 1850 | /// See the example below for how this guarantee can be used. | |
| 1851 | /// | |
| 1852 | /// # Examples | |
| 1853 | /// | |
| 1854 | /// Due to the aliasing guarantee, the following code is legal: | |
| 1855 | /// | |
| 1856 | /// ```rust | |
| 1857 | /// #![feature(box_as_non_null)] | |
| 1858 | /// | |
| 1859 | /// unsafe { | |
| 1860 | /// let mut b = Box::new(0); | |
| 1861 | /// let ptr1 = Box::as_non_null(&mut b); | |
| 1862 | /// ptr1.write(1); | |
| 1863 | /// let ptr2 = Box::as_non_null(&mut b); | |
| 1864 | /// ptr2.write(2); | |
| 1865 | /// // Notably, the write to `ptr2` did *not* invalidate `ptr1`: | |
| 1866 | /// ptr1.write(3); | |
| 1867 | /// } | |
| 1868 | /// ``` | |
| 1869 | /// | |
| 1870 | /// [`as_mut_ptr`]: Self::as_mut_ptr | |
| 1871 | /// [`as_ptr`]: Self::as_ptr | |
| 1872 | /// [`as_non_null`]: Self::as_non_null | |
| 1873 | #[must_use] | |
| 1874 | #[unstable(feature = "box_as_non_null", issue = "157345")] | |
| 1875 | #[rustc_as_ptr] | |
| 1876 | #[inline] | |
| 1877 | pub fn as_non_null(b: &mut Self) -> NonNull<T> { | |
| 1878 | // SAFETY: `Box` is guaranteed to be non-null. | |
| 1879 | unsafe { NonNull::new_unchecked(Self::as_mut_ptr(b)) } | |
| 1880 | } | |
| 1881 | ||
| 1836 | 1882 | /// Returns a reference to the underlying allocator. |
| 1837 | 1883 | /// |
| 1838 | 1884 | /// Note: this is an associated function, which means that you have |
library/core/src/sync/atomic.rs+9-18| ... | ... | @@ -608,7 +608,6 @@ impl AtomicBool { |
| 608 | 608 | /// # Examples |
| 609 | 609 | /// |
| 610 | 610 | /// ``` |
| 611 | /// #![feature(atomic_from_mut)] | |
| 612 | 611 | /// use std::sync::atomic::{AtomicBool, Ordering}; |
| 613 | 612 | /// |
| 614 | 613 | /// let mut some_bool = true; |
| ... | ... | @@ -618,7 +617,7 @@ impl AtomicBool { |
| 618 | 617 | /// ``` |
| 619 | 618 | #[inline] |
| 620 | 619 | #[cfg(target_has_atomic_primitive_alignment = "8")] |
| 621 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 620 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 622 | 621 | pub fn from_mut(v: &mut bool) -> &mut Self { |
| 623 | 622 | // SAFETY: the mutable reference guarantees unique ownership, and |
| 624 | 623 | // alignment of both `bool` and `Self` is 1. |
| ... | ... | @@ -633,7 +632,6 @@ impl AtomicBool { |
| 633 | 632 | /// # Examples |
| 634 | 633 | /// |
| 635 | 634 | /// ```ignore-wasm |
| 636 | /// #![feature(atomic_from_mut)] | |
| 637 | 635 | /// use std::sync::atomic::{AtomicBool, Ordering}; |
| 638 | 636 | /// |
| 639 | 637 | /// let mut some_bools = [const { AtomicBool::new(false) }; 10]; |
| ... | ... | @@ -653,7 +651,7 @@ impl AtomicBool { |
| 653 | 651 | /// }); |
| 654 | 652 | /// ``` |
| 655 | 653 | #[inline] |
| 656 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 654 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 657 | 655 | pub fn get_mut_slice(this: &mut [Self]) -> &mut [bool] { |
| 658 | 656 | // SAFETY: the mutable reference guarantees unique ownership. |
| 659 | 657 | unsafe { &mut *(this as *mut [Self] as *mut [bool]) } |
| ... | ... | @@ -664,7 +662,6 @@ impl AtomicBool { |
| 664 | 662 | /// # Examples |
| 665 | 663 | /// |
| 666 | 664 | /// ```rust,ignore-wasm |
| 667 | /// #![feature(atomic_from_mut)] | |
| 668 | 665 | /// use std::sync::atomic::{AtomicBool, Ordering}; |
| 669 | 666 | /// |
| 670 | 667 | /// let mut some_bools = [false; 10]; |
| ... | ... | @@ -678,7 +675,7 @@ impl AtomicBool { |
| 678 | 675 | /// ``` |
| 679 | 676 | #[inline] |
| 680 | 677 | #[cfg(target_has_atomic_primitive_alignment = "8")] |
| 681 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 678 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 682 | 679 | pub fn from_mut_slice(v: &mut [bool]) -> &mut [Self] { |
| 683 | 680 | // SAFETY: the mutable reference guarantees unique ownership, and |
| 684 | 681 | // alignment of both `bool` and `Self` is 1. |
| ... | ... | @@ -1577,7 +1574,6 @@ impl<T> AtomicPtr<T> { |
| 1577 | 1574 | /// # Examples |
| 1578 | 1575 | /// |
| 1579 | 1576 | /// ``` |
| 1580 | /// #![feature(atomic_from_mut)] | |
| 1581 | 1577 | /// use std::sync::atomic::{AtomicPtr, Ordering}; |
| 1582 | 1578 | /// |
| 1583 | 1579 | /// let mut data = 123; |
| ... | ... | @@ -1589,7 +1585,7 @@ impl<T> AtomicPtr<T> { |
| 1589 | 1585 | /// ``` |
| 1590 | 1586 | #[inline] |
| 1591 | 1587 | #[cfg(target_has_atomic_primitive_alignment = "ptr")] |
| 1592 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 1588 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 1593 | 1589 | pub fn from_mut(v: &mut *mut T) -> &mut Self { |
| 1594 | 1590 | let [] = [(); align_of::<AtomicPtr<()>>() - align_of::<*mut ()>()]; |
| 1595 | 1591 | // SAFETY: |
| ... | ... | @@ -1607,7 +1603,6 @@ impl<T> AtomicPtr<T> { |
| 1607 | 1603 | /// # Examples |
| 1608 | 1604 | /// |
| 1609 | 1605 | /// ```ignore-wasm |
| 1610 | /// #![feature(atomic_from_mut)] | |
| 1611 | 1606 | /// use std::ptr::null_mut; |
| 1612 | 1607 | /// use std::sync::atomic::{AtomicPtr, Ordering}; |
| 1613 | 1608 | /// |
| ... | ... | @@ -1633,7 +1628,7 @@ impl<T> AtomicPtr<T> { |
| 1633 | 1628 | /// }); |
| 1634 | 1629 | /// ``` |
| 1635 | 1630 | #[inline] |
| 1636 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 1631 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 1637 | 1632 | pub fn get_mut_slice(this: &mut [Self]) -> &mut [*mut T] { |
| 1638 | 1633 | // SAFETY: the mutable reference guarantees unique ownership. |
| 1639 | 1634 | unsafe { &mut *(this as *mut [Self] as *mut [*mut T]) } |
| ... | ... | @@ -1646,7 +1641,6 @@ impl<T> AtomicPtr<T> { |
| 1646 | 1641 | /// # Examples |
| 1647 | 1642 | /// |
| 1648 | 1643 | /// ```ignore-wasm |
| 1649 | /// #![feature(atomic_from_mut)] | |
| 1650 | 1644 | /// use std::ptr::null_mut; |
| 1651 | 1645 | /// use std::sync::atomic::{AtomicPtr, Ordering}; |
| 1652 | 1646 | /// |
| ... | ... | @@ -1668,7 +1662,7 @@ impl<T> AtomicPtr<T> { |
| 1668 | 1662 | /// ``` |
| 1669 | 1663 | #[inline] |
| 1670 | 1664 | #[cfg(target_has_atomic_primitive_alignment = "ptr")] |
| 1671 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 1665 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 1672 | 1666 | pub fn from_mut_slice(v: &mut [*mut T]) -> &mut [Self] { |
| 1673 | 1667 | // SAFETY: |
| 1674 | 1668 | // - the mutable reference guarantees unique ownership. |
| ... | ... | @@ -2721,7 +2715,6 @@ macro_rules! atomic_int { |
| 2721 | 2715 | /// # Examples |
| 2722 | 2716 | /// |
| 2723 | 2717 | /// ``` |
| 2724 | /// #![feature(atomic_from_mut)] | |
| 2725 | 2718 | #[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")] |
| 2726 | 2719 | /// |
| 2727 | 2720 | /// let mut some_int = 123; |
| ... | ... | @@ -2732,7 +2725,7 @@ macro_rules! atomic_int { |
| 2732 | 2725 | /// |
| 2733 | 2726 | #[inline] |
| 2734 | 2727 | #[$cfg_align] |
| 2735 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 2728 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 2736 | 2729 | pub fn from_mut(v: &mut $int_type) -> &mut Self { |
| 2737 | 2730 | let [] = [(); align_of::<Self>() - align_of::<$int_type>()]; |
| 2738 | 2731 | // SAFETY: |
| ... | ... | @@ -2750,7 +2743,6 @@ macro_rules! atomic_int { |
| 2750 | 2743 | /// # Examples |
| 2751 | 2744 | /// |
| 2752 | 2745 | /// ```ignore-wasm |
| 2753 | /// #![feature(atomic_from_mut)] | |
| 2754 | 2746 | #[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")] |
| 2755 | 2747 | /// |
| 2756 | 2748 | #[doc = concat!("let mut some_ints = [const { ", stringify!($atomic_type), "::new(0) }; 10];")] |
| ... | ... | @@ -2772,7 +2764,7 @@ macro_rules! atomic_int { |
| 2772 | 2764 | /// }); |
| 2773 | 2765 | /// ``` |
| 2774 | 2766 | #[inline] |
| 2775 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 2767 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 2776 | 2768 | pub fn get_mut_slice(this: &mut [Self]) -> &mut [$int_type] { |
| 2777 | 2769 | // SAFETY: the mutable reference guarantees unique ownership. |
| 2778 | 2770 | unsafe { &mut *(this as *mut [Self] as *mut [$int_type]) } |
| ... | ... | @@ -2791,7 +2783,6 @@ macro_rules! atomic_int { |
| 2791 | 2783 | /// # Examples |
| 2792 | 2784 | /// |
| 2793 | 2785 | /// ```ignore-wasm |
| 2794 | /// #![feature(atomic_from_mut)] | |
| 2795 | 2786 | #[doc = concat!($extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};")] |
| 2796 | 2787 | /// |
| 2797 | 2788 | /// let mut some_ints = [0; 10]; |
| ... | ... | @@ -2807,7 +2798,7 @@ macro_rules! atomic_int { |
| 2807 | 2798 | /// ``` |
| 2808 | 2799 | #[inline] |
| 2809 | 2800 | #[$cfg_align] |
| 2810 | #[unstable(feature = "atomic_from_mut", issue = "76314")] | |
| 2801 | #[stable(feature = "atomic_from_mut", since = "CURRENT_RUSTC_VERSION")] | |
| 2811 | 2802 | pub fn from_mut_slice(v: &mut [$int_type]) -> &mut [Self] { |
| 2812 | 2803 | let [] = [(); align_of::<Self>() - align_of::<$int_type>()]; |
| 2813 | 2804 | // SAFETY: |
src/bootstrap/src/core/config/config.rs+3-1| ... | ... | @@ -1206,7 +1206,9 @@ impl Config { |
| 1206 | 1206 | | Subcommand::Install => { |
| 1207 | 1207 | assert_eq!( |
| 1208 | 1208 | stage, 2, |
| 1209 | "x.py should be run with `--stage 2` on CI, but was run with `--stage {stage}`", | |
| 1209 | "\ | |
| 1210 | x.py was run under CI with an implicit `--stage {stage}`. This is probably wrong and you want stage 2. | |
| 1211 | NOTE: Please add `--stage 2` to your command line, or if you're sure you want to run stage {stage} then add `--stage {stage}` explicitly" | |
| 1210 | 1212 | ); |
| 1211 | 1213 | } |
| 1212 | 1214 | Subcommand::Clean { .. } |
src/doc/rustc/src/SUMMARY.md+1| ... | ... | @@ -104,6 +104,7 @@ |
| 104 | 104 | - [mips\*-mti-none-elf](platform-support/mips-mti-none-elf.md) |
| 105 | 105 | - [mipsisa\*r6\*-unknown-linux-gnu\*](platform-support/mips-release-6.md) |
| 106 | 106 | - [nvptx64-nvidia-cuda](platform-support/nvptx64-nvidia-cuda.md) |
| 107 | - [\*-oe-linux-gnu](platform-support/oe-linux-gnu.md) | |
| 107 | 108 | - [powerpc-unknown-openbsd](platform-support/powerpc-unknown-openbsd.md) |
| 108 | 109 | - [powerpc-unknown-linux-gnuspe](platform-support/powerpc-unknown-linux-gnuspe.md) |
| 109 | 110 | - [powerpc-unknown-linux-muslspe](platform-support/powerpc-unknown-linux-muslspe.md) |
src/doc/rustc/src/platform-support.md+5| ... | ... | @@ -267,6 +267,7 @@ target | std | host | notes |
| 267 | 267 | -------|:---:|:----:|------- |
| 268 | 268 | [`aarch64-kmc-solid_asp3`](platform-support/kmc-solid.md) | ✓ | | ARM64 SOLID with TOPPERS/ASP3 |
| 269 | 269 | [`aarch64-nintendo-switch-freestanding`](platform-support/aarch64-nintendo-switch-freestanding.md) | * | | ARM64 Nintendo Switch, Horizon |
| 270 | [`aarch64-oe-linux-gnu`](platform-support/oe-linux-gnu.md) | ✓ | | ARM64 OpenEmbedded/Yocto Linux (GNU) | |
| 270 | 271 | [`aarch64-unknown-helenos`](platform-support/helenos.md) | ✓ | | ARM64 HelenOS |
| 271 | 272 | [`aarch64-unknown-hermit`](platform-support/hermit.md) | ✓ | | ARM64 Hermit |
| 272 | 273 | [`aarch64-unknown-illumos`](platform-support/illumos.md) | ✓ | ✓ | ARM64 illumos |
| ... | ... | @@ -310,6 +311,7 @@ target | std | host | notes |
| 310 | 311 | [`armv6-unknown-freebsd`](platform-support/freebsd.md) | ✓ | ✓ | Armv6 FreeBSD |
| 311 | 312 | [`armv6-unknown-netbsd-eabihf`](platform-support/netbsd.md) | ✓ | ✓ | Armv6 NetBSD w/hard-float |
| 312 | 313 | [`armv6k-nintendo-3ds`](platform-support/armv6k-nintendo-3ds.md) | ? | | Armv6k Nintendo 3DS, Horizon (Requires devkitARM toolchain) |
| 314 | [`armv7-oe-linux-gnueabihf`](platform-support/oe-linux-gnu.md) | ✓ | | ARMv7 OpenEmbedded/Yocto Linux (GNU) | |
| 313 | 315 | [`armv7-rtems-eabihf`](platform-support/armv7-rtems-eabihf.md) | ? | | RTEMS OS for ARM BSPs |
| 314 | 316 | [`armv7-sony-vita-newlibeabihf`](platform-support/armv7-sony-vita-newlibeabihf.md) | ✓ | | Armv7-A Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain) |
| 315 | 317 | [`armv7-unknown-freebsd`](platform-support/freebsd.md) | ✓ | ✓ | Armv7-A FreeBSD |
| ... | ... | @@ -337,6 +339,7 @@ target | std | host | notes |
| 337 | 339 | [`i586-unknown-netbsd`](platform-support/netbsd.md) | ✓ | | 32-bit x86 (original Pentium) [^x86_32-floats-x87] |
| 338 | 340 | [`i586-unknown-redox`](platform-support/redox.md) | ✓ | | 32-bit x86 Redox OS (PentiumPro) [^x86_32-floats-x87] |
| 339 | 341 | [`i686-apple-darwin`](platform-support/apple-darwin.md) | ✓ | ✓ | 32-bit macOS (10.12+, Sierra+, Penryn) [^x86_32-floats-return-ABI] |
| 342 | [`i686-oe-linux-gnu`](platform-support/oe-linux-gnu.md) | ✓ | | 32-bit x86 OpenEmbedded/Yocto Linux (GNU) | |
| 340 | 343 | [`i686-pc-nto-qnx700`](platform-support/nto-qnx.md) | * | | 32-bit x86 QNX Neutrino 7.0 RTOS (Pentium 4) [^x86_32-floats-return-ABI] |
| 341 | 344 | `i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku (Pentium 4) [^x86_32-floats-return-ABI] |
| 342 | 345 | [`i686-unknown-helenos`](platform-support/helenos.md) | ✓ | | HelenOS IA-32 (see docs for pending issues) |
| ... | ... | @@ -406,6 +409,7 @@ target | std | host | notes |
| 406 | 409 | [`riscv32imc-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF |
| 407 | 410 | [`riscv32imc-unknown-nuttx-elf`](platform-support/nuttx.md) | ✓ | | RISC-V 32bit with NuttX |
| 408 | 411 | [`riscv64-linux-android`](platform-support/android.md) | ? | | RISC-V 64-bit Android |
| 412 | [`riscv64-oe-linux-gnu`](platform-support/oe-linux-gnu.md) | ✓ | | RISC-V OpenEmbedded/Yocto Linux (GNU) | |
| 409 | 413 | [`riscv64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | | |
| 410 | 414 | `riscv64gc-unknown-freebsd` | ? | | RISC-V FreeBSD |
| 411 | 415 | `riscv64gc-unknown-fuchsia` | ? | | RISC-V Fuchsia |
| ... | ... | @@ -443,6 +447,7 @@ target | std | host | notes |
| 443 | 447 | [`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ✓ | | x86 64-bit tvOS |
| 444 | 448 | [`x86_64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | x86 64-bit Apple WatchOS simulator |
| 445 | 449 | [`x86_64-lynx-lynxos178`](platform-support/lynxos178.md) | | | x86_64 LynxOS-178 |
| 450 | [`x86_64-oe-linux-gnu`](platform-support/oe-linux-gnu.md) | ✓ | | x86 64-bit OpenEmbedded/Yocto Linux (GNU) | |
| 446 | 451 | [`x86_64-pc-cygwin`](platform-support/x86_64-pc-cygwin.md) | ✓ | | 64-bit x86 Cygwin | |
| 447 | 452 | [`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS with default network stack (io-pkt) | |
| 448 | 453 | [`x86_64-pc-nto-qnx710_iosock`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS with new network stack (io-sock) | |
src/doc/rustc/src/platform-support/oe-linux-gnu.md created+41| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | # `*-oe-linux-gnu` | |
| 2 | ||
| 3 | **Tier: 3** | |
| 4 | ||
| 5 | Targets for OpenEmbedded/Yocto-based Linux systems. | |
| 6 | ||
| 7 | Target triplets available: | |
| 8 | ||
| 9 | * `x86_64-oe-linux-gnu` | |
| 10 | * `aarch64-oe-linux-gnu` | |
| 11 | * `i686-oe-linux-gnu` | |
| 12 | * `armv7-oe-linux-gnueabihf` | |
| 13 | * `riscv64-oe-linux-gnu` | |
| 14 | ||
| 15 | ## Target maintainers | |
| 16 | ||
| 17 | [@DeepeshWR](https://github.com/DeepeshWR) | |
| 18 | ||
| 19 | ## Requirements | |
| 20 | ||
| 21 | ### Operating System | |
| 22 | ||
| 23 | These targets are intended for Linux systems built using the OpenEmbedded and Yocto Project build systems. | |
| 24 | ||
| 25 | ### C Toolchain | |
| 26 | ||
| 27 | The targets use the architecture-specific OpenEmbedded GCC driver as the default linker and therefore require the corresponding OpenEmbedded cross-compilation toolchain to be available in the build environment. | |
| 28 | ||
| 29 | ## Building | |
| 30 | ||
| 31 | These targets are intended for use with the OpenEmbedded/Yocto build system. They provide base target definitions from which downstream Yocto-generated targets may inherit. | |
| 32 | ||
| 33 | ## Building Rust programs | |
| 34 | ||
| 35 | Rust does not currently ship precompiled artifacts for these targets. | |
| 36 | ||
| 37 | Downstream Yocto-generated targets may inherit from these base OpenEmbedded targets and customize metadata or vendor-specific configuration as needed. | |
| 38 | ||
| 39 | ## Cross-compilation toolchains and C code | |
| 40 | ||
| 41 | The targets support linking with C code through the corresponding OpenEmbedded cross-compilation toolchains. |
src/librustdoc/clean/inline.rs+128-54| ... | ... | @@ -142,7 +142,7 @@ pub(crate) fn try_inline( |
| 142 | 142 | Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) => return Some(Vec::new()), |
| 143 | 143 | Res::Def(DefKind::Mod, did) => { |
| 144 | 144 | record_extern_fqn(cx, did, ItemType::Module); |
| 145 | clean::ModuleItem(build_module(cx, did, visited)) | |
| 145 | clean::ModuleItem(build_module(cx, did, name, visited)) | |
| 146 | 146 | } |
| 147 | 147 | Res::Def(DefKind::Static { .. }, did) => { |
| 148 | 148 | record_extern_fqn(cx, did, ItemType::Static); |
| ... | ... | @@ -207,6 +207,7 @@ pub(crate) fn try_inline_glob( |
| 207 | 207 | let mut items = build_module_items( |
| 208 | 208 | cx, |
| 209 | 209 | did, |
| 210 | cx.tcx.item_name(did), | |
| 210 | 211 | visited, |
| 211 | 212 | inlined_names, |
| 212 | 213 | Some(&reexports), |
| ... | ... | @@ -665,16 +666,43 @@ pub(crate) fn build_impl( |
| 665 | 666 | )); |
| 666 | 667 | } |
| 667 | 668 | |
| 668 | fn build_module(cx: &mut DocContext<'_>, did: DefId, visited: &mut DefIdSet) -> clean::Module { | |
| 669 | let items = build_module_items(cx, did, visited, &mut FxHashSet::default(), None, None); | |
| 669 | fn build_module( | |
| 670 | cx: &mut DocContext<'_>, | |
| 671 | did: DefId, | |
| 672 | name: Symbol, | |
| 673 | visited: &mut DefIdSet, | |
| 674 | ) -> clean::Module { | |
| 675 | let items = build_module_items(cx, did, name, visited, &mut FxHashSet::default(), None, None); | |
| 670 | 676 | |
| 671 | 677 | let span = clean::Span::new(cx.tcx.def_span(did)); |
| 672 | 678 | clean::Module { items, span } |
| 673 | 679 | } |
| 674 | 680 | |
| 681 | // We are only interested into `Res::Def`. And in there, we only want "items" which get their own | |
| 682 | // rustdoc page. So not `DefKind::Ctor` for example (which is returned by `tcx.module_children()`). | |
| 683 | fn should_ignore_res(res: Res) -> bool { | |
| 684 | !matches!( | |
| 685 | res, | |
| 686 | Res::Def(DefKind::Trait, _) | |
| 687 | | Res::Def(DefKind::TraitAlias, _) | |
| 688 | | Res::Def(DefKind::Fn, _) | |
| 689 | | Res::Def(DefKind::Struct, _) | |
| 690 | | Res::Def(DefKind::Union, _) | |
| 691 | | Res::Def(DefKind::TyAlias, _) | |
| 692 | | Res::Def(DefKind::Enum, _) | |
| 693 | | Res::Def(DefKind::ForeignTy, _) | |
| 694 | | Res::Def(DefKind::Variant, _) | |
| 695 | | Res::Def(DefKind::Mod, _) | |
| 696 | | Res::Def(DefKind::Static { .. }, _) | |
| 697 | | Res::Def(DefKind::Const { .. }, _) | |
| 698 | | Res::Def(DefKind::Macro(_), _) | |
| 699 | ) | |
| 700 | } | |
| 701 | ||
| 675 | 702 | fn build_module_items( |
| 676 | 703 | cx: &mut DocContext<'_>, |
| 677 | did: DefId, | |
| 704 | module_def_id: DefId, | |
| 705 | module_name: Symbol, | |
| 678 | 706 | visited: &mut DefIdSet, |
| 679 | 707 | inlined_names: &mut FxHashSet<(ItemType, Symbol)>, |
| 680 | 708 | allowed_def_ids: Option<&DefIdSet>, |
| ... | ... | @@ -685,61 +713,107 @@ fn build_module_items( |
| 685 | 713 | // If we're re-exporting a re-export it may actually re-export something in |
| 686 | 714 | // two namespaces, so the target may be listed twice. Make sure we only |
| 687 | 715 | // visit each node at most once. |
| 688 | for item in cx.tcx.module_children(did).iter() { | |
| 689 | if item.vis.is_public() { | |
| 690 | let res = item.res.expect_non_local(); | |
| 691 | if let Some(def_id) = res.opt_def_id() | |
| 692 | && let Some(allowed_def_ids) = allowed_def_ids | |
| 693 | && !allowed_def_ids.contains(&def_id) | |
| 716 | for item in cx.tcx.module_children(module_def_id).iter() { | |
| 717 | if !item.vis.is_public() { | |
| 718 | continue; | |
| 719 | } | |
| 720 | let res = item.res.expect_non_local(); | |
| 721 | if let Some(def_id) = res.opt_def_id() | |
| 722 | && let Some(allowed_def_ids) = allowed_def_ids | |
| 723 | && !allowed_def_ids.contains(&def_id) | |
| 724 | { | |
| 725 | continue; | |
| 726 | } | |
| 727 | if let Some(def_id) = res.mod_def_id() { | |
| 728 | // If we're inlining a glob import, it's possible to have | |
| 729 | // two distinct modules with the same name. We don't want to | |
| 730 | // inline it, or mark any of its contents as visited. | |
| 731 | if module_def_id == def_id | |
| 732 | || inlined_names.contains(&(ItemType::Module, item.ident.name)) | |
| 733 | || !visited.insert(def_id) | |
| 694 | 734 | { |
| 695 | 735 | continue; |
| 696 | 736 | } |
| 697 | if let Some(def_id) = res.mod_def_id() { | |
| 698 | // If we're inlining a glob import, it's possible to have | |
| 699 | // two distinct modules with the same name. We don't want to | |
| 700 | // inline it, or mark any of its contents as visited. | |
| 701 | if did == def_id | |
| 702 | || inlined_names.contains(&(ItemType::Module, item.ident.name)) | |
| 703 | || !visited.insert(def_id) | |
| 704 | { | |
| 705 | continue; | |
| 706 | } | |
| 707 | } | |
| 708 | if let Res::PrimTy(p) = res { | |
| 709 | // Primitive types can't be inlined so generate an import instead. | |
| 710 | let prim_ty = clean::PrimitiveType::from(p); | |
| 711 | items.push(clean::Item { | |
| 712 | inner: Box::new(clean::ItemInner { | |
| 713 | name: None, | |
| 714 | // We can use the item's `DefId` directly since the only information ever | |
| 715 | // used from it is `DefId.krate`. | |
| 716 | item_id: ItemId::DefId(did), | |
| 717 | attrs: Default::default(), | |
| 718 | stability: None, | |
| 719 | kind: clean::ImportItem(clean::Import::new_simple( | |
| 720 | item.ident.name, | |
| 721 | clean::ImportSource { | |
| 722 | path: clean::Path { | |
| 723 | res, | |
| 724 | segments: thin_vec![clean::PathSegment { | |
| 725 | name: prim_ty.as_sym(), | |
| 726 | args: clean::GenericArgs::AngleBracketed { | |
| 727 | args: Default::default(), | |
| 728 | constraints: ThinVec::new(), | |
| 729 | }, | |
| 730 | }], | |
| 731 | }, | |
| 732 | did: None, | |
| 737 | } | |
| 738 | if let Res::PrimTy(p) = res { | |
| 739 | // Primitive types can't be inlined so generate an import instead. | |
| 740 | let prim_ty = clean::PrimitiveType::from(p); | |
| 741 | items.push(clean::Item { | |
| 742 | inner: Box::new(clean::ItemInner { | |
| 743 | name: None, | |
| 744 | // We can use the item's `DefId` directly since the only information ever | |
| 745 | // used from it is `DefId.krate`. | |
| 746 | item_id: ItemId::DefId(module_def_id), | |
| 747 | attrs: Default::default(), | |
| 748 | stability: None, | |
| 749 | kind: clean::ImportItem(clean::Import::new_simple( | |
| 750 | item.ident.name, | |
| 751 | clean::ImportSource { | |
| 752 | path: clean::Path { | |
| 753 | res, | |
| 754 | segments: thin_vec![clean::PathSegment { | |
| 755 | name: prim_ty.as_sym(), | |
| 756 | args: clean::GenericArgs::AngleBracketed { | |
| 757 | args: Default::default(), | |
| 758 | constraints: ThinVec::new(), | |
| 759 | }, | |
| 760 | }], | |
| 733 | 761 | }, |
| 734 | true, | |
| 735 | )), | |
| 736 | cfg: None, | |
| 737 | inline_stmt_id: None, | |
| 738 | }), | |
| 739 | }); | |
| 740 | } else if let Some(i) = try_inline(cx, res, item.ident.name, attrs, visited) { | |
| 741 | items.extend(i) | |
| 762 | did: None, | |
| 763 | }, | |
| 764 | true, | |
| 765 | )), | |
| 766 | cfg: None, | |
| 767 | inline_stmt_id: None, | |
| 768 | }), | |
| 769 | }); | |
| 770 | } else if let Some(def_id) = res.opt_def_id() | |
| 771 | && let Some(reexport) = item.reexport_chain.first() | |
| 772 | && let Some(reexport_def_id) = reexport.id() | |
| 773 | && find_attr!( | |
| 774 | load_attrs(cx.tcx, reexport_def_id), | |
| 775 | Doc(d) | |
| 776 | if d.inline.first().is_some_and(|(inline, _)| *inline == hir::attrs::DocInline::NoInline) | |
| 777 | ) | |
| 778 | { | |
| 779 | if should_ignore_res(res) { | |
| 780 | continue; | |
| 742 | 781 | } |
| 782 | // This item is reexported as `no_inline` so it shouldn't be inlined. | |
| 783 | let item = Item::from_def_id_and_parts( | |
| 784 | module_def_id, | |
| 785 | None, | |
| 786 | clean::ImportItem(clean::Import::new_simple( | |
| 787 | item.ident.name, | |
| 788 | clean::ImportSource { | |
| 789 | path: clean::Path { | |
| 790 | res, | |
| 791 | segments: thin_vec![ | |
| 792 | clean::PathSegment { | |
| 793 | name: module_name, | |
| 794 | args: clean::GenericArgs::AngleBracketed { | |
| 795 | args: Default::default(), | |
| 796 | constraints: ThinVec::new(), | |
| 797 | }, | |
| 798 | }, | |
| 799 | clean::PathSegment { | |
| 800 | name: cx.tcx.item_name(def_id), | |
| 801 | args: clean::GenericArgs::AngleBracketed { | |
| 802 | args: Default::default(), | |
| 803 | constraints: ThinVec::new(), | |
| 804 | }, | |
| 805 | }, | |
| 806 | ], | |
| 807 | }, | |
| 808 | did: None, | |
| 809 | }, | |
| 810 | true, | |
| 811 | )), | |
| 812 | cx.tcx, | |
| 813 | ); | |
| 814 | items.push(item); | |
| 815 | } else if let Some(i) = try_inline(cx, res, item.ident.name, attrs, visited) { | |
| 816 | items.extend(i) | |
| 743 | 817 | } |
| 744 | 818 | } |
| 745 | 819 |
src/librustdoc/passes/stripper.rs+2| ... | ... | @@ -287,12 +287,14 @@ impl DocFolder for ImportStripper<'_> { |
| 287 | 287 | clean::ImportItem(imp) |
| 288 | 288 | if !self.document_hidden && self.import_should_be_hidden(&i, imp) => |
| 289 | 289 | { |
| 290 | debug!("ImportStripper: stripping {:?}", i.name); | |
| 290 | 291 | None |
| 291 | 292 | } |
| 292 | 293 | // clean::ImportItem(_) if !self.document_hidden && i.is_doc_hidden() => None, |
| 293 | 294 | clean::ExternCrateItem { .. } | clean::ImportItem(..) |
| 294 | 295 | if i.visibility(self.tcx) != Some(Visibility::Public) => |
| 295 | 296 | { |
| 297 | debug!("ImportStripper: stripping {:?}", i.name); | |
| 296 | 298 | None |
| 297 | 299 | } |
| 298 | 300 | _ => Some(self.fold_item_recur(i)), |
src/tools/miri/tests/pass/0weak_memory/extra_cpp.rs-2| ... | ... | @@ -3,8 +3,6 @@ |
| 3 | 3 | // Tests operations not performable through C++'s atomic API |
| 4 | 4 | // but doable in safe (at least sound) Rust. |
| 5 | 5 | |
| 6 | #![feature(atomic_from_mut)] | |
| 7 | ||
| 8 | 6 | use std::sync::atomic::Ordering::*; |
| 9 | 7 | use std::sync::atomic::{AtomicU16, AtomicU32}; |
| 10 | 8 | use std::thread::spawn; |
tests/assembly-llvm/targets/targets-elf.rs+15| ... | ... | @@ -28,6 +28,9 @@ |
| 28 | 28 | //@ revisions: aarch64_nintendo_switch_freestanding |
| 29 | 29 | //@ [aarch64_nintendo_switch_freestanding] compile-flags: --target aarch64-nintendo-switch-freestanding |
| 30 | 30 | //@ [aarch64_nintendo_switch_freestanding] needs-llvm-components: aarch64 |
| 31 | //@ revisions: aarch64_oe_linux_gnu | |
| 32 | //@ [aarch64_oe_linux_gnu] compile-flags: --target aarch64-oe-linux-gnu | |
| 33 | //@ [aarch64_oe_linux_gnu] needs-llvm-components: aarch64 | |
| 31 | 34 | //@ revisions: aarch64_unknown_freebsd |
| 32 | 35 | //@ [aarch64_unknown_freebsd] compile-flags: --target aarch64-unknown-freebsd |
| 33 | 36 | //@ [aarch64_unknown_freebsd] needs-llvm-components: aarch64 |
| ... | ... | @@ -166,6 +169,9 @@ |
| 166 | 169 | //@ revisions: armv7_linux_androideabi |
| 167 | 170 | //@ [armv7_linux_androideabi] compile-flags: --target armv7-linux-androideabi |
| 168 | 171 | //@ [armv7_linux_androideabi] needs-llvm-components: arm |
| 172 | //@ revisions: armv7_oe_linux_gnueabihf | |
| 173 | //@ [armv7_oe_linux_gnueabihf] compile-flags: --target armv7-oe-linux-gnueabihf | |
| 174 | //@ [armv7_oe_linux_gnueabihf] needs-llvm-components: arm | |
| 169 | 175 | //@ revisions: armv7_rtems_eabihf |
| 170 | 176 | //@ [armv7_rtems_eabihf] compile-flags: --target armv7-rtems-eabihf |
| 171 | 177 | //@ [armv7_rtems_eabihf] needs-llvm-components: arm |
| ... | ... | @@ -271,6 +277,9 @@ |
| 271 | 277 | //@ revisions: i686_linux_android |
| 272 | 278 | //@ [i686_linux_android] compile-flags: --target i686-linux-android |
| 273 | 279 | //@ [i686_linux_android] needs-llvm-components: x86 |
| 280 | //@ revisions: i686_oe_linux_gnu | |
| 281 | //@ [i686_oe_linux_gnu] compile-flags: --target i686-oe-linux-gnu | |
| 282 | //@ [i686_oe_linux_gnu] needs-llvm-components: x86 | |
| 274 | 283 | //@ revisions: i686_unknown_freebsd |
| 275 | 284 | //@ [i686_unknown_freebsd] compile-flags: --target i686-unknown-freebsd |
| 276 | 285 | //@ [i686_unknown_freebsd] needs-llvm-components: x86 |
| ... | ... | @@ -502,6 +511,9 @@ |
| 502 | 511 | //@ revisions: riscv64_linux_android |
| 503 | 512 | //@ [riscv64_linux_android] compile-flags: --target riscv64-linux-android |
| 504 | 513 | //@ [riscv64_linux_android] needs-llvm-components: riscv |
| 514 | //@ revisions: riscv64_oe_linux_gnu | |
| 515 | //@ [riscv64_oe_linux_gnu] compile-flags: --target riscv64-oe-linux-gnu | |
| 516 | //@ [riscv64_oe_linux_gnu] needs-llvm-components: riscv | |
| 505 | 517 | //@ revisions: riscv64_wrs_vxworks |
| 506 | 518 | //@ [riscv64_wrs_vxworks] compile-flags: --target riscv64-wrs-vxworks |
| 507 | 519 | //@ [riscv64_wrs_vxworks] needs-llvm-components: riscv |
| ... | ... | @@ -664,6 +676,9 @@ |
| 664 | 676 | //@ revisions: x86_64_lynx_lynxos178 |
| 665 | 677 | //@ [x86_64_lynx_lynxos178] compile-flags: --target x86_64-lynx-lynxos178 |
| 666 | 678 | //@ [x86_64_lynx_lynxos178] needs-llvm-components: x86 |
| 679 | //@ revisions: x86_64_oe_linux_gnu | |
| 680 | //@ [x86_64_oe_linux_gnu] compile-flags: --target x86_64-oe-linux-gnu | |
| 681 | //@ [x86_64_oe_linux_gnu] needs-llvm-components: x86 | |
| 667 | 682 | //@ revisions: x86_64_pc_nto_qnx710 |
| 668 | 683 | //@ [x86_64_pc_nto_qnx710] compile-flags: --target x86_64-pc-nto-qnx710 |
| 669 | 684 | //@ [x86_64_pc_nto_qnx710] needs-llvm-components: x86 |
tests/rustdoc-html/reexport/auxiliary/inline-foreign-no_inline.rs created+9| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | #[doc(no_inline)] | |
| 2 | pub use crate::{ | |
| 3 | future::{Future, FutureExt as _}, | |
| 4 | }; | |
| 5 | ||
| 6 | mod future { | |
| 7 | pub struct Future; | |
| 8 | pub trait FutureExt {} | |
| 9 | } |
tests/rustdoc-html/reexport/inline-foreign-no_inline.rs created+22| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | // This test ensures that an inlined foreign item with `#[doc(no_inline)]` is | |
| 2 | // not inlined. | |
| 3 | // This is a regression test for <https://github.com/rust-lang/rust/issues/92379>. | |
| 4 | ||
| 5 | //@ aux-build: inline-foreign-no_inline.rs | |
| 6 | ||
| 7 | #![crate_name = "foo"] | |
| 8 | ||
| 9 | extern crate inline_foreign_no_inline; | |
| 10 | ||
| 11 | // Since we cannot inline `inline_foreign_no_inline` because it has `no_inline`, there | |
| 12 | // should have no other items than "Module". | |
| 13 | //@ has 'foo/index.html' | |
| 14 | //@ count - '//*[@id="main-content"]/h2' 1 | |
| 15 | //@ has - '//*[@id="main-content"]/h2' 'Module' | |
| 16 | //@ has - '//*[@id="main-content"]/dl[@class="item-table"]/dt' 'dep' | |
| 17 | ||
| 18 | //@ has 'foo/dep/index.html' | |
| 19 | //@ has - '//*[@class="item-table reexports"]/dt' 'pub use dep::Future;' | |
| 20 | //@ has - '//*[@class="item-table reexports"]/dt' 'pub use dep::FutureExt as _;' | |
| 21 | #[doc(inline)] | |
| 22 | pub use inline_foreign_no_inline as dep; |
tests/rustdoc-html/reexport/inline-no_inline.rs created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | // This test checks that inlining a `no_inline` is done correctly. | |
| 2 | ||
| 3 | #![crate_name = "foo"] | |
| 4 | ||
| 5 | //@ has 'foo/index.html' | |
| 6 | // There should be `Re-exports` and `Structs` | |
| 7 | //@ count - '//*[@id="main-content"]/h2' 2 | |
| 8 | //@ has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Re-exports' | |
| 9 | //@ has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Structs' | |
| 10 | ||
| 11 | //@ has - '//*[@id="main-content"]/dl[@class="item-table reexports"]/dt' 'pub use self::bar::A;' | |
| 12 | //@ has - '//*[@id="main-content"]/dl[@class="item-table"]/dt' 'X' | |
| 13 | ||
| 14 | mod bar { | |
| 15 | pub struct A; | |
| 16 | } | |
| 17 | ||
| 18 | #[doc(no_inline)] | |
| 19 | pub use self::bar::A; | |
| 20 | #[doc(inline)] | |
| 21 | pub use self::A as X; |
tests/ui/lint/c-void-returns.rs created+22| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | #![allow(unused)] | |
| 2 | #![deny(c_void_returns)] | |
| 3 | ||
| 4 | use std::ffi::c_void; | |
| 5 | use std::ptr; | |
| 6 | ||
| 7 | fn foo() -> c_void { //~ ERROR c_void | |
| 8 | unreachable!() | |
| 9 | } | |
| 10 | ||
| 11 | fn bar() -> *mut c_void { | |
| 12 | ptr::null_mut() | |
| 13 | } | |
| 14 | ||
| 15 | unsafe extern "C" { | |
| 16 | fn baz() -> c_void; //~ ERROR c_void | |
| 17 | fn quux() -> *const c_void; | |
| 18 | } | |
| 19 | ||
| 20 | type Xyzzy = fn() -> c_void; //~ ERROR c_void | |
| 21 | ||
| 22 | fn main() {} |
tests/ui/lint/c-void-returns.stderr created+38| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | error: `c_void` should not be used as a return type | |
| 2 | --> $DIR/c-void-returns.rs:7:13 | |
| 3 | | | |
| 4 | LL | fn foo() -> c_void { | |
| 5 | | ----^^^^^^ | |
| 6 | | | | |
| 7 | | help: remove the return type to implicitly return `()` | |
| 8 | | | |
| 9 | = help: returning `()` in Rust is equivalent to returning `void` in C | |
| 10 | note: the lint level is defined here | |
| 11 | --> $DIR/c-void-returns.rs:2:9 | |
| 12 | | | |
| 13 | LL | #![deny(c_void_returns)] | |
| 14 | | ^^^^^^^^^^^^^^ | |
| 15 | ||
| 16 | error: declarations returning `c_void` are not compatible with C functions returning `void` | |
| 17 | --> $DIR/c-void-returns.rs:16:17 | |
| 18 | | | |
| 19 | LL | fn baz() -> c_void; | |
| 20 | | ----^^^^^^ | |
| 21 | | | | |
| 22 | | help: remove the return type to implicitly return `()` | |
| 23 | | | |
| 24 | = help: returning `()` in Rust is equivalent to returning `void` in C | |
| 25 | = note: `c_void` is only used through raw pointers for compatibility with `void` pointers | |
| 26 | ||
| 27 | error: `c_void` should not be used as a return type | |
| 28 | --> $DIR/c-void-returns.rs:20:22 | |
| 29 | | | |
| 30 | LL | type Xyzzy = fn() -> c_void; | |
| 31 | | ----^^^^^^ | |
| 32 | | | | |
| 33 | | help: remove the return type to implicitly return `()` | |
| 34 | | | |
| 35 | = help: returning `()` in Rust is equivalent to returning `void` in C | |
| 36 | ||
| 37 | error: aborting due to 3 previous errors | |
| 38 |
tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.alignment_matches.stderr deleted-13| ... | ... | @@ -1,13 +0,0 @@ |
| 1 | error[E0658]: use of unstable library feature `atomic_from_mut` | |
| 2 | --> $DIR/atomic-from-mut-not-available.rs:24:5 | |
| 3 | | | |
| 4 | LL | core::sync::atomic::AtomicU64::from_mut(&mut 0u64); | |
| 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 6 | | | |
| 7 | = note: see issue #76314 <https://github.com/rust-lang/rust/issues/76314> for more information | |
| 8 | = help: add `#![feature(atomic_from_mut)]` to the crate attributes to enable | |
| 9 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | |
| 10 | ||
| 11 | error: aborting due to 1 previous error | |
| 12 | ||
| 13 | For more information about this error, try `rustc --explain E0658`. |
tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.alignment_mismatch.stderr+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0599]: no associated function or constant named `from_mut` found for struct `Atomic<u64>` in the current scope |
| 2 | --> $DIR/atomic-from-mut-not-available.rs:24:36 | |
| 2 | --> $DIR/atomic-from-mut-not-available.rs:25:36 | |
| 3 | 3 | | |
| 4 | 4 | LL | core::sync::atomic::AtomicU64::from_mut(&mut 0u64); |
| 5 | 5 | | ^^^^^^^^ associated function or constant not found in `Atomic<u64>` |
tests/ui/stdlib-unit-tests/atomic-from-mut-not-available.rs+1-1| ... | ... | @@ -19,9 +19,9 @@ |
| 19 | 19 | // ... but pass on 64-bit x86_64 linux. |
| 20 | 20 | //@[alignment_matches] only-x86_64 |
| 21 | 21 | //@[alignment_matches] only-linux |
| 22 | //@[alignment_matches] check-pass | |
| 22 | 23 | |
| 23 | 24 | fn main() { |
| 24 | 25 | core::sync::atomic::AtomicU64::from_mut(&mut 0u64); |
| 25 | 26 | //[alignment_mismatch]~^ ERROR no associated function or constant named `from_mut` found for struct `Atomic<u64>` |
| 26 | //[alignment_matches]~^^ ERROR use of unstable library feature `atomic_from_mut` | |
| 27 | 27 | } |