Skip to content

Rustc crash #8759

New issue

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

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

Already on GitHub? # to your account

Closed
tiffany352 opened this issue Aug 26, 2013 · 1 comment
Closed

Rustc crash #8759

tiffany352 opened this issue Aug 26, 2013 · 1 comment

Comments

@tiffany352
Copy link

The logged output it told me to post: http://pastebin.com/J9Bk6ntk
The file that caused it: http://pastebin.com/xFxR65Dn

The crash occurs in both 0.7 and git master. I'm running Arch Linux.

@huonw
Copy link
Member

huonw commented Aug 26, 2013

Hi, thanks for the bug report!

I think this can be worked around via:

fn parse<'a>(pat: Pattern, text: &'a str, offset: uint) -> Option<Token<'a>> {
    match pat {
        Literal(s) => {
            let slc = text.slice_from(offset);
// ...

In any case, this is a dup of #6396.

@huonw huonw closed this as completed Aug 26, 2013
xFrednet pushed a commit to xFrednet/rust that referenced this issue May 21, 2022
Address `unnecessary_to_owned` false positive

My proposed fix for rust-lang#8759 is to revise the conditions that delineate `redundant_clone` and `unnecessary_to_owned`:
```rust
        // Only flag cases satisfying at least one of the following three conditions:
        // * the referent and receiver types are distinct
        // * the referent/receiver type is a copyable array
        // * the method is `Cow::into_owned`
        // This restriction is to ensure there is no overlap between `redundant_clone` and this
        // lint. It also avoids the following false positive:
        //  rust-lang/rust-clippy#8759
        //   Arrays are a bit of a corner case. Non-copyable arrays are handled by
        // `redundant_clone`, but copyable arrays are not.
```
This change causes a few cases that were previously flagged by `unnecessary_to_owned` to no longer be flagged. But one could argue those cases would be better handled by `redundant_clone`.

Closes rust-lang#8759

changelog: none
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants