about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-03-10Auto merge of #94737 - lcnr:pass-stuff-by-value, r=davidtwcobors-5/+6
add `#[rustc_pass_by_value]` to more types the only interesting changes here should be to `TransitiveRelation`, but I believe to be highly unlikely that we will ever use a non `Copy` type with this type.
2022-03-09Account for suggestions for complete removal of linesEsteban Kuber-0/+113
Fix #94192.
2022-03-09better suggestion for int to wide ptr castMichael Goulet-13/+44
2022-03-09suggest enabling generic_const_exprs feature if const is unevaluatableMichael Goulet-0/+45
2022-03-09Rollup merge of #94772 - Urgau:check-cfg-miri, r=petrochenkovMatthias Krüger-2/+41
Add miri to the well known conditional compilation names and values This pull request adds `miri` to the list of well known names and values of the conditional compilation checking (`--check-cfg`). This was brought up in [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/RFC.203013.3A.20Checking.20conditional.20compilation.20at.20compile.20time/near/274513827) when discussing about the future of `--check-cfg`. r? ``@petrochenkov``
2022-03-09Rollup merge of #94754 - c410-f3r:nice-error, r=lcnrMatthias Krüger-55/+110
Warn users about `||` in let chain expressions Or more specifically, warn that `||` operators are forbidden. This PR is simple so I guess anyone can review 🤷 cc #53667 cc ``@matthewjasper``
2022-03-09Rollup merge of #94739 - estebank:suggest-let-else, r=oli-obkMatthias Krüger-51/+83
Suggest `if let`/`let_else` for refutable pat in `let` r? `````@oli-obk`````
2022-03-09Add support for targeting riscv32im-unknown-none-elfridwanabdillahi-0/+2
Update riscv32im-unknown-none-elf to Tier2 support. Downgrade to Tier 3 platform support.
2022-03-09Permit `#[deprecated]` in stdlibJacob Pratt-352/+159
2022-03-09New `deprecated_suggestion` feature, use in testsJacob Pratt-3/+22
2022-03-09Fix spurious CI failuresGuillaume Gomez-1/+4
2022-03-09Implement macro meta-variable expressionsCaio-0/+578
2022-03-09Warn users about || in let chain expressionsCaio-55/+110
2022-03-09Update armv7-unknown-linux-uclibceabi platform support page.lancethepants-11/+21
2022-03-09diagnostics: use rustc_on_unimplemented to recommend `[].iter()`Michael Howell-8/+30
To make this work, the `#[rustc_on_unimplemented]` data needs to be used to report method resolution errors, which is most of what this commit does. Fixes #94581
2022-03-09Add miri to the well known conditional compilation names and valuesLoïc BRANSTETT-2/+41
2022-03-09keep ERROR in messageb-naber-4/+4
2022-03-09Also take in account mdbook redirect in linkcheckerLoïc BRANSTETT-7/+13
2022-03-09manually bless 32-bit stderrb-naber-8/+7
2022-03-09normalization change and rebaseb-naber-341/+276
2022-03-09bless testsb-naber-289/+357
2022-03-09Enable issue-23036.rs on wasm32Nikita Popov-1/+0
2022-03-09Auto merge of #94515 - estebank:tweak-move-error, r=davidtwcobors-59/+94
Tweak move error Point at method definition that causes type to be consumed. Fix #94056.
2022-03-09Update LLVM submoduleNikita Popov-0/+0
2022-03-09Rollup merge of #94759 - ehuss:update-cargo, r=ehussDylan DPC-0/+0
Update cargo 11 commits in 3d6970d50e30e797b8e26b2b9b1bdf92dc381f34..65c82664263feddc5fe2d424be0993c28d46377a 2022-02-28 19:29:07 +0000 to 2022-03-09 02:32:56 +0000 - Remove remaining 2 warn(clippy::*) instances (rust-lang/cargo#10438) - Use `available_parallelism` instead of `num_cpus` (rust-lang/cargo#10427) - Wait up to one second while waiting for curl (rust-lang/cargo#10456) - Improve code coverage (rust-lang/cargo#10460) - Don't recommend leaking tokens into the console history (rust-lang/cargo#10458) - fix some typos (rust-lang/cargo#10454) - Use `extend` instead of `push`ing in a loop (rust-lang/cargo#10453) - Use locked_version more (rust-lang/cargo#10449) - Disable dependabot (rust-lang/cargo#10443) - Update git2 dependencies (rust-lang/cargo#10442) - Stop gating stable features (rust-lang/cargo#10434)
2022-03-09Rollup merge of #94686 - ChayimFriedman2:issue-94629, r=jackh726Dylan DPC-3/+16
Do not allow `#[rustc_legacy_const_generics]` on methods It caused an ICE since `item` was `None`. Fixes #94629.
2022-03-08Update cargoEric Huss-0/+0
2022-03-08Improve mod resolution error for mods with multiple candidate filesYacin Tmimi-6/+35
Fixes 5167 When ``a.rs`` and ``a/mod.rs`` are both present we would emit an error message telling the user that the module couldn't be found. However, this behavior is misleading because we're dealing with an ambiguous module path, not a "file not found" error. Is the file ``a.rs`` or is it ``a/mod.rs``? Rustfmt can't decide, and the user needs to resolve this ambiguity themselves. Now, the error message displayed to the user is in line with what they would see if they went to compile their code with these conflicting module names.
2022-03-09Improve rustdoc bookLoïc BRANSTETT-83/+106
2022-03-09Enable conditional checking of values in the Rust codebaseLoïc BRANSTETT-1/+15
2022-03-08Update GUI tests for impl blocks path changesGuillaume Gomez-9/+11
2022-03-08Unify inherent impl blocks by wrapping them into a divGuillaume Gomez-8/+13
2022-03-08Rollup merge of #94689 - compiler-errors:on-unimplemented-substs, r=petrochenkovDylan DPC-2/+85
Use impl substs in `#[rustc_on_unimplemented]` We were using the trait-ref substs instead of impl substs in `rustc_on_unimplemented`, even when computing the `rustc_on_unimplemented` attached to an impl block. Let's not do that. This PR also untangles impl and trait def-ids in the logic in `on_unimplemented` a bit. Fixes #94675
2022-03-08Update for changes to other lintsDavid Koloski-10/+15
2022-03-08Fix docs, fix incorrect lint source in noteDavid Koloski-7/+5
2022-03-08Switch the primary diagnostic to `unknown_lints`David Koloski-109/+254
This also affects the `non_exhaustive_omitted_patterns` and `must_not_suspend` lints as they are not stable. This also changes the diagnostic level to pull from `unknown_lints` instead of always being allow or deny.
2022-03-08Treat unstable lints as unknownDavid Koloski-0/+50
This change causes unstable lints to be ignored if the `unknown_lints` lint is allowed. To achieve this, it also changes lints to apply as soon as they are processed. Previously, lints in the same set were processed as a batch and then all simultaneously applied. Implementation of https://github.com/rust-lang/compiler-team/issues/469
2022-03-08Do not suggest `let_else` if no bindings would be introducedEsteban Kuber-44/+0
2022-03-08Auto merge of #92260 - jyn514:less-python-logic, r=Mark-Simulacrumbors-49/+171
Move some more bootstrap logic from python to rust Same rationale as https://github.com/rust-lang/rust/pull/76544; it would be nice to make python entirely optional at some point. This also removes $ROOT as an option for the build directory; I haven't been using it, and like Alex said in https://github.com/rust-lang/rust/pull/76544#discussion_r488248930 it seems like a misfeature. This allows running `cargo run` from src/bootstrap, although that still gives lots of compile errors if you don't use the beta toolchain. It's not exactly the same as using `x.py`, since it won't have `BOOTSTRAP_DOWNLOAD_RUSTC` set, but it's pretty close. Doing this from the top-level directory requires https://github.com/rust-lang/cargo/issues/7290 to be fixed, or using `cargo run -p bootstrap`. The next steps for making python optional are to move download-ci-llvm and download-rustc support into rustbuild, likely be shelling out as the python scripts do today. It would also be nice (although not required) to move submodule support there, but that would require taking bootstrap out of the workspace to avoid errors from crates that haven't been cloned yet. r? `@Mark-Simulacrum`
2022-03-08Suggest `if let`/`let_else` for refutable pat in `let`Esteban Kuber-49/+125
2022-03-08add `#[rustc_pass_by_value]` to more typeslcnr-5/+6
2022-03-08Auto merge of #94734 - matthiaskrgr:rollup-28shqhy, r=matthiaskrgrbors-1008/+2528
Rollup of 8 pull requests Successful merges: - #91993 (Tweak output for non-exhaustive `match` expression) - #92385 (Add Result::{ok, err, and, or, unwrap_or} as const) - #94559 (Remove argument from closure in thread::Scope::spawn.) - #94580 (Emit `unused_attributes` if a level attr only has a reason) - #94586 (Generalize `get_nullable_type` to allow types where null is all-ones.) - #94708 (diagnostics: only talk about `Cargo.toml` if running under Cargo) - #94712 (promot debug_assert to assert) - #94726 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-08Rollup merge of #94726 - lnicola:rust-analyzer-2022-03-08, r=lnicolaMatthias Krüger-18/+17
:arrow_up: rust-analyzer r? `@ghost`
2022-03-08Rollup merge of #94708 - notriddle:notriddle/cargo-toml-warning, r=lcnrMatthias Krüger-24/+114
diagnostics: only talk about `Cargo.toml` if running under Cargo Fixes #94646
2022-03-08Rollup merge of #94586 - sunfishcode:sunfishcode/io-lifetimes-tests, r=davidtwcoMatthias Krüger-2/+2
Generalize `get_nullable_type` to allow types where null is all-ones. Generalize get_nullable_type to accept types that have an all-ones bit pattern as their sentry "null" value. This will allow [`OwnedFd`], [`BorrowedFd`], [`OwnedSocket`], and [`BorrowedSocket`] to be marked with `#[rustc_nonnull_optimization_guaranteed]`, which will allow `Option<OwnedFd>`, `Option<BorrowedFd>`, `Option<OwnedSocket>`, and `Option<BorrowedSocket>` to be used in FFI declarations, as described in the [I/O safety RFC]. For example, it will allow a function like `open` on Unix and `WSASocketW` on Windows to be declared using `Option<OwnedFd>` and `Option<OwnedSocket>` return types, respectively. The actual change to add `#[rustc_nonnull_optimization_guaranteed]` to the abovementioned types will be a separate PR, as it'll depend on having this patch in the stage0 compiler. Also, update the diagnostics to mention that "niche optimizations" are used in libstd as well as libcore, as `rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end` are already in use in libstd. [`OwnedFd`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/fd/owned.rs#L49 [`BorrowedFd`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/fd/owned.rs#L29 [`OwnedSocket`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/windows/io/socket.rs#L51 [`BorrowedSocket`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/windows/io/socket.rs#L29 [I/O safety RFC]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md#ownedfd-and-borrowedfdfd-1
2022-03-08Rollup merge of #94580 - xFrednet:55112-only-reason-in-lint-attr, r=lcnrMatthias Krüger-9/+81
Emit `unused_attributes` if a level attr only has a reason Fixes a comment from `compiler/rustc_lint/src/levels.rs`. Lint level attributes that only contain a reason will also trigger the `unused_attribute` lint. The lint now also checks for the `expect` lint level. That's it, have a great rest of the day for everyone reasoning this :upside_down_face: cc: #55112
2022-03-08Rollup merge of #91993 - estebank:match-span-suggestion, r=oli-obkMatthias Krüger-955/+2314
Tweak output for non-exhaustive `match` expression * Provide structured suggestion when missing `match` arms * Move pointing at the missing variants *after* the main error <img width="1164" alt="" src="https://user-images.githubusercontent.com/1606434/146312085-b57ef4a3-6e96-4f32-aa2a-803637d9eeba.png">
2022-03-08Create a function for gathering profiles and run only Full benchmarks in ↵Jakub Beránek-39/+38
LLVM PGO
2022-03-08suggest adding `{ .. }` around a const function with argumentsTakayuki Maeda-0/+75
2022-03-08Auto merge of #94716 - RalfJung:miri, r=RalfJungbors-10/+7
update Miri Fixes https://github.com/rust-lang/rust/issues/94687 r? `@rust-lang/miri`