Skip to content
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

rhai (smartstring) breaks std::string::String #707

Closed
DSeeLP opened this issue Feb 17, 2023 · 1 comment
Closed

rhai (smartstring) breaks std::string::String #707

DSeeLP opened this issue Feb 17, 2023 · 1 comment

Comments

@DSeeLP
Copy link

DSeeLP commented Feb 17, 2023

Rhai depends on smartstring which contains a regression that breaks std::string::String in projects depending on smartstring and by extend rhai.
bodil/smartstring#7

fn main() {
    let a = "Hello ".to_string();
    let b = "World!".to_string();
    let c = a + &b; // Breaks here
    println!("{c}");
}

This code works when not depending on rhai or smartstring.
When inserting use smartstring or use rhai it breaks compilation with this error:

error[E0277]: cannot add `&String` to `String`
 --> src/main.rs:5:15
  |
5 |     let c = a + &b;
  |               ^ no implementation for `String + &String`
  |
  = help: the trait `Add<&String>` is not implemented for `String`
  = help: the following other types implement trait `Add<Rhs>`:
            <String as Add<&str>>
            <String as Add<smartstring::SmartString<Mode>>>
DSeeLP added a commit to authentra/authentra that referenced this issue Feb 17, 2023
@schungx schungx added the bug label Feb 18, 2023
@schungx
Copy link
Collaborator

schungx commented Feb 18, 2023

Not sure what we can do about this though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants