Skip to content

Commit

Permalink
Rollup merge of #98530 - davidkna:known-bug-ref, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
compiletest: add issue number param to `known-bug`

I was getting some errors while testing this, but I'm pretty sure that was unrelated to my changes.

Closes #98436

> Basically, instead of `// known-bug`, do `// known-bug #00000` or maybe `// known-bug chalk#00`?
>
> From: https://rust-lang.zulipchat.com/#narrow/stream/326866-t-types.2Fnominated/topic/.2398095.3A.20NLL.3A.20unsound.20verification.20of.20higher.20ranked.20outlives.E2.80.A6/near/287258738

I also added an `unknown` escape-hatch because I didn't find corresponding issues for every `// known-bug`.

The syntax also ended up being `// known-bug: `, because of `set_name_value_directive`.
  • Loading branch information
JohnTitor authored Jun 26, 2022
2 parents 542718e + 93d3359 commit 40e4fef
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/chalkify/bugs/async.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: unknown
// compile-flags: -Z chalk --edition=2021

fn main() -> () {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-80626.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #80626

// This should pass, but it requires `Sized` to be coinductive.

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-86218.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #86218

// This should pass, but seems to run into a TAIT issue.

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-87735.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #87735, #88526

// This should pass, but we need an extension of implied bounds (probably).

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-87748.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #87748

// This should pass, but unnormalized input args aren't treated as implied.

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-87755.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #87755

// This should pass.

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-87803.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #87803

// This should pass, but using a type alias vs a reference directly
// changes late-bound -> early-bound.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-88382.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #88382

// This should pass, but has a missed normalization due to HRTB.

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-88460.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #88460

// This should pass, but has a missed normalization due to HRTB.

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-88526.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #88526

// This should pass, but requires more logic.

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-89008.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// check-fail
// edition:2021
// known-bug
// known-bug: #88908

// This should pass, but seems to run into a TAIT bug.

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/hrtb/issue-95034.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// known-bug
// known-bug: #95034
// failure-status: 101
// compile-flags: --edition=2021 --crate-type=lib
// rustc-env:RUST_BACKTRACE=0
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-47511.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-fail
// known-bug
// known-bug: #47511

// Regression test for #47511: anonymous lifetimes can appear
// unconstrained in a return type, but only if they appear just once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// known-bug
// known-bug: #93008
// build-fail
// failure-status: 101
// compile-flags:--crate-type=lib -Zmir-opt-level=3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// known-bug
// known-bug: #96572
// compile-flags: --edition=2021 --crate-type=lib
// rustc-env:RUST_BACKTRACE=0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Regression test for issue #57611
// Ensures that we don't ICE
// FIXME: This should compile, but it currently doesn't
// known-bug
// known-bug: unknown

#![feature(trait_alias)]
#![feature(type_alias_impl_trait)]
Expand Down
24 changes: 23 additions & 1 deletion src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,29 @@ impl TestProps {
);
config.set_name_directive(ln, STDERR_PER_BITWIDTH, &mut self.stderr_per_bitwidth);
config.set_name_directive(ln, INCREMENTAL, &mut self.incremental);
config.set_name_directive(ln, KNOWN_BUG, &mut self.known_bug);

// Unlike the other `name_value_directive`s this needs to be handled manually,
// because it sets a `bool` flag.
if let Some(known_bug) = config.parse_name_value_directive(ln, KNOWN_BUG) {
let known_bug = known_bug.trim();
if known_bug == "unknown"
|| known_bug.split(',').all(|issue_ref| {
issue_ref
.trim()
.split_once('#')
.filter(|(_, number)| {
number.chars().all(|digit| digit.is_numeric())
})
.is_some()
})
{
self.known_bug = true;
} else {
panic!(
"Invalid known-bug value: {known_bug}\nIt requires comma-separated issue references (`#000` or `chalk#000`) or `unknown`."
);
}
}
config.set_name_value_directive(ln, MIR_UNIT_TEST, &mut self.mir_unit_test, |s| {
s.trim().to_string()
});
Expand Down

0 comments on commit 40e4fef

Please sign in to comment.