Skip to content

Conversation

@N1ark
Copy link
Contributor

@N1ark N1ark commented Dec 29, 2025

This was discussed IRL at some point and wanted to get it done :)
Changed representation of arrays and slices to not use TyKind::Adt, and instead just be TyKind::Array(_, _) and TyKind::Slice(_, _)

Right now tests fail because of mismatches trait clauses with arrays/slices, I'm not exactly sure what part of typecheck_and_unify.rs handles it, I tried having a look and couldn't see anything suspicious. The errors look like

error: Type error after transformations:
       Mismatched trait clause:
       expected: [@TraitClause0]: MetaSized<missing(@TypeBound(1, 0))>
            got: {built_in impl MetaSized for [u32; 2 : usize]}: MetaSized<[u32; 2 : usize]>
       Visitor stack:
         charon_lib::ast::types::TraitRef
         charon_lib::ids::index_map::IndexMap<charon_lib::ast::types::vars::TraitClauseId, charon_lib::ast::types::TraitRef>
         charon_lib::ast::types::GenericArgs
         alloc::boxed::Box<charon_lib::ast::types::GenericArgs>
         charon_lib::ast::expressions::FnPtr
         charon_lib::ast::gast::FnOperand
         charon_lib::ast::gast::Call
         charon_lib::ast::llbc_ast::StatementKind
         charon_lib::ast::llbc_ast::Statement
         alloc::vec::Vec<charon_lib::ast::llbc_ast::Statement>
         charon_lib::ast::llbc_ast::Block
         charon_lib::ast::gast::GExprBody<charon_lib::ast::llbc_ast::Block>
         charon_lib::ast::gast::Body
         charon_lib::ast::gast::FunDecl
       Binding stack (depth 1):
         0:
 --> tests/ui/simple/ptr-from-raw-parts.rs:8:27
  |
8 |     let _: *const [u32] = core::ptr::from_raw_parts(&raw const a, 2);
  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@Nadrieril
Copy link
Member

Superceded by #958.

@Nadrieril Nadrieril closed this Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants