Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
parser
/
method-call-on-struct-literal-in-if-condition.rs
blob: 8be7c9ee8ac3acbc5e9c1ceae280e026fe897198 [
file
] [
log
] [
blame
] [
edit
]
pub
struct
Example
{
a
:
i32
}
impl
Example
{
fn
is_pos
(&
self
)
->
bool
{
self
.
a
>
0
}
}
fn
one
()
->
i32
{
1
}
fn
main
()
{
if
Example
{
a
:
one
(),
}.
is_pos
()
{
//~ ERROR invalid struct literal
println
!(
"Positive!"
);
}
}