Skip to content

Replace reference to ~"string" with box "string" in compiler error message #15074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2014
Merged

Replace reference to ~"string" with box "string" in compiler error message #15074

merged 1 commit into from
Jun 21, 2014

Conversation

conradkleinespel
Copy link
Contributor

Using something like:

box "string"

yields

"`~\"string\"` has been removed; use `\"string\".to_string()` instead"

Should the error message maybe say box "string" instead?

@conradkleinespel conradkleinespel changed the title Replace reference to ~"string" with box "string" Replace reference to ~"string" with box "string" in compiler error Jun 21, 2014
@conradkleinespel conradkleinespel changed the title Replace reference to ~"string" with box "string" in compiler error Replace reference to ~"string" with box "string" in compiler error message Jun 21, 2014
bors added a commit that referenced this pull request Jun 21, 2014
Using something like:

```rust
box "string"
```

yields
```shell
"`~\"string\"` has been removed; use `\"string\".to_string()` instead"
```

Should the error message maybe say `box "string"` instead?
@bors bors closed this Jun 21, 2014
@bors bors merged commit 8bcfaba into rust-lang:master Jun 21, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 17, 2023
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 25, 2025
<strike>blocked on rust-lang/rust-clippy#15073</strike>

Lint method calls inside `map_or` too, so for this, lint will be showed:
```rust
Some(4).map_or("asd".to_string().len() as i32, f);
```
previously it worked only for:
```rust
Some(4).map_or(slow_fun(), f);
```

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=bfcda42a6af446e69bc883a8b45eb13c

Sorry for multiple `or_fun_call` PRs.

changelog: [`or_fun_call`]: lint method calls inside map_or first arg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants