From: Owen Avery <[email protected]>
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]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.
Commit on github:
https://github.com/Rust-GCC/gccrs/commit/a62af1405973d5c27f1414a144075af340c5f6da
The commit has NOT been mentioned in any issue.
The commit has been mentioned in the following pull-request(s):
- https://github.com/Rust-GCC/gccrs/pull/4887
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 d412b50cf..7e6331cab 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 8362e3473..e74ed9e4d 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>;
base-commit: 938aa8e80f9b455b9f5236f92054a04380410dc5
--
2.55.0