Skip to content

Commit 7194b7a

Browse files
Rollup merge of #157737 - zedddie:gsoc-batch-7-meow, r=Teapot4195
Reorganize `tests/ui/issues` [7/N] Part of [GSoC'26 project](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Reorganizing.20tests.2Fui.2Fissues) r? Kivooeo @Teapot4195
2 parents bc2c2b5 + 1fe2c18 commit 7194b7a

17 files changed

Lines changed: 71 additions & 49 deletions

tests/ui/issues/issue-21402.rs renamed to tests/ui/derives/hash-on-compound-types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/21402>.
2+
13
//@ check-pass
24
#![allow(dead_code)]
35

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/21160>.
2+
//! Ensure we don't use existing hash method internally in hash derive.
3+
4+
struct Bar;
5+
6+
impl Bar {
7+
fn hash<T>(&self, _: T) {}
8+
}
9+
10+
#[derive(Hash)]
11+
struct Foo(Bar);
12+
//~^ error: `Bar: Hash` is not satisfied
13+
14+
fn main() {}

tests/ui/issues/issue-21160.stderr renamed to tests/ui/derives/ufcs-in-derive-hash.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `Bar: Hash` is not satisfied
2-
--> $DIR/issue-21160.rs:8:12
2+
--> $DIR/ufcs-in-derive-hash.rs:11:12
33
|
44
LL | #[derive(Hash)]
55
| ---- in this derive macro expansion

tests/ui/issues/issue-21245.rs renamed to tests/ui/inference/iter-ufcs-coercion-type-unification.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/21245>.
2+
//!
3+
//! Check that we are able to infer the types in these examples correctly.
4+
//! It used to be that insufficient type propagation caused the type of the
5+
//! iterator to be incorrectly unified with the `*const` type to which it is coerced.
6+
17
//@ check-pass
28
#![allow(dead_code)]
3-
// Regression test for issue #21245. Check that we are able to infer
4-
// the types in these examples correctly. It used to be that
5-
// insufficient type propagation caused the type of the iterator to be
6-
// incorrectly unified with the `*const` type to which it is coerced.
79

810

911
use std::ptr;

tests/ui/issues/issue-21140.rs

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/ui/issues/issue-21160.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui/issues/issue-21202.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/ui/issues/issue-20831-debruijn.rs renamed to tests/ui/lifetimes/implicit-lifetime-in-assoc-type-projection.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// Regression test for #20831: debruijn index account was thrown off
2-
// by the (anonymous) lifetime in `<Self as Publisher>::Output`
3-
// below. Note that changing to a named lifetime made the problem go
4-
// away.
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/20831>.
2+
//!
3+
//! DeBruijn index account was thrown off by the (anonymous) lifetime
4+
//! in `<Self as Publisher>::Output` below. Note that changing to a
5+
//! named lifetime made the problem go away.
56
67
use std::cell::RefCell;
78
use std::ops::{Shl, Shr};

tests/ui/issues/issue-20831-debruijn.stderr renamed to tests/ui/lifetimes/implicit-lifetime-in-assoc-type-projection.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
error[E0803]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
2-
--> $DIR/issue-20831-debruijn.rs:28:33
2+
--> $DIR/implicit-lifetime-in-assoc-type-projection.rs:29:33
33
|
44
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: first, the lifetime cannot outlive the anonymous lifetime as defined here...
8-
--> $DIR/issue-20831-debruijn.rs:28:67
8+
--> $DIR/implicit-lifetime-in-assoc-type-projection.rs:29:67
99
|
1010
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
1111
| ^^^^^^^^^
1212
note: ...but the lifetime must also be valid for the lifetime `'a` as defined here...
13-
--> $DIR/issue-20831-debruijn.rs:26:6
13+
--> $DIR/implicit-lifetime-in-assoc-type-projection.rs:27:6
1414
|
1515
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
1616
| ^^
1717
note: ...so that the types are compatible
18-
--> $DIR/issue-20831-debruijn.rs:28:33
18+
--> $DIR/implicit-lifetime-in-assoc-type-projection.rs:29:33
1919
|
2020
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
2121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2222
= note: expected `<MyStruct<'a> as Publisher<'_>>`
2323
found `<MyStruct<'_> as Publisher<'_>>`
2424

2525
error: lifetime may not live long enough
26-
--> $DIR/issue-20831-debruijn.rs:28:5
26+
--> $DIR/implicit-lifetime-in-assoc-type-projection.rs:29:5
2727
|
2828
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
2929
| -- lifetime `'a` defined here
@@ -35,7 +35,7 @@ LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher
3535
| requires that `'a` must outlive `'1`
3636

3737
error: lifetime may not live long enough
38-
--> $DIR/issue-20831-debruijn.rs:28:5
38+
--> $DIR/implicit-lifetime-in-assoc-type-projection.rs:29:5
3939
|
4040
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
4141
| -- lifetime `'a` defined here
File renamed without changes.

0 commit comments

Comments
 (0)