Skip to main content

Elsewhere

Struct Elsewhere 

Source
pub struct Elsewhere { /* private fields */ }
Expand description

The names whose address only the linker knows.

Functions and not objects, which is not an oversight. The address of a static or of anything this file defines is in this file, so there is a distance and no table is needed. The address of an object another file defines is also reachable that way in an executable, because the linker answers a reference to one by making room for it in this program and copying it there, so the name really does end up somewhere this file can measure to. A function cannot be copied: it has exactly one address that every object in the program has to agree on, or two pointers to it compare unequal, so the one address is what the table holds and what everything reads.

A name this module has never heard of is not in here. Nothing the front end writes produces one, and treating an unknown name as a function would put the addresses the instrumentation takes of its own tables through a table of their own for no reason.

Implementations§

Source§

impl Elsewhere

Source

pub fn of(module: &Module) -> Self

The functions a module declares and does not define.

Source

pub fn holds(&self, name: Symbol) -> bool

Whether the address of that name has to be read out of the global offset table.

Trait Implementations§

Source§

impl Clone for Elsewhere

Source§

fn clone(&self) -> Elsewhere

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Elsewhere

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Elsewhere

Source§

fn default() -> Elsewhere

Returns the “default value” for a type. Read more
Source§

impl Eq for Elsewhere

Source§

impl FromIterator<Symbol> for Elsewhere

The same set, written out by hand.

Elsewhere::of is how the driver builds one and is the only way a compilation does. This is for a test that wants to lower one function and say what is outside the file without building a module for it to be outside of.

Source§

fn from_iter<T: IntoIterator<Item = Symbol>>(names: T) -> Self

Creates a value from an iterator. Read more
Source§

impl PartialEq for Elsewhere

Source§

fn eq(&self, other: &Elsewhere) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Elsewhere

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.