mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
46 lines
580 B
Rust
46 lines
580 B
Rust
#![feature(coverage_attribute)]
|
|
//@ edition: 2024
|
|
//@ min-llvm-version: 23
|
|
|
|
// Basic test for method calls and chained method calls.
|
|
|
|
#[rustfmt::skip]
|
|
fn call_method() {
|
|
let thing = Thing;
|
|
|
|
thing
|
|
.
|
|
method
|
|
(
|
|
"arg"
|
|
)
|
|
;
|
|
|
|
thing
|
|
.
|
|
method
|
|
(
|
|
"arg"
|
|
)
|
|
.
|
|
method
|
|
(
|
|
"arg"
|
|
)
|
|
;
|
|
}
|
|
|
|
struct Thing;
|
|
|
|
#[coverage(off)]
|
|
impl Thing {
|
|
fn method(&self, _arg: &str) -> &Self {
|
|
self
|
|
}
|
|
}
|
|
|
|
#[coverage(off)]
|
|
fn main() {
|
|
call_method();
|
|
}
|