Files
rust/tests/ui/const-generics/try-from-with-const-genericsrs-98299.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
502 B
Rust
Raw Normal View History

2025-07-13 16:39:45 -04:00
// https://github.com/rust-lang/rust/issues/98299
use std::convert::TryFrom;
pub fn test_usage(p: ()) {
SmallCString::try_from(p).map(|cstr| cstr);
//~^ ERROR: type annotations needed
2024-06-17 08:34:26 +00:00
//~| ERROR: type annotations needed
//~| ERROR: type annotations needed
}
pub struct SmallCString<const N: usize> {}
impl<const N: usize> TryFrom<()> for SmallCString<N> {
type Error = ();
fn try_from(path: ()) -> Result<Self, Self::Error> {
unimplemented!();
}
}
fn main() {}