-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Tidying up tests/ui/issues 33 tests [4/N] #149767
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| //! regression test for issue https://github.com/rust-lang/rust/issues/46472 | ||
| fn bar<'a>() -> &'a mut u32 { | ||
| &mut 4 | ||
| //~^ ERROR cannot return reference to temporary value [E0515] | ||
| } | ||
|
|
||
| fn main() { } | ||
| fn main() {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| //! regression test for https://github.com/rust-lang/rust/issues/24779 | ||
| //@ run-pass | ||
| fn main() { | ||
| assert_eq!((|| || 42)()(), 42); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| //! regression test for https://github.com/rust-lang/rust/issues/23253 | ||
| enum Foo { | ||
| Bar, | ||
| } | ||
|
|
||
| fn main() { | ||
| Foo::Bar.a; | ||
| //~^ ERROR no field `a` on type `Foo` | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| //! regression test for https://github.com/rust-lang/rust/issues/18110 | ||
| //@ run-pass | ||
| #![allow(unreachable_code)] | ||
|
|
||
| fn main() { | ||
| ({ return },); | ||
| } |
reddevilmidzy marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| //! Regression test for https://github.com/rust-lang/rust/issues/19398 | ||
| //@ check-pass | ||
|
|
||
| trait T { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| //! regression test for https://github.com/rust-lang/rust/issues/11382 | ||
| //@ run-pass | ||
| fn main() { | ||
| println!("{}", 1.2); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| //! regression test for https://github.com/rust-lang/rust/issues/43205 | ||
| //@ run-pass | ||
| fn main() { | ||
| let _ = &&[()][0]; | ||
| println!("{:?}", &[(), ()][1]); | ||
| } |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // regression test for https://github.com/rust-lang/rust/issues/10656 | ||
| #![deny(missing_docs)] | ||
| //~^ ERROR missing documentation for the crate | ||
| #![crate_type = "lib"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| //! regression test for https://github.com/rust-lang/rust/issues/19734 | ||
| fn main() {} | ||
|
|
||
| struct Type; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| //! Regression test for issue https://github.com/rust-lang/rust/issues/4968 | ||
| //@ dont-require-annotations: NOTE | ||
|
|
||
| const A: (isize, isize) = (4, 2); | ||
| fn main() { | ||
| match 42 { | ||
| A => (), | ||
| //~^ ERROR mismatched types | ||
| //~| NOTE expected type `{integer}` | ||
| //~| NOTE found tuple `(isize, isize)` | ||
| //~| NOTE expected integer, found `(isize, isize)` | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| error[E0308]: mismatched types | ||
| --> $DIR/match-const-tuple-type-mismatch.rs:7:9 | ||
| | | ||
| LL | const A: (isize, isize) = (4, 2); | ||
| | ----------------------- constant defined here | ||
| LL | fn main() { | ||
| LL | match 42 { | ||
| | -- this expression has type `{integer}` | ||
| LL | A => (), | ||
| | ^ | ||
| | | | ||
| | expected integer, found `(isize, isize)` | ||
| | `A` is interpreted as a constant, not a new binding | ||
| | help: introduce a new binding instead: `other_a` | ||
| | | ||
| = note: expected type `{integer}` | ||
| found tuple `(isize, isize)` | ||
|
|
||
| error: aborting due to 1 previous error | ||
|
|
||
| For more information about this error, try `rustc --explain E0308`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there a directory for tests that test a CLI options passed to compiler like in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was an
invalid-compile-flagsdirectory, but no directory like run-pass compile flagsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do
tests/ui/compile-flagsand split it intoui/compile-flags/invalid/andui/compile-flags/run-pass/