mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-25 23:14:12 +00:00
Rename the "unsafe" lang item to "unsafe_cell"
This commit is contained in:
parent
ba2efe96ae
commit
b4a286144d
@ -649,7 +649,8 @@ impl<'b, T> DerefMut for RefMut<'b, T> {
|
||||
///
|
||||
/// **NOTE:** `UnsafeCell<T>`'s fields are public to allow static initializers. It is not
|
||||
/// recommended to access its fields directly, `get` should be used instead.
|
||||
#[lang="unsafe"]
|
||||
#[cfg_attr(stage0, lang="unsafe")] // NOTE: remove after next snapshot
|
||||
#[cfg_attr(not(stage0), lang="unsafe_cell")]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct UnsafeCell<T> {
|
||||
/// Wrapped value
|
||||
|
@ -271,7 +271,7 @@ lets_do_this! {
|
||||
RangeToStructLangItem, "range_to", range_to_struct;
|
||||
RangeFullStructLangItem, "range_full", range_full_struct;
|
||||
|
||||
UnsafeTypeLangItem, "unsafe", unsafe_type;
|
||||
UnsafeCellTypeLangItem, "unsafe_cell", unsafe_cell_type;
|
||||
|
||||
DerefTraitLangItem, "deref", deref_trait;
|
||||
DerefMutTraitLangItem, "deref_mut", deref_mut_trait;
|
||||
|
@ -1654,7 +1654,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
ty::BoundSync => {
|
||||
if
|
||||
Some(def_id) == tcx.lang_items.managed_bound() ||
|
||||
Some(def_id) == tcx.lang_items.unsafe_type()
|
||||
Some(def_id) == tcx.lang_items.unsafe_cell_type()
|
||||
{
|
||||
return Err(Unimplemented)
|
||||
}
|
||||
|
@ -3577,7 +3577,7 @@ pub fn type_contents<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> TypeContents {
|
||||
-> TypeContents {
|
||||
if Some(did) == cx.lang_items.managed_bound() {
|
||||
tc | TC::Managed
|
||||
} else if Some(did) == cx.lang_items.unsafe_type() {
|
||||
} else if Some(did) == cx.lang_items.unsafe_cell_type() {
|
||||
tc | TC::InteriorUnsafe
|
||||
} else {
|
||||
tc
|
||||
|
@ -453,7 +453,7 @@ fn add_constraints_from_crate<'a, 'tcx>(terms_cx: TermsContext<'a, 'tcx>,
|
||||
invariant_lang_items[RegionParam as uint] =
|
||||
terms_cx.tcx.lang_items.invariant_lifetime();
|
||||
|
||||
let unsafe_lang_item = terms_cx.tcx.lang_items.unsafe_type();
|
||||
let unsafe_lang_item = terms_cx.tcx.lang_items.unsafe_cell_type();
|
||||
|
||||
let covariant = terms_cx.arena.alloc(ConstantTerm(ty::Covariant));
|
||||
let contravariant = terms_cx.arena.alloc(ConstantTerm(ty::Contravariant));
|
||||
|
Loading…
Reference in New Issue
Block a user