about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-04-22Fix grammarCaleb Robson-2/+2
2023-04-22Auto merge of #109507 - Amanieu:panic-oom-payload, r=davidtwcobors-878/+138
Report allocation errors as panics OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`. This should be review one commit at a time: - The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics. - The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API. ACP: https://github.com/rust-lang/libs-team/issues/192 Closes #51540 Closes #51245
2023-04-22Auto merge of #104844 - cjgillot:mention-eval-place, r=jackh726,RalfJungbors-39/+201
Evaluate place expression in `PlaceMention` https://github.com/rust-lang/rust/pull/102256 introduces a `PlaceMention(place)` MIR statement which keep trace of `let _ = place` statements from surface rust, but without semantics. This PR proposes to change the behaviour of `let _ =` patterns with respect to the borrow-checker to verify that the bound place is live. Specifically, consider this code: ```rust let _ = { let a = 5; &a }; ``` This passes borrowck without error on stable. Meanwhile, replacing `_` by `_: _` or `_p` errors with "error[E0597]: `a` does not live long enough", [see playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c448d25a7c205dc95a0967fe96bccce8). This PR *does not* change how `_` patterns behave with respect to initializedness: it remains ok to bind a moved-from place to `_`. The relevant test is `tests/ui/borrowck/let_underscore_temporary.rs`. Crater check found no regression. For consistency, this PR changes miri to evaluate the place found in `PlaceMention`, and report eventual dangling pointers found within it. r? `@RalfJung`
2023-04-22Auto merge of #110567 - JohnBobbo96:monomorphize-dyn-dispatch, r=b-naberbors-20/+91
Remove some uses of dynamic dispatch during monomorphization/partitioning. This removes a few uses of dynamic dispatch and instead uses generics, as well as an enum to allow for other partitioning methods to be added later.
2023-04-22Auto merge of #110666 - JohnTitor:rollup-3pwilte, r=JohnTitorbors-180/+200
Rollup of 7 pull requests Successful merges: - #109949 (rustdoc: migrate `document_type_layout` to askama) - #110622 (Stable hash tag (discriminant) of `GenericArg`) - #110635 (More `IS_ZST` in `library`) - #110640 (compiler/rustc_target: Raise m68k-linux-gnu baseline to 68020) - #110657 (nit: consistent naming for SimplifyConstCondition) - #110659 (rustdoc: clean up JS) - #110660 (Print ty placeholders pretty) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-22Auto merge of #110469 - compiler-errors:encode-lt-param-span, r=oli-obkbors-34/+50
Encode lifetime param spans too Fixes #110464 Fixes #110591
2023-04-22Rollup merge of #110660 - compiler-errors:placeholders-pretty, ↵Yuki Okushi-1/+25
r=wesleywiser,BoxyUwU Print ty placeholders pretty Makes anon placeholders print like `!0` instead of `Placeholder { ... }`. ``` rustc_trait_selection::solve::compute_well_formed_goal goal=Goal{ predicate: !0, param_env: ParamEnv{ caller_bounds: [ Binder(TraitPredicate(<!0 as std::marker::Copy>, polarity: Positive), []), Binder(TraitPredicate(<!0 as std::clone::Clone>, polarity: Positive), []), Binder(TraitPredicate(<!0 as std::marker::Sized>, polarity: Positive), []), ], reveal: UserFacing, constness: NotConst, } } ``` cc `@BoxyUwU` who might care about this formatting decision
2023-04-22Rollup merge of #110659 - notriddle:notriddle/js-cleanup-20230421, ↵Yuki Okushi-11/+6
r=GuillaumeGomez rustdoc: clean up JS * use `Set` for ignored crates in cross-crate trait impl JS, instead of `indexOf` string manipulation * lift constant `window.location.split` code out of a loop in source code sidebar builder * remove redundant history manipulation from search page exit
2023-04-22Rollup merge of #110657 - miguelraz:cleanup-simplifycfg-refactor, ↵Yuki Okushi-8/+6
r=compiler-errors nit: consistent naming for SimplifyConstCondition Fixing a small naming inconsistency that `@JakobDegen` brought up in https://github.com/rust-lang/rust/pull/110477#discussion_r1170783823. Please signal for rollup.
2023-04-22Rollup merge of #110640 - glaubitz:m68k-baseline, r=oli-obkYuki Okushi-0/+1
compiler/rustc_target: Raise m68k-linux-gnu baseline to 68020 Atomic operations require 68020 or later on m68k-linux-gnu.
2023-04-22Rollup merge of #110635 - scottmcm:zst-checks, r=the8472Yuki Okushi-15/+7
More `IS_ZST` in `library` I noticed that `post_inc_start` and `pre_dec_end` were doing this check in different ways https://github.com/rust-lang/rust/blob/d19b64fb54391b64ce99981577c67c93ac2a9ffa/library/core/src/slice/iter/macros.rs#L76-L93 so started making this PR, then added a few more I found since I was already making changes anyway.
2023-04-22Rollup merge of #110622 - WaffleLapkin:hashtag#, r=compiler-errorsYuki Okushi-29/+1
Stable hash tag (discriminant) of `GenericArg` This is a continuation of my quest of removing `transmute` if generic args and types (#110496, #110599). r? `@compiler-errors`
2023-04-22Rollup merge of #109949 - notriddle:notriddle/type-layout, r=jshaYuki Okushi-116/+154
rustdoc: migrate `document_type_layout` to askama
2023-04-22Print ty placeholders prettyMichael Goulet-1/+25
2023-04-22Encode lifetime param spans tooMichael Goulet-34/+50
2023-04-22Auto merge of #106934 - DrMeepster:offset_of, r=WaffleLapkinbors-42/+1355
Add offset_of! macro (RFC 3308) Implements https://github.com/rust-lang/rfcs/pull/3308 (tracking issue #106655) by adding the built in macro `core::mem::offset_of`. Two of the future possibilities are also implemented: * Nested field accesses (without array indexing) * DST support (for `Sized` fields) I wrote this a few months ago, before the RFC merged. Now that it's merged, I decided to rebase and finish it. cc `@thomcc` (RFC author)
2023-04-21More `IS_ZST` in `library`Scott McMurray-15/+7
I noticed that `post_inc_start` and `pre_dec_end` were doing this check in different ways https://github.com/rust-lang/rust/blob/d19b64fb54391b64ce99981577c67c93ac2a9ffa/library/core/src/slice/iter/macros.rs#L76-L93 so started making this PR, then added a few more I found since I was already making changes anyway.
2023-04-21rustdoc: clean up redundant search hiding results codeMichael Howell-8/+1
* There's no need to call `history.replaceState` right before calling `searchState.hideResults`, which already does it. * There's no need to implement hiding search results when that is already implemented.
2023-04-21rustdoc: lift constant string manipulation out of loopMichael Howell-1/+1
2023-04-21rustdoc: use Set for ignored crates, instead of string matchingMichael Howell-2/+4
2023-04-21Auto merge of #110653 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 14 commits in d0a4cbcee614fdb7ba66e860e603a00a644d71f8..de80432f04da61d98dcbbc1572598071718ccfd2 2023-04-16 17:42:50 +0000 to 2023-04-21 13:18:32 +0000 - Bump to 0.72.0; update changelog (rust-lang/cargo#12012) - Remove `src/doc` from `exclude` list in Cargo.toml (rust-lang/cargo#12000) - `--help` output use line wrap (rust-lang/cargo#12013) - Fix semver checks for 1.69 (rust-lang/cargo#12011) - Update contributor guide with new issue labels. (rust-lang/cargo#12003) - Better error message when getting an empty dep table (rust-lang/cargo#11997) - Fix broken links in contributor guide. (rust-lang/cargo#12002) - Update linux-raw-sys to 0.3.2 (rust-lang/cargo#11998) - chore: Use globs for workspace members (rust-lang/cargo#11996) - fix: Allow win/mac credential managers to build on all platforms (rust-lang/cargo#11993) - Add S-triage auto-label. (rust-lang/cargo#11995) - ci: check if Cargo.lock is up-to-date (rust-lang/cargo#11994) - Recompile on profile rustflags changes (rust-lang/cargo#11981) - Clarify some 1.69 changelog entries. (rust-lang/cargo#11982)
2023-04-21nit: consistent naming for SimplifyConstConditionmiguelraz-8/+6
2023-04-21Actually keep `PlaceMention` if requested.Camille GILLOT-23/+45
2023-04-21Evaluate place expression in `PlaceMention`.Camille GILLOT-19/+159
2023-04-21Auto merge of #110648 - Dylan-DPC:rollup-em3ovcq, r=Dylan-DPCbors-40/+153
Rollup of 5 pull requests Successful merges: - #110333 (rustc_metadata: Split `children` into multiple tables) - #110501 (rustdoc: fix ICE from rustc_resolve and librustdoc parse divergence) - #110608 (Specialize some `io::Read` and `io::Write` methods for `VecDeque<u8>` and `&[u8]`) - #110632 (Panic instead of truncating if the incremental on-disk cache is too big) - #110633 (More `mem::take` in `library`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-21Update cargoWeihang Lo-0/+0
2023-04-21rustdoc: remove unnecessary bindingMichael Howell-5/+4
2023-04-21rustdoc: factor `document_type_layout` into its own moduleMichael Howell-77/+90
2023-04-21Auto merge of #110107 - cjgillot:const-prop-lint-junk, r=oli-obkbors-51/+65
Ensure mir_drops_elaborated_and_const_checked when requiring codegen. mir_drops_elaborated_and_const_checked may emit errors while codegen has started, and the compiler would exit leaving object code files around. Found by `@cuviper` in https://github.com/rust-lang/rust/issues/109731
2023-04-21Adjust expected result for coverage testAmanieu d'Antras-3/+3
2023-04-21Do not rely on exact error code.Camille GILLOT-1/+1
2023-04-21Bless miri.Camille GILLOT-11/+20
2023-04-21Ensure mir_drops_elaborated_and_const_checked when requiring codegen.Camille GILLOT-40/+45
2023-04-21rustdoc: get rid of redundant, nested `let` linesMichael Howell-17/+13
2023-04-21rustfmt fmtDrMeepster-1/+3
2023-04-21Auto merge of #110569 - saethlin:mir-pass-cooperation, r=cjgillotbors-19/+61
Deduplicate unreachable blocks, for real this time In https://github.com/rust-lang/rust/pull/106428 (in particular https://github.com/rust-lang/rust/pull/106428/commits/41eda69516dd3ee217ae07c0efa369d31f630405) we noticed that inlining `unreachable_unchecked` can produce duplicate unreachable blocks. So we improved two MIR optimizations: `SimplifyCfg` was given a simplify to deduplicate unreachable blocks, then `InstCombine` was given a combiner to deduplicate switch targets that point at the same block. The problem is that change doesn't actually work. Our current pass order is ``` SimplifyCfg (does nothing relevant to this situation) Inline (produces multiple unreachable blocks) InstCombine (doesn't do anything here, oops) SimplifyCfg (produces the duplicate SwitchTargets that InstCombine is looking for) ``` So in here, I have factored out the specific function from `InstCombine` and placed it inside the simplify that produces the case it is looking for. This should ensure that it runs in the scenario it was designed for. Fixes https://github.com/rust-lang/rust/issues/110551 r? `@cjgillot`
2023-04-21Rollup merge of #110633 - scottmcm:more-take, r=thomccDylan DPC-10/+10
More `mem::take` in `library` A bunch of places were using `replace(…, &mut [])`, but that can just be `take`.
2023-04-21Rollup merge of #110632 - saethlin:panic-if-dep-graph-too-big, r=lcnrDylan DPC-1/+1
Panic instead of truncating if the incremental on-disk cache is too big It seems _unlikely_ that anyone would hit this truncation, but if this `as` does actually truncate, that seems incredibly bad.
2023-04-21Rollup merge of #110608 - a1phyr:specialize_io_methods, r=thomccDylan DPC-0/+54
Specialize some `io::Read` and `io::Write` methods for `VecDeque<u8>` and `&[u8]` This improves implementation of: - `<&[u8]>::read_to_string` - `VecDeque<u8>::read_to_end` - `VecDeque<u8>::read_to_string` - `VecDeque<u8>::write_vectored`
2023-04-21Rollup merge of #110501 - notriddle:notriddle/ice-110495, r=petrochenkovDylan DPC-0/+61
rustdoc: fix ICE from rustc_resolve and librustdoc parse divergence Fixes #110495
2023-04-21Rollup merge of #110333 - petrochenkov:notagain, r=compiler-errorsDylan DPC-29/+27
rustc_metadata: Split `children` into multiple tables instead of merging everything into a single bag. If it's acceptable from performance point of view, then it's more clear to keep this stuff organized more in accordance with its use.
2023-04-21Auto merge of #110542 - petrochenkov:qcstore4, r=cjgillotbors-14/+3
resolve: Remove `module_children_untracked` One of the expensive spans in `ModChild` was removed in https://github.com/rust-lang/rust/pull/109772, so let's try again.
2023-04-21rustc_metadata: Split `children` into multiple tablesVadim Petrochenkov-29/+27
instead of merging everything into a single bag. If it's acceptable from performance point of view, then it's more clear to keep this stuff organized more in accordance with its use.
2023-04-21compiler/rustc_target: Raise m68k-linux-gnu baseline to 68020John Paul Adrian Glaubitz-0/+1
Atomic operations require 68020 or later on m68k-linux-gnu.
2023-04-21Auto merge of #109002 - michaelvanstraten:master, r=petrochenkovbors-3/+28
Added byte position range for `proc_macro::Span` Currently, the [`Debug`](https://doc.rust-lang.org/beta/proc_macro/struct.Span.html#impl-Debug-for-Span) implementation for [`proc_macro::Span`](https://doc.rust-lang.org/beta/proc_macro/struct.Span.html#) calls the debug function implemented in the trait implementation of `server::Span` for the type `Rustc` in the `rustc-expand` crate. The current implementation, of the referenced function, looks something like this: ```rust fn debug(&mut self, span: Self::Span) -> String { if self.ecx.ecfg.span_debug { format!("{:?}", span) } else { format!("{:?} bytes({}..{})", span.ctxt(), span.lo().0, span.hi().0) } } ``` It returns the byte position of the [`Span`](https://doc.rust-lang.org/beta/proc_macro/struct.Span.html#) as an interpolated string. Because this is currently the only way to get a spans position in the file, I might lead someone, who is interested in this information, to parsing this interpolated string back into a range of bytes, which I think is a very non-rusty way. The proposed `position()`, method implemented in this PR, gives the ability to directly get this info. It returns a [`std::ops::Range`](https://doc.rust-lang.org/std/ops/struct.Range.html#) wrapping the lowest and highest byte of the [`Span`](https://doc.rust-lang.org/beta/proc_macro/struct.Span.html#). I put it behind the `proc_macro_span` feature flag because many of the other functions that have a similar footprint also are annotated with it, I don't actually know if this is right. It would be great if somebody could take a look at this, thank you very much in advanced.
2023-04-21major test improvementsDrMeepster-24/+349
2023-04-21minor tweaksDrMeepster-21/+19
2023-04-21blessDrMeepster-6/+6
2023-04-21fmtDrMeepster-13/+12
2023-04-21use P<[Ident]> instead of Vec<Ident>DrMeepster-4/+4