about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorsurechen <chenshuo17@huawei.com>2024-07-23 10:24:45 +0800
committersurechen <chenshuo17@huawei.com>2024-07-23 10:24:45 +0800
commitb4b991e66f0a1fd0e517ed7f038129350a7ad6ce (patch)
treeab3d9efc34ac6c71e2e50580e6c347a82631e6c1 /tests/rustdoc-js-std/parser-errors.js
parentcefe1dcef0e21f4d0c8ea856ad61c1936dfb7913 (diff)
downloadrust-b4b991e66f0a1fd0e517ed7f038129350a7ad6ce.tar.gz
rust-b4b991e66f0a1fd0e517ed7f038129350a7ad6ce.zip
Suggest adding Result return type for associated method in E0277.
For following:

```rust
struct A;
impl A {
    fn test4(&self) {
        let mut _file = File::create("foo.txt")?;
        //~^ ERROR the `?` operator can only be used in a method
    }
```
Suggest:

```rust
impl A {
    fn test4(&self) -> Result<(), Box<dyn std::error::Error>> {
        let mut _file = File::create("foo.txt")?;
        //~^ ERROR the `?` operator can only be used in a method

    Ok(())
    }
}
```

For #125997
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions