You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code should trigger a compilation error because [u8] isn't sized:
fntest(t:&([u8],[u16])) -> &[u16]{&t.1}
Instead it triggers an LLVM assertion error:
rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/IR/Instructions.cpp:1304: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
We had a debate on IRC whether or not tuples with multiple unsized types shoud be allowed at all.
For the moment they work as long as you don't use instantiate them (they can be useful for metaprogramming purposes). But it's ambiguous whether they are supposed to work.
This no longer ICEs, and gives the following error, which is correct: closing.
error[E0277]: the trait bound `[u8]: std::marker::Sized` is not satisfied
--> test.rs:1:1
|
1 | / fn test(t: &([u8], [u16])) -> &[u16] {
2 | | &t.1
3 | | }
| |_^ the trait `std::marker::Sized` is not implemented for `[u8]`
|
= note: `[u8]` does not have a constant size known at compile-time
= note: tuple elements must have `Sized` type
This code should trigger a compilation error because
[u8]
isn't sized:Instead it triggers an LLVM assertion error:
(playpen)
The text was updated successfully, but these errors were encountered: