Home
last modified time | relevance | path

Searched +full:hir +full:- +full:expand (Results 1 – 25 of 71) sorted by relevance

123

/third_party/rust/rust/src/tools/rust-analyzer/
DCargo.toml3 exclude = ["crates/proc-macro-test/imp"]
7 rust-version = "1.66"
9 license = "MIT OR Apache-2.0"
10 authors = ["rust-analyzer team"]
19 rowan.opt-level = 3
20 rustc-hash.opt-level = 3
21 smol_str.opt-level = 3
22 text-size.opt-level = 3
24 miniz_oxide.opt-level = 3
31 [patch.'crates-io']
[all …]
DCargo.lock8 source = "registry+https://github.com/rust-lang/crates.io-index"
17 source = "registry+https://github.com/rust-lang/crates.io-index"
21 name = "always-assert"
23 source = "registry+https://github.com/rust-lang/crates.io-index"
32 source = "registry+https://github.com/rust-lang/crates.io-index"
37 version = "1.0.0-beta.2"
38 source = "registry+https://github.com/rust-lang/crates.io-index"
44 source = "registry+https://github.com/rust-lang/crates.io-index"
50 source = "registry+https://github.com/rust-lang/crates.io-index"
56 source = "registry+https://github.com/rust-lang/crates.io-index"
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/hir/
DCargo.toml2 name = "hir"
9 rust-version.workspace = true
15 rustc-hash = "1.1.0"
24 base-db.workspace = true
26 hir-def.workspace = true
27 hir-expand.workspace = true
28 hir-ty.workspace = true
/third_party/rust/rust/src/tools/rust-analyzer/crates/hir-expand/src/
Dbuiltin_attr_macro.rs6 ( $(($name:ident, $variant:ident) => $expand:ident),* ) => {
13 pub fn expand(
18 ) -> ExpandResult<tt::Subtree> {
20 $( BuiltinAttrExpander::$variant => $expand, )*
25 fn find_by_name(name: &name::Name) -> Option<Self> {
37 pub fn is_derive(self) -> bool { in is_derive()
40 pub fn is_test(self) -> bool { in is_test()
43 pub fn is_bench(self) -> bool { in is_bench()
58 pub fn find_builtin_attr(ident: &name::Name) -> Option<BuiltinAttrExpander> { in find_builtin_attr()
66 ) -> ExpandResult<tt::Subtree> { in dummy_attr_expand()
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/hir-ty/
DCargo.toml2 name = "hir-ty"
9 rust-version.workspace = true
15 cov-mark = "2.0.0-pre.1"
23 rustc-hash = "1.1.0"
24 scoped-tls = "1.0.0"
25 chalk-solve = { version = "0.91.0", default-features = false }
26 chalk-ir = "0.91.0"
27 chalk-recursive = { version = "0.91.0", default-features = false }
28 chalk-derive = "0.91.0"
29 la-arena = { version = "0.3.0", path = "../../lib/la-arena" }
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/.github/workflows/
Dautopublish.yaml6 # - cron: "0 0 * * *" # midnight UTC
10 - release
15 runs-on: ubuntu-latest
17 - name: Checkout repository
20 fetch-depth: 0
22 - name: Install Rust toolchain
23 run: rustup update --no-self-update stable
25 - name: Install cargo-workspaces
26 run: cargo install cargo-workspaces
28 - name: Publish Crates
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/hir-def/
DCargo.toml2 name = "hir-def"
9 rust-version.workspace = true
15 anymap = "1.0.0-beta.2"
18 cov-mark = "2.0.0-pre.1"
19 # We need to freeze the version of the crate, as the raw-api feature is considered unstable
20 dashmap = { version = "=5.4.0", features = ["raw-api"] }
23 fst = { version = "0.4.7", default-features = false }
24 hashbrown = { version = "0.12.1", default-features = false }
27 la-arena = { version = "0.3.0", path = "../../lib/la-arena" }
29 rustc-hash = "1.1.0"
[all …]
/third_party/rust/rust/src/librustdoc/html/render/
Dspan_map.rs9 use rustc_middle::hir::nested_filter;
46 ) -> (FxHashMap<PathBuf, String>, FxHashMap<Span, LinkFromSrc>) { in collect_spans_and_sources()
51 tcx.hir().walk_toplevel_module(&mut visitor); in collect_spans_and_sources()
66 /// This function is where we handle `hir::Path` elements and add them into the "span map".
75 // FIXME: Doesn't handle "path-like" primitives like arrays or tuples. in handle_path()
82 if let Some(span) = self.tcx.hir().res_span(path.res) { in handle_path()
96 fn handle_macro(&mut self, span: Span) -> bool { in handle_macro()
104 // Macros can expand to code containing macros, which will in turn be expanded, etc. in handle_macro()
139 fn nested_visit_map(&mut self) -> Self::Map { in nested_visit_map()
140 self.tcx.hir() in nested_visit_map()
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/hir-expand/
DCargo.toml2 name = "hir-expand"
9 rust-version.workspace = true
15 cov-mark = "2.0.0-pre.1"
18 rustc-hash = "1.1.0"
19 la-arena = { version = "0.3.0", path = "../../lib/la-arena" }
22 "inline-more",
23 ], default-features = false }
30 base-db.workspace = true
38 [dev-dependencies]
39 expect-test = "1.4.0"
/third_party/rust/rust/compiler/rustc_builtin_macros/src/
Dlib.rs1 //! This crate contains implementations of built-in macros and other code generating facilities
2 //! injecting code into the crate before it is lowered to HIR.
4 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
104 alloc_error_handler: alloc_error_handler::expand, in register_builtin_macros()
107 cfg_eval: cfg_eval::expand, in register_builtin_macros()
110 global_allocator: global_allocator::expand, in register_builtin_macros()
/third_party/rust/rust/src/tools/rust-analyzer/crates/ide/src/
Dexpand_macro.rs1 use hir::Semantics;
15 // Feature: Expand Macro Recursively
22 // | VS Code | **rust-analyzer: Expand macro recursively**
25 // image::https://user-images.githubusercontent.com/48062697/113020648-b3973180-917a-11eb-84a9-ecb9…
26 pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option<ExpandedMacro> { in expand_macro()
35 // due to how rust-analyzer works internally, we need to special case derive attributes, in expand_macro()
36 // otherwise they might not get found, e.g. here with the cursor at $0 `#[attr]` would expand: in expand_macro()
51 let token = hir::InFile::new(hir_file, descended).upmap(db)?.value; in expand_macro()
71 // currently we only recursively expand one of the two types in expand_macro()
107 ) -> Option<SyntaxNode> { in expand_macro_recur()
[all …]
/third_party/rust/rust/src/tools/clippy/book/src/development/
Dlint_passes.md11 Let us expand on these two traits more below.
19 > Context for lint checking of the AST, after expansion, before lowering to HIR.
24 be our trait choice for a new lint if the lint only deals with syntax-related issues.
34 $ cargo dev new_lint --name=<your_new_lint> --pass=early --category=<your_category_choice>
53 define new lints <!-- FIXME: add link --> chapter.
69 deal with type-checking, which do not exist in `EarlyContext`, such as:
71 - [`maybe_typeck_results`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/context/struc…
72 - [`typeck_results`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/context/struct.Late…
100 that require the inspection of other nodes, which is easier at the HIR level.
107 $ cargo dev new_lint --name=<your_new_lint> --pass=late --category=<your_category_choice>
[all …]
/third_party/rust/rust/compiler/rustc_interface/src/
Dpasses.rs45 pub fn parse<'a>(sess: &'a Session) -> PResult<'a, ast::Crate> { in parse()
55 eprintln!("Pre-expansion node count: {}", count_nodes(&krate)); in parse()
63 hir_stats::print_ast_stats(&krate, "PRE EXPANSION AST STATS", "ast-stats-1"); in parse()
69 fn count_nodes(krate: &ast::Crate) -> usize { in count_nodes()
81 ) -> Result<LintStore> { in register_plugins()
174 ) -> ast::Crate { in configure_and_expand()
194 // Expand all macros in configure_and_expand()
230 let cfg = rustc_expand::expand::ExpansionConfig { in configure_and_expand()
237 ..rustc_expand::expand::ExpansionConfig::default(crate_name.to_string()) in configure_and_expand()
243 // Expand macros now! in configure_and_expand()
[all …]
/third_party/rust/rust/compiler/rustc_hir_analysis/src/astconv/
Dbounds.rs3 use rustc_hir as hir;
24 ast_bounds: &'tcx [hir::GenericBound<'tcx>], in add_implicitly_sized()
25 self_ty_where_predicates: Option<(LocalDefId, &'tcx [hir::WherePredicate<'tcx>])>, in add_implicitly_sized()
32 let mut search_bounds = |ast_bounds: &'tcx [hir::GenericBound<'tcx>]| { in add_implicitly_sized()
34 if let hir::GenericBound::Trait(ptr, hir::TraitBoundModifier::Maybe) = ab { in add_implicitly_sized()
46 if let hir::WherePredicate::BoundPredicate(pred) = clause { in add_implicitly_sized()
88 /// ^ ^^^^^ `ast_bounds` parameter, in HIR form
99 pub(crate) fn add_bounds<'hir, I: Iterator<Item = &'hir hir::GenericBound<'hir>>>( in add_bounds() argument
109 hir::GenericBound::Trait(poly_trait_ref, modifier) => { in add_bounds()
111 hir::TraitBoundModifier::MaybeConst => { in add_bounds()
[all …]
Dobject_safety.rs6 use rustc_hir as hir;
25 hir_id: hir::HirId, in conv_object_ty_poly_trait_ref()
26 hir_trait_bounds: &[hir::PolyTraitRef<'_>], in conv_object_ty_poly_trait_ref()
27 lifetime: &hir::Lifetime, in conv_object_ty_poly_trait_ref()
30 ) -> Ty<'tcx> { in conv_object_ty_poly_trait_ref()
86 // Expand trait aliases recursively and check that only one regular (non-auto) trait in conv_object_ty_poly_trait_ref()
105 "additional non-auto trait", in conv_object_ty_poly_trait_ref()
108 first_trait.label_with_exp_info(&mut err, "first non-auto trait", "first use"); in conv_object_ty_poly_trait_ref()
119 "auto-traits like `Send` and `Sync` are traits that have special properties; \ in conv_object_ty_poly_trait_ref()
121 <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>", in conv_object_ty_poly_trait_ref()
[all …]
/third_party/rust/rust/src/tools/clippy/clippy_lints/src/
Dfrom_over_into.rs13 use rustc_middle::{hir::nested_filter::OnlyBodies, ty};
30 /// fn into(self) -> StringWrapper {
40 /// fn from(s: String) -> StringWrapper {
57 pub fn new(msrv: Msrv) -> Self { in new()
93 … https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence" in check_item()
126 fn nested_visit_map(&mut self) -> Self::Map { in nested_visit_map()
127 self.cx.tcx.hir() in nested_visit_map()
159 ) -> Option<Vec<(Span, String)>> { in convert_to_from()
161 // It's tricky to expand self-aliases correctly, we'll ignore it to not cause a in convert_to_from()
165 let impl_item = cx.tcx.hir().impl_item(impl_item_ref.id); in convert_to_from()
[all …]
/third_party/rust/rust/compiler/rustc_hir_typeck/src/
D_match.rs4 use rustc_hir::{self as hir, ExprKind};
18 expr: &'tcx hir::Expr<'tcx>, in check_match()
19 scrut: &'tcx hir::Expr<'tcx>, in check_match()
20 arms: &'tcx [hir::Arm<'tcx>], in check_match()
22 match_src: hir::MatchSource, in check_match()
23 ) -> Ty<'tcx> { in check_match()
83 hir::Guard::If(e) => { in check_match()
86 hir::Guard::IfLet(l) => { in check_match()
101 let (arm_block_id, arm_span) = if let hir::ExprKind::Block(blk, _) = arm.body.kind { in check_match()
131 // We use it this way to be able to expand on the potential error and detect when a in check_match()
[all …]
/third_party/rust/rust/compiler/rustc_middle/src/ty/
Dconsts.rs6 use rustc_hir as hir;
51 pub fn ty(self) -> Ty<'tcx> { in ty()
56 pub fn kind(self) -> ConstKind<'tcx> { in kind()
61 pub fn new(tcx: TyCtxt<'tcx>, kind: ty::ConstKind<'tcx>, ty: Ty<'tcx>) -> Const<'tcx> { in new()
66 pub fn new_param(tcx: TyCtxt<'tcx>, param: ty::ParamConst, ty: Ty<'tcx>) -> Const<'tcx> { in new_param()
71 pub fn new_var(tcx: TyCtxt<'tcx>, infer: ty::ConstVid<'tcx>, ty: Ty<'tcx>) -> Const<'tcx> { in new_var()
76 pub fn new_fresh(tcx: TyCtxt<'tcx>, fresh: u32, ty: Ty<'tcx>) -> Const<'tcx> { in new_fresh()
81 pub fn new_infer(tcx: TyCtxt<'tcx>, infer: ty::InferConst<'tcx>, ty: Ty<'tcx>) -> Const<'tcx> { in new_infer()
91 ) -> Const<'tcx> { in new_bound()
100 ) -> Const<'tcx> { in new_placeholder()
[all …]
/third_party/mesa3d/src/compiler/glsl/
DREADME3 1) lex and yacc-based preprocessor takes the incoming shader string
9 2) lex and yacc-based parser takes the preprocessed string and
13 3) The AST is converted to "HIR". This is the intermediate
41 Q: What is HIR versus IR versus LIR?
44 high-level IR ("HIR"), with things like matrix operations, structure
52 requirements from a LIR. A 915-generation chipset wants all functions
59 would want to break to have (almost) all operations down channel-wise
61 low-level IR that will make everyone happy. So that usage has fallen
63 to take the HIR down to whatever restrictions it wants to impose
71 ./glsl_compiler --dump-lir \
[all …]
/third_party/rust/crates/regex/regex-syntax/src/hir/
Dmod.rs2 Defines a high-level intermediate representation for regular expressions.
12 use crate::hir::interval::{Interval, IntervalSet, IntervalSetIter};
15 pub use crate::hir::visitor::{visit, Visitor};
24 /// An error that can occur while translating an `Ast` to a `Hir`.
38 pub fn kind(&self) -> &ErrorKind { in kind()
45 pub fn pattern(&self) -> &str { in pattern()
50 pub fn span(&self) -> &Span { in span()
55 /// The type of an error that occurred while building an `Hir`.
59 /// support is disabled. For example `(?-u:\pL)` would trigger this error.
62 /// sequence that isn't UTF-8 and `allow_invalid_utf8` was disabled.
[all …]
/third_party/rust/rust/src/tools/clippy/clippy_utils/src/
Dmacros.rs8 use rustc_hir::{self as hir, Expr, ExprKind, HirId, Node, QPath};
36 pub fn is_format_macro(cx: &LateContext<'_>, macro_def_id: DefId) -> bool { in is_format_macro()
63 pub fn is_local(&self) -> bool { in is_local()
69 pub fn expn_backtrace(mut span: Span) -> impl Iterator<Item = (ExpnId, ExpnData)> { in expn_backtrace()
83 pub fn span_is_local(span: Span) -> bool { in span_is_local()
88 pub fn expn_is_local(expn: ExpnId) -> bool { in expn_is_local()
102 pub fn macro_backtrace(span: Span) -> impl Iterator<Item = MacroCall> { in macro_backtrace()
121 pub fn root_macro_call(span: Span) -> Option<MacroCall> { in root_macro_call()
127 pub fn root_macro_call_first_node(cx: &LateContext<'_>, node: &impl HirNode) -> Option<MacroCall> { in root_macro_call_first_node()
136 pub fn first_node_macro_backtrace(cx: &LateContext<'_>, node: &impl HirNode) -> impl Iterator<Item … in first_node_macro_backtrace()
[all …]
/third_party/rust/rust/compiler/rustc_middle/src/query/
Derase.rs22 pub fn erase<T: EraseType>(src: T) -> Erase<T> {
38 pub fn restore<T: EraseType>(value: Erase<T>) -> T { in restore()
153 impl EraseType for Option<rustc_middle::hir::Owner<'_>> {
154 type Result = [u8; size_of::<Option<rustc_middle::hir::Owner<'static>>>()];
207 Option<rustc_ast::expand::allocator::AllocatorKind>,
227 rustc_ast::expand::allocator::AllocatorKind,
310 rustc_middle::hir::Owner,
/third_party/rust/rust/src/tools/rust-analyzer/editors/code/src/
Dcommands.ts2 import * as lc from "vscode-languageclient";
20 import { LanguageClient } from "vscode-languageclient/node";
29 readonly uri = vscode.Uri.parse("rust-analyzer-status://status");
50 vscode.workspace.registerTextDocumentContentProvider("rust-analyzer-status", tdcp)
65 readonly uri = vscode.Uri.parse("rust-analyzer-memory://memory");
72 return "Per-query memory usage:\n" + mem + "\n(note: database has been cleared)";
82 vscode.workspace.registerTextDocumentContentProvider("rust-analyzer-memory", tdcp)
285 await ctx.treeView?.reveal(dep, { select: true, expand: true });
295 * - core
296 * - alloc
[all …]
/third_party/rust/rust/compiler/rustc_ast_lowering/src/
Dexpr.rs14 use rustc_hir as hir;
23 impl<'hir> LoweringContext<'_, 'hir> {
24 fn lower_exprs(&mut self, exprs: &[AstP<Expr>]) -> &'hir [hir::Expr<'hir>] { in lower_exprs() argument
28 pub(super) fn lower_expr(&mut self, e: &Expr) -> &'hir hir::Expr<'hir> { in lower_expr() argument
32 pub(super) fn lower_expr_mut(&mut self, e: &Expr) -> hir::Expr<'hir> { in lower_expr_mut() argument
38 // Include parens in span, but only if it is a super-span. in lower_expr_mut()
61 … // This also needs special handling because the HirId of the returned `hir::Expr` will not in lower_expr_mut()
73 ExprKind::Array(exprs) => hir::ExprKind::Array(self.lower_exprs(exprs)), in lower_expr_mut()
75 let c = self.with_new_scopes(|this| hir::ConstBlock { in lower_expr_mut()
80 hir::ExprKind::ConstBlock(c) in lower_expr_mut()
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/ide-completion/src/completions/
Ddot.rs79 Some(hir::known::SELF_PARAM), in complete_undotted_self()
84 |acc, field, ty| acc.add_tuple_field(ctx, Some(hir::known::SELF_PARAM), field, &ty), in complete_undotted_self()
95 Some(hir::known::SELF_PARAM), in complete_undotted_self()
104 receiver: &hir::Type, in complete_fields()
105 mut named_field: impl FnMut(&mut Completions, hir::Field, hir::Type), in complete_fields()
106 mut tuple_index: impl FnMut(&mut Completions, usize, hir::Type), in complete_fields()
118 if !seen_names.contains(&hir::Name::new_tuple_field(i)) { in complete_fields()
128 receiver: &hir::Type, in complete_methods()
129 mut f: impl FnMut(hir::Function), in complete_methods()
186 //- /main.rs crate:main deps:std in no_unstable_method_on_stable()
[all …]

123