about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-08-25rustdoc: remove unused CSS for `.multi-column`Michael Howell-10/+0
As a sanity check, [this tool] can be used to run a CSS query across an HTML tree to detect if a selector ever matches (I use compiler-docs and std docs). This isn't good enough, because I also need to account for JavaScript, but this class is never mentioned in any of the JS files, either. According to [blame], this class was added when rustdoc was first written, and, as far as I can tell, was never actually used. [this tool]: https://gitlab.com/notriddle/html-scanner [blame]: https://github.com/rust-lang/rust/blame/4d45b0745ab227feb9000bc15713ade4b99241ea/src/librustdoc/html/static/css/rustdoc.css#L753-L761
2022-08-23Auto merge of #100675 - Xiretza:fluent-mandate-crate-prefix, r=davidtwcobors-31/+82
fluent: mandate slug names to be prefixed by crate name This is currently only convention, but not actively checked for. Additionally, improve error messages to highlight the path of the offending fluent file rather than the identifier preceding it. This will conflict with #100671, so I'll leave it as draft until that's merged.
2022-08-23Auto merge of #99917 - yaahc:error-in-core-move, r=thomccbors-226/+1264
Move Error trait into core This PR moves the error trait from the standard library into a new unstable `error` module within the core library. The goal of this PR is to help unify error reporting across the std and no_std ecosystems, as well as open the door to integrating the error trait into the panic reporting system when reporting panics whose source is an errors (such as via `expect`). This PR is a rewrite of https://github.com/rust-lang/rust/pull/90328 using new compiler features that have been added to support error in core.
2022-08-23Auto merge of #100920 - Dylan-DPC:rollup-vlcw3sr, r=Dylan-DPCbors-622/+509
Rollup of 9 pull requests Successful merges: - #99249 (Do not re-parse function signatures to suggest generics) - #100309 (Extend comma suggestion to cases where fields arent missing) - #100368 (InferCtxt tainted_by_errors_flag should be Option<ErrorGuaranteed>) - #100768 (Migrate `rustc_plugin_impl` to `SessionDiagnostic`) - #100835 (net listen backlog update, follow-up from #97963.) - #100851 (Fix rustc_parse_format precision & width spans) - #100857 (Refactor query modifier parsing) - #100907 (Fix typo in UnreachableProp) - #100909 (Minor `ast::LitKind` improvements) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-23Rollup merge of #100909 - nnethercote:minor-ast-LitKind-improvement, ↵Dylan DPC-21/+21
r=petrochenkov Minor `ast::LitKind` improvements r? `@petrochenkov`
2022-08-23Rollup merge of #100907 - Nilstrieb:unrachable-typo-lol, r=Dylan-DPCDylan DPC-1/+1
Fix typo in UnreachableProp r? ``@Dylan-DPC``
2022-08-23Rollup merge of #100857 - camsteffen:query-parse-refactor, r=davidtwcoDylan DPC-260/+125
Refactor query modifier parsing Reduce redundancy and improve error spans.
2022-08-23Rollup merge of #100851 - Alexendoo:rpf-width-prec-spans, r=fee1-deadDylan DPC-65/+84
Fix rustc_parse_format precision & width spans When a `precision`/`width` was `CountIsName - {:name$}` or `CountIs - {:10}` the `precision_span`/`width_span` was set to `None` For `width` the name span in `CountIsName(_, name_span)` had its `.start` off by one r? ``@fee1-dead`` / cc ``@PrestonFrom`` since this is similar to #99987
2022-08-23Rollup merge of #100835 - devnexen:listener_followups, r=devnexenDylan DPC-4/+2
net listen backlog update, follow-up from #97963. FreeBSD and using system limit instead for others.
2022-08-23Rollup merge of #100768 - Facel3ss1:plugin-impl-translation, r=davidtwcoDylan DPC-11/+35
Migrate `rustc_plugin_impl` to `SessionDiagnostic` Migration of the `rustc_plugin_impl` crate. ~Draft PR because it is blocked on #100694 for `#[fatal(...)]` support~ (this has been merged, and I've changed over to `#[diag(...)]` now too), but I would also like to know if what I did with `LoadPluginError` is okay, because all it does is display the error message from `libloading` ([See conversation on zulip](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.23100717.20diagnostic.20translation/near/294327843)). This crate is apparently for a deprecated feature which is used by servo, so I don't know how much this matters anyway.
2022-08-23Rollup merge of #100368 - chenyukang:fix-100321, r=lcnrDylan DPC-12/+11
InferCtxt tainted_by_errors_flag should be Option<ErrorGuaranteed> Fixes #100321. Use Cell<Option<ErrorGuaranteed>> to guarantee that we emit an error when that flag is set.
2022-08-23Rollup merge of #100309 - compiler-errors:issue-100300, r=sanxiynDylan DPC-30/+96
Extend comma suggestion to cases where fields arent missing Fixes #100300
2022-08-23Rollup merge of #99249 - cjgillot:no-reparse-fn, r=fee1-deadDylan DPC-218/+134
Do not re-parse function signatures to suggest generics This PR uses the existing resolution rib infrastructure to channel the correct span information to suggest generic parameters. This allows to avoid re-parsing a function's source code. Drive-by cleanup: this removes useless `FnItemRibKind` from late resolution ribs. All the use cases are already covered by `ItemRibKind` and `AssocItemRibKind` which have more precise semantics.
2022-08-23Auto merge of #100782 - thomcc:fix-android-sigaddset, r=Mark-Simulacrumbors-3/+23
Align android `sigaddset` impl with the reference impl from Bionic In https://github.com/rust-lang/rust/pull/100737 I noticed we were treating the sigset_t as an array of bytes, while referencing code from android (https://github.com/aosp-mirror/platform_bionic/blob/ad8dcd6023294b646e5a8288c0ed431b0845da49/libc/include/android/legacy_signal_inlines.h) which treats it as an array of unsigned long. That said, the behavior difference is so subtle here that it's not hard to see why nobody noticed. This fixes the implementation to be equivalent to the one in bionic.
2022-08-23Remove the symbol from `ast::LitKind::Err`.Nicholas Nethercote-19/+17
Because it's never used meaningfully.
2022-08-23Add some useful comments to `LitKind`.Nicholas Nethercote-2/+4
2022-08-23Fix typo in UnreachablePropnils-1/+1
2022-08-23Auto merge of #100904 - matthiaskrgr:rollup-z3yzivj, r=matthiaskrgrbors-111/+403
Rollup of 9 pull requests Successful merges: - #100382 (Make the GATS self outlives error take into GATs in the inputs) - #100565 (Suggest adding a missing semicolon before an item) - #100641 (Add the armv4t-none-eabi target to the supported_targets) - #100789 (Use separate infcx to solve obligations during negative coherence) - #100832 (Some small bootstrap cleanup) - #100861 (fix ICE with extra-const-ub-checks) - #100862 (tidy: remove crossbeam-utils) - #100887 (Refactor part of codegen_call_terminator) - #100893 (Remove out-of-context comment in `mem::MaybeUninit` documentation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-23Rollup merge of #100893 - thinety:master, r=scottmcmMatthias Krüger-5/+2
Remove out-of-context comment in `mem::MaybeUninit` documentation Reverted the comment to an earlier version to avoid confusion: neither raw pointer assignment nor `ptr::write` is used inside the for loop.
2022-08-23Rollup merge of #100887 - eholk:codegen_call_terminator-cleanup, r=fee1-deadMatthias Krüger-47/+44
Refactor part of codegen_call_terminator I was reading through this code and found the chain of `if let` and a nested match on the same value that was matched in the `if let` to be kind of hard to follow. This PR cleans it up by flattening the `if let` chain and nested match into a single `match` expression.
2022-08-23Rollup merge of #100862 - ehuss:tidy-crossbeam, r=Mark-SimulacrumMatthias Krüger-6/+3
tidy: remove crossbeam-utils crossbeam-utils is no longer needed now that scoped threads are available in 1.63.
2022-08-23Rollup merge of #100861 - RalfJung:const-ice, r=oli-obkMatthias Krüger-7/+53
fix ICE with extra-const-ub-checks Fixes https://github.com/rust-lang/rust/issues/100771
2022-08-23Rollup merge of #100832 - ehuss:bootstrap-cleanup, r=jyn514Matthias Krüger-27/+14
Some small bootstrap cleanup This is a collection of a few small cleanups. See commits for more details. * Remove some unused fields from the tool_extended macro. * Remove rustfmt from publish_toolstate. * Remove Steve from toolstate failure notices. * Don't allow rustfmt to fail on dist.
2022-08-23Rollup merge of #100789 - compiler-errors:issue-99662, r=spastorinoMatthias Krüger-15/+26
Use separate infcx to solve obligations during negative coherence I feel like I fixed this already but I may have fixed it then forgot to push the branch... Also fixes up some redundant param-envs being passed around (since they're already passed around in the `Obligation`) Fixes #99662 r? ``@spastorino``
2022-08-23Rollup merge of #100641 - corwinkuiper:add-armv4t-target, r=oli-obkMatthias Krüger-0/+2
Add the armv4t-none-eabi target to the supported_targets This target was added in #100244 but forgot to add it to the macro in the `mod.rs` file. ``@Lokathor``
2022-08-23Rollup merge of #100565 - ↵Matthias Krüger-2/+233
TaKO8Ki:suggest-adding-missing-semicolon-before-item, r=compiler-errors Suggest adding a missing semicolon before an item fixes #100533
2022-08-23Rollup merge of #100382 - jackh726:gat-self-outlives-input, r=compiler-errorsMatthias Krüger-2/+26
Make the GATS self outlives error take into GATs in the inputs Before, the reasoning was that outlives should factor in to the outlives error, because that value is produced and inputs aren't. However, this is potentially confusing, and we can just require this for now and relax it later if we need. GATs in where clauses still don't count for the self outlives error, and I've added a test for that. This now errors: ```rust trait Input { type Item<'a>; //~^ missing required fn takes_item<'a>(&'a self, item: Self::Item<'a>); } ``` I've also added a test that this does not: ```rust trait WhereClause { type Item<'a>; fn takes_item<'a>(&'a self) where Self::Item<'a>: ; } ``` r? ``@compiler-errors``
2022-08-23Auto merge of #100678 - GuillaumeGomez:improve-rustdoc-json-tests, ↵bors-674/+605
r=aDotInTheVoid Improve rustdoc json tests Fixes #100588. r? `@aDotInTheVoid`
2022-08-22Auto merge of #99963 - cjgillot:iter-submodule, r=compiler-errorsbors-19/+13
Simplify implementation for par_for_each_module
2022-08-22Remove out-of-context comment in `mem::MaybeUninit` documentationThiago Trannin-5/+2
2022-08-23Mark suggestion as MaybeIncorrect.Camille GILLOT-1/+1
2022-08-23Remove FnItemRibKind.Camille GILLOT-27/+10
2022-08-23Remove generate_fn_name_span and generate_local_type_param_snippet.Camille GILLOT-87/+0
2022-08-23Do not call generate_fn_name_span in typeck.Camille GILLOT-9/+7
2022-08-23Improve local generic parameter suggestions.Camille GILLOT-81/+90
2022-08-23Create specific ConstantHasGenerics for ConstantItemRibKind.Camille GILLOT-18/+31
2022-08-22Move error trait into coreJane Losare-Lusby-226/+1264
2022-08-22Auto merge of #99762 - Nilstrieb:unreachable-prop, r=oli-obkbors-181/+315
UnreachableProp: Preserve unreachable branches for multiple targets Before, UnreachablePropagation removed all unreachable branches. This was a pessimization, as it removed information about reachability that was used later in the optimization pipeline. For example, this code ```rust pub enum Two { A, B } pub fn identity(x: Two) -> Two { match x { Two::A => Two::A, Two::B => Two::B, } } ``` basically has `switchInt() -> [0: 0, 1: 1, otherwise: unreachable]` for the match. This allows it to be transformed into a simple `x`. If we remove the unreachable branch, the transformation becomes illegal. This was the problem keeping `UnreachablePropagation` from being enabled, so we can enable it now. Something similar already happened in #77800, but it did not show a perf improvement there. Let's try it again anyways! Fixes #68105, although that issue has been fixed for a long time (see #77680).
2022-08-22Refactor part of codegen_call_terminatorEric Holk-47/+44
2022-08-22Auto merge of #100881 - Dylan-DPC:rollup-q9rr658, r=Dylan-DPCbors-425/+1050
Rollup of 8 pull requests Successful merges: - #98200 (Expand potential inner `Or` pattern for THIR) - #99770 (Make some const prop mir-opt tests `unit-test`s) - #99957 (Rework Ipv6Addr::is_global to check for global reachability rather than global scope - rebase) - #100331 (Guarantee `try_reserve` preserves the contents on error) - #100336 (Fix two const_trait_impl issues) - #100713 (Convert diagnostics in parser/expr to SessionDiagnostic) - #100820 (Use pointer `is_aligned*` methods) - #100872 (Add guarantee that Vec::default() does not alloc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-22Migrate rustc_plugin_impl to SessionDiagnosticPeter Medus-11/+35
2022-08-22net listen backlog update, follow-up from #97963.David CARLIER-4/+2
FreeBSD and using system limit instead for others.
2022-08-22Rollup merge of #100872 - JanBeh:PR_vec_default_alloc_doc, r=fee1-deadDylan DPC-0/+2
Add guarantee that Vec::default() does not alloc Currently `Vec::new()` is guaranteed to not allocate until elements are pushed onto the `Vec`, but such a guarantee is missing for `Vec`'s implementation of `Default::default`. This adds such a guarantee for `Vec::default()` to the API reference. See also [this discussion on URLO](https://users.rust-lang.org/t/guarantee-that-vec-default-does-not-allocate/79903).
2022-08-22Rollup merge of #100820 - WaffleLapkin:use_ptr_is_aligned_methods, r=scottmcmDylan DPC-8/+10
Use pointer `is_aligned*` methods This PR replaces some manual alignment checks with calls to `pointer::{is_aligned, is_aligned_to}` and removes a useless pointer cast. r? `@scottmcm` _split off from #100746_
2022-08-22Rollup merge of #100713 - Xiretza:parser-expr-session-diagnostics, r=estebankDylan DPC-282/+596
Convert diagnostics in parser/expr to SessionDiagnostic This migrates all the easy cases in `rustc_parse::parser::expr` to `SessionDiagnostic`s, I've left things such as `multipart_suggestion`s out for now in the hopes of a derive API being developed soon.
2022-08-22Rollup merge of #100336 - fee1-dead-contrib:fix-wf-const-trait, r=oli-obkDylan DPC-2/+39
Fix two const_trait_impl issues r? ``@oli-obk`` Fixes #100222. Fixes #100543.
2022-08-22Rollup merge of #100331 - lo48576:try-reserve-preserve-on-failure, r=thomccDylan DPC-6/+12
Guarantee `try_reserve` preserves the contents on error Update doc comments to make the guarantee explicit. However, some implementations does not have the statement though. * `HashMap`, `HashSet`: require guarantees on hashbrown side. * `PathBuf`: simply redirecting to `OsString`. Fixes #99606.
2022-08-22Rollup merge of #99957 - chotchki:ip-globally-reachable_rebase, ↵Dylan DPC-85/+217
r=Mark-Simulacrum Rework Ipv6Addr::is_global to check for global reachability rather than global scope - rebase Rebasing of pull request #86634 off of master to try and get the feature "ip" stabilized. I also found a test failure in the rebase that is_global was considering the benchmark space to be globally reachable. This is related to my other rebasing pull request #99947
2022-08-22Rollup merge of #99770 - Nilstrieb:mir-pass-unit-test, r=oli-obkDylan DPC-38/+60
Make some const prop mir-opt tests `unit-test`s Most of these have no or only tiny diffs beyond line numbers being changed (would it make sense to not have line numbers in mir-opt tests?). Some things changed a bit, but I think it should all be fine, not sure though.
2022-08-22Rollup merge of #98200 - ouz-a:issue-98177, r=oli-obkDylan DPC-4/+114
Expand potential inner `Or` pattern for THIR Code assumed there wouldn't be a deeper `Or` pattern inside expanded `PatStack` this fixes it by looking for the `Or` pattern inside expanded `PatStack`. A more ideal solution would be recursively doing this but I haven't found a good way to do that. _fixes #97898_