about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-12-07also print 'immutable' flagRalf Jung-2/+16
2023-12-07compile-time evaluation: emit a lint when a write through an immutable ↵Ralf Jung-3/+4
pointer occurs
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-6/+8
is immutable
2023-12-07Move round_* functions from `shims::x86::sse41` module to `shims::x86`Eduardo Sánchez Muñoz-84/+84
2023-12-07Move unary_op_* functions from `shims::x86::sse` module to `shims::x86`Eduardo Sánchez Muñoz-125/+129
2023-12-07Auto merge of #118463 - cuviper:restore-cg_gcc-ci, r=cuviper,GuillaumeGomezbors-7/+16
Re-enable `rustc_codegen_gcc` tests in CI When #117947 dropped llvm-15 from CI, we neglected to copy #117313's changes to enable `rustc_codegen_gcc` testing to the new base llvm-16. This is now restored, as well as copying the setup to llvm-17 as well so we hopefully won't miss it next time. In addition, due to case mismatch in `$extra_env` updates in `docker/run.sh`, I think it wasn't actually getting enabled before, but this should now be fixed. I also avoided the linker hack for `libgccjit.so` that was present before, because that's not needed if the version matches the base `gcc` used for linking. r? GuillaumeGomez
2023-12-07Fix display of features in rustdocGuillaume Gomez-9/+12
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-70/+3
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-06Auto merge of #118679 - matthiaskrgr:rollup-zr1l9w6, r=matthiaskrgrbors-4/+48
Rollup of 7 pull requests Successful merges: - #116496 (Provide context when `?` can't be called because of `Result<_, E>`) - #117563 (docs: clarify explicitly freeing heap allocated memory) - #117874 (`riscv32` platform support) - #118516 (Add ADT variant infomation to StableMIR and finish implementing TyKind::internal()) - #118650 (add comment about keeping flags in sync between bootstrap.py and bootstrap.rs) - #118664 (docs: remove #110800 from release notes) - #118669 (library: fix comment about const assert in win api) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-06Rollup merge of #118650 - RalfJung:flags-sync, r=clubby789Matthias Krüger-0/+2
add comment about keeping flags in sync between bootstrap.py and bootstrap.rs They got out of sync, probably because this comment was missing on the Python side (it only exists on the Rust side). https://github.com/rust-lang/rust/pull/118642 brings the flags back in sync but does not fix the comment, so let's do that here. r? clubby789
2023-12-06Rollup merge of #117874 - esp-rs:riscv3264imafc-unknown-none-elf, r=davidtwcoMatthias Krüger-4/+46
`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-06Auto merge of #118605 - fee1-dead-contrib:rm-rustc_host, r=compiler-errorsbors-6/+7
Remove `#[rustc_host]`, use internal desugaring Also removed a way for users to explicitly specify the host param since that isn't particularly useful. This should eliminate any pain with encoding attributes across crates and etc. r? `@compiler-errors`
2023-12-06Adjust tests for newly added ambiguous_wide_pointer_comparisons lintUrgau-0/+2
2023-12-06Drop clippy::vtable_address_comparisonsUrgau-244/+70
2023-12-06Auto merge of #118663 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 5 commits in 623b788496b3e51dc2f9282373cf0f6971a229b5..9787229614b27854cf73d57ffae430d7c1e6caa4 2023-12-02 18:10:03 +0000 to 2023-12-06 02:29:23 +0000 - feat(spec): Extend PackageIdSpec with source kind + git ref for unambiguous specs (rust-lang/cargo#12933) - test(trim-paths): assert `OSO` and `SO` cannot be trimmed (rust-lang/cargo#13118) - refactor(schemas): Pull out mod for proposed schemas package (rust-lang/cargo#13097) - chore(test): remove unnecesary packages and versions for `optionals` tests (rust-lang/cargo#13108) - chore(config): migrate renovate config (rust-lang/cargo#13106) r? ghost
2023-12-05Update cargoWeihang Lo-0/+0
2023-12-06Auto merge of #118655 - compiler-errors:rollup-vrngyzn, r=compiler-errorsbors-2/+1
Rollup of 9 pull requests Successful merges: - #117793 (Update variable name to fix `unused_variables` warning) - #118123 (Add support for making lib features internal) - #118268 (Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always) - #118346 (Add `deeply_normalize_for_diagnostics`, use it in coherence) - #118350 (Simplify Default for tuples) - #118450 (Use OnceCell in cell module documentation) - #118585 (Fix parser ICE when recovering `dyn`/`impl` after `for<...>`) - #118587 (Cleanup error handlers some more) - #118642 (bootstrap(builder.rs): Don't explicitly warn against `semicolon_in_expressions_from_macros`) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-05remove unnecesary `-Zunstable-options`Weihang Lo-4/+1
AFAIK `-Zunstable-options` is for `cargo --config` CLI, which was stabilized in 1.63 https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#config-cli
2023-12-06Auto merge of #117072 - betrusted-io:unwinding-crate-support, r=cuviperbors-0/+1
Use `unwinding` crate for unwinding on Xous platform This patch adds support for using [unwinding](https://github.com/nbdd0121/unwinding) on platforms where libunwinding isn't viable. An example of such a platform is `riscv32imac-unknown-xous-elf`. ### Background The Rust project maintains a fork of llvm at [llvm-project](https://github.com/rust-lang/llvm-project/) where it applies patches on top of the llvm project. This mostly seems to be to get unwinding support for the SGX project, and there may be other patches that I'm unaware of. There is a lot of machinery in the build system to support compiling `libunwind` on other platforms, and I needed to add additional patches to llvm in order to add support for Xous. Rather than continuing down this path, it seemed much easier to use a Rust-based library. The `unwinding` crate by `@nbdd0121` fits this description perfectly. ### Future work This could potentially replace the custom patches for `libunwind` on other platforms such as SGX, and could enable unwinding support on many more exotic platforms. ### Anti-goals This is not designed to replace `libunwind` on tier-one platforms or those where unwinding support already exists. There is already a well-established approach for unwinding there. Instead, this aims to enable unwinding on new platforms where C++ code may be difficult to compile.
2023-12-06tidy: add `unwinding` as an allowed dependencySean Cross-0/+1
Add `unwinding` as a permitted dependency of rustc, as it is now used as part of panic unwinding within platforms such as Xous. Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-05Rollup merge of #118642 - Xanewok:patch-1, r=clubby789Michael Goulet-1/+0
bootstrap(builder.rs): Don't explicitly warn against `semicolon_in_expressions_from_macros` This already wasn't passed in bootstrap.py and the lint itself already warns-by-default for 2 years now and has already been added to the future-incompat group in Rust 1.68. See https://github.com/rust-lang/rust/issues/79813 for the tracking issue.
2023-12-05Rollup merge of #118123 - RalfJung:internal-lib-features, r=compiler-errorsMichael Goulet-1/+1
Add support for making lib features internal We have the notion of an "internal" lang feature: a feature that is never intended to be stabilized, and using which can cause ICEs and other issues without that being considered a bug. This extends that idea to lib features as well. It is an alternative to https://github.com/rust-lang/rust/pull/115623: instead of using an attribute to declare lib features internal, we simply do this based on the name. Everything ending in `_internals` or `_internal` is considered internal. Then we rename `core_intrinsics` to `core_intrinsics_internal`, which fixes https://github.com/rust-lang/rust/issues/115597.
2023-12-05Auto merge of #118457 - eholk:genfn, r=compiler-errorsbors-23/+37
Add support for `gen fn` This builds on #116447 to add support for `gen fn` functions. For the most part we follow the same approach as desugaring `async fn`, but replacing `Future` with `Iterator` and `async {}` with `gen {}` for the body. The version implemented here uses the return type of a `gen fn` as the yield type. For example: ```rust gen fn count_to_three() -> i32 { yield 1; yield 2; yield 3; } ``` In the future, I think we should experiment with a syntax like `gen fn count_to_three() yield i32 { ... }`, but that can go in another PR. cc `@oli-obk` `@compiler-errors`
2023-12-05add comment about keeping flags in sync between bootstrap.py and bootstrap.rsRalf Jung-0/+2
2023-12-05Rollup merge of #118614 - rustbot:docs-update, r=ehussMatthias Krüger-0/+0
Update books ## rust-lang/nomicon 1 commits in 1842257814919fa62e81bdecd5e8f95be2839dbb..83d015105e6d490fc30d6c95da1e56152a50e228 2023-11-22 15:35:31 UTC to 2023-11-22 15:35:31 UTC - Reword the section on general race conditions (rust-lang/nomicon#431) ## rust-lang/reference 5 commits in cd8193e972f61b92117095fc73b67af767b4d6bc..692d216f5a1151e8852ddb308ba64040e634c876 2023-12-04 09:45:06 UTC to 2023-11-21 17:57:18 UTC - Fix note on `self` coercion (rust-lang/reference#1431) - Document C string literal tokens. (rust-lang/reference#1423) - type-layout.md: Warn about repr(align)/repr(packed) and field order (rust-lang/reference#1430) - Lone `self` in a method body resolves to the self parameter (rust-lang/reference#1427) - Reference wildcard patterns from underscore expr (rust-lang/reference#1428) ## rust-lang/rust-by-example 4 commits in a6581246f96837113968c02187db24f742af3908..da0a06aada31a324ae84a9eaee344f6a944b9683 2023-11-27 12:50:49 UTC to 2023-11-21 11:58:19 UTC - fix tiny typo in string conversion docs (rust-lang/rust-by-example#1776) - fix(arg): Remove reference to Rust Cookbook in arg parsing (rust-lang/rust-by-example#1775) - fix:typo error (rust-lang/rust-by-example#1774) - Remove space between `&` and `self` (rust-lang/rust-by-example#1772) ## rust-lang/rustc-dev-guide 5 commits in ddb8b1309f9e905804cea1e248a4572fed6b464b..904bb5aa7b21adad58ffae610e2830c7b0f813b0 2023-11-28 13:13:36 UTC to 2023-11-22 06:13:00 UTC - Update how-to-build-and-run.md (rust-lang/rustc-dev-guide#1828) - notification groups: add information about how to ping them (rust-lang/rustc-dev-guide#1818) - Add explanations on how to run rustc_codegen_gcc tests (rust-lang/rustc-dev-guide#1821) - Add back the `canonicalization` chapter. (rust-lang/rustc-dev-guide#1532) - Emphasize that the experts map is not up to date (rust-lang/rustc-dev-guide#1826)
2023-12-05Rollup merge of #118606 - ↵Matthias Krüger-6/+7
long-long-float:x-do-not-quit-when-x-prints-settings-json, r=onur-ozkan Fix `x` not to quit after `x` prints `settings.json` I fixed the `x` not to quit after the `x` prints `.vscode/settings.json`. The command `x setup` ask as following: ``` x.py can automatically install the recommended `.vscode/settings.json` file for rustc development Would you like to create/update `settings.json`, or only print suggested settings?: [y/p/N] ``` When user types `p`, the `x` prints the contents and quit the program. It is a hassle to start the command again, so I fixed the `x` to ask what to do again.
2023-12-05Rollup merge of #118594 - hdost:patch-1, r=fmeaseMatthias Krüger-1/+1
Remove mention of rust to make the error message generic. The deprecation notice is used when in crates as well. This applies to versions Rust or Crates. Relates #118148
2023-12-05Remove deprecated --check-cfg names() and values() syntaxUrgau-67/+0
2023-12-05Update bootstrap libc to 0.2.150Urgau-3/+3
Version 0.2.150 include support for the new check-cfg syntax
2023-12-05Fix formattingIgor Matuszewski-1/+3
2023-12-05bootstrap(builder.rs): Don't explicitly warn against ↵Igor Matuszewski-1/+0
`semicolon_in_expressions_from_macros` This already wasn't passed in bootstrap.py and the lint itself already warns-by-default for 2 years now and has already been added to the future-incompat group in Rust 1.68. See https://github.com/rust-lang/rust/issues/79813 for the tracking issue.
2023-12-05Add riscv32 imafc bare metal targetScott Mabin-4/+46
- riscv32imac-unknown-none-elf - Add platform support docs for rv32
2023-12-05Don't explicitly warn against `semicolon_in_expressions_from_macros`Igor Matuszewski-1/+1
This warns-by-default since 2 years and already has been added to the future-incompat group since Rust 1.68. See https://github.com/rust-lang/rust/issues/79813 for the tracking issue.
2023-12-05Fix x not to quit when x prints settings.jsonlong-long-float-6/+7
Use `while` instead of `loop` Co-authored-by: Onur Özkan <onurozkan.dev@outlook.com> Update prompt message
2023-12-05Remove mention of rust to make the error message generic.Harold Dost-1/+1
The deprecation notice is used when in crates as well. This applies to versions Rust or Crates. Fixes #118148 Signed-off-by: Harold Dost <h.dost@criteo.com>
2023-12-05simd numeric intrinsics: share code with scalar intrinsicRalf Jung-12/+1
2023-12-05fix miri_promise_symbolic_alignment for huge alignmentsRalf Jung-3/+46
2023-12-05fix typo in commentRalf Jung-1/+1
2023-12-05Add safe compilation optionsl00846161-0/+13
Add two options when building rust: strip and stack protector. If set `strip = true`, symbols will be stripped using `-Cstrip=symbols`. Also can set `stack-protector` and stack protectors will be used.
2023-12-05fmtThe Miri Conjob Bot-20/+24
2023-12-05Merge from rustcThe Miri Conjob Bot-201/+969
2023-12-05Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-12-05Remove `#[rustc_host]`, use internal desugaringDeadbeef-6/+7
2023-12-04Fix buildEric Holk-1/+1
2023-12-04Update doctestEric Holk-2/+2
2023-12-04Remove bad mergeEric Holk-199/+0
2023-12-04Address code review feedbackEric Holk-15/+6