Existing code broken by the 1.90 release. Bug?

⚓ Rust    📅 2025-09-19    👤 surdeus    👁️ 9      

surdeus

Warning

This post was published 43 days ago. The information described in this article may have changed.

Hello!

I have some existing code which has been broken by the 1.90 release. The code below, on playground, fails to compile with 1.90, but succeeded without as much as a warning on 1.89.

Is this a bug? I don't understand why the trait can't resolve as I expect it to, but I haven't dug too deeply. However all my builds are broken now, yikes!

use std::ffi::CString;

fn main() {
    assert_eq!(CString::from(c"foo"), c"foo".into());
}

(Playground)

Errors:

   Compiling playground v0.0.1 (/playground)
error[E0283]: type annotations needed
 --> src/main.rs:4:46
  |
4 |     assert_eq!(CString::from(c"foo"), c"foo".into());
  |                                              ^^^^
  |
  = note: cannot satisfy `_: From<&CStr>`
  = note: required for `&CStr` to implement `Into<_>`
help: try using a fully qualified path to specify the expected types
  |
4 -     assert_eq!(CString::from(c"foo"), c"foo".into());
4 +     assert_eq!(CString::from(c"foo"), <&CStr as Into<T>>::into(c"foo"));
  |

For more information about this error, try `rustc --explain E0283`.
error: could not compile `playground` (bin "playground") due to 1 previous error

5 posts - 3 participants

Read full topic

🏷️ Rust_feed