Skip to content

Commit 720a9f1

Browse files
authored
Rollup merge of #106738 - compiler-errors:known-bugs-oops, r=jackh726
Fix known-bug annotations r? ``@Nilstrieb``
2 parents 3d79cbc + a3d5be6 commit 720a9f1

File tree

10 files changed

+25
-33
lines changed

10 files changed

+25
-33
lines changed

src/tools/compiletest/src/header.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,15 @@ impl TestProps {
426426
self.known_bug = true;
427427
} else {
428428
panic!(
429-
"Invalid known-bug value: {known_bug}\nIt requires comma-separated issue references (`#000` or `chalk#000`) or `unknown`."
429+
"Invalid known-bug value: {known_bug}\nIt requires comma-separated issue references (`#000` or `chalk#000`) or `known-bug: unknown`."
430430
);
431431
}
432+
} else if config.parse_name_directive(ln, KNOWN_BUG) {
433+
panic!(
434+
"Invalid known-bug attribute, requires comma-separated issue references (`#000` or `chalk#000`) or `known-bug: unknown`."
435+
);
432436
}
437+
433438
config.set_name_value_directive(ln, MIR_UNIT_TEST, &mut self.mir_unit_test, |s| {
434439
s.trim().to_string()
435440
});

tests/ui/chalkify/bugs/async.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// check-fail
2-
// known-bug
1+
// edition:2021
2+
// known-bug: unknown
33
// unset-rustc-env:RUST_BACKTRACE
4-
// compile-flags:-Z trait-solver=chalk --edition=2021
4+
// compile-flags:-Z trait-solver=chalk
55
// error-pattern:internal compiler error
66
// failure-status:101
77
// normalize-stderr-test "DefId([^)]*)" -> "..."

tests/ui/const-generics/issues/issue-85031-2.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
// known-bug
2+
// known-bug: unknown
33

44
// This should not compile, as the compiler should not know
55
// `A - 0` is satisfied `?x - 0` if `?x` is inferred to `A`.
@@ -10,7 +10,6 @@ pub struct Ref<'a>(&'a i32);
1010

1111
impl<'a> Ref<'a> {
1212
pub fn foo<const A: usize>() -> [(); A - 0] {
13-
//~^ WARN function cannot
1413
Self::foo()
1514
}
1615
}

tests/ui/const-generics/issues/issue-85031-2.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ warning: function cannot return without recursing
33
|
44
LL | pub fn foo<const A: usize>() -> [(); A - 0] {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
6-
LL |
76
LL | Self::foo()
87
| ----------- recursive call site
98
|

tests/ui/generic-associated-types/bugs/hrtb-implied-1.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-fail
2-
// known-bug
2+
// known-bug: unknown
33

44
// This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for
55
// all 'a where I::Item<'a> is WF", but really means "for all 'a possible"
@@ -29,7 +29,6 @@ where
2929

3030
fn main() {
3131
let slice = &mut ();
32-
//~^ temporary value dropped while borrowed
3332
let windows = WindowsMut { slice };
3433
print_items::<WindowsMut<'_>>(windows);
3534
}

tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0716]: temporary value dropped while borrowed
33
|
44
LL | let slice = &mut ();
55
| ^^ creates a temporary value which is freed while still in use
6-
...
6+
LL | let windows = WindowsMut { slice };
77
LL | print_items::<WindowsMut<'_>>(windows);
88
| -------------------------------------- argument requires that borrow lasts for `'static`
99
LL | }

tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-fail
2-
// known-bug
2+
// known-bug: unknown
33

44
// This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for
55
// all 'a where I::Item<'a> is WF", but really means "for all 'a possible"
@@ -16,7 +16,6 @@ where
1616
{
1717
let mut iter2 = Eat(iter, f);
1818
let _next = iter2.next();
19-
//~^ borrowed data escapes
2019
true
2120
}
2221
impl<I: LendingIterator> LendingIterator for &mut I {

tests/ui/generic-associated-types/bugs/issue-100013.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-fail
2-
// known-bug
2+
// known-bug: unknown
33
// edition: 2021
44

55
// We really should accept this, but we need implied bounds between the regions
@@ -13,24 +13,20 @@ pub trait FutureIterator {
1313

1414
fn call<I: FutureIterator>() -> impl Send {
1515
async { // a generator checked for autotrait impl `Send`
16-
//~^ lifetime bound not satisfied
1716
let x = None::<I::Future<'_, '_>>; // a type referencing GAT
1817
async {}.await; // a yield point
1918
}
2019
}
2120

2221
fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
2322
async { // a generator checked for autotrait impl `Send`
24-
//~^ lifetime bound not satisfied
2523
let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
26-
//~^ lifetime may not live long enough
2724
async {}.await; // a yield point
2825
}
2926
}
3027

3128
fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
3229
async { // a generator checked for autotrait impl `Send`
33-
//~^ lifetime bound not satisfied
3430
let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
3531
async {}.await; // a yield point
3632
}

tests/ui/generic-associated-types/bugs/issue-100013.stderr

+10-14
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,73 @@ error: lifetime bound not satisfied
22
--> $DIR/issue-100013.rs:15:5
33
|
44
LL | / async { // a generator checked for autotrait impl `Send`
5-
LL | |
65
LL | | let x = None::<I::Future<'_, '_>>; // a type referencing GAT
76
LL | | async {}.await; // a yield point
87
LL | | }
98
| |_____^
109
|
1110
note: the lifetime defined here...
12-
--> $DIR/issue-100013.rs:17:38
11+
--> $DIR/issue-100013.rs:16:38
1312
|
1413
LL | let x = None::<I::Future<'_, '_>>; // a type referencing GAT
1514
| ^^
1615
note: ...must outlive the lifetime defined here
17-
--> $DIR/issue-100013.rs:17:34
16+
--> $DIR/issue-100013.rs:16:34
1817
|
1918
LL | let x = None::<I::Future<'_, '_>>; // a type referencing GAT
2019
| ^^
2120
= note: this is a known limitation that will be removed in the future (see issue #100013 <https://github.com/rust-lang/rust/issues/100013> for more information)
2221

2322
error: lifetime bound not satisfied
24-
--> $DIR/issue-100013.rs:23:5
23+
--> $DIR/issue-100013.rs:22:5
2524
|
2625
LL | / async { // a generator checked for autotrait impl `Send`
27-
LL | |
2826
LL | | let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
29-
LL | |
3027
LL | | async {}.await; // a yield point
3128
LL | | }
3229
| |_____^
3330
|
3431
note: the lifetime defined here...
35-
--> $DIR/issue-100013.rs:22:14
32+
--> $DIR/issue-100013.rs:21:14
3633
|
3734
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
3835
| ^^
3936
note: ...must outlive the lifetime defined here
40-
--> $DIR/issue-100013.rs:22:10
37+
--> $DIR/issue-100013.rs:21:10
4138
|
4239
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
4340
| ^^
4441
= note: this is a known limitation that will be removed in the future (see issue #100013 <https://github.com/rust-lang/rust/issues/100013> for more information)
4542

4643
error: lifetime may not live long enough
47-
--> $DIR/issue-100013.rs:25:17
44+
--> $DIR/issue-100013.rs:23:17
4845
|
4946
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
5047
| -- -- lifetime `'b` defined here
5148
| |
5249
| lifetime `'a` defined here
53-
...
50+
LL | async { // a generator checked for autotrait impl `Send`
5451
LL | let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
5552
| ^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'b`
5653
|
5754
= help: consider adding the following bound: `'a: 'b`
5855

5956
error: lifetime bound not satisfied
60-
--> $DIR/issue-100013.rs:32:5
57+
--> $DIR/issue-100013.rs:29:5
6158
|
6259
LL | / async { // a generator checked for autotrait impl `Send`
63-
LL | |
6460
LL | | let x = None::<I::Future<'a, 'b>>; // a type referencing GAT
6561
LL | | async {}.await; // a yield point
6662
LL | | }
6763
| |_____^
6864
|
6965
note: the lifetime defined here...
70-
--> $DIR/issue-100013.rs:31:18
66+
--> $DIR/issue-100013.rs:28:18
7167
|
7268
LL | fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
7369
| ^^
7470
note: ...must outlive the lifetime defined here
75-
--> $DIR/issue-100013.rs:31:10
71+
--> $DIR/issue-100013.rs:28:10
7672
|
7773
LL | fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
7874
| ^^

tests/ui/generic-associated-types/bugs/issue-91762.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-fail
2-
// known-bug
2+
// known-bug: unknown
33

44
// We almost certainly want this to pass, but
55
// it's particularly difficult currently, because we need a way of specifying
@@ -22,7 +22,6 @@ pub trait FunctorExt<T>: Sized {
2222

2323
arg = self;
2424
ret = <Self::Base as Functor>::fmap(arg);
25-
//~^ type annotations needed
2625
}
2726
}
2827

0 commit comments

Comments
 (0)