Update glue tests

This commit is contained in:
Richard Feldman 2022-07-24 11:57:01 -04:00
parent cc790a2773
commit ed69a73786
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
19 changed files with 74 additions and 105 deletions

View file

@ -106,7 +106,7 @@ pub fn load_types(
if !can_problems.is_empty() || !type_problems.is_empty() {
todo!(
"Gracefully report compilation problems during bindgen: {:?}, {:?}",
"Gracefully report compilation problems during glue generation: {:?}, {:?}",
can_problems,
type_problems
);

View file

@ -254,7 +254,7 @@ fn add_type(target_info: TargetInfo, id: TypeId, types: &Types, impls: &mut Impl
// so no extra work needs to happen.
}
RocType::Function { .. } => {
// TODO actually bindgen functions!
// TODO actually generate glue functions!
}
}
}
@ -312,8 +312,8 @@ fn add_tag_union(
types: &Types,
impls: &mut Impls,
) {
// We should never be attempting to bindgen empty tag unions; RocType should not
// have let this happen.
// We should never be attempting to generate glue for empty tag unions;
// RocType should not have let this happen.
debug_assert_ne!(tags.len(), 0);
let tag_names = tags.iter().map(|(name, _)| name).cloned().collect();
@ -471,7 +471,7 @@ pub struct {name} {{
);
} else {
todo!(
"Support {} tags in a recursive tag union on target_info {:?}. (This is too many tags for pointer tagging to work, so we need to bindgen something different.)",
"Support {} tags in a recursive tag union on target_info {:?}. (This is too many tags for pointer tagging to work, so we need to generate different glue.)",
tags.len(),
target_info
);

View file

@ -1111,11 +1111,11 @@ fn add_tag_union<'a>(
| Layout::Boxed(_)
| Layout::LambdaSet(_)
| Layout::RecursivePointer => {
// These must be single-tag unions. Bindgen ordinary nonrecursive
// These must be single-tag unions. Generate ordinary nonrecursive
// tag unions for them, and let Rust do the unwrapping.
//
// This should be a very rare use case, and it's not worth overcomplicating
// the rest of bindgen to make it do something different.
// the rest of glue to make it do something different.
RocType::TagUnion(RocTagUnion::NonRecursive {
name: name.clone(),
tags,