generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Labels
[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.[F] CrashKani crashedKani crashed
Description
#![feature(layout_for_ptr)]
use std::mem;
use std::sync::Arc;
use std::sync::Mutex;
pub trait Subscriber {
fn process(&mut self);
fn interest_list(&self);
}
struct DummySubscriber {
}
impl DummySubscriber {
fn new() -> Self {
DummySubscriber {}
}
}
impl Subscriber for DummySubscriber {
fn process(&mut self) {}
fn interest_list(&self) {}
}
fn main() {
let v = unsafe { mem::size_of_val_raw(&5i32) };
assert!(v == 4);
let x : [u8;13] = [0; 13];
let y: &[u8] = &x;
let v = unsafe { mem::size_of_val_raw(y) };
assert!(v == 13);
let s : Arc<Mutex<dyn Subscriber>> = Arc::new(Mutex::new(DummySubscriber::new()));
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.[F] CrashKani crashedKani crashed