-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
mention expect if we try to unwrap("string lit") #155502
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Code
Current output
error[E0061]: this method takes 0 arguments but 1 argument was supplied --> src/main.rs:3:7 | 3 | x.unwrap("oh no"); | ^^^^^^ ------- unexpected argument of type `&'static str` | note: method defined here --> /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:1013:18 | 1013 | pub const fn unwrap(self) -> T { | ^^^^^^ help: remove the extra argument | 3 - x.unwrap("oh no"); 3 + x.unwrap(); | For more information about this error, try `rustc --explain E0061`.Desired output
Rationale and extra context
No response
Other cases
Rust Version
Anything else?
No response