https://gcc.gnu.org/g:16f795c742cd1c1bc6fa77099d5c1aae85e5cda9
commit r17-4356-g16f795c742cd1c1bc6fa77099d5c1aae85e5cda9 Author: Owen Avery <[email protected]> Date: Thu Sep 10 22:37:27 2026 -0400 gccrs: Change alloc crate test edition to 2018 The alloc crate should be tested with edition 2018, not 2015. However, the included mock core crate did not support edition 2018. gcc/testsuite/ChangeLog: * rust/alloc/alloc.exp: Test with edition 2018. * rust/alloc/core.rs: Fix some use declaration paths and use raw identifiers for "try". Signed-off-by: Owen Avery <[email protected]> Diff: --- gcc/testsuite/rust/alloc/alloc.exp | 2 +- gcc/testsuite/rust/alloc/core.rs | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gcc/testsuite/rust/alloc/alloc.exp b/gcc/testsuite/rust/alloc/alloc.exp index d412b50cf22e..7e6331cab90d 100644 --- a/gcc/testsuite/rust/alloc/alloc.exp +++ b/gcc/testsuite/rust/alloc/alloc.exp @@ -37,7 +37,7 @@ if { [check_effective_target_lp64] } { $srcdir/$subdir/alloc/* \ ]] - dg-runtest $srcdir/$subdir/alloc/src/lib.rs "-frust-edition=2015 -frust-crate=alloc -frust-compile-until=nameresolution -frust-cfg=target_has_atomic=\"ptr\" -w" "" + dg-runtest $srcdir/$subdir/alloc/src/lib.rs "-frust-edition=2018 -frust-crate=alloc -frust-compile-until=nameresolution -frust-cfg=target_has_atomic=\"ptr\" -w" "" set dg-do-what-default ${saved-dg-do-what-default} } else { unsupported "alloc crate tests require a 64-bit target " diff --git a/gcc/testsuite/rust/alloc/core.rs b/gcc/testsuite/rust/alloc/core.rs index 8362e3473fcd..e74ed9e4db8e 100644 --- a/gcc/testsuite/rust/alloc/core.rs +++ b/gcc/testsuite/rust/alloc/core.rs @@ -106,14 +106,14 @@ pub mod ops { pub use self::arith::{Add, AddAssign, Sub}; pub use self::deref::{Deref, DerefMut, Receiver}; - pub use bit::{BitAnd, BitOr, BitXor}; - pub use drop::Drop; - pub use function::{Fn, FnMut, FnOnce}; - pub use generator::{Generator, GeneratorState}; - pub use index::{Index, IndexMut}; - pub use range::{Bound, Range, RangeBounds}; - pub use try::Try; - pub use unsize::{CoerceUnsized, DispatchFromDyn}; + pub use self::bit::{BitAnd, BitOr, BitXor}; + pub use self::drop::Drop; + pub use self::function::{Fn, FnMut, FnOnce}; + pub use self::generator::{Generator, GeneratorState}; + pub use self::index::{Index, IndexMut}; + pub use self::range::{Bound, Range, RangeBounds}; + pub use self::r#try::Try; + pub use self::unsize::{CoerceUnsized, DispatchFromDyn}; use super::marker::Sized; @@ -222,7 +222,7 @@ pub mod ops { fn index_mut(&mut self, index: Idx) -> &mut Self::Output; } } - pub mod try { + pub mod r#try { use crate::core::result::Result; #[lang = "try"] @@ -855,7 +855,7 @@ pub mod iter { use super::Result; use super::Sized; use crate::core::ops::function::FnMut; - use crate::core::ops::try::Try; + use crate::core::ops::r#try::Try; pub trait IntoIterator { type Item; type IntoIter: Iterator<Item = Self::Item>;
