Skip to content

compiletest: add issue number param to known-bug #98530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I didn't notice this before. This is outside the "intended" syntax we're validating; if we want to accept it, I think we should do so intentionally -- and probably update our parser to validate the prefix before # as well (no whitespace?).

Copy link
Contributor Author

@davidkna davidkna Jun 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the parser. I wasn't able to compile the tests, but it seems to work as expected in the rust playground.


// 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