32,125 matches across 25 files for func main
snippet_mode: grep · sorted by relevance
LICENSE-APACHE LICENSE 2 matches view file →
42 editorial revisions, annotations, elaborations, or other modifications
43 represent, as a whole, an original work of authorship. For the purposes
44 of this License, Derivative Works shall not include works that remain
45 separable from, or merely link (or bind by name) to the interfaces of,
46 the Work and Derivative Works thereof.
· · ·
159 result of this License or out of the use or inability to use the
160 Work (including but not limited to damages for loss of goodwill,
161 work stoppage, computer failure or malfunction, or any and all
162 other commercial damages or losses), even if such Contributor
163 has been advised of the possibility of such damages.
LICENSES/Apache-2.0.txt PLAIN TEXT 2 matches view file →
21"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
23"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
25"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
· · ·
497. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
518. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
539. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
LICENSES/GPL-3.0-or-later.txt PLAIN TEXT 6 matches · showing 5 view file →
11The GNU General Public License is a free, copyleft license for software and other kinds of works.
12
13The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
14
15When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
· · ·
23For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
24
25Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
26
27Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
· · ·
63 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
64
65 You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
66
67 Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
· · ·
87 b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
88 c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
89 d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
90 e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
91
· · ·
94 A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
95
96 "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
97
98 If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+ 1 more matches in this file
RELEASES.md MARKDOWN 244 matches · showing 5 view file →
183- [Rust will use the v0 symbol mangling scheme by default.](https://github.com/rust-lang/rust/pull/151994) This may cause some tools (such as debuggers or profilers, especially with old versions) to fail to demangle symbols emitted by Rust. It may also cause the formatting of text in backtraces to change.
184- [Prevent deref coercions in `pin!`, in order to prevent unsoundness.](https://github.com/rust-lang/rust/pull/153457) The most likely case where this might impact users is: writing `pin!(x)` where `x` has type `&mut T` will now always correctly produce a value of type `Pin<&mut &mut T>`, instead of sometimes allowing a coercion that produces a value of type `Pin<&mut T>`. This coercion was previously incorrectly allowed since Rust 1.88.0.
185- [Deprecate `std::char` constants and functions](https://github.com/rust-lang/rust/pull/153873)
186- [Warn on linker output by default](https://github.com/rust-lang/rust/pull/153968)
187- [Remove hidden `f64` methods which have been deprecated since 1.0](https://github.com/rust-lang/rust/pull/153975)
· · ·
214- [Allow passing `expr` metavariable to `cfg`](https://github.com/rust-lang/rust/pull/146961)
215- [Always coerce never types in tuple expressions](https://github.com/rust-lang/rust/pull/147834)
216- [Avoid incorrect inference guidance of function arguments in rare cases](https://github.com/rust-lang/rust/pull/150316)
217- [Support s390x vector registers in inline assembly](https://github.com/rust-lang/rust/pull/154184)
218- [Allow using constants of type `ManuallyDrop` as patterns (fixing a regression introduced in 1.94.0)](https://github.com/rust-lang/rust/pull/154891)
· · ·
264- [Deprecation notes are now rendered like any other documentation](https://github.com/rust-lang/rust/pull/149931). Previously they used the css `white-space: pre-wrap;` property and stripped any `<p>` elements from the rendered html, however this caused issues and unintuitive behavior. The new behavior should be more predictable, however some multi-line deprecation notes will now be rendered as as single lines. If this is undesirable, you can use the standard markdown method of forcing a linebreak, which is two spaces followed by a newline (`"\n"`).
265- [Don't emit rustdoc `missing_doc_code_examples` lint on impl items](https://github.com/rust-lang/rust/pull/154048)
266- [Separate methods and associated functions in sidebar](https://github.com/rust-lang/rust/pull/154644)
267
268<a id="1.96.0-Compatibility-Notes"></a>
· · ·
273- [Prevent unsize-coercing into `Pin<Foo>` where `Foo` doesn't implement `Deref`. Some such coercions were previously allowed, but produce a type with no useful public API.](https://github.com/rust-lang/rust/pull/149218)
274- [rustc: Stop passing `--allow-undefined` on wasm targets](https://github.com/rust-lang/rust/pull/149868)
275- [Gate the accidentally stabilized `#![reexport_test_harness_main]` attribute](https://github.com/rust-lang/rust/pull/152210)
276- [Error on return-position-impl-trait-in-traits whose types are too private](https://github.com/rust-lang/rust/pull/152543)
277- [Report the `uninhabited_static` lint in dependencies and make it deny-by-default](https://github.com/rust-lang/rust/pull/152853)
· · ·
421- `mut ref` and `mut ref mut` patterns, part of the unstable [Match Ergonomics 2024 RFC](https://github.com/rust-lang/rust/issues/123076), were accidentally allowed on stable within struct pattern field shorthand. These patterns are now correctly feature-gated as unstable in this position.
422- [Add future-compatibility warning for derive helper attributes which conflict with built-in attributes](https://github.com/rust-lang/rust/pull/151152)
423- [JSON target specs](https://doc.rust-lang.org/rustc/targets/custom.html) have been destabilized and now require `-Z unstable-options` to use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for the `build-std` project adding that support, JSON target specs are being proactively gated to ensure they remain unstable even if `build-std` is stabilized. Cargo now includes the `-Z json-target-spec` CLI flag to automatically pass `-Z unstable-options` to the compiler when needed. See [#150151](https://github.com/rust-lang/rust/pull/150151), [#151534](https://github.com/rust-lang/rust/pull/150151), and [rust-lang/cargo#16557](https://github.com/rust-lang/cargo/pull/16557).
424- [The arguments of `#[feature]` attributes on invalid targets are now checked](https://github.com/rust-lang/rust/issues/153764)
425
+ 239 more matches in this file
bootstrap.example.toml TOML 3 matches view file →
599# Indicates that the build should be configured for debugging Rust. A
600# `debug`-enabled compiler and standard library will be somewhat
601# slower (due to e.g. checking of debug assertions) but should remain
602# usable.
603#
· · ·
858
859# Compile the compiler with a non-default ThinLTO import limit. This import
860# limit controls the maximum size of functions imported by ThinLTO. Decreasing
861# will make code compile faster at the expense of lower runtime performance.
862#rust.thin-lto-import-instr-limit = if incremental { 10 } else { LLVM default (currently 100) }
· · ·
941# If unset, the first upstream parent commit will be used.
942#
943# The SHA must point to a merge commit merged into the mainline rust-lang/rust `main` branch,
944# because bootstrap will attempt to download the JSON docs data for this commit from its CI.
945#rust.stdlib-semver-baseline = "<commit-sha>"
compiler/rustc_abi/src/lib.rs RUST 10 matches · showing 5 view file →
95 ///
96 /// `repr(Rust)` structs with only zero-sized fields, single-variant `repr(Rust)` enums with only
97 /// zero-sized fields, and zero-variant `repr(Rust)` enums must remain zero-sized as per
98 /// T-lang decisions in https://github.com/rust-lang/reference/pull/2262 and https://github.com/rust-lang/reference/pull/2293
99 const RANDOMIZE_LAYOUT = 1 << 4;
· · ·
430 /// [llvm data layout string](https://llvm.org/docs/LangRef.html#data-layout)
431 ///
432 /// This function doesn't fill `c_enum_min_size` and it will always be `I32` since it can not be
433 /// determined from llvm string.
434 pub fn parse_from_llvm_datalayout_string<'a>(
· · ·
641 ///
642 /// The theoretical maximum object size is defined as the maximum positive `isize` value.
643 /// This ensures that the `offset` semantics remain well-defined by allowing it to correctly
644 /// index every address within an object along with one byte past the end, along with allowing
645 /// `isize` to store the difference between any two pointers into an object.
· · ·
660 ///
661 /// The theoretical maximum object size is defined as the maximum positive `isize` value.
662 /// This ensures that the `offset` semantics remain well-defined by allowing it to correctly
663 /// index every address within an object along with one byte past the end, along with allowing
664 /// `isize` to store the difference between any two pointers into an object.
· · ·
1827 // FIXME(rustc_scalable_vector): Scalable vectors are `Sized` while the
1828 // `sized_hierarchy` feature is not yet fully implemented. After `sized_hierarchy` is
1829 // fully implemented, scalable vectors will remain `Sized`, they just won't be
1830 // `const Sized` - whether `is_unsized` continues to return `false` at that point will
1831 // need to be revisited and will depend on what `is_unsized` is used for.
+ 5 more matches in this file
compiler/rustc_arena/src/lib.rs RUST 4 matches view file →
30use smallvec::SmallVec;
31
32/// This calls the passed function while ensuring it won't be inlined into the caller.
33#[inline(never)]
34#[cold]
· · ·
226 //
227 // So we collect all the elements beforehand, which takes care of reentrancy and panic
228 // safety. This function is much less hot than `DroplessArena::alloc_from_iter`, so it
229 // doesn't need to be hyper-optimized.
230 assert!(size_of::<T>() != 0);
· · ·
546 assert!(size_of::<T>() != 0);
547
548 // Warning: this function is reentrant: `iter` could hold a reference to `&self` and
549 // allocate additional elements while we're iterating.
550 let iter = iter.into_iter();
· · ·
613///
614/// As an optimization, types that are `!Copy + !needs_drop` will actually be stored in the
615/// [`DroplessArena`], and the corresponding [`TypedArena`] will remain empty. This makes
616/// better use of the dropless arena's storage blocks, while the overhead of having a few
617/// unused typed-arenas is negligible.
compiler/rustc_ast/src/ast.rs RUST 35 matches · showing 5 view file →
2//!
3//! This module contains common structures forming the language AST.
4//! Two main entities in the module are [`Item`] (which represents an AST element with
5//! additional metadata), and [`ItemKind`] (which represents a concrete type and contains
6//! information specific to the type of the item).
· · ·
11//! - [`Pat`] and [`PatKind`]: A parsed Rust pattern. Patterns are often dual to expressions.
12//! - [`Stmt`] and [`StmtKind`]: An executable action that does not return a value.
13//! - [`FnDecl`], [`FnHeader`] and [`Param`]: Metadata associated with a function declaration.
14//! - [`Generics`], [`GenericParam`], [`WhereClause`]: Metadata associated with generic parameters.
15//! - [`EnumDef`] and [`Variant`]: Enum declaration.
· · ·
186}
187
188/// Like `join_path_syms`, but for `Ident`s. This function is necessary because
189/// `Ident::to_string` does more than just print the symbol in the `name` field.
190pub fn join_path_idents(path: impl IntoIterator<Item = impl Borrow<Ident>>) -> String {
· · ·
468
469/// Represents lifetime, type and const parameters attached to a declaration of
470/// a function, enum, trait, etc.
471#[derive(Clone, Encodable, Decodable, Debug, Default, Walkable)]
472pub struct Generics {
· · ·
1410 /// is a path, it mostly dispatches to [`Path::is_single_argless_ident`].
1411 ///
1412 /// This function will only allow paths with no qself, before dispatching to the `Path`
1413 /// function of the same name.
1414 ///
+ 30 more matches in this file
compiler/rustc_ast/src/entry.rs RUST 18 matches · showing 5 view file →
3#[derive(Debug)]
4pub enum EntryPointType {
5 /// This function is not an entrypoint.
6 None,
7 /// This is a function called `main` at the root level.
· · ·
7 /// This is a function called `main` at the root level.
8 /// ```
9 /// fn main() {}
· · ·
9 /// fn main() {}
10 /// ```
11 MainNamed,
· · ·
11 MainNamed,
12 /// This is a function with the `#[rustc_main]` attribute.
13 /// Used by the testing harness to create the test entrypoint.
· · ·
12 /// This is a function with the `#[rustc_main]` attribute.
13 /// Used by the testing harness to create the test entrypoint.
14 /// ```ignore (clashes with test entrypoint)
+ 13 more matches in this file
compiler/rustc_ast/src/visit.rs RUST 10 matches · showing 5 view file →
5//!
6//! Note: it is an important invariant that the default visitor walks the body
7//! of a function in "execution order" (more concretely, reverse post-order
8//! with respect to the CFG implied by the AST), meaning that if AST node A may
9//! execute before AST node B, then A is visited first. The borrow checker in
· · ·
769
770 // This is only used by the MutVisitor. We include this symmetry here to make writing other
771 // functions easier.
772 $(${ignore($lt)}
773 #[expect(unused, rustc::disallowed_pass_by_ref)]
· · ·
828 ) -> V::Result {
829 match self {
830 ItemKind::Fn(func) => {
831 let kind = FnKind::Fn(FnCtxt::Free, visibility, &$($mut)? *func);
832 try_visit!(vis.visit_fn(kind, attrs, span, id));
· · ·
831 let kind = FnKind::Fn(FnCtxt::Free, visibility, &$($mut)? *func);
832 try_visit!(vis.visit_fn(kind, attrs, span, id));
833 }
· · ·
890 AssocItemKind::Const(item) =>
891 visit_visitable!($($mut)? vis, item),
892 AssocItemKind::Fn(func) => {
893 let kind = FnKind::Fn(FnCtxt::Assoc(ctxt), visibility, &$($mut)? *func);
894 try_visit!(vis.visit_fn(kind, attrs, span, id))
+ 5 more matches in this file
compiler/rustc_ast_lowering/src/diagnostics.rs RUST 9 matches · showing 5 view file →
84#[derive(Diagnostic)]
85#[diag("`impl Trait` is not allowed in {$position}", code = E0562)]
86#[note("`impl Trait` is only allowed in arguments and return types of functions and methods")]
87pub(crate) struct MisplacedImplTrait<'a> {
88 #[primary_span]
· · ·
114
115#[derive(Diagnostic)]
116#[diag("`await` is only allowed inside `async` functions and blocks", code = E0728)]
117pub(crate) struct AwaitOnlyInAsyncFnAndBlocks {
118 #[primary_span]
· · ·
119 #[label("only allowed inside `async` functions and blocks")]
120 pub await_kw_span: Span,
121 #[label("this is not `async`")]
· · ·
124
125#[derive(Diagnostic)]
126#[diag("a function cannot be both `comptime` and `const`")]
127pub(crate) struct ConstComptimeFn {
128 #[primary_span]
· · ·
129 #[suggestion("remove the `const`", applicability = "machine-applicable", code = "")]
130 #[note("`const` implies the function can be called at runtime, too")]
131 pub span: Span,
132 #[label("`comptime` because of this")]
+ 4 more matches in this file
compiler/rustc_ast_lowering/src/expr.rs RUST 7 matches · showing 5 view file →
21use crate::diagnostics::{
22 AsyncCoroutinesNotSupported, AwaitOnlyInAsyncFnAndBlocks,
23 FunctionalRecordUpdateDestructuringAssignment, InclusiveRangeWithNoEnd,
24 InvalidLegacyConstGenericArg, MatchArmWithNoBody, MoveExprOnlyInPlainClosures,
25 NeverPatternWithBody, NeverPatternWithGuard, UnderscoreExprLhsAssign, UseConstGenericArg,
· · ·
806 let coroutine_kind = hir::CoroutineKind::Desugared(desugaring_kind, coroutine_source);
807
808 // The `async` desugaring takes a resume argument and maintains a `task_context`,
809 // whereas a generator does not.
810 let (inputs, params, task_context): (&[_], &[_], _) = match desugaring_kind {
· · ·
990 // Note that the name of this binding must not be changed to something else because
991 // debuggers and debugger extensions expect it to be called `__awaitee`. They use
992 // this name to identify what is being awaited by a suspended async functions.
993 let awaitee_ident = Ident::with_dummy_span(sym::__awaitee);
994 let (awaitee_pat, awaitee_pat_hid) =
· · ·
1349 let fields_omitted = match &se.rest {
1350 StructRest::Base(e) => {
1351 self.dcx().emit_err(FunctionalRecordUpdateDestructuringAssignment {
1352 span: e.span,
1353 });
· · ·
1927
1928 let (constructor_item, target_id) = match self.try_block_scope {
1929 TryBlockScope::Function => {
1930 (LangItem::TryTraitFromResidual, Err(hir::LoopIdError::OutsideLoopScope))
1931 }
+ 2 more matches in this file
compiler/rustc_ast_lowering/src/lib.rs RUST 20 matches · showing 5 view file →
260
261 // Lowering state.
262 try_block_scope: TryBlockScope::Function,
263 loop_scope: None,
264 is_in_loop_condition: false,
· · ·
335
336 // We do not need to look at `partial_res_overrides`. That map only contains overrides for
337 // `self_param` locals. And here we are looking for the function definition that `expr`
338 // resolves to.
339 let def_id = self.partial_res_map.get(&expr.id)?.full_res()?.opt_def_id()?;
· · ·
487enum TryBlockScope {
488 /// There isn't a `try` block, so a `?` will use `return`.
489 Function,
490 /// We're inside a `try { … }` block, so a `?` will block-break
491 /// from that block using a type depending only on the argument.
· · ·
816 /// The lowered item is registered into `self.children`.
817 ///
818 /// This function sets up `HirId` lowering infrastructure,
819 /// and stashes the shared mutable state to avoid pollution by the closure.
820 #[instrument(level = "debug", skip(self, f))]
· · ·
994 // This can happen when trying to lower the return type `x` in erroneous code like
995 // async fn foo(x: u8) -> x {}
996 // In that case, `x` is lowered as a function parameter, and the return type is lowered as
997 // an opaque type as a synthesized HIR owner.
998 res.unwrap_or(Res::Err)
+ 15 more matches in this file
compiler/rustc_attr_ir/src/data_structures.rs RUST 17 matches · showing 5 view file →
114 Never,
115 /// `#[rustc_force_inline]` forces inlining to happen in the MIR inliner - it reports an error
116 /// if the inlining cannot happen. It is limited to only free functions so that the calls
117 /// can always be resolved.
118 Force {
· · ·
649 /// Conceptually either forward or reverse mode AD, as described in various autodiff papers and
650 /// e.g. in the [JAX
651 /// Documentation](https://jax.readthedocs.io/en/latest/_tutorials/advanced-autodiff.html#how-it-s-made-two-foundational-autodiff-functions).
652 pub mode: DiffMode,
653 /// A user-provided, batching width. If not given, we will default to 1 (no batching).
· · ·
654 /// Calling a differentiated, non-batched function through a loop 100 times is equivalent to:
655 /// - Calling the function 50 times with a batch size of 2
656 /// - Calling the function 25 times with a batch size of 4,
· · ·
655 /// - Calling the function 50 times with a batch size of 2
656 /// - Calling the function 25 times with a batch size of 4,
657 /// etc. A batched function takes more (or longer) arguments, and might be able to benefit from
· · ·
656 /// - Calling the function 25 times with a batch size of 4,
657 /// etc. A batched function takes more (or longer) arguments, and might be able to benefit from
658 /// cache locality, better re-usal of primal values, and other optimizations.
+ 12 more matches in this file
compiler/rustc_attr_ir/src/encode_cross_crate.rs RUST 4 matches view file →
74 NoImplicitPrelude => No,
75 NoLink => No,
76 NoMain => No,
77 NoMangle(..) => Yes, // Needed for rustdoc
78 NoStd => No,
· · ·
87 Optimize(..) => No,
88 PanicRuntime => No,
89 PatchableFunctionEntry { .. } => Yes,
90 Path(..) => No,
91 PatternComplexityLimit { .. } => No,
· · ·
97 ProfilerRuntime => No,
98 RecursionLimit { .. } => No,
99 ReexportTestHarnessMain(..) => No,
100 RegisterTool { .. } => No,
101 Repr { .. } => No,
· · ·
161 RustcLintUntrackedQueryInformation => Yes,
162 RustcMacroTransparency(..) => Yes,
163 RustcMain => No,
164 RustcMir(..) => Yes,
165 RustcMustImplementOneOf { .. } => No,
compiler/rustc_attr_ir/src/lang_items.rs RUST 5 matches view file →
6//! * Traits that specify "kinds"; e.g., `Sync`, `Send`.
7//! * Traits that represent operators; e.g., `Add`, `Sub`, `Index`.
8//! * Functions called by the compiler itself.
9
10use rustc_data_structures::fx::FxIndexMap;
· · ·
339 FormatArguments, sym::format_arguments, format_arguments, Target::Struct, GenericRequirement::None;
340
341 // Compiler-generated drop glue function, aka `core::ptr::drop_glue`
342 DropGlue, sym::drop_glue, drop_glue_fn, Target::Fn, GenericRequirement::Exact(1);
343 AllocLayout, sym::alloc_layout, alloc_layout, Target::Struct, GenericRequirement::None;
· · ·
344
345 /// For all binary crates without `#![no_main]`, Rust will generate a "main" function.
346 /// The exact name and signature are target-dependent. The "main" function will invoke
347 /// this lang item, passing it the `argc` and `argv` (or null, if those don't exist
· · ·
346 /// The exact name and signature are target-dependent. The "main" function will invoke
347 /// this lang item, passing it the `argc` and `argv` (or null, if those don't exist
348 /// on the current target) as well as the user-defined `fn main` from the binary crate.
· · ·
348 /// on the current target) as well as the user-defined `fn main` from the binary crate.
349 Start, sym::start, start_fn, Target::Fn, GenericRequirement::Exact(1);
350
compiler/rustc_attr_ir/src/stability.rs RUST 3 matches view file →
49 pub level: StabilityLevel,
50 pub feature: Symbol,
51 /// whether the function has a `#[rustc_promotable]` attribute
52 pub promotable: bool,
53 /// This is true iff the `const_stable_indirect` attribute is present.
· · ·
89 pub level: StabilityLevel,
90 pub feature: Symbol,
91 /// whether the function has a `#[rustc_promotable]` attribute
92 pub promotable: bool,
93}
· · ·
113 /// Relevant `rust-lang/rust` issue.
114 issue: Option<NonZero<u32>>,
115 /// If part of a feature is stabilized and a new feature is added for the remaining parts,
116 /// then the `implied_by` attribute is used to indicate which now-stable feature previously
117 /// contained an item.
compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs RUST 15 matches · showing 5 view file →
10use crate::attributes::AttributeSafety;
11use crate::diagnostics::{
12 EmptyExportName, EmptySection, NakedFunctionIncompatibleAttribute, NullOnExport,
13 NullOnObjcClass, NullOnObjcSelector, NullOnSection, ObjcClassExpectedStringLiteral,
14 ObjcSelectorExpectedStringLiteral, SanitizeInvalidStatic, TargetFeatureOnLangItem,
· · ·
226 })];
227 const SAFETY: AttributeSafety = AttributeSafety::Unsafe {
228 note: "the `#[naked]` attribute adds the safety obligation that the function's body must respect the function’s calling convention, uphold its signature, and either return or diverge (i.e., not fall through past the end of the assembly code).",
229 unsafe_since: None,
230 };
· · ·
248 // * `#[test]`, `#[ignore]`, `#[should_panic]`
249 //
250 // NOTE: when making changes to this list, check that `error_codes/E0736.md` remains
251 // accurate.
252 const ALLOW_LIST: &[rustc_span::Symbol] = &[
· · ·
306
307 if other_attr.word_is(sym::target_feature) {
308 if !cx.features().naked_functions_target_feature() {
309 feature_err(
310 cx.sess(),
· · ·
311 sym::naked_functions_target_feature,
312 other_attr.span(),
313 "`#[target_feature(/* ... */)]` is currently unstable on `#[naked]` functions",
+ 10 more matches in this file
compiler/rustc_attr_parsing/src/attributes/doc.rs RUST 6 matches · showing 5 view file →
269
270 fn parse_cfg(&mut self, cx: &mut AcceptContext<'_, '_>, args: &ArgParser) {
271 // This function replaces cases like `cfg(all())` with `true`.
272 fn simplify_cfg(cfg_entry: &mut CfgEntry) {
273 match cfg_entry {
· · ·
375 }
376 ArgParser::List(list) => {
377 'main: for meta in list.mixed() {
378 let MetaItemOrLitParser::MetaItemParser(item) = meta else {
379 cx.emit_lint(
· · ·
418 item.span(),
419 );
420 continue 'main;
421 };
422 match sub_item.args() {
· · ·
424 let Some(name) = sub_item.path().word_sym() else {
425 cx.adcx().expected_identifier(sub_item.path().span());
426 continue 'main;
427 };
428 cfg_names.insert(name);
· · ·
432 let Some(sym::values) = sub_item.path().word_sym() else {
433 cx.adcx().expected_identifier(sub_item.path().span());
434 continue 'main;
435 };
436 if cfg_names.is_empty() {
+ 1 more matches in this file
compiler/rustc_attr_parsing/src/attributes/mod.rs RUST 5 matches view file →
2//!
3//! This module defines traits for attribute parsers, little state machines that recognize and parse
4//! attributes out of a longer list of attributes. The main trait is called [`AttributeParser`].
5//! You can find more docs about [`AttributeParser`]s on the trait itself.
6//! However, for many types of attributes, implementing [`AttributeParser`] is not necessary.
· · ·
89///
90/// Then, it defines what paths this group will accept in [`AttributeParser::ATTRIBUTES`].
91/// These are listed as pairs, of symbols and function pointers. The function pointer will
92/// be called when that attribute is found on an item, which can influence the state of the little
93/// state machine.
· · ·
94///
95/// Finally, after all attributes on an item have been seen, and possibly been accepted,
96/// the [`finalize`](AttributeParser::finalize) functions for all attribute parsers are called. Each can then report
97/// whether it has seen the attribute it has been looking for.
98///
· · ·
104 /// The symbols for the attributes that this parser is interested in.
105 ///
106 /// If an attribute has this symbol, the `accept` function will be called on it.
107 const ATTRIBUTES: AcceptMapping<Self>;
108 const ALLOWED_TARGETS: AllowedTargets<'_>;
· · ·
330
331 type Item;
332 /// A function that converts individual items (of type [`Item`](Self::Item)) into the final attribute.
333 ///
334 /// For example, individual representations from `#[repr(...)]` attributes into an `AttributeKind::Repr(x)`,
compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs RUST 10 matches · showing 5 view file →
20};
21
22pub(crate) struct RustcMainParser;
23
24impl NoArgsAttributeParser for RustcMainParser {
· · ·
24impl NoArgsAttributeParser for RustcMainParser {
25 const PATH: &[Symbol] = &[sym::rustc_main];
26 const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
· · ·
25 const PATH: &[Symbol] = &[sym::rustc_main];
26 const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
27 const STABILITY: AttributeStability = unstable!(
· · ·
28 rustc_attrs,
29 "the `rustc_main` attribute is used internally to specify test entry point function"
30 );
31 const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcMain;
· · ·
31 const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcMain;
32}
33
+ 5 more matches in this file
compiler/rustc_attr_parsing/src/context.rs RUST 5 matches view file →
225 Single<MustUseParser>,
226 Single<OptimizeParser>,
227 Single<PatchableFunctionEntryParser>,
228 Single<PathAttributeParser>,
229 Single<PatternComplexityLimitParser>,
· · ·
230 Single<ProcMacroDeriveParser>,
231 Single<RecursionLimitParser>,
232 Single<ReexportTestHarnessMainParser>,
233 Single<RustcAbiParser>,
234 Single<RustcAllocatorZeroedVariantParser>,
· · ·
283 Single<WithoutArgs<NoImplicitPreludeParser>>,
284 Single<WithoutArgs<NoLinkParser>>,
285 Single<WithoutArgs<NoMainParser>>,
286 Single<WithoutArgs<NoMangleParser>>,
287 Single<WithoutArgs<NoStdParser>>,
· · ·
333 Single<WithoutArgs<RustcLintQueryInstabilityParser>>,
334 Single<WithoutArgs<RustcLintUntrackedQueryInformationParser>>,
335 Single<WithoutArgs<RustcMainParser>>,
336 Single<WithoutArgs<RustcNeverReturnsNullPtrParser>>,
337 Single<WithoutArgs<RustcNoImplicitAutorefsParser>>,
· · ·
527 ///
528 /// This is a higher-level (and harder to misuse) wrapper over [`ArgParser::as_list`] that
529 /// allows using `?` when the attribute parsing function allows it. You may still want to use
530 /// [`ArgParser::as_list`] for the following reasons:
531 ///
compiler/rustc_attr_parsing/src/lib.rs RUST 5 matches view file →
11//! This crate (`rustc_attr_parsing`) handles how to convert raw tokens into those structures.
12//! This split allows other parts of the compiler to use the data structures without needing
13//! the parsing logic, making the codebase more modular and maintainable.
14//!
15//! ## Background
· · ·
16//! Previously, the compiler had a single attribute definition ([`ast::Attribute`]) with parsing and
17//! validation scattered throughout the codebase. This was reorganized for better maintainability
18//! (see [#131229](https://github.com/rust-lang/rust/issues/131229)).
19//!
· · ·
20//! ## Types of Attributes
21//! In Rust, attributes are markers that can be attached to items. They come in two main categories.
22//!
23//! ### 1. Active Attributes
· · ·
32//! They can be user-defined (in proc-macro helpers) or built-in. Examples of built-in inert attributes:
33//! - `#[stable()]`: Marks stable API items
34//! - `#[inline()]`: Suggests function inlining
35//! - `#[repr()]`: Controls type representation
36//!
· · ·
82//! However, sometimes an attributes' parsed form is needed before the HIR is constructed.
83//! This is referred to as "early" attribute parsing,
84//! and is performed using the `parse_limited_*` family of functions on `AttributeParser`.
85//!
86//! [`ast::Attribute`]: rustc_ast::ast::Attribute
compiler/rustc_borrowck/src/dataflow.rs RUST 31 matches · showing 5 view file →
5use rustc_mir_dataflow::fmt::DebugWithContext;
6use rustc_mir_dataflow::impls::{
7 EverInitializedPlaces, EverInitializedPlacesDomain, MaybeUninitializedPlaces,
8 MaybeUninitializedPlacesDomain,
9};
· · ·
8 MaybeUninitializedPlacesDomain,
9};
10use rustc_mir_dataflow::{Analysis, GenKill, JoinSemiLattice};
· · ·
16// `iterate_to_fixpoint`, but are instead composed from the results of three sub-analyses that are
17// computed individually with `iterate_to_fixpoint`. Because it's faster that way than having a
18// single analysis where the domain has three components.
19pub(crate) struct Borrowck<'a, 'tcx> {
20 pub(crate) borrows: Borrows<'a, 'tcx>,
· · ·
24
25impl<'a, 'tcx> Analysis<'tcx> for Borrowck<'a, 'tcx> {
26 type Domain = BorrowckDomain;
27
28 const NAME: &'static str = "borrowck";
· · ·
29
30 fn bottom_value(&self, body: &mir::Body<'tcx>) -> Self::Domain {
31 BorrowckDomain {
32 borrows: self.borrows.bottom_value(body),
+ 26 more matches in this file
compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs RUST 45 matches · showing 5 view file →
465 && let Some(pos) = args.iter().position(|arg| arg.hir_id == expr.hir_id)
466 {
467 // The move occurred as one of the arguments to a function call. Is that
468 // argument generic? `def_id` can't be a closure here, so using `fn_sig` is fine
469 let arg_param = if self.infcx.tcx.def_kind(def_id).is_fn_like()
· · ·
479
480 // If the moved value is a mut reference, it is used in a
481 // generic function and it's type is a generic param, it can be
482 // reborrowed to avoid moving.
483 // for example:
· · ·
515 && let Some(arg) = fn_decl.inputs.get(pos + offset)
516 {
517 // If we can't suggest borrowing in the call, but the function definition
518 // is local, instead offer changing the function to borrow that argument.
519 let mut span: MultiSpan = arg.span.into();
· · ·
518 // is local, instead offer changing the function to borrow that argument.
519 let mut span: MultiSpan = arg.span.into();
520 span.push_span_label(
· · ·
523 );
524 let descr = match node.fn_kind() {
525 Some(hir::intravisit::FnKind::ItemFn(..)) | None => "function",
526 Some(hir::intravisit::FnKind::Method(..)) => "method",
527 Some(hir::intravisit::FnKind::Closure) => "closure",
+ 40 more matches in this file
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.