Skip to content

Commit 297f41a

Browse files
committed
Fix tests
1 parent 1b6736e commit 297f41a

3 files changed

Lines changed: 10 additions & 52 deletions

File tree

tests/incremental/delegation/impl-reuse-pass.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,6 @@ mod macros {
174174
macro_rules! m { () => { M } }
175175
reuse impl Trait for m!() { self_0_ref!(self) }
176176

177-
struct S1(u8);
178-
macro_rules! one_line_reuse { ($self:ident) => { reuse impl Trait for S1 { $self.0 } } }
179-
one_line_reuse!(self);
180-
181-
struct S2(u8);
182-
macro_rules! one_line_reuse_expr { ($x:expr) => { reuse impl Trait for S2 { $x } } }
183-
one_line_reuse_expr!(self.0);
184-
185-
struct S3(u8);
186-
macro_rules! s3 { () => { S3 } }
187-
macro_rules! one_line_reuse_expr2 { ($x:expr) => { reuse impl Trait for s3!() { $x } } }
188-
one_line_reuse_expr2!(self.0);
189-
190177
fn f() {
191178
let s = S(1);
192179
s.foo();
@@ -195,18 +182,6 @@ mod macros {
195182
let m = M(41);
196183
m.foo();
197184
m.bar();
198-
199-
let s1 = S1(2);
200-
s1.foo();
201-
s1.bar();
202-
203-
let s2 = S2(4);
204-
s2.foo();
205-
s2.bar();
206-
207-
let s3 = S3(5);
208-
s3.foo();
209-
s3.bar();
210185
}
211186
}
212187

tests/ui/delegation/query-cycle-oom.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ mod test_2 {
2222
trait Trait {
2323
fn foo() -> Self::Assoc;
2424
//~^ ERROR: associated type `Assoc` not found for `Self`
25-
//~| ERROR: this function takes 0 arguments but 1 argument was supplied
2625
fn bar(&self) -> u8;
2726
}
2827

@@ -35,20 +34,21 @@ mod test_2 {
3534

3635
impl Trait for S {
3736
reuse Trait::* { &self.0 }
37+
//~^ ERROR: this function takes 0 arguments but 1 argument was supplied
3838
fn bar(&self) -> u8 { 2 }
3939
}
4040
}
4141

4242
mod test_3 {
4343
trait Trait {
4444
fn foo(&self) -> Self::Assoc<3> { //~ ERROR: associated type `Assoc` not found for `Self`
45-
//~^ ERROR: no method named `foo` found for reference `&()` in the current scope
4645
[(); 3]
4746
}
4847
}
4948

5049
impl () { //~ ERROR: cannot define inherent `impl` for primitive types
5150
reuse Trait::*;
51+
//~^ ERROR: no method named `foo` found for reference `&()` in the current scope
5252
}
5353
}
5454

tests/ui/delegation/query-cycle-oom.stderr

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ LL | reuse Trait::<_>::foo::<i32> as x;
4949
| ^ not allowed in type signatures
5050

5151
error[E0046]: not all trait items implemented, missing: `foo`
52-
--> $DIR/query-cycle-oom.rs:29:5
52+
--> $DIR/query-cycle-oom.rs:28:5
5353
|
5454
LL | fn foo() -> Self::Assoc;
5555
| ------------------------ `foo` from trait
@@ -58,7 +58,7 @@ LL | impl Trait for u8 {
5858
| ^^^^^^^^^^^^^^^^^ missing `foo` in implementation
5959

6060
error[E0390]: cannot define inherent `impl` for primitive types
61-
--> $DIR/query-cycle-oom.rs:50:5
61+
--> $DIR/query-cycle-oom.rs:49:5
6262
|
6363
LL | impl () {
6464
| ^^^^^^^
@@ -74,13 +74,10 @@ LL | reuse to_reuse::foo { &self.0 }
7474
= help: you might be missing a crate named `to_reuse`
7575

7676
error[E0061]: this function takes 0 arguments but 1 argument was supplied
77-
--> $DIR/query-cycle-oom.rs:23:12
77+
--> $DIR/query-cycle-oom.rs:36:22
7878
|
79-
LL | fn foo() -> Self::Assoc;
80-
| ^^^
81-
...
8279
LL | reuse Trait::* { &self.0 }
83-
| ------- unexpected argument
80+
| ^ ------- unexpected argument
8481
|
8582
note: associated function defined here
8683
--> $DIR/query-cycle-oom.rs:23:12
@@ -89,29 +86,15 @@ LL | fn foo() -> Self::Assoc;
8986
| ^^^
9087
help: remove the extra argument
9188
|
92-
LL - fn foo() -> Self::Assoc;
93-
LL -
94-
LL -
95-
LL - fn bar(&self) -> u8;
96-
LL - }
97-
LL -
98-
LL - impl Trait for u8 {
99-
LL -
100-
LL - fn bar(&self) -> u8 { 1 }
101-
LL - }
102-
LL -
103-
LL - struct S(u8);
104-
LL -
105-
LL - impl Trait for S {
10689
LL - reuse Trait::* { &self.0 }
107-
LL + fn fo&self.0 }
90+
LL + reuse Trait::&self.0 }
10891
|
10992

11093
error[E0599]: no method named `foo` found for reference `&()` in the current scope
111-
--> $DIR/query-cycle-oom.rs:44:12
94+
--> $DIR/query-cycle-oom.rs:50:22
11295
|
113-
LL | fn foo(&self) -> Self::Assoc<3> {
114-
| ^^^ method not found in `&()`
96+
LL | reuse Trait::*;
97+
| ^ method not found in `&()`
11598
|
11699
= help: items from traits can only be used if the trait is implemented and in scope
117100
= note: the following traits define an item `foo`, perhaps you need to implement one of them:

0 commit comments

Comments
 (0)