Skip to content

Commit 579825d

Browse files
committed
tests: Update syntax tests
1 parent 6b07571 commit 579825d

File tree

2 files changed

+41
-39
lines changed

2 files changed

+41
-39
lines changed

tests/run-pass/specialization.rs

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,47 @@
77

88
pub mod default_impl {
99
// I don't feel `default impl` is the good feature to combine with ext trait, but test anyway.
10+
// TODO: `default impl` became syntactically invalid in https://github.com/rust-lang/rust/pull/144386#issuecomment-3133213586
1011

1112
// https://github.com/rust-lang/rust/blob/1.84.0/tests/ui/specialization/defaultimpl/auxiliary/go_trait.rs
1213
pub mod go_trait {
13-
use easy_ext::ext;
14-
15-
pub trait Go {
16-
fn go(&self, arg: isize);
17-
}
18-
19-
pub fn go<G: Go>(this: &G, arg: isize) {
20-
this.go(arg)
21-
}
22-
23-
pub fn go_mut<G: GoMut>(this: &mut G, arg: isize) {
24-
this.go_mut(arg)
25-
}
26-
27-
pub fn go_once<G: GoOnce>(this: G, arg: isize) {
28-
this.go_once(arg)
29-
}
30-
31-
#[ext(GoMut)]
32-
pub default impl<G> G
33-
where
34-
G: Go,
35-
{
36-
fn go_mut(&mut self, arg: isize) {
37-
go(&*self, arg)
38-
}
39-
}
40-
41-
#[ext(GoOnce)]
42-
pub default impl<G> G
43-
where
44-
G: GoMut,
45-
{
46-
fn go_once(mut self, arg: isize) {
47-
go_mut(&mut self, arg)
48-
}
49-
}
14+
// use easy_ext::ext;
15+
16+
// pub trait Go {
17+
// fn go(&self, arg: isize);
18+
// }
19+
20+
// pub fn go<G: Go>(this: &G, arg: isize) {
21+
// this.go(arg)
22+
// }
23+
24+
// pub fn go_mut<G: GoMut>(this: &mut G, arg: isize) {
25+
// this.go_mut(arg)
26+
// }
27+
28+
// pub fn go_once<G: GoOnce>(this: G, arg: isize) {
29+
// this.go_once(arg)
30+
// }
31+
32+
// #[ext(GoMut)]
33+
// pub default impl<G> G
34+
// where
35+
// G: Go,
36+
// {
37+
// fn go_mut(&mut self, arg: isize) {
38+
// go(&*self, arg)
39+
// }
40+
// }
41+
42+
// #[ext(GoOnce)]
43+
// pub default impl<G> G
44+
// where
45+
// G: GoMut,
46+
// {
47+
// fn go_once(mut self, arg: isize) {
48+
// go_mut(&mut self, arg)
49+
// }
50+
// }
5051
}
5152
}
5253

tests/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,9 @@ fn assoc_ty() {
329329
#[allow(clippy::let_underscore_future)]
330330
#[test]
331331
fn syntax() {
332+
// TODO: `unsafe impl` became syntactically invalid in https://github.com/rust-lang/rust/pull/144386#issuecomment-3133213586
332333
#[ext(E1)]
333-
unsafe impl str {
334+
impl str {
334335
fn normal(&self) {}
335336
unsafe fn unsafety(&self) {}
336337
extern "C" fn abi1() {}
@@ -351,7 +352,7 @@ fn syntax() {
351352
};
352353

353354
struct S {}
354-
unsafe impl E1 for S {
355+
impl E1 for S {
355356
fn normal(&self) {}
356357
unsafe fn unsafety(&self) {}
357358
extern "C" fn abi1() {}

0 commit comments

Comments
 (0)