Skip to content
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

add a couple more tests #122888

Merged
merged 2 commits into from
Mar 23, 2024
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
5 changes: 5 additions & 0 deletions tests/ui/const-generics/occurs-check/unify-fixpoint.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// -Zunstable-options added as test for ICE #97725 (left == right)`
Copy link
Member

Choose a reason for hiding this comment

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

How does -Zunstable-options change behavior of this test?

Copy link
Member

Choose a reason for hiding this comment

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

I assume the thing that causes that test to fail is not -Znunstable-options, but just debug assertions. We don't test those in CI afaict.

Copy link
Member Author

Choose a reason for hiding this comment

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

It would have caught the original ice which is reason enough to add it imo.

I do run x.py test with debug assertions from time to time.

Copy link
Member

@compiler-errors compiler-errors Mar 22, 2024

Choose a reason for hiding this comment

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

No, I am asking why you believe -Zunstable-options would have caught the original ICE? -Zunstable-options afaict does nothing on its own -- it's required to pass other unstable flags, but it doesn't do anything behavioral on its own.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have been reporting several ices where -Zunstable-options was crucial to reproducing the ICE, with no other flags being involved.
https://github.com/rust-lang/rust/issues?q=is%3Aissue+%22-Zunstable-options%22++author%3Amatthiaskrgr+
As to why that happens, no idea 🤷

// left: `Binder(<[u8; _] as std::default::Default>, [])`,
// right: `Binder(<[u8; 4] as std::default::Default>, [])

//@ compile-flags: -Zunstable-options
//@ check-pass
#![feature(generic_const_exprs)] //~ WARN the feature `generic_const_exprs` is incomplete

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/const-generics/occurs-check/unify-fixpoint.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/unify-fixpoint.rs:2:12
--> $DIR/unify-fixpoint.rs:7:12
|
LL | #![feature(generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/parser/parser-ice-ed2021-await-105210.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// ICE #105210 self.lines.iter().all(|r| !r.iter().any(|sc| sc.chr == \'\\t\'))
// ignore-tidy-tab
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

I like to have some context in the test what the ice looked like

Copy link
Member

Choose a reason for hiding this comment

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

No, I mean ignore-tidy-tab.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah lol.
The original repro needed a tab on a very specific place for some reason 🐙
while reducing the ice would go away if I replaced the tab with a space

//@ edition:2021
pub fn main() {}

fn box () {
(( h (const {( default ( await ( await ( (move {await((((}}
//~^ ERROR mismatched closing delimiter: `}`
//~^^ ERROR mismatched closing delimiter: `}`
//~ ERROR this file contains an unclosed delimiter
34 changes: 34 additions & 0 deletions tests/ui/parser/parser-ice-ed2021-await-105210.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
error: mismatched closing delimiter: `}`
--> $DIR/parser-ice-ed2021-await-105210.rs:7:58
|
LL | (( h (const {( default ( await ( await ( (move {await((((}}
| - ^^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this

error: mismatched closing delimiter: `}`
--> $DIR/parser-ice-ed2021-await-105210.rs:7:43
|
LL | (( h (const {( default ( await ( await ( (move {await((((}}
| - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this

error: this file contains an unclosed delimiter
--> $DIR/parser-ice-ed2021-await-105210.rs:10:52
|
LL | fn box () {
| - unclosed delimiter
LL | (( h (const {( default ( await ( await ( (move {await((((}}
| -- - unclosed delimiter
| ||
| |unclosed delimiter
| unclosed delimiter
...
LL |
| ^

error: aborting due to 3 previous errors

Loading