Skip to content

Commit f9fda7a

Browse files
committed
some lang items that I may end up using to distinguish data type tracking.
1 parent ff74a67 commit f9fda7a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/libcore/marker.rs

+19
Original file line numberDiff line numberDiff line change
@@ -461,3 +461,22 @@ pub trait Reflect {}
461461
reason = "requires RFC and more experience",
462462
issue = "27749")]
463463
impl Reflect for .. { }
464+
465+
/// Implement this trait to indicate that the type in question should
466+
/// be "tracked", in the sense that a scan over a thread's call-stack
467+
/// should include the set of such values on the stack.
468+
///
469+
/// Long-term, pnkfelix (or at least nmatsakis) expects this trait to
470+
/// be implemented by default. But for the short-term, pnkfelix
471+
/// expects it to be easier to get something up-and-running by opting
472+
/// *in* via this marker trait.
473+
#[unstable(feature = "patchpoint_tracking", issue="17668")]
474+
#[lang = "patchpoint_tracked"]
475+
pub trait PatchpointTracked {}
476+
477+
/// Implement this trait to indicate that the type in question should
478+
/// not be "tracked", in the sense that a scan over a thread's
479+
/// call-stack need not include such values.
480+
#[unstable(feature = "patchpoint_tracking", issue="17668")]
481+
#[lang = "patchpoint_untracked"]
482+
pub trait PatchpointUntracked {}

src/librustc/middle/lang_items.rs

+3
Original file line numberDiff line numberDiff line change
@@ -375,4 +375,7 @@ lets_do_this! {
375375
NonZeroItem, "non_zero", non_zero;
376376

377377
DebugTraitLangItem, "debug_trait", debug_trait;
378+
379+
PatchpointTrackedLangItem, "patchpoint_tracked", patchpoint_tracked_trait;
380+
PatchpointUntrackedLangItem, "patchpoint_untracked", patchpoint_untracked_trait;
378381
}

0 commit comments

Comments
 (0)