Skip to main content

Module source_util

Module source_util 

Source
Expand description

The implementation of built-in macros which relate to the file system.

Re-exportsยง

use std::path::Path; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use std::rc::Rc; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use rustc_ast as ast; ๐Ÿ”’
use rustc_ast::tokenstream::TokenStream; ๐Ÿ”’
use rustc_ast::join_path_idents; ๐Ÿ”’
use rustc_ast::token; ๐Ÿ”’
use rustc_ast_pretty::pprust; ๐Ÿ”’
use rustc_expand::base::DummyResult; ๐Ÿ”’
use rustc_expand::base::ExpandResult; ๐Ÿ”’
use rustc_expand::base::ExtCtxt; ๐Ÿ”’
use rustc_expand::base::MacEager; ๐Ÿ”’
use rustc_expand::base::MacResult; ๐Ÿ”’
use rustc_expand::base::MacroExpanderResult; ๐Ÿ”’
use rustc_expand::module::DirOwnership; ๐Ÿ”’
use rustc_lint_defs::builtin::INCOMPLETE_INCLUDE; ๐Ÿ”’
use rustc_parse::lexer::StripTokens; ๐Ÿ”’
use rustc_parse::parser::AllowConstBlockItems; ๐Ÿ”’
use rustc_parse::parser::ForceCollect; ๐Ÿ”’
use rustc_parse::new_parser_from_file; ๐Ÿ”’
use rustc_parse::unwrap_or_emit_fatal; ๐Ÿ”’
use rustc_parse::utf8_error; ๐Ÿ”’
use rustc_session::parse::ParseSess; ๐Ÿ”’
use rustc_span::source_map::SourceMap; ๐Ÿ”’
use rustc_span::ByteSymbol; ๐Ÿ”’
use rustc_span::Pos; ๐Ÿ”’
use rustc_span::Span; ๐Ÿ”’
use rustc_span::Symbol; ๐Ÿ”’
use smallvec::SmallVec; ๐Ÿ”’
use crate::diagnostics; ๐Ÿ”’
use crate::util::check_zero_tts; ๐Ÿ”’
use crate::util::get_single_str_from_tts; ๐Ÿ”’
use crate::util::get_single_str_spanned_from_tts; ๐Ÿ”’
use crate::util::parse_expr; ๐Ÿ”’

Functionsยง

expand_column ๐Ÿ”’
Expand column!() to the current column number.
expand_file ๐Ÿ”’
Expand file!() to the current filename.
expand_include ๐Ÿ”’
Expand include!($input).
expand_include_bytes ๐Ÿ”’
Expand include_bytes!($input) to the content of the file given by path $input.
expand_include_str ๐Ÿ”’
Expand include_str!($input) to the content of the UTF-8-encoded file given by path $input as a string literal.
expand_line ๐Ÿ”’
Expand line!() to the current line number.
expand_mod ๐Ÿ”’
Expand module_path!() to (a textual representation of) the current module path.
expand_stringify ๐Ÿ”’
Expand stringify!($input).
find_path_suggestion ๐Ÿ”’
load_binary_file ๐Ÿ”’