Struct rustc_typeck::session::Session
[−]
[src]
pub struct Session { pub dep_graph: DepGraph, pub target: Config, pub host: Target, pub opts: Options, pub cstore: Rc<CrateStore + 'static>, pub parse_sess: ParseSess, pub entry_fn: RefCell<Option<(NodeId, Span)>>, pub entry_type: Cell<Option<EntryFnType>>, pub plugin_registrar_fn: Cell<Option<NodeId>>, pub derive_registrar_fn: Cell<Option<NodeId>>, pub default_sysroot: Option<PathBuf>, pub local_crate_source_file: Option<PathBuf>, pub working_dir: PathBuf, pub lint_store: RefCell<LintStore>, pub lints: RefCell<LintTable>, pub one_time_diagnostics: RefCell<HashSet<(LintId, Span, String), BuildHasherDefault<FxHasher>>>, pub plugin_llvm_passes: RefCell<Vec<String>>, pub mir_passes: RefCell<Passes>, pub plugin_attributes: RefCell<Vec<(String, AttributeType)>>, pub crate_types: RefCell<Vec<CrateType>>, pub dependency_formats: RefCell<HashMap<CrateType, Vec<Linkage>, BuildHasherDefault<FxHasher>>>, pub crate_disambiguator: RefCell<Symbol>, pub features: RefCell<Features>, pub recursion_limit: Cell<usize>, pub type_length_limit: Cell<usize>, pub injected_allocator: Cell<Option<CrateNum>>, pub injected_panic_runtime: Cell<Option<CrateNum>>, pub imported_macro_spans: RefCell<HashMap<Span, (String, Span), RandomState>>, pub perf_stats: PerfStats, pub code_stats: RefCell<CodeStats>, // some fields omitted }
rustc_private
)Fields
dep_graph: DepGraph
rustc_private
)target: Config
rustc_private
)host: Target
rustc_private
)opts: Options
rustc_private
)cstore: Rc<CrateStore + 'static>
rustc_private
)parse_sess: ParseSess
rustc_private
)entry_fn: RefCell<Option<(NodeId, Span)>>
rustc_private
)entry_type: Cell<Option<EntryFnType>>
rustc_private
)plugin_registrar_fn: Cell<Option<NodeId>>
rustc_private
)derive_registrar_fn: Cell<Option<NodeId>>
rustc_private
)default_sysroot: Option<PathBuf>
rustc_private
)local_crate_source_file: Option<PathBuf>
rustc_private
)working_dir: PathBuf
rustc_private
)lint_store: RefCell<LintStore>
rustc_private
)lints: RefCell<LintTable>
rustc_private
)one_time_diagnostics: RefCell<HashSet<(LintId, Span, String), BuildHasherDefault<FxHasher>>>
rustc_private
)Set of (LintId, span, message) tuples tracking lint (sub)diagnostics that have been set once, but should not be set again, in order to avoid redundantly verbose output (Issue #24690).
plugin_llvm_passes: RefCell<Vec<String>>
rustc_private
)mir_passes: RefCell<Passes>
rustc_private
)plugin_attributes: RefCell<Vec<(String, AttributeType)>>
rustc_private
)crate_types: RefCell<Vec<CrateType>>
rustc_private
)dependency_formats: RefCell<HashMap<CrateType, Vec<Linkage>, BuildHasherDefault<FxHasher>>>
rustc_private
)crate_disambiguator: RefCell<Symbol>
rustc_private
)features: RefCell<Features>
rustc_private
)recursion_limit: Cell<usize>
rustc_private
)The maximum recursion limit for potentially infinitely recursive operations such as auto-dereference and monomorphization.
type_length_limit: Cell<usize>
rustc_private
)The maximum length of types during monomorphization.
injected_allocator: Cell<Option<CrateNum>>
rustc_private
)The metadata::creader module may inject an allocator/panic_runtime dependency if it didn't already find one, and this tracks what was injected.
injected_panic_runtime: Cell<Option<CrateNum>>
rustc_private
)imported_macro_spans: RefCell<HashMap<Span, (String, Span), RandomState>>
rustc_private
)Map from imported macro spans (which consist of the localized span for the macro body) to the macro name and defintion span in the source crate.
perf_stats: PerfStats
rustc_private
)Some measurements that are being gathered during compilation.
code_stats: RefCell<CodeStats>
rustc_private
)Data about code being compiled, gathered during compilation.
Methods
impl Session
[src]
fn local_crate_disambiguator(&self) -> Symbol
rustc_private
)fn struct_span_warn<S>(&'a self, sp: S, msg: &str) -> DiagnosticBuilder<'a> where S: Into<MultiSpan>
rustc_private
)fn struct_span_warn_with_code<S>(&'a self,
sp: S,
msg: &str,
code: &str)
-> DiagnosticBuilder<'a> where S: Into<MultiSpan>
sp: S,
msg: &str,
code: &str)
-> DiagnosticBuilder<'a> where S: Into<MultiSpan>
rustc_private
)fn struct_warn(&'a self, msg: &str) -> DiagnosticBuilder<'a>
rustc_private
)fn struct_span_err<S>(&'a self, sp: S, msg: &str) -> DiagnosticBuilder<'a> where S: Into<MultiSpan>
rustc_private
)fn struct_span_err_with_code<S>(&'a self,
sp: S,
msg: &str,
code: &str)
-> DiagnosticBuilder<'a> where S: Into<MultiSpan>
sp: S,
msg: &str,
code: &str)
-> DiagnosticBuilder<'a> where S: Into<MultiSpan>
rustc_private
)fn struct_err(&'a self, msg: &str) -> DiagnosticBuilder<'a>
rustc_private
)fn struct_span_fatal<S>(&'a self, sp: S, msg: &str) -> DiagnosticBuilder<'a> where S: Into<MultiSpan>
rustc_private
)fn struct_span_fatal_with_code<S>(&'a self,
sp: S,
msg: &str,
code: &str)
-> DiagnosticBuilder<'a> where S: Into<MultiSpan>
sp: S,
msg: &str,
code: &str)
-> DiagnosticBuilder<'a> where S: Into<MultiSpan>
rustc_private
)fn struct_fatal(&'a self, msg: &str) -> DiagnosticBuilder<'a>
rustc_private
)fn span_fatal<S>(&self, sp: S, msg: &str) -> ! where S: Into<MultiSpan>
rustc_private
)fn span_fatal_with_code<S>(&self, sp: S, msg: &str, code: &str) -> ! where S: Into<MultiSpan>
rustc_private
)fn fatal(&self, msg: &str) -> !
rustc_private
)fn span_err_or_warn<S>(&self, is_warning: bool, sp: S, msg: &str) where S: Into<MultiSpan>
rustc_private
)fn span_err<S>(&self, sp: S, msg: &str) where S: Into<MultiSpan>
rustc_private
)fn span_err_with_code<S>(&self, sp: S, msg: &str, code: &str) where S: Into<MultiSpan>
rustc_private
)fn err(&self, msg: &str)
rustc_private
)fn err_count(&self) -> usize
rustc_private
)fn has_errors(&self) -> bool
rustc_private
)fn abort_if_errors(&self)
rustc_private
)fn track_errors<F, T>(&self, f: F) -> Result<T, usize> where F: FnOnce() -> T
rustc_private
)fn span_warn<S>(&self, sp: S, msg: &str) where S: Into<MultiSpan>
rustc_private
)fn span_warn_with_code<S>(&self, sp: S, msg: &str, code: &str) where S: Into<MultiSpan>
rustc_private
)fn warn(&self, msg: &str)
rustc_private
)fn opt_span_warn<S>(&self, opt_sp: Option<S>, msg: &str) where S: Into<MultiSpan>
rustc_private
)fn delay_span_bug<S>(&self, sp: S, msg: &str) where S: Into<MultiSpan>
rustc_private
)Delay a span_bug() call until abort_if_errors()
fn note_without_error(&self, msg: &str)
rustc_private
)fn span_note_without_error<S>(&self, sp: S, msg: &str) where S: Into<MultiSpan>
rustc_private
)fn span_unimpl<S>(&self, sp: S, msg: &str) -> ! where S: Into<MultiSpan>
rustc_private
)fn unimpl(&self, msg: &str) -> !
rustc_private
)fn add_lint<S>(&self, lint: &'static Lint, id: NodeId, sp: S, msg: String) where S: Into<MultiSpan>
rustc_private
)fn add_lint_diagnostic<M>(&self, lint: &'static Lint, id: NodeId, msg: M) where M: IntoEarlyLint
rustc_private
)fn reserve_node_ids(&self, count: usize) -> NodeId
rustc_private
)fn next_node_id(&self) -> NodeId
rustc_private
)fn diagnostic(&'a self) -> &'a Handler
rustc_private
)fn diag_span_note_once(&'a self,
diag_builder: &'b mut DiagnosticBuilder<'a>,
lint: &'static Lint,
span: Span,
message: &str)
diag_builder: &'b mut DiagnosticBuilder<'a>,
lint: &'static Lint,
span: Span,
message: &str)
rustc_private
)Analogous to calling .span_note
on the given DiagnosticBuilder, but
deduplicates on lint ID, span, and message for this Session
if we're
not outputting in JSON mode.
fn codemap(&'a self) -> &'a CodeMap
rustc_private
)fn verbose(&self) -> bool
rustc_private
)fn time_passes(&self) -> bool
rustc_private
)fn count_llvm_insns(&self) -> bool
rustc_private
)fn time_llvm_passes(&self) -> bool
rustc_private
)fn trans_stats(&self) -> bool
rustc_private
)fn meta_stats(&self) -> bool
rustc_private
)fn asm_comments(&self) -> bool
rustc_private
)fn no_verify(&self) -> bool
rustc_private
)fn borrowck_stats(&self) -> bool
rustc_private
)fn print_llvm_passes(&self) -> bool
rustc_private
)fn lto(&self) -> bool
rustc_private
)fn panic_strategy(&self) -> PanicStrategy
rustc_private
)Returns the panic strategy for this compile session. If the user explicitly selected one using '-C panic', use that, otherwise use the panic strategy defined by the target.
fn no_landing_pads(&self) -> bool
rustc_private
)fn unstable_options(&self) -> bool
rustc_private
)fn nonzeroing_move_hints(&self) -> bool
rustc_private
)fn overflow_checks(&self) -> bool
rustc_private
)fn must_not_eliminate_frame_pointers(&self) -> bool
rustc_private
)fn generate_plugin_registrar_symbol(&self, svh: &Svh, index: DefIndex) -> String
rustc_private
)Returns the symbol name for the registrar function, given the crate Svh and the function DefIndex.
fn generate_derive_registrar_symbol(&self, svh: &Svh, index: DefIndex) -> String
rustc_private
)fn sysroot(&'a self) -> &'a Path
rustc_private
)fn target_filesearch(&self, kind: PathKind) -> FileSearch
rustc_private
)fn host_filesearch(&self, kind: PathKind) -> FileSearch
rustc_private
)fn init_incr_comp_session(&self, session_dir: PathBuf, lock_file: Lock)
rustc_private
)fn finalize_incr_comp_session(&self, new_directory_path: PathBuf)
rustc_private
)fn mark_incr_comp_session_as_invalid(&self)
rustc_private
)fn incr_comp_session_dir(&self) -> Ref<PathBuf>
rustc_private
)fn incr_comp_session_dir_opt(&self) -> Option<Ref<PathBuf>>
rustc_private
)fn print_perf_stats(&self)
rustc_private
)