about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2023-12-21Add support for hexagon-unknown-none-elf as targetBrian Cain-0/+268
Signed-off-by: Brian Cain <bcain@quicinc.com>
2023-12-20Rollup merge of #119115 - GuillaumeGomez:env-docs, r=NilstriebGuillaume Gomez-1/+20
Update documentation for `--env` compilation flag Part of https://github.com/rust-lang/rust/issues/80792. As mentioned in https://github.com/rust-lang/rust/pull/118830. It adds a mention to `tracked_env::var` and also clarifies what triggers a new compilation. r? `@Nilstrieb`
2023-12-20Add link to explanations about dep-info filesGuillaume Gomez-1/+2
2023-12-20Rollup merge of #119102 - chrisnc:arm-none-eabi-docs, r=wesleywiserMatthias Krüger-106/+176
Add arm-none-eabi and armv7r-none-eabi platform-support documentation. Mostly collecting existing information that's common to all arm-none-eabi targets and putting it in one file and adding a new file with specific details about armv7r.
2023-12-19Update documentation for `--env` compilation flagGuillaume Gomez-1/+19
2023-12-19Rollup merge of #119087 - rustbot:docs-update, r=ehussMatthias Krüger-0/+0
Update books ## rust-lang/edition-guide 2 commits in 34fca48ed284525b2f124bf93c51af36d6685492..bbffb074e16bef89772818b400b6c76a65eac126 2023-12-11 18:46:08 UTC to 2023-12-06 21:38:11 UTC - Update links and text about rustfix. (rust-lang/edition-guide#287) - Add C-string literals. (rust-lang/edition-guide#286) ## rust-embedded/book 1 commits in 22bca3d0f6e9b9b556689b54ce96f25b46ecd1b3..3f9df2b9885c6741365da2e12ed6662cd0e827d6 2023-12-11 21:22:20 UTC to 2023-12-11 21:22:20 UTC - #363 (rust-embedded/book#364) ## rust-lang/nomicon 2 commits in 83d015105e6d490fc30d6c95da1e56152a50e228..f6bd083c4ccfc4ce6699b8b4154e3c45c5a27a8c 2023-12-10 03:19:24 UTC to 2023-12-10 03:18:32 UTC - Minor improvements to Vec (rust-lang/nomicon#415) - Improve the `PhantomData` table (rust-lang/nomicon#417) ## rust-lang/reference 1 commits in 692d216f5a1151e8852ddb308ba64040e634c876..f9f5b5babd95515e7028c32d6ca4d9790f64c146 2023-12-10 16:16:17 UTC to 2023-12-10 16:16:17 UTC - Document object unsafety of async-fn-in-trait (rust-lang/reference#1435) ## rust-lang/rust-by-example 11 commits in da0a06aada31a324ae84a9eaee344f6a944b9683..4c2b24ff9d9cf19f2fcff799a3a49b9a2c50ae8e 2023-12-18 13:02:23 UTC to 2023-12-10 12:10:43 UTC - nested destructure example for structs (rust-lang/rust-by-example#1787) - Make example in pipe.md compatible with both Windows and Unix-type system with less code (rust-lang/rust-by-example#1780) - Add i18n support (rust-lang/rust-by-example#1760) - Add pub keyword before mod bar definition in doc.md (rust-lang/rust-by-example#1785) - Update address and title of github source of rust playground in playground.md (rust-lang/rust-by-example#1784) - Update example in ffi.md to make it compatible with both Windows OS and Unit-type systems (rust-lang/rust-by-example#1781) - Update the path of html_playground_url in playground.md (rust-lang/rust-by-example#1783) - Update unit_testing.md ignore running the last example because it's test (rust-lang/rust-by-example#1782) - Update example in fs.md and use target_family instead of target_os (rust-lang/rust-by-example#1779) - Update the example in pipe.md to make it compatible with both Windows OS and Unix-type systems (rust-lang/rust-by-example#1778) - Update the example in fs.md to ensure compatibility with both Window and Unix-type systems. (rust-lang/rust-by-example#1777) ## rust-lang/rustc-dev-guide 7 commits in 904bb5aa7b21adad58ffae610e2830c7b0f813b0..0610665a8687b1b0aa037917a1598b9f2a21e3ef 2023-12-17 17:21:38 UTC to 2023-12-05 16:40:26 UTC - add a mailmap (rust-lang/rustc-dev-guide#1839) - Move Editions chapter to "Contributing to Rust". (rust-lang/rustc-dev-guide#1838) - Remove feature edition fields. (rust-lang/rustc-dev-guide#1836) - Add a chapter on editions. (rust-lang/rustc-dev-guide#1835) - Remove mentions of plugin lints (rust-lang/rustc-dev-guide#1833) - Fix typo of unused_parens (rust-lang/rustc-dev-guide#1832) - Replace experts map with reviewers from triagebot (rust-lang/rustc-dev-guide#1831)
2023-12-18Add arm-none-eabi and armv7r-none-eabi platform-support documentation.Chris Copeland-106/+176
2023-12-19Auto merge of #119074 - leohowell:new-aarch64-apple-watchos-target, ↵bors-0/+4
r=wesleywiser Add new tier 3 aarch64-apple-watchos target Apple Xcode 14/15 releases add a new apple watchos target architecture arm64 out of arm64_32 and armv7k, now add a new tier 3 target support for this target. ### Tier 3 Target Requirements Adds support for Apple WatchOS aarch64-apple-watchos target. Below are details on how this target meets the requirements for tier 3: > tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) `@leohowell` has volunteered to be the target maintainer. I am also happy to help if a second maintainer is required. > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. Uses the same naming as the LLVM target, and the same convention as other Apple targets. > Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. I don't believe there is any ambiguity here. > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. I don't see any legal issues here. > The target must not introduce license incompatibilities. > Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). > The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. > If the target supports building host tools (such as rustc or cargo), those host tools must not depend on proprietary (non-FOSS) libraries, other than ordinary runtime libraries supplied by the platform and commonly used by other binaries built for the target. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. > Targets should not require proprietary (non-FOSS) components to link a functional binary or library. > "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. I see no issues with any of the above. > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. > This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. Only relevant to those making approval decisions. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. core and alloc can be used. std support will be added in a subsequent PR. > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running tests (even if they do not pass), the documentation must explain how to run tests for the target, using emulation if possible or dedicated hardware if necessary. Use --target= option to cross compile, just like any target. Tests can be run using the WatchOS simulator (see https://developer.apple.com/documentation/xcode/running-your-app-in-the-simulator-or-on-a-device). > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. > Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. I don't foresee this being a problem. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. > In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. No other targets should be affected by the pull request. r? compiler-team
2023-12-18Update booksrustbot-0/+0
2023-12-18fix typo in stable doc codegen-options chapterRémy Rakic-1/+1
2023-12-18describe unstable self-contained linking components in the unstable bookRémy Rakic-0/+24
2023-12-18Add new tier 3 aarch64-apple-watchos targetleohowell-0/+4
2023-12-16describe unstable linker flavors in the unstable bookRémy Rakic-0/+32
2023-12-16remove unstable linker flavors from stable documentationRémy Rakic-3/+0
2023-12-14Auto merge of #118417 - anforowicz:default-hidden-visibility, r=TaKO8Kibors-0/+12
Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`. The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/656
2023-12-13Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`.Lukasz Anforowicz-0/+12
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/656
2023-12-12Change a typo mistake in the-doc-attribute.md Hosssein-1/+1
I guess that `Bar` in the section I changed should be `bar` because when I run the program it has its page under struct but bar doesn't have any page.
2023-12-11Rollup merge of #118827 - Nilstrieb:linker-plugin-lto, r=ehussMatthias Krüger-2/+6
Update table for linker-plugin-lto docs
2023-12-11Update table for linker-plugin-lto docsNilstrieb-2/+6
2023-12-11Edit target doc template to remove emailNilstrieb-1/+1
We don't really want to communicate with target maintainers via email. GitHub is where everything happens, people should have a GitHub account that can be pinged on issues. This doesn't necessarily have to be a strict rule, but edit the template to suggest this. The previous template made it look like we care about having an email address, which we do not.
2023-12-10Auto merge of #118368 - GuillaumeGomez:env-flag, r=Nilstriebbors-0/+26
Implement `--env` compiler flag (without `tracked_env` support) Part of https://github.com/rust-lang/rust/issues/80792. Implementation of https://github.com/rust-lang/compiler-team/issues/653. Not an implementation of https://github.com/rust-lang/rfcs/pull/2794. It adds the `--env` compiler flag option which allows to set environment values used by `env!` and `option_env!`. Important to note: When trying to retrieve an environment variable value, it will first look into the ones defined with `--env`, and if there isn't one, then only it will look into the environment variables. So if you use `--env PATH=a`, then `env!("PATH")` will return `"a"` and not the actual `PATH` value. As mentioned in the title, `tracked_env` support is not added here. I'll do it in a follow-up PR. r? rust-lang/compiler
2023-12-10Add (unstable) documentation for `--env` command line optionGuillaume Gomez-0/+26
2023-12-09Auto merge of #118150 - roblabla:new-win7-targets, r=davidtwcobors-0/+83
Add new targets {x86_64,i686}-win7-windows-msvc This PR adds two new Tier 3 targets, x86_64-win7-windows-msvc and i686-win7-windows-msvc, that aim to support targeting Windows 7 after the `*-pc-windows-msvc` target drops support for it (slated to happen in 1.76.0). # Tier 3 target policy > At this tier, the Rust project provides no official support for a target, so we place minimal requirements on the introduction of targets. > > A proposed new tier 3 target must be reviewed and approved by a member of the compiler team based on these requirements. The reviewer may choose to gauge broader compiler team consensus via a [Major Change Proposal (MCP)](https://forge.rust-lang.org/compiler/mcp.html). > > A proposed target or target-specific patch that substantially changes code shared with other targets (not just target-specific code) must be reviewed and approved by the appropriate team for that shared code before acceptance. > > - A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) This is me, `@roblabla` on github. > - Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. I went with naming the target `x86_64-win7-windows-msvc`, inserting the `win7` in the vendor field (usually set to to `pc`). This is done to avoid ecosystem churn, as quite a few crates have `cfg(target_os = "windows")` or `cfg(target_env = "msvc")`, but nearly no `cfg(target_vendor = "pc")`. Since my goal is to be able to seamlessly swap to the `win7` target, I figured it'd be easier this way. > - Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. I believe the naming is pretty explicit. > - If possible, use only letters, numbers, dashes and underscores for the name. Periods (`.`) are known to cause issues in Cargo. The name comforms to this requirement. > - Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. > - The target must not introduce license incompatibilities. > - Anything added to the Rust repository must be under the standard Rust license (`MIT OR Apache-2.0`). > - The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the `tidy` tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. > - Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, `rustc` built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. > - "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are *not* limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. As far as I understand it, this target has exactly the same legal situation as the existing Tier 1 x86_64-pc-windows-msvc. > - Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. > - This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. Understood. > - Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. This target supports the whole libstd surface, since it's essentially reusing all of the x86_64-pc-windows-msvc target. Understood. > - The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. Wrote some documentation on how to build, test and cross-compile the target in the `platform-support` part. Hopefully it's enough to get started. > - Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via ``@`)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. > - Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. Understood. > - Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. > - In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. Understood. > If a tier 3 target stops meeting these requirements, or the target maintainers no longer have interest or time, or the target shows no signs of activity and has not built for some time, or removing the target would improve the quality of the Rust codebase, we may post a PR to remove it; any such PR will be CCed to the target maintainers (and potentially other people who have previously worked on the target), to check potential interest in improving the situation. Understood.
2023-12-09Auto merge of #117873 - quininer:android-emutls, r=Amanieubors-0/+2
Add emulated TLS support This is a reopen of https://github.com/rust-lang/rust/pull/96317 . many android devices still only use 128 pthread keys, so using emutls can be helpful. Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false. This commit has some changes to allow users to enable emutls: 1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key. 2. when using emutls, decorate symbol names to find thread local symbol correctly. 3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls. r? `@Amanieu`
2023-12-07Auto merge of #116565 - Sword-Destiny:master, r=Amanieubors-3/+10
add teeos std impl add teeos std library implement. this MR is draft untill the libc update to 0.2.150 this MR is the final step for suppot rust in teeos. first step(add target): https://github.com/rust-lang/rust/pull/113480 second step(add teeos libc): https://github.com/rust-lang/libc/pull/3333
2023-12-07add teeos std impl袁浩-3/+10
Signed-off-by: 袁浩 <yuanhao34@huawei.com>
2023-12-06Rollup merge of #117981 - Urgau:check-cfg-remove-deprecated-syntax, r=b-naberMatthias Krüger-67/+0
Remove deprecated `--check-cfg` syntax This PR removes the deprecated `--check-cfg` `names(...)` and `values(...)` syntax. Follow up to https://github.com/rust-lang/rust/pull/111072 Part of https://github.com/rust-lang/compiler-team/issues/636 r? compiler
2023-12-06Rollup merge of #117874 - esp-rs:riscv3264imafc-unknown-none-elf, r=davidtwcoMatthias Krüger-4/+44
`riscv32` platform support This PR adds the following RISCV targets to the tier 2 list of targets: - riscv32imafc-unknown-none-elf - riscv32im-unknown-none-elf The rationale behind adding them directly to tier 2, is that the other bare metal targets already exist at tier 2, and these new targets are the same with an additional target feature enabled. As well as the additional targets, this PR fills out the platform support document(s) that were previously missing. ~~The RISC-V bare metal targets don't currently have a platform support document, but this will change soon as the RISC-V team from the Rust-embedded working group will maintain these once https://github.com/davidtwco/rust/pull/1 is merged (and `@davidtwco's` upstream PR is merged after). For the time being you can cc myself or any other member of the RISC-V team: https://github.com/orgs/rust-embedded/teams/riscv.~~ > A tier 2 target must have value to people other than its maintainers. (It may still be a niche target, but it must not be exclusively useful for an inherently closed group.) RISC-V is an open specification, used and accessible to anyone including individuals. > A tier 2 target must have a designated team of developers (the "target maintainers") available to consult on target-specific build-breaking issues, or if necessary to develop target-specific language or library implementation details. This team must have at least 2 developers. This rust-embedded working group's [RISCV team](https://github.com/orgs/rust-embedded/teams/riscv) will maintain these targets. > The target must not place undue burden on Rust developers not specifically concerned with that target. Rust developers are expected to not gratuitously break a tier 2 target, but are not expected to become experts in every tier 2 target, and are not expected to provide target-specific implementations for every tier 2 target. I don't forsee this being an issue, the RISCV team will ensure we avoid undue burden for the general Rust community. > The target must provide documentation for the Rust community explaining how to build for the target using cross-compilation, and explaining how to run tests for the target. If at all possible, this documentation should show how to run Rust programs and tests for the target using emulation, to allow anyone to do so. If the target cannot be feasibly emulated, the documentation should explain how to obtain and work with physical hardware, cloud systems, or equivalent. There are links to resources we maintain in the re wg org in the platform support document. > The target must document its baseline expectations for the features or versions of CPUs, operating systems, libraries, runtime environments, and similar. Documented in the platform support document. > If introducing a new tier 2 or higher target that is identical to an existing Rust target except for the baseline expectations for the features or versions of CPUs, operating systems, libraries, runtime environments, and similar, then the proposed target must document to the satisfaction of the approving teams why the specific difference in baseline expectations provides sufficient value to justify a separate target. New target features in RISCV can drastically change the capability of a CPU, hence the need for a separate target to support different variants. We aim to support any ratified RISCV extensions. > Tier 2 targets must not leave any significant portions of core or the standard library unimplemented or stubbed out, unless they cannot possibly be supported on the target. `core` is fully implemented. > The code generation backend for the target should not have deficiencies that invalidate Rust safety properties, as evaluated by the Rust compiler team. (This requirement does not apply to arbitrary security enhancements or mitigations provided by code generation backends, only to those properties needed to ensure safe Rust code cannot cause undefined behavior or other unsoundness.) If this requirement does not hold, the target must clearly and prominently document any such limitations as part of the target's entry in the target tier list, and ideally also via a failing test in the testsuite. The Rust compiler team must be satisfied with the balance between these limitations and the difficulty of implementing the necessary features. RISCV is a well-established and well-maintained LLVM backend. To the best of my knowledge, the backend won't cause the generated code to have undefined behaviour. > If the target supports C code, and the target has an interoperable calling convention for C code, the Rust target must support that C calling convention for the platform via extern "C". The C calling convention does not need to be the default Rust calling convention for the target, however. The C calling convention is supported by RISCV. > The target must build reliably in CI, for all components that Rust's CI considers mandatory. For the last 4-5 years many of these RISCV targets have been building in CI without any known issues. > The approving teams may additionally require that a subset of tests pass in CI, such as enough to build a functional "hello world" program, ./x.py test --no-run, or equivalent "smoke tests". In particular, this requirement may apply if the target builds host tools, or if the tests in question provide substantial value via early detection of critical problems. Not applicable, in the future we may wish to add qemu tests but this is out of scope for now. > Building the target in CI must not take substantially longer than the current slowest target in CI, and should not substantially raise the maintenance burden of the CI infrastructure. This requirement is subjective, to be evaluated by the infrastructure team, and will take the community importance of the target into account. To the best of my knowledge, this will not induce a burden on the current CI infra. > Tier 2 targets should, if at all possible, support cross-compiling. Tier 2 targets should not require using the target as the host for builds, even if the target supports host tools. Cross-compilation is supported and documented in the platform support document. > In addition to the legal requirements for all targets (specified in the tier 3 requirements), because a tier 2 target typically involves the Rust project building and supplying various compiled binaries, incorporating the target and redistributing any resulting compiled binaries (e.g. built libraries, host tools if any) must not impose any onerous license requirements on any members of the Rust project, including infrastructure team members and those operating CI systems. This is a subjective requirement, to be evaluated by the approving teams. There are no additional license issues to worry about. > Tier 2 targets must not impose burden on the authors of pull requests, or other developers in the community, to ensure that tests pass for the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on tests failing for the target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding the PR breaking tests on a tier 2 target, unless they have opted into such messages. The RISCV team agrees not to do this. > The target maintainers should regularly run the testsuite for the target, and should fix any test failures in a reasonably timely fashion. The RISCV team will fix any issues in a timely manner.
2023-12-07Add emulated TLS supportquininer-0/+2
Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false. This commit has some changes to allow users to enable emutls: 1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key. 2. when using emutls, decorate symbol names to find thread local symbol correctly. 3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls.
2023-12-05Remove deprecated --check-cfg names() and values() syntaxUrgau-67/+0
2023-12-05Add riscv32 imafc bare metal targetScott Mabin-4/+44
- riscv32imac-unknown-none-elf - Add platform support docs for rv32
2023-12-04Update booksrustbot-0/+0
2023-11-30Auto merge of #116892 - ojeda:rethunk, r=wesleywiserbors-0/+25
Add `-Zfunction-return={keep,thunk-extern}` option This is intended to be used for Linux kernel RETHUNK builds. With this commit (optionally backported to Rust 1.73.0), plus a patched Linux kernel to pass the flag, I get a RETHUNK build with Rust enabled that is `objtool`-warning-free and is able to boot in QEMU and load a sample Rust kernel module. Issue: https://github.com/rust-lang/rust/issues/116853.
2023-11-30Add `-Zfunction-return={keep,thunk-extern}` optionMiguel Ojeda-0/+25
This is intended to be used for Linux kernel RETHUNK builds. With this commit (optionally backported to Rust 1.73.0), plus a patched Linux kernel to pass the flag, I get a RETHUNK build with Rust enabled that is `objtool`-warning-free and is able to boot in QEMU and load a sample Rust kernel module. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-11-30Enable link-arg link kind inside of #[link] attributezetanumbers-0/+21
- Implement link-arg as an attribute - Apply suggestions from review - Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> - Add unstable book entry
2023-11-29Update nto-qnx.mdAkhilTThomas-4/+2
x.py does not support specify multiple --target keywords. The targets must be specified comma separated.
2023-11-22Stabilize RFC3324 dyn upcasting coercionUrgau-27/+0
Aka trait_upcasting feature. And also adjust the `deref_into_dyn_supertrait` lint.
2023-11-22Improve -win7-windows-msvc documentationroblabla-9/+45
2023-11-22Add i686-win7-windows-msvc targetroblabla-0/+1
2023-11-22Add new x86_64-win7-windows-msvc targetroblabla-0/+46
2023-11-21Rollup merge of #118091 - psumbera:solaris-target, r=compiler-errorsNilstrieb-3/+2
Remove now deprecated target x86_64-sun-solaris.
2023-11-21Rollup merge of #117522 - Urgau:check-cfg-cli-own-lint, r=petrochenkovNilstrieb-0/+3
Remove `--check-cfg` checking of command line `--cfg` args Back in https://github.com/rust-lang/rust/pull/100574 we added to the `unexpected_cfgs` lint the checking of `--cfg` CLI arguments and emitted unexpected names and values for them. The implementation works as expected, but it's usability in particular when using it in combination with Cargo+`RUSTFLAGS` as people who set `RUSTFLAGS=--cfg=tokio_unstable` (or whatever) have `unexpected_cfgs` warnings on all of their crates is debatable. ~~To fix this issue this PR proposes that we split the CLI argument checking into it's own separate allow-by-default lint: `unexpected_cli_cfgs`.~~ ~~This has the advantage of letting people who want CLI warnings have them (although not by default anymore), while still linting on every unexpected cfg name and values in the code.~~ After some discussion with the Cargo team ([Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/check-cfg.20and.20RUSTFLAGS.20interaction)) and member of the compiler team (see below), I propose that we follow the suggestion from `@epage:` never check `--cfg` arguments, but still reserve us the possibility to do it later. We would still lint on unexpected cfgs found in the source code no matter the `--cfg` args passed. This mean reverting https://github.com/rust-lang/rust/pull/100574 but NOT https://github.com/rust-lang/rust/pull/99519. r? `@petrochenkov`
2023-11-21Rollup merge of #116085 - notriddle:notriddle/search-associated-types, ↵Nilstrieb-4/+43
r=GuillaumeGomez rustdoc-search: add support for traits and associated types # Summary Trait associated type queries work in rustdoc's type driven search. The data is included in the search-index.js file, and the queries are designed to "do what I mean" when users type them in, so, for example, `Iterator<Item=T> -> Option<T>` includes `Iterator::next` in the SERP[^SERP], and `Iterator<T> -> Option<T>` also includes `Iterator::next` in the SERP. [^SERP]: search engine results page ## Sample searches * [`iterator<Item=T>, fnmut -> T`][iterreduce] * [`iterator<T>, fnmut -> T`][iterreduceterse] [iterreduce]: http://notriddle.com/rustdoc-html-demo-5/associated-types/std/index.html?search=iterator%3CItem%3DT%3E%2C%20fnmut%20-%3E%20T&filter-crate=std [iterreduceterse]: http://notriddle.com/rustdoc-html-demo-5/associated-types/std/index.html?search=iterator%3CT%3E%2C%20fnmut%20-%3E%20T&filter-crate=std # Motivation My primary motivation for working on search.js at all is to make it easier to use highly generic APIs, like the Iterator API. The type signature describes these functions pretty well, while the names are almost arbitrary. Before this PR, type bindings were not consistently included in search-index.js at all (you couldn't find Iterator::next by typing in its function signature) and you couldn't explicitly search for them. This PR fixes both of these problems. # Guide-level explanation *Excerpt from [the Rustdoc book](http://notriddle.com/rustdoc-html-demo-5/associated-types/rustdoc/read-documentation/search.html), included in this PR.* > Function signature searches can query generics, wrapped in angle brackets, and traits will be normalized like types in the search engine if no type parameters match them. For example, a function with the signature `fn my_function<I: Iterator<Item=u32>>(input: I) -> usize` can be matched with the following queries: > > * `Iterator<Item=u32> -> usize` > * `Iterator<u32> -> usize` (you can leave out the `Item=` part) > * `Iterator -> usize` (you can leave out iterator's generic entirely) > * `T -> usize` (you can match with a generic parameter) > > Each of the above queries is progressively looser, except the last one would not match `dyn Iterator`, since that's not a type parameter. # Reference-level explanation Inside the angle brackets, you can choose whether to write a name before the parameter and the equal sign. This syntax is called [`GenericArgsBinding`](https://doc.rust-lang.org/reference/paths.html#paths-in-expressions) in the Rust Reference, and it allows you to constrain a trait's associated type. As a convenience, you don't actually have to put the name in (Rust requires it, but Rustdoc Search doesn't). This works about the same way unboxing already works in Search: the terse `Iterator<u32>` is a match for `Iterator<Item=u32>`, but the opposite is not true, just like `u32` is a match for `Iterator<u32>`. When converting a trait method for the search index, the trait is substituted for `Self`, and all associated types are bound to generics. This way, if you have the following trait definition: ```rust pub trait MyTrait { type Output; fn method(self) -> Self::Output; } ``` The following queries will match its method: * `MyTrait<Output=T> -> T` * `MyTrait<T> -> T` * `MyTrait -> T` But these queries will not match it: * <i>`MyTrait<Output=u32> -> u32`</i> * <i>`MyTrait<Output> -> Output`</i> * <i>`MyTrait -> MyTrait::Output`</i> # Drawbacks It's a little bit bigger: ```console $ du before/search-index1.74.0.js after/search-index1.74.0.js 4020 before/search-index1.74.0.js 4068 after/search-index1.74.0.js ``` # Rationale and alternatives I don't want to just not do this. On it's own, it's not terribly useful, but in addition to searching by normal traits, this is also intended as a desugaring target for closures. That's why it needs to actually distinguish the two: it allows the future desugaring to distinguish function output and input. The other alternative would be to not allow users to leave out the name, so `iterator<u32>` doesn't work. That would be unfortunate, because mixing up which ones have out params and which ones are plain generics is an easy enough mistake that the Rust compiler itself helps people out with it. # Prior art * <http://neilmitchell.blogspot.com/2020/06/hoogle-searching-overview.html> The current Rustdoc algorithm, both before this PR and after it, has a fairly expensive matching algorithm over a fairly simple file format. Luckily, we aren't trying to scale to all of crates.io, so it's usable, but it's not great when I throw it at docs.servo.org # Unresolved questions Okay, but *how do we want to handle closures?* I know the system will desugar `FnOnce(T) -> U` into `trait:FnOnce<Output=U, primitive:tuple<T>>`, but what if I don't know what trait I'm looking for? This PR can merge with nothing, but it'd be nice to have a plan. Specifically, how should the special form used to handle all varieties of basic callable: primitive:fn (function pointers), and trait:Fn, trait:FnOnce, and trait:FnMut should all be searchable using a single syntax, because I'm always forgetting which one is used in the function I'm looking for. The essential question is how closely we want to copy Rust's own syntax. The tersest way to expression Option::map might be: Option<T>, (T -> U) -> Option<U> That's the approach I would prefer, but nobody's going to attempt it without being told, so maybe this would be better? Option<T>, (fn(T) -> U) -> Option<U> It does require double parens, but at least it's mostly unambiguous. Unfortunately, it looks like the syntax you'd use for function pointers, implying that if you specifically wanted to limit your search to function pointers, you'd need to use `primitive:fn(T) -> U`. Then again, searching is normally case-insensitive, so you'd want that anyway to disambiguate from `trait:Fn(T) -> U`. # Future possibilities ## This thing really needs a ranking algorithm That is, this PR increases the number of matches for some type-based queries. They're usually pretty good matches, but there's still more of them, and it's evident that if you have two functions, `foo(MyTrait<u8>)` and `bar(MyTrait<Item=u8>)`, if the user typed `MyTrait<u8>` then `foo` should show up first. A design choice that these PRs have followed is that adding more stuff to the search query always reduces the number of functions that get matched. The advantage of doing it that way is that you can rank them by just counting how many atoms are in the function's signature (lowest score goes on top). Since it's impossible for a matching function to have fewer atoms than the search query, if there's a function with exactly the same set of atoms in it, then that'll be on top. More complicated ranking algos tend to penalize long documents anyway, if the [distance metrics](https://www.benfrederickson.com/distance-metrics/?utm_source=flipboard&utm_content=other) I found through [Flipboard](https://flipboard.com/`@arnie0426/building-recommender-systems-nvue3iqtgrn10t45)` (and postgresql's `ts_rank_cd`) are anything to go by. Real-world data sets tend to have weird outliers, like they have God Functions with zillions of arguments of all sorts of types, and Rustdoc ought to put such a function at the bottom. The other natural choice would be interleaving with `unifyFunctionTypes` to count the number of unboxings and reorderings. This would compute a distance function, and would do a fine job of ranking the results, as [described here](https://ndmitchell.com/downloads/slides-hoogle_finding_functions_from_types-16_may_2011.pdf) by the Hoogle dev, but is more complicated than it sounds. The current algorithm returns when it finds a result that *exists at all*, but a distance function should find an *optimal solution* to find the smallest sequence of edits. ## This could also use a benchmark suite and some optimization This approach also lends itself to layering a bloom filter in front of the backtracking unification engine. * At load time, hash the typeNameIdMap ID for each atom and set the matching entry in a fixed-size byte array for each function to 1. Call it `fnType.bloomFilter` * At search time, do the same for the atoms in the query (excluding special forms like `[]` that can match more than one thing). Call it `parsedQuery.bloomFilter` * For each function, `if (fnType.bloomFilter | (~parsedQuery.bloomFilter) !== ~0) { return false; }` There's also room to optimize the unification engine itself, by using stacks and persistent data structures instead of copying arrays around, or by using hashing instead of linear scans (the current algorithm was rewritten from one that tried to do that, but was too much to fit in my head and had a bunch of bugs). The advantage of Just Backtracking Better over the bloom filter is that it doesn't require the engine to retain any special algebraic properties. But, first, we need a set of benchmarks to be able to judge if such a thing will actually help. ## Referring to associated types by path *I don't want to implement this one, but if I did, this is how I'd do it.* In Rust, this is represented by a structure called a qualified path, or QPath. They look like this: <Self as Iterator>::Item <F as FnOnce>::Output They can also, if it's unambiguous, use a plain path and just let the system figure it out: Self::Item F::Output In Rustdoc Type-Driven Search, we don't want to force people to be unambiguous. Instead, we should try *all reasonable interpretations*, return results whenever any of them match, and let users make their query more specific if too many results are matches. To enable associated type path searches in Rustdoc, we need to: 1. When lowering a trait method to a search-index.js function signature, Self should be explicitly represented as a generic argument. It should always be assigned `-1`, so that if the user uses `Self` in their search query, we can ensure it always matches the real Self and not something else. Any functions that don't *have* a Self should drop a `0` into the first position of the where clause, to express that there isn't one and reserve the `-1` position. * Reminder: generics are negative, concrete types are positive, and zero is a reserved sentinel. * Right now, `Iterator::next` is lowered as if it were `fn next<T>(self: Iterator<Item=T>) -> Option<T>`. It should become `fn next<Self, T>(self: Self) -> Option<T> where Self: Iterator<Item=T>` instead. 3. Add another backtracking edge to the unification engine, so that when the user writes something like `some::thing`, the interpretation where `some` is a module and `thing` is a standalone item becomes one possible match candidate, while the interpretation where `some` is a trait and `thing` is an associated type is a separate match candidate. The backtracking engine is basically powerful enough to do this already, since unboxing generic type parameters into their traits already requires the ability to do this kind of thing. * When interpreting `some::thing` where `some` is a trait and `thing` is an associated type, it should be treated equivalently to `<self as some>::thing`. If you want to bind it to some generic parameter other than `Self`, you need to explicitly say so. * If no trait called `some` actually exists, treat it as a generic type parameter instead. Track every trait mentioned in the current working function signature, and add a match candidate for each one. * A user that explicitly wants the trait-associated-type interpretation could write a qpath (like `<self as trait>::type`), and a user that explicitly wants the module-item interpretation should use an item type filter (like `struct:module::type`). 4. To actually do the matching, maintain a `Map<(QueryGenericParamId, TraitId), FnGenericParamId>` alongside the existing `Map<QueryGenericParamId, FnGenericParamId>` that is already used to handle plain generic parameters. This works, because, when a trait function signature is lowered to search-index.js, the `rustdoc` backend always generates an FnGenericParamId for every trait associated type it sees mentioned in the function's signature. 5. Parse QPaths. Specifically, * QueryElem adds three new fields. `isQPath` is a boolean flag, and `traitNameId` contains an entry for `typeNameIdMap` corresponding to the trait part of a qpath, and `parentId` may contain either a concrete type ID or a negative number referring to a generic type parameter. The actual `id` of the query elem will always be a negative number, because this is essentially a funny way to add a generic type constraint. * If it's a QPath, then both of those IDs get filled in with the respective parts of the map. The unification engine will check the where clause to ensure the trait actually applies to the generic parameter in question, will check the type parameter constraint, and will add a mapping to `mgens` recording this as a solution. * If it's just a regular path, then `isQPath` is false, and the parser will fill in both `traitNameId` and `parentId` based on the same path. The unification engine, seeing isQPath is false and that these IDs were filled in, will try all three solutions: the path might be part of a concrete type name, or it might be referring to a trait, or it might be referring to a generic type parameter. ### Why not implement QPath searches? I'm not sure if anybody really wants to write such complicated queries. You can do a pretty good job of describing the generic functions in the standard library without resorting to FQPs. These two queries, for example, would both match the Iterator::map function if we added support for higher order function queries and a rule that allows a type to match its *notable traits*. // I like this version, because it's identical to how `Option::map` would be written. // There's a reason why Iterator::map and Option::map have the same name. Iterator<T>, (T -> U) -> Iterator<U> // This version explicitly uses the type parameter constraints. Iterator<Item=T>, (T -> U) -> Iterator<Item=U> If I try to write this one using FQP, however, the results seem worse: // This one is less expressive than the versions that don't use associated type paths. // It matches `Iterator::filter`, while the above two example queries don't. Iterator, (Iterator::Item -> Iterator::Item) -> Iterator // This doesn't work, because the return type of `Iterator::map` is not a generic // parameter with an `Iterator` trait bound. It's a concrete type that // implements `Iterator`. Return-Position-Impl-Trait is the same way. // // There's a difference between something like `map`, whose return value // implements Iterator, and something like `collect`, where the caller // gets to decide what the concrete type is going to be. //Self, (Self::Item -> I::Item) -> I where Self: Iterator, I: Iterator // This works, but it seems subjectively ugly, complex, and counterintuitive to me. Self, (<Self as Iterator>::Item -> T) -> Iterator<Item=T>
2023-11-21Auto merge of #118126 - Nilstrieb:rollup-5ogh896, r=Nilstriebbors-0/+0
Rollup of 7 pull requests Successful merges: - #117790 (CFI: Add missing use core::ffi::c_int) - #118059 (Explicitly unset $CARGO for compiletest) - #118081 (`rustc_ty_utils` cleanups) - #118094 (feat: specialize `SpecFromElem` for `()`) - #118097 (Update books) - #118115 (Fix occurrences of old fn names in comment and tracing) - #118121 (`rustc_hir` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-21Auto merge of #115691 - jsgf:typed-json-diags, r=est31,dtolnaybors-3/+11
Add `$message_type` field to distinguish json diagnostic outputs Currently the json-formatted outputs have no way to unambiguously determine which kind of message is being output. A consumer can look for specific fields in the json object (eg "message"), but there's no guarantee that in future some other kind of output will have a field of the same name. This PR adds a `"type"` field to add json outputs which can be used to unambiguously determine which kind of output it is. The mapping is: `diagnostic`: regular compiler diagnostics `artifact`: artifact notifications `future_incompat`: Future incompatibility report `unused_extern`: Unused crate warnings/errors This matches the "internally tagged" representation for serde enums.
2023-11-20Update some more cases of "type" -> "$message_type"David Tolnay-2/+2
2023-11-20Update booksrustbot-0/+0
2023-11-20Remove now deprecated target x86_64-sun-solaris.Petr Sumbera-3/+2
2023-11-20Auto merge of #115526 - arttet:master, r=jackh726bors-0/+77
Add arm64e-apple-ios & arm64e-apple-darwin targets This introduces * `arm64e-apple-ios` * `arm64e-apple-darwin` Rust targets for support `arm64e` architecture on `iOS` and `Darwin`. So, this is a first approach for integrating to the Rust compiler. ## Tier 3 Target Policy > * A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) I will be the target maintainer. > * Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo. The target names `arm64e-apple-ios`, `arm64e-apple-darwin` were derived from `aarch64-apple-ios`, `aarch64-apple-darwin`. In this [ticket,](#73628) people discussed the best suitable names for these targets. > In some cases, the arm64e arch might be "different". For example: > * `thread_set_state` might fail with (os/kern) protection failure if we try to call it from arm64 process to arm64e process. > * The returning value of dlsym is PAC signed on arm64e, while left untouched on arm64 > * Some function like pthread_create_from_mach_thread requires a PAC signed function pointer on arm64e, which is not required on arm64. So, I have chosen them because there are similar triplets in LLVM. I think there are no more suitable names for these targets. > * Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. The target must not introduce license incompatibilities. Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. No dependencies were added to Rust. > * Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. > * This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. Understood. I am not a member of a Rust team. > * Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. Understood. `std` is supported. > * The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. Building is described in the derived target doc. > * Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. > * Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. Understood. > * Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. > * In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. These targets are not fully ABI compatible with arm64e code. #73628
2023-11-19rustdoc: update book with info on type bindingsMichael Howell-4/+43