Shrink some stuff

This commit is contained in:
Lukas Wirth 2023-09-09 22:45:01 +02:00
parent 994df3d6a3
commit ccff704c25
7 changed files with 18 additions and 16 deletions

View file

@ -163,7 +163,7 @@ fn repr_discr(
return Err(LayoutError::UserError(
"Integer::repr_discr: `#[repr]` hint too small for \
discriminant range of enum "
.to_string(),
.into(),
));
}
return Ok((discr, ity.is_signed()));

View file

@ -212,14 +212,14 @@ fn recursive() {
}
check_fail(
r#"struct Goal(Goal);"#,
LayoutError::UserError("infinite sized recursive type".to_string()),
LayoutError::UserError("infinite sized recursive type".into()),
);
check_fail(
r#"
struct Foo<T>(Foo<T>);
struct Goal(Foo<i32>);
"#,
LayoutError::UserError("infinite sized recursive type".to_string()),
LayoutError::UserError("infinite sized recursive type".into()),
);
}