about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-08-03Auto merge of #100082 - matthiaskrgr:rollup-ywu4iux, r=matthiaskrgrbors-391/+1019
Rollup of 6 pull requests Successful merges: - #99933 (parallelize HTML checking tool) - #99958 (Improve position named arguments lint underline and formatting names) - #100008 (Update all pre-cloned submodules on startup) - #100049 (:arrow_up: rust-analyzer) - #100070 (Clarify Cargo.toml comments) - #100074 (rustc-docs: Be less specific about the representation of `+bundle`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-02Auto merge of #92268 - jswrenn:transmute, r=oli-obkbors-0/+4128
Initial implementation of transmutability trait. *T'was the night before Christmas and all through the codebase, not a miri was stirring — no hint of `unsafe`!* This PR provides an initial, **incomplete** implementation of *[MCP 411: Lang Item for Transmutability](https://github.com/rust-lang/compiler-team/issues/411)*. The `core::mem::BikeshedIntrinsicFrom` trait provided by this PR is implemented on-the-fly by the compiler for types `Src` and `Dst` when the bits of all possible values of type `Src` are safely reinterpretable as a value of type `Dst`. What this PR provides is: - [x] [support for transmutations involving primitives](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/primitives) - [x] [support for transmutations involving arrays](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/arrays) - [x] [support for transmutations involving structs](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/structs) - [x] [support for transmutations involving enums](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/enums) - [x] [support for transmutations involving unions](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/unions) - [x] [support for weaker validity checks](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs) (i.e., `Assume::VALIDITY`) - [x] visibility checking What isn't yet implemented: - [ ] transmutability options passed using the `Assume` struct - [ ] [support for references](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/references.rs) - [ ] smarter error messages These features will be implemented in future PRs.
2022-08-02Rollup merge of #100074 - petrochenkov:bundledoc, r=bjorn3Matthias Krüger-3/+3
rustc-docs: Be less specific about the representation of `+bundle` For https://github.com/rust-lang/rust/issues/99429. r? `@bjorn3`
2022-08-02Rollup merge of #100070 - mqudsi:99768_revisited, r=RalfJungMatthias Krüger-4/+3
Clarify Cargo.toml comments Existing comments were left in an incoherent state after #99768. r? `@RalfJung`
2022-08-02Rollup merge of #100049 - lnicola:rust-analyzer-2022-08-02, r=lnicolaMatthias Krüger-241/+765
:arrow_up: rust-analyzer r? `@ghost`
2022-08-02Rollup merge of #100008 - jyn514:eager-submodules, r=bjorn3Matthias Krüger-18/+2
Update all pre-cloned submodules on startup Fixes https://github.com/rust-lang/rust/issues/99083
2022-08-02Rollup merge of #99958 - PrestonFrom:issue_99907, r=compiler-errorsMatthias Krüger-104/+220
Improve position named arguments lint underline and formatting names For named arguments used as implicit position arguments, underline both the opening curly brace and either: * if there is formatting, the next character (which will either be the closing curl brace or the `:` denoting the start of formatting args) * if there is no formatting, the entire arg span (important if there is whitespace like `{ }`) This should make it more obvious where the named argument should be. Additionally, in the lint message, emit the formatting argument names without a dollar sign to avoid potentially confusion. Fixes #99907
2022-08-02Rollup merge of #99933 - alex:parallel-html-checking, r=Mark-SimulacrumMatthias Krüger-21/+26
parallelize HTML checking tool there's a lot of IO, so timings on my laptop are far from stable, but it seems to be considerably faster. this step often appears to take 5+ minutes in CI, so hopefully this offers a speedup
2022-08-02rustc-docs: Be less specific about the representation of `+bundle`Vadim Petrochenkov-3/+3
2022-08-02Clarify Cargo.toml commentsMahmoud Al-Qudsi-4/+3
Existing comments were left in an incoherent state after #99768.
2022-08-02Rollup merge of #100057 - GuillaumeGomez:rm-more-clean-impl, r=Dylan-DPCMatthias Krüger-34/+28
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? ``@notriddle``
2022-08-02Rollup merge of #100053 - flip1995:clippy_backport, r=xFrednetMatthias Krüger-3/+5
move [`assertions_on_result_states`] to restriction "Backports" the first commit of https://github.com/rust-lang/rust-clippy/pull/9273, so that the lint doesn't go into beta as a warn-by-default lint. The other changes in the linked PR can ride the train as usual. r? ``@xFrednet`` (only Clippy changes, so we don't need to bother compiler people) --- For Clippy: changelog: none
2022-08-02Rollup merge of #100052 - TimNN:patch-1, r=nikicMatthias Krüger-1/+1
RISC-V ASM test: relax label name constraint. The test is currently [broken at LLVM Head](https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12425#01825d5b-c3d1-4fdc-a98d-5956b246aee2), likely since https://github.com/llvm/llvm-project/commit/260a64106854986a981e49ed87ee740460a23eb5: ```plain /var/lib/buildkite-agent/builds/rust-llvm-integrate/llvm-project/rust-llvm-integrate-prototype/src/test/assembly/asm/riscv-types.rs:59:11: error: CHECK: expected string not found in input --   | // CHECK: lb t0, %pcrel_lo(.Lpcrel_hi0)(t0)   | ^   | /var/lib/buildkite-agent/builds/rust-llvm-integrate/llvm-project/rust-llvm-integrate-prototype/build/x86_64-unknown-linux-gnu/test/assembly/asm/riscv-types.riscv64/riscv-types.s:24:36: note: scanning from here   | auipc t0, %pcrel_hi(extern_static)   | ^   | /var/lib/buildkite-agent/builds/rust-llvm-integrate/llvm-project/rust-llvm-integrate-prototype/build/x86_64-unknown-linux-gnu/test/assembly/asm/riscv-types.riscv64/riscv-types.s:25:2: note: possible intended match here   | lb t0, %pcrel_lo(.Lpcrel_hi18)(t0)   | ^ ``` As far as I can tell, the exact index in the label probably doesn't matter for the test, especially if LLVM can change it to ~arbitrary values, though I'm not an ASM or RISC-V expert. This [fixes the test](https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12427).
2022-08-02Rollup merge of #100045 - Amanieu:global_asm_may_unwind, r=tmiaskoMatthias Krüger-36/+36
Properly reject the `may_unwind` option in `global_asm!` This was accidentally accepted even though it had no effect in `global_asm!`. The option only makes sense for `asm!` which runs within a function.
2022-08-02Rollup merge of #100005 - GuillaumeGomez:cleanup-ast-attr-clean, r=notriddleMatthias Krüger-19/+15
Remove Clean trait for ast::Attribute and improve Attributes::from_ast I prefer to keep this commit on its own for this PR because I'm changing a bit more things than expected originally: I split `Attributes::from_ast` into two because there is only one location making use of its second parameter. Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-08-02Rollup merge of #99987 - Alexendoo:parse-format-position-span, r=fee1-deadMatthias Krüger-2/+2
Always include a position span in `rustc_parse_format::Argument` Moves the spans from the `Position` enum to always be included in the `Argument` struct. Doesn't make any changes to use it in rustc, but it will be useful for some upcoming Clippy lints
2022-08-02Remove Clean trait implementation for ast::Attribute and cleanup ↵Guillaume Gomez-19/+15
Attributes::from_ast function by splitting it in two
2022-08-02Remove Clean trait implementation for hir::LifetimeGuillaume Gomez-20/+20
2022-08-02Remove Clean trait implementation for ty::TraitRefGuillaume Gomez-14/+8
2022-08-02move [`assertions_on_result_states`] to restrictiontabokie-3/+5
Signed-off-by: tabokie <xy.tao@outlook.com>
2022-08-02RISC-V ASM test: relax label name constraint.Tim Neumann-1/+1
2022-08-02Improve position named arguments lint underline and formatting namesPreston From-104/+220
For named arguments used as implicit position arguments, underline both the opening curly brace and either: * if there is formatting, the next character (which will either be the closing curl brace or the `:` denoting the start of formatting args) * if there is no formatting, the entire arg span (important if there is whitespace like `{ }`) This should make it more obvious where the named argument should be. Additionally, in the lint message, emit the formatting argument names without a dollar sign to avoid potentially confusion. Fixes #99907
2022-08-02:arrow_up: rust-analyzerLaurențiu Nicola-241/+765
2022-08-02Rollup merge of #100042 - ehuss:update-books, r=ehussMatthias Krüger-0/+0
Update books ## reference 2 commits in a92be0fef439b3d8e0468d82cb24812d303520a0..f3d3953bf3b158d596c96d55ce5366f9f3f972e9 2022-07-21 19:01:23 -0700 to 2022-08-01 17:17:37 -0700 - Add `let_chains` references (rust-lang/reference#1179) - Remove outdated warning (rust-lang/reference#1243) ## rust-by-example 18 commits in 3155db49b0d57cd82c65456ac210b69ecec5ccb1..ee342dc91e1ba1bb1e1f1318f84bbe3bfac04798 2022-07-05 20:35:53 -0300 to 2022-07-27 11:06:36 -0300 - Closure inferred twice (rust-lang/rust-by-example#1588) - fix a syntax bug in example assembly (rust-lang/rust-by-example#1511) - Minor grammar change in src/std/rc.md paragraph 2 (rust-lang/rust-by-example#1586) - Fix typo in asm.md (rust-lang/rust-by-example#1585) - Fix incorrect padding in fixed-width print (rust-lang/rust-by-example#1584) - Update print.md (rust-lang/rust-by-example#1582) - add-chapter-on-defaults (rust-lang/rust-by-example#1580) - Fix typo (rust-lang/rust-by-example#1579) - fix a compile error (rust-lang/rust-by-example#1578) - Suggest using mod.rs pattern to share test code (rust-lang/rust-by-example#1577) - fix a compile error in iter_any.md (rust-lang/rust-by-example#1576) - Mention attribute like macros in attributes.md (rust-lang/rust-by-example#1574) - Update exercise to be clearer (rust-lang/rust-by-example#1573) - fixes link for turbofish in testcase_mapreduce.md (rust-lang/rust-by-example#1572) - Fix inconsistency between comment and code in hello/print.md (rust-lang/rust-by-example#1571) - Fixes a typo in print.md (rust-lang/rust-by-example#1570) - into_iter-moves-elements (rust-lang/rust-by-example#1569) - Fix a typo in print.md (rust-lang/rust-by-example#1568) ## rustc-dev-guide 16 commits in d5201cddace979b299ec1bf9fd8997338151aa9d..04f3cf0bb2f5a6ee2bfc4b1a6a6cd8c11d1c5531 2022-07-21 04:48:49 +0200 to 2022-07-31 07:46:57 +0200 - address review comment - accept review suggestion - try address review comments - summary of chapter - Update src/building/compiler-documenting.md - revamp doc-build chapter - minor fixes - Prefer relative links - Fix the link to clippy docs - Fix the link to `ResolverAstLowering` - Fix the link to `ProcMacro` trait - Fix the link to `Lazy&lt;T&gt;` - Add instructions to fix build errors in std after adding a new target - Document how to build a cross-compiler - Add documentation about Microsoft provided debuggers and CodeView/PDB… (rust-lang/rustc-dev-guide#1406) - rust-analyzer is now a subtree ## embedded-book 2 commits in 766979590da8100998f0d662499d4a901d8d1640..befe6840874311635c417cf731377f07234ee373 2022-07-04 09:13:58 +0000 to 2022-07-25 07:51:14 +0000 - Updated instructions for running first Hardware example (rust-embedded/book#323) - Improved ligability for hardware.md (rust-embedded/book#324)
2022-08-02Rollup merge of #100037 - fw-immunant:patch-1, r=jyn514Matthias Krüger-3/+3
Update rustc man page to match `rustc --help` This brings the `--crate-type`, `--emit`, and `--print` options' allowed arguments into sync with that printed by `rustc --help`. c.f. the `opt::multi_s` calls for `"crate-type"`, `"emit"`, and `"print"` here: https://github.com/rust-lang/rust/blob/master/compiler/rustc_session/src/config.rs
2022-08-02Rollup merge of #100011 - compiler-errors:let-chain-restriction, r=fee1-deadMatthias Krüger-248/+332
Use Parser's `restrictions` instead of `let_expr_allowed` This also means that the `ALLOW_LET` flag is reset properly for subexpressions, so we can properly deny things like `a && (b && let c = d)`. Also the parser is a tiny bit smaller now. It doesn't reject _all_ bad `let` expr usages, just a bit more. cc `@c410-f3r`
2022-08-02Rollup merge of #99779 - GuillaumeGomez:fix-item-info-pos-and-height, ↵Matthias Krüger-9/+44
r=notriddle Fix item info pos and height Fixes https://github.com/rust-lang/rust/issues/98266. Fixes https://github.com/rust-lang/rust/issues/98343. You can test it [here](https://rustdoc.crud.net/imperio/fix-item-info-pos-and-height/lib2/trait.Trait.html). Here is a screenshot of the result: ![Screenshot from 2022-07-26 21-55-53](https://user-images.githubusercontent.com/3050060/181100624-18b8b045-5c25-4c7c-9c44-97d55d29b675.png) r? `@jsha`
2022-08-02Rollup merge of #99293 - jo3bingham:issue-98720-fix, r=jyn514Matthias Krüger-1/+7
only run --all-targets in stage0 for Std Repro'd the issue with `python3 x.py check --stage 1 library/std` and tested the fix with the same command. r? `@jyn514` I tried to implement [this solution](https://github.com/rust-lang/rust/issues/98720#issuecomment-1184435462), but didn't have any luck. I don't think I fully understood what needed to be done. However, I would love to be mentored on it since it would be a more correct solution, and I can learn more about how bootstrap works.
2022-08-02Properly reject the `may_unwind` option in `global_asm!`Amanieu d'Antras-36/+36
This was accidentally accepted even though it had no effect in `global_asm!`. The option only makes sense for `asm!` which runs within a function.
2022-08-01Update booksEric Huss-0/+0
2022-08-02Auto merge of #100033 - rylev:no-cancel-try-perf, r=Mark-Simulacrumbors-1/+1
Don't cancel try-perf branch if 'outdated' `try-perf` just like the `try` branch should always run all jobs to completion. This allows us to use the branch like a queue. r? `@Mark-Simulacrum`
2022-08-01Don't cancel try-perf branch if 'outdated'Ryan Levick-1/+1
2022-08-01Update rustc man page to match `rustc --help`Frances Wingerter-3/+3
This brings the `--crate-type`, `--emit`, and `--print` options' allowed arguments into sync with that printed by `rustc --help`.
2022-08-01Auto merge of #95884 - cjgillot:assoc-item, r=lcnrbors-61/+80
Thin `AssocItem` This PR removes a few fields from `AssocItem` that should be easily computed using other queries. This simplifies some of the metadata decoding.
2022-08-01Bless incremental tests.Camille GILLOT-31/+47
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-25/+28
2022-08-01Remove visibility from AssocItem.Camille GILLOT-1/+1
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-7/+7
2022-08-01add commentJoseph Bingham-0/+3
2022-08-01Auto merge of #99476 - dpaoliello:rawdylibvectorcall, r=michaelwoeristerbors-24/+134
Add tests for raw-dylib with vectorcall, and fix vectorcall code generation * Adds tests for using `raw-dylib` (#58713) with `vectorcall`. * Fixed code generation for `vectorcall` (parameters have to be marked with `InReg`, just like `fastcall`). * Enabled running the `raw-dylib` `fastcall` tests when using MSVC (since I had to add support in the test for running MSVC-only tests since GCC doesn't support `vectorcall`).
2022-08-01Auto merge of #100024 - matthiaskrgr:rollup-36ab4wx, r=matthiaskrgrbors-151/+193
Rollup of 8 pull requests Successful merges: - #99340 (Fix ICE in Definitions::create_def) - #99629 (Improve `cannot move out of` error message) - #99864 (bootstrap: don't emit warn about duplicated deps with same/different features if some of sets actually empty) - #99911 (Remove some uses of `guess_head_span`) - #99976 (Make Rustdoc exit with correct error code when scraping examples from invalid files) - #100003 (Improve size assertions.) - #100012 (Avoid `Ty` to `String` conversions) - #100020 (better error when python is not found in x - issue #99648) Failed merges: - #99994 (Replace `guess_head_span` with `opt_span`) r? `@ghost` `@rustbot` modify labels: rollup
2022-08-01Rollup merge of #100020 - CallumIO:issue-99648, r=jyn514Matthias Krüger-3/+3
better error when python is not found in x - issue #99648 `x` now shows an appropriate error message and exits, when a version of `python` is not found on the users `PATH`. Resolves #99648
2022-08-01Rollup merge of #100003 - nnethercote:improve-size-assertions, r=lqdMatthias Krüger-39/+16
Improve size assertions. - For any file with four or more size assertions, move them into a separate module (as is already done for `hir.rs`). - Add some more for AST nodes and THIR nodes. - Put the `hir.rs` ones in alphabetical order. r? `@lqd`
2022-08-01Rollup merge of #99976 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-0/+27
Make Rustdoc exit with correct error code when scraping examples from invalid files This PR fixes a small issue with the new Rustdoc scrape-examples feature. If a file that is being scraped has a type error, then currently that error is printed out, but the rustdoc process exits as if it succeeded. This is a problem for Cargo, which needs to track whether scraping succeeded (see rust-lang/cargo#10343). This PR fixes the issue by checking whether an error is emitted, and aborting if so.
2022-08-01Rollup merge of #99911 - cjgillot:no-guess, r=davidtwcoMatthias Krüger-56/+65
Remove some uses of `guess_head_span` That function cuts a span at the first occurrence of `{`. Using `def_span` is almost always more precise.
2022-08-01Rollup merge of #99864 - klensy:bootstrap-art-dupe, r=jyn514Matthias Krüger-24/+28
bootstrap: don't emit warn about duplicated deps with same/different features if some of sets actually empty Example (https://github.com/rust-lang-ci/rust/runs/7551453940?check_suite_focus=true#step:25:15008): ``` duplicate artifacts found when compiling a tool, this typically means that something was recompiled because a transitive dependency has different features activated than in a previous build: the following dependencies are duplicated although they have the same features enabled: the following dependencies have different features: memchr 2.5.0 (registry+https://github.com/rust-lang/crates.io-index) `clippy-driver` additionally enabled features {} at "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-freebsd/release/deps/libmemchr-44aa6ff4f08e293f.rlib" `cargo` additionally enabled features {"use_std"} at "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-freebsd/release/deps/libmemchr-70e29af0fd3ef292.rlib" ``` Notice that no info printed under `the following dependencies are duplicated although they have the same features enabled:`
2022-08-01Rollup merge of #99629 - obeis:issue-99470, r=compiler-errorsMatthias Krüger-29/+54
Improve `cannot move out of` error message Closes #99470 r? `@bjorn3`
2022-08-01Auto merge of #99884 - nnethercote:lexer-improvements, r=matkladbors-5/+5
Lexer improvements Some cleanups and small speed improvements. r? `@matklad`
2022-08-01fix: better error when python not found in xCallum Leslie-3/+3
chore: clean comments to be relevant
2022-08-01Make Rustdoc exit with correct error code when scrape examples from invalid ↵Will Crichton-0/+27
files