Skip to content

Commit e461ddd

Browse files
committed
update tests
1 parent 42150fb commit e461ddd

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

compiler/rustc_middle/src/ty/relate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ pub fn super_relate_tys<R: TypeRelation<'tcx>>(
423423
let sz_a = sz_a.try_eval_usize(tcx, relation.param_env());
424424
let sz_b = sz_b.try_eval_usize(tcx, relation.param_env());
425425
match (sz_a, sz_b) {
426-
(Some(sz_a_val), Some(sz_b_val)) => Err(TypeError::FixedArraySize(
427-
expected_found(relation, sz_a_val, sz_b_val),
428-
)),
426+
(Some(sz_a_val), Some(sz_b_val)) if sz_a_val != sz_b_val => Err(
427+
TypeError::FixedArraySize(expected_found(relation, sz_a_val, sz_b_val)),
428+
),
429429
_ => Err(err),
430430
}
431431
}

src/test/ui/const-generics/issues/issue-69654-run-pass.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ where
1414

1515
fn main() {
1616
Foo::foo();
17-
//~^ ERROR no function or associated item
17+
//~^ ERROR the function or associated item
1818
}

src/test/ui/const-generics/issues/issue-69654-run-pass.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
error[E0599]: no function or associated item named `foo` found for struct `Foo<{_: usize}>` in the current scope
1+
error[E0599]: the function or associated item `foo` exists for struct `Foo<{_: usize}>`, but its trait bounds were not satisfied
22
--> $DIR/issue-69654-run-pass.rs:16:10
33
|
44
LL | struct Foo<const N: usize> {}
55
| -------------------------- function or associated item `foo` not found for this
66
...
77
LL | Foo::foo();
8-
| ^^^ function or associated item not found in `Foo<{_: usize}>`
8+
| ^^^ function or associated item cannot be called on `Foo<{_: usize}>` due to unsatisfied trait bounds
99
|
10-
= note: the method `foo` exists but the following trait bounds were not satisfied:
10+
= note: the following trait bounds were not satisfied:
1111
`[u8; _]: Bar<[(); _]>`
1212

1313
error: aborting due to previous error

src/test/ui/const-generics/issues/issue-69654.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ where
1515

1616
fn main() {
1717
Foo::foo();
18-
//~^ ERROR no function or associated item
18+
//~^ ERROR the function or associated item
1919
}

src/test/ui/const-generics/issues/issue-69654.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ error[E0423]: expected value, found type parameter `T`
44
LL | impl<T> Bar<T> for [u8; T] {}
55
| ^ not a value
66

7-
error[E0599]: no function or associated item named `foo` found for struct `Foo<{_: usize}>` in the current scope
7+
error[E0599]: the function or associated item `foo` exists for struct `Foo<{_: usize}>`, but its trait bounds were not satisfied
88
--> $DIR/issue-69654.rs:17:10
99
|
1010
LL | struct Foo<const N: usize> {}
1111
| -------------------------- function or associated item `foo` not found for this
1212
...
1313
LL | Foo::foo();
14-
| ^^^ function or associated item not found in `Foo<{_: usize}>`
14+
| ^^^ function or associated item cannot be called on `Foo<{_: usize}>` due to unsatisfied trait bounds
1515
|
16-
= note: the method `foo` exists but the following trait bounds were not satisfied:
16+
= note: the following trait bounds were not satisfied:
1717
`[u8; _]: Bar<[(); _]>`
1818

1919
error: aborting due to 2 previous errors

0 commit comments

Comments
 (0)