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
It seems the decoding of [mutable] and [non_owned] is broken: specifically it seems they are ignored when applied on a struct in an external module, when another attribute follows.
In particular, it seems that when more than one attribute is present, only the last attribute survives encode+decode, and the others are somehow lost.
extern mod std;
use core::cell::Cell;
use std::rc::RcMut;
use std::arc::RWARC;
fn check_const<T: Const>(v: &T)
{
}
fn check_owned<T: Owned>(v: &T)
{
}
#[mutable]
#[deriving(Clone)]
pub struct MyCell<T> {
priv value: Option<T>
}
fn test(c: &Cell<u32>, m: &RcMut<u32>, a: &RWARC<u32>, mc: &MyCell<u32>)
{
// these succeed but should fail
check_const(c);
check_owned(m);
// these fail as expected
check_const(m);
check_const(a);
check_const(mc);
}