Skip to content

Commit

Permalink
demonstrate the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jan 6, 2025
1 parent 9699349 commit fe95f84
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions crates/top/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2286,6 +2286,7 @@ impl RecordingStream {
#[cfg(test)]
mod tests {
use re_chunk::TransportChunk;
use re_log_types::example_components::MyLabel;

use super::*;

Expand Down Expand Up @@ -2623,4 +2624,44 @@ mod tests {

vec![row0, row1, row2]
}

// See <TODO> for context.
#[test]
fn allows_ascomponents_unsized() {
let labels = &[
MyLabel("a".into()),
MyLabel("b".into()),
MyLabel("c".into()),
];

let (rec, _mem) = RecordingStreamBuilder::new("rerun_example_test_ascomponents_unsized")
.default_enabled(false)
.enabled(false)
.memory()
.unwrap();

// This call used to *not* compile due to a lack of `?Sized` bounds.
rec.log("labels", &labels as &dyn crate::AsComponents)
.unwrap();
}

// See <TODO> for context.
#[test]
fn allows_componentbatch_unsized() {
let labels = &[
MyLabel("a".into()),
MyLabel("b".into()),
MyLabel("c".into()),
];

let (rec, _mem) = RecordingStreamBuilder::new("rerun_example_test_componentbatch_unsized")
.default_enabled(false)
.enabled(false)
.memory()
.unwrap();

// This call used to *not* compile due to a lack of `?Sized` bounds.
rec.log("labels", &labels as &dyn crate::ComponentBatch)
.unwrap();
}
}

0 comments on commit fe95f84

Please sign in to comment.