2018-10-30 15:21:23 -05:00
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:37:26
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | with_none_and_format.expect(&format!("Error {}: fake error", error_code));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::expect-fun-call` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::expect_fun_call)]`
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:40:26
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:43:37
|
2022-02-10 11:40:06 -06:00
|
|
|
|
|
|
|
|
LL | with_none_and_format_with_macro.expect(format!("Error {}: fake error", one!()).as_str());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("Error {}: fake error", one!()))`
|
2022-02-10 11:40:06 -06:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:53:25
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | with_err_and_format.expect(&format!("Error {}: fake error", error_code));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:56:25
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:68:17
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
2019-01-23 22:58:53 -06:00
|
|
|
LL | Some("foo").expect(format!("{} {}", 1, 2).as_ref());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("{} {}", 1, 2))`
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:89:21
|
2018-10-30 15:21:23 -05:00
|
|
|
|
|
2019-01-23 22:58:53 -06:00
|
|
|
LL | Some("foo").expect(&get_string());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| { panic!("{}", get_string()) })`
|
2018-10-30 15:21:23 -05:00
|
|
|
|
2019-01-19 06:13:06 -06:00
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:90:21
|
2019-01-19 06:13:06 -06:00
|
|
|
|
|
2019-01-23 22:58:53 -06:00
|
|
|
LL | Some("foo").expect(get_string().as_ref());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| { panic!("{}", get_string()) })`
|
2019-01-23 22:58:53 -06:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:91:21
|
2019-01-23 22:58:53 -06:00
|
|
|
|
|
|
|
|
LL | Some("foo").expect(get_string().as_str());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| { panic!("{}", get_string()) })`
|
2019-01-23 22:58:53 -06:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:93:21
|
2019-01-23 22:58:53 -06:00
|
|
|
|
|
|
|
|
LL | Some("foo").expect(get_static_str());
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| { panic!("{}", get_static_str()) })`
|
2019-01-23 22:58:53 -06:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:94:21
|
2019-01-23 22:58:53 -06:00
|
|
|
|
|
|
|
|
LL | Some("foo").expect(get_non_static_str(&0));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| { panic!("{}", get_non_static_str(&0).to_string()) })`
|
2019-01-19 06:13:06 -06:00
|
|
|
|
2019-03-05 23:00:05 -06:00
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:98:16
|
2019-03-05 23:00:05 -06:00
|
|
|
|
|
|
|
|
LL | Some(true).expect(&format!("key {}, {}", 1, 2));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("key {}, {}", 1, 2))`
|
2019-03-05 23:00:05 -06:00
|
|
|
|
2019-12-18 13:54:37 -06:00
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:104:17
|
2019-12-18 13:54:37 -06:00
|
|
|
|
|
|
|
|
LL | opt_ref.expect(&format!("{:?}", opt_ref));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("{:?}", opt_ref))`
|
2019-12-18 13:54:37 -06:00
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:108:20
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | format_capture.expect(&format!("{error_code}"));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("{error_code}"))`
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: use of `expect` followed by a function call
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/expect_fun_call.rs:111:30
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | format_capture_and_value.expect(&format!("{error_code}, {}", 1));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("{error_code}, {}", 1))`
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: aborting due to 15 previous errors
|
2018-10-30 15:21:23 -05:00
|
|
|
|