Skip to content

Commit fec6f70

Browse files
committed
Bless a test
1 parent 1d788e4 commit fec6f70

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed

tests/ui/delegation/not-supported.rs

+4
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,16 @@ mod opaque {
7070

7171
pub fn opaque_arg(_: impl Trait) -> i32 { 0 }
7272
pub fn opaque_ret() -> impl Trait { unimplemented!() }
73+
//~^ warn: this function depends on never type fallback being `()`
74+
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7375
}
7476
reuse to_reuse::opaque_arg;
7577
//~^ ERROR delegation with early bound generics is not supported yet
7678

7779
trait ToReuse {
7880
fn opaque_ret() -> impl Trait { unimplemented!() }
81+
//~^ warn: this function depends on never type fallback being `()`
82+
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
7983
}
8084

8185
// FIXME: Inherited `impl Trait`s create query cycles when used inside trait impls.

tests/ui/delegation/not-supported.stderr

+36-15
Original file line numberDiff line numberDiff line change
@@ -107,62 +107,83 @@ LL | reuse Trait::foo2 { &self.0 }
107107
| ^^^^
108108

109109
error: delegation with early bound generics is not supported yet
110-
--> $DIR/not-supported.rs:74:21
110+
--> $DIR/not-supported.rs:76:21
111111
|
112112
LL | pub fn opaque_arg(_: impl Trait) -> i32 { 0 }
113113
| --------------------------------------- callee defined here
114114
...
115115
LL | reuse to_reuse::opaque_arg;
116116
| ^^^^^^^^^^
117117

118-
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/not-supported.rs:82:5: 82:24>::{synthetic#0}`
119-
--> $DIR/not-supported.rs:83:25
118+
warning: this function depends on never type fallback being `()`
119+
--> $DIR/not-supported.rs:80:9
120+
|
121+
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
122+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123+
|
124+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
125+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
126+
= help: specify the types explicitly
127+
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
128+
129+
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/not-supported.rs:86:5: 86:24>::{synthetic#0}`
130+
--> $DIR/not-supported.rs:87:25
120131
|
121132
LL | reuse to_reuse::opaque_ret;
122133
| ^^^^^^^^^^
123134
|
124135
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
125-
--> $DIR/not-supported.rs:83:25
136+
--> $DIR/not-supported.rs:87:25
126137
|
127138
LL | reuse to_reuse::opaque_ret;
128139
| ^^^^^^^^^^
129-
= note: ...which again requires computing type of `opaque::<impl at $DIR/not-supported.rs:82:5: 82:24>::{synthetic#0}`, completing the cycle
130-
note: cycle used when checking that `opaque::<impl at $DIR/not-supported.rs:82:5: 82:24>` is well-formed
131-
--> $DIR/not-supported.rs:82:5
140+
= note: ...which again requires computing type of `opaque::<impl at $DIR/not-supported.rs:86:5: 86:24>::{synthetic#0}`, completing the cycle
141+
note: cycle used when checking that `opaque::<impl at $DIR/not-supported.rs:86:5: 86:24>` is well-formed
142+
--> $DIR/not-supported.rs:86:5
132143
|
133144
LL | impl ToReuse for u8 {
134145
| ^^^^^^^^^^^^^^^^^^^
135146
= 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
136147

137-
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/not-supported.rs:85:5: 85:25>::{synthetic#0}`
138-
--> $DIR/not-supported.rs:86:24
148+
warning: this function depends on never type fallback being `()`
149+
--> $DIR/not-supported.rs:72:9
150+
|
151+
LL | pub fn opaque_ret() -> impl Trait { unimplemented!() }
152+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
153+
|
154+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
155+
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
156+
= help: specify the types explicitly
157+
158+
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/not-supported.rs:89:5: 89:25>::{synthetic#0}`
159+
--> $DIR/not-supported.rs:90:24
139160
|
140161
LL | reuse ToReuse::opaque_ret;
141162
| ^^^^^^^^^^
142163
|
143164
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
144-
--> $DIR/not-supported.rs:86:24
165+
--> $DIR/not-supported.rs:90:24
145166
|
146167
LL | reuse ToReuse::opaque_ret;
147168
| ^^^^^^^^^^
148-
= note: ...which again requires computing type of `opaque::<impl at $DIR/not-supported.rs:85:5: 85:25>::{synthetic#0}`, completing the cycle
149-
note: cycle used when checking that `opaque::<impl at $DIR/not-supported.rs:85:5: 85:25>` is well-formed
150-
--> $DIR/not-supported.rs:85:5
169+
= note: ...which again requires computing type of `opaque::<impl at $DIR/not-supported.rs:89:5: 89:25>::{synthetic#0}`, completing the cycle
170+
note: cycle used when checking that `opaque::<impl at $DIR/not-supported.rs:89:5: 89:25>` is well-formed
171+
--> $DIR/not-supported.rs:89:5
151172
|
152173
LL | impl ToReuse for u16 {
153174
| ^^^^^^^^^^^^^^^^^^^^
154175
= 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
155176

156177
error: recursive delegation is not supported yet
157-
--> $DIR/not-supported.rs:99:22
178+
--> $DIR/not-supported.rs:103:22
158179
|
159180
LL | pub reuse to_reuse2::foo;
160181
| --- callee defined here
161182
...
162183
LL | reuse to_reuse1::foo;
163184
| ^^^
164185

165-
error: aborting due to 16 previous errors
186+
error: aborting due to 16 previous errors; 2 warnings emitted
166187

167188
Some errors have detailed explanations: E0049, E0195, E0391.
168189
For more information about an error, try `rustc --explain E0049`.

0 commit comments

Comments
 (0)