Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8747443

Browse files
committed
Update tests
1 parent 92715b5 commit 8747443

16 files changed

+307
-43
lines changed

‎tests/ui/associated-inherent-types/bugs/cycle-iat-inside-of-adt.stderr‎

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
1-
error[E0391]: cycle detected when computing predicates of `Foo`
1+
error[E0391]: cycle detected when computing the inferred outlives predicates for items in this crate
2+
|
3+
note: ...which requires computing type of `Foo::bar`...
4+
--> $DIR/cycle-iat-inside-of-adt.rs:8:5
5+
|
6+
LL | bar: Self::Bar,
7+
| ^^^^^^^^^^^^^^
8+
note: ...which requires computing normalized predicates of `Foo`...
29
--> $DIR/cycle-iat-inside-of-adt.rs:7:1
310
|
411
LL | struct Foo {
512
| ^^^^^^^^^^
6-
|
713
note: ...which requires computing predicates of `Foo`...
814
--> $DIR/cycle-iat-inside-of-adt.rs:7:1
915
|
1016
LL | struct Foo {
1117
| ^^^^^^^^^^
12-
note: ...which requires computing inferred outlives predicates of `Foo`...
18+
note: ...which requires computing predicates of `Foo`...
1319
--> $DIR/cycle-iat-inside-of-adt.rs:7:1
1420
|
1521
LL | struct Foo {
1622
| ^^^^^^^^^^
17-
= note: ...which requires computing the inferred outlives predicates for items in this crate...
18-
note: ...which requires computing type of `Foo::bar`...
19-
--> $DIR/cycle-iat-inside-of-adt.rs:8:5
20-
|
21-
LL | bar: Self::Bar,
22-
| ^^^^^^^^^^^^^^
23-
note: ...which requires computing normalized predicates of `Foo`...
23+
note: ...which requires computing inferred outlives predicates of `Foo`...
2424
--> $DIR/cycle-iat-inside-of-adt.rs:7:1
2525
|
2626
LL | struct Foo {
2727
| ^^^^^^^^^^
28-
= note: ...which again requires computing predicates of `Foo`, completing the cycle
29-
note: cycle used when collecting item types in top-level module
30-
--> $DIR/cycle-iat-inside-of-adt.rs:3:1
31-
|
32-
LL | / #![feature(inherent_associated_types)]
33-
LL | | #![allow(incomplete_features)]
34-
LL | | // FIXME(inherent_associated_types): This should pass.
35-
LL | |
36-
... |
37-
LL | |
38-
LL | | fn main() {}
39-
| |____________^
28+
= note: ...which again requires computing the inferred outlives predicates for items in this crate, completing the cycle
29+
= note: cycle used when running analysis passes on this crate
4030
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
4131

4232
error: aborting due to previous error

‎tests/ui/const-generics/issues/issue-83765.rs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
trait TensorDimension {
55
const DIM: usize;
66
//~^ ERROR cycle detected when resolving instance
7+
//~| ERROR cycle detected when resolving instance
78
// FIXME Given the current state of the compiler its expected that we cycle here,
89
// but the cycle is still wrong.
910
const ISSCALAR: bool = Self::DIM == 0;
@@ -57,10 +58,14 @@ impl<'a, T: Broadcastable, const DIM: usize> Broadcastable for LazyUpdim<'a, T,
5758
fn bget(&self, index: [usize; DIM]) -> Option<Self::Element> {
5859
assert!(DIM >= T::DIM);
5960
if !self.inbounds(index) {
61+
//~^ ERROR unconstrained generic constant
62+
//~| ERROR mismatched types
6063
return None;
6164
}
6265
let size = self.size();
66+
//~^ ERROR unconstrained generic constant
6367
let newindex: [usize; T::DIM] = Default::default();
68+
//~^ ERROR the trait bound `[usize; T::DIM]: Default` is not satisfied [E0277]
6469
self.reference.bget(newindex)
6570
}
6671
}
@@ -79,7 +84,10 @@ impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorSi
7984
for BMap<'a, R, T, F, DIM>
8085
{
8186
fn size(&self) -> [usize; DIM] {
87+
//~^ ERROR method not compatible with trait
8288
self.reference.size()
89+
//~^ ERROR unconstrained generic constant
90+
//~| ERROR mismatched types
8391
}
8492
}
8593

@@ -88,7 +96,10 @@ impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> Broadcas
8896
{
8997
type Element = R;
9098
fn bget(&self, index: [usize; DIM]) -> Option<Self::Element> {
99+
//~^ ERROR method not compatible with trait
91100
self.reference.bget(index).map(&self.closure)
101+
//~^ ERROR unconstrained generic constant
102+
//~| ERROR mismatched types
92103
}
93104
}
94105

‎tests/ui/const-generics/issues/issue-83765.stderr‎

Lines changed: 136 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,140 @@ LL | trait TensorDimension {
1717
| ^^^^^^^^^^^^^^^^^^^^^
1818
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
1919

20-
error: aborting due to previous error
20+
error[E0391]: cycle detected when resolving instance `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>::DIM`
21+
--> $DIR/issue-83765.rs:5:5
22+
|
23+
LL | const DIM: usize;
24+
| ^^^^^^^^^^^^^^^^
25+
|
26+
note: ...which requires computing candidate for `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>`...
27+
--> $DIR/issue-83765.rs:4:1
28+
|
29+
LL | trait TensorDimension {
30+
| ^^^^^^^^^^^^^^^^^^^^^
31+
= note: ...which again requires resolving instance `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>::DIM`, completing the cycle
32+
note: cycle used when checking item types in top-level module
33+
--> $DIR/issue-83765.rs:1:1
34+
|
35+
LL | / #![feature(generic_const_exprs)]
36+
LL | | #![allow(incomplete_features)]
37+
LL | |
38+
LL | | trait TensorDimension {
39+
... |
40+
LL | | println!("The size of v is {:?}", bbv.bget([0, 2]).expect("Out of bounds."));
41+
LL | | }
42+
| |_^
43+
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
44+
45+
error[E0308]: method not compatible with trait
46+
--> $DIR/issue-83765.rs:86:5
47+
|
48+
LL | fn size(&self) -> [usize; DIM] {
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM`
50+
|
51+
= note: expected constant `Self::DIM`
52+
found constant `DIM`
53+
54+
error[E0308]: method not compatible with trait
55+
--> $DIR/issue-83765.rs:98:5
56+
|
57+
LL | fn bget(&self, index: [usize; DIM]) -> Option<Self::Element> {
58+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM`
59+
|
60+
= note: expected constant `Self::DIM`
61+
found constant `DIM`
62+
63+
error: unconstrained generic constant
64+
--> $DIR/issue-83765.rs:60:13
65+
|
66+
LL | if !self.inbounds(index) {
67+
| ^^^^
68+
|
69+
= help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
70+
note: required by a bound in `TensorSize::inbounds`
71+
--> $DIR/issue-83765.rs:18:39
72+
|
73+
LL | fn inbounds(&self, index: [usize; Self::DIM]) -> bool {
74+
| ^^^^^^^^^ required by this bound in `TensorSize::inbounds`
75+
76+
error[E0308]: mismatched types
77+
--> $DIR/issue-83765.rs:60:27
78+
|
79+
LL | if !self.inbounds(index) {
80+
| ^^^^^ expected `Self::DIM`, found `DIM`
81+
|
82+
= note: expected constant `Self::DIM`
83+
found constant `DIM`
84+
85+
error: unconstrained generic constant
86+
--> $DIR/issue-83765.rs:65:25
87+
|
88+
LL | let size = self.size();
89+
| ^^^^
90+
|
91+
= help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
92+
note: required by a bound in `TensorSize::size`
93+
--> $DIR/issue-83765.rs:17:31
94+
|
95+
LL | fn size(&self) -> [usize; Self::DIM];
96+
| ^^^^^^^^^ required by this bound in `TensorSize::size`
97+
98+
error[E0277]: the trait bound `[usize; T::DIM]: Default` is not satisfied
99+
--> $DIR/issue-83765.rs:67:41
100+
|
101+
LL | let newindex: [usize; T::DIM] = Default::default();
102+
| ^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[usize; T::DIM]`
103+
|
104+
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
105+
|
106+
LL | impl<'a, T: Broadcastable, const DIM: usize> Broadcastable for LazyUpdim<'a, T, { T::DIM }, DIM> where [usize; T::DIM]: Default {
107+
| ++++++++++++++++++++++++++++++
108+
109+
error: unconstrained generic constant
110+
--> $DIR/issue-83765.rs:88:24
111+
|
112+
LL | self.reference.size()
113+
| ^^^^
114+
|
115+
= help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
116+
note: required by a bound in `TensorSize::size`
117+
--> $DIR/issue-83765.rs:17:31
118+
|
119+
LL | fn size(&self) -> [usize; Self::DIM];
120+
| ^^^^^^^^^ required by this bound in `TensorSize::size`
121+
122+
error[E0308]: mismatched types
123+
--> $DIR/issue-83765.rs:88:9
124+
|
125+
LL | self.reference.size()
126+
| ^^^^^^^^^^^^^^^^^^^^^ expected `DIM`, found `Self::DIM`
127+
|
128+
= note: expected constant `DIM`
129+
found constant `Self::DIM`
130+
131+
error: unconstrained generic constant
132+
--> $DIR/issue-83765.rs:100:9
133+
|
134+
LL | self.reference.bget(index).map(&self.closure)
135+
| ^^^^^^^^^^^^^^
136+
|
137+
= help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
138+
note: required by a bound in `Broadcastable::bget`
139+
--> $DIR/issue-83765.rs:25:35
140+
|
141+
LL | fn bget(&self, index: [usize; Self::DIM]) -> Option<Self::Element>;
142+
| ^^^^^^^^^ required by this bound in `Broadcastable::bget`
143+
144+
error[E0308]: mismatched types
145+
--> $DIR/issue-83765.rs:100:29
146+
|
147+
LL | self.reference.bget(index).map(&self.closure)
148+
| ^^^^^ expected `Self::DIM`, found `DIM`
149+
|
150+
= note: expected constant `Self::DIM`
151+
found constant `DIM`
152+
153+
error: aborting due to 12 previous errors
21154

22-
For more information about this error, try `rustc --explain E0391`.
155+
Some errors have detailed explanations: E0277, E0308, E0391.
156+
For more information about an error, try `rustc --explain E0277`.

‎tests/ui/impl-trait/issues/issue-86800.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// edition:2021
44
// compile-flags:-Z treat-err-as-bug=1
55
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
6-
// failure-status:101
6+
// failure-status:1
77
// normalize-stderr-test ".*note: .*\n\n" -> ""
88
// normalize-stderr-test "thread 'rustc' panicked.*:\n.*\n" -> ""
99
// rustc-env:RUST_BACKTRACE=0

‎tests/ui/impl-trait/issues/issue-86800.stderr‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,19 @@ query stack during panic:
1010
#0 [type_of_opaque] computing type of opaque `TransactionFuture::{opaque#0}`
1111
#1 [type_of] computing type of `TransactionFuture::{opaque#0}`
1212
end of query stack
13+
error[E0792]: expected generic lifetime parameter, found `'_`
14+
--> $DIR/issue-86800.rs:39:5
15+
|
16+
LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;
17+
| --- this generic parameter must be used with a generic lifetime parameter
18+
...
19+
LL | f
20+
| ^
21+
22+
23+
error: the compiler unexpectedly panicked. this is a bug.
24+
25+
query stack during panic:
26+
#0 [mir_borrowck] borrow-checking `execute_transaction_fut`
27+
#1 [type_of_opaque] computing type of opaque `execute_transaction_fut::{opaque#0}`
28+
end of query stack

‎tests/ui/lang-items/lang-item-generic-requirements.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ trait MyIndex<'a, T> {}
2222
#[lang = "phantom_data"]
2323
//~^ ERROR `phantom_data` language item must be applied to a struct with 1 generic argument
2424
struct MyPhantomData<T, U>;
25+
//~^ ERROR parameter `T` is never used
26+
//~| ERROR parameter `U` is never used
2527

2628
#[lang = "owned_box"]
2729
//~^ ERROR `owned_box` language item must be applied to a struct with at least 1 generic argument

‎tests/ui/lang-items/lang-item-generic-requirements.stderr‎

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LL | struct MyPhantomData<T, U>;
3333
| ------ this struct has 2 generic arguments
3434

3535
error[E0718]: `owned_box` language item must be applied to a struct with at least 1 generic argument
36-
--> $DIR/lang-item-generic-requirements.rs:26:1
36+
--> $DIR/lang-item-generic-requirements.rs:28:1
3737
|
3838
LL | #[lang = "owned_box"]
3939
| ^^^^^^^^^^^^^^^^^^^^^
@@ -42,14 +42,33 @@ LL | struct Foo;
4242
| - this struct has 0 generic arguments
4343

4444
error[E0718]: `start` language item must be applied to a function with 1 generic argument
45-
--> $DIR/lang-item-generic-requirements.rs:32:1
45+
--> $DIR/lang-item-generic-requirements.rs:34:1
4646
|
4747
LL | #[lang = "start"]
4848
| ^^^^^^^^^^^^^^^^^
4949
LL |
5050
LL | fn start(_: *const u8, _: isize, _: *const *const u8) -> isize {
5151
| - this function has 0 generic arguments
5252

53-
error: aborting due to 6 previous errors
53+
error[E0392]: parameter `T` is never used
54+
--> $DIR/lang-item-generic-requirements.rs:24:22
55+
|
56+
LL | struct MyPhantomData<T, U>;
57+
| ^ unused parameter
58+
|
59+
= help: consider removing `T` or referring to it in a field
60+
= help: if you intended `T` to be a const parameter, use `const T: usize` instead
61+
62+
error[E0392]: parameter `U` is never used
63+
--> $DIR/lang-item-generic-requirements.rs:24:25
64+
|
65+
LL | struct MyPhantomData<T, U>;
66+
| ^ unused parameter
67+
|
68+
= help: consider removing `U` or referring to it in a field
69+
= help: if you intended `U` to be a const parameter, use `const U: usize` instead
70+
71+
error: aborting due to 8 previous errors
5472

55-
For more information about this error, try `rustc --explain E0718`.
73+
Some errors have detailed explanations: E0392, E0718.
74+
For more information about an error, try `rustc --explain E0392`.

‎tests/ui/panic-handler/panic-handler-std.stderr‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ LL | fn panic(info: PanicInfo) -> ! {
88
= note: first definition in `std` loaded from SYSROOT/libstd-*.rlib
99
= note: second definition in the local crate (`panic_handler_std`)
1010

11-
error: aborting due to previous error
11+
error: argument should be `&PanicInfo`
12+
--> $DIR/panic-handler-std.rs:8:16
13+
|
14+
LL | fn panic(info: PanicInfo) -> ! {
15+
| ^^^^^^^^^
16+
17+
error: aborting due to 2 previous errors
1218

1319
For more information about this error, try `rustc --explain E0152`.

‎tests/ui/span/issue-35987.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ struct Foo<T: Clone>(T);
33
use std::ops::Add;
44

55
impl<T: Clone, Add> Add for Foo<T> {
6-
//~^ ERROR expected trait, found type parameter
6+
//~^ ERROR expected trait, found type parameter
77
type Output = usize;
88

99
fn add(self, rhs: Self) -> Self::Output {
10+
//~^ ERROR ambiguous associated type
1011
unimplemented!();
1112
}
1213
}

‎tests/ui/span/issue-35987.stderr‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ help: consider importing this trait instead
1414
LL + use std::ops::Add;
1515
|
1616

17-
error: aborting due to previous error
17+
error[E0223]: ambiguous associated type
18+
--> $DIR/issue-35987.rs:9:32
19+
|
20+
LL | fn add(self, rhs: Self) -> Self::Output {
21+
| ^^^^^^^^^^^^ help: use the fully-qualified path: `<Foo<T> as IntoFuture>::Output`
22+
23+
error: aborting due to 2 previous errors
1824

19-
For more information about this error, try `rustc --explain E0404`.
25+
Some errors have detailed explanations: E0223, E0404.
26+
For more information about an error, try `rustc --explain E0223`.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /