]> git.lizzy.rs Git - rust.git/log
rust.git
23 months agoCompile functions from clif ir to object code in parallel
bjorn3 [Tue, 23 Aug 2022 16:09:08 +0000 (16:09 +0000)]
Compile functions from clif ir to object code in parallel

23 months agoUse correct CguReuse variant
bjorn3 [Tue, 23 Aug 2022 16:06:01 +0000 (16:06 +0000)]
Use correct CguReuse variant

23 months agoRewrite error index generator to greatly reduce the size of the pages
Guillaume Gomez [Tue, 23 Aug 2022 16:27:18 +0000 (18:27 +0200)]
Rewrite error index generator to greatly reduce the size of the pages

23 months agoAdd a warning about `Option/Result::and()` being eagerly evaluated
Chayim Refael Friedman [Tue, 23 Aug 2022 16:15:09 +0000 (16:15 +0000)]
Add a warning about `Option/Result::and()` being eagerly evaluated

Copied from `or()`.

23 months agoDo asm compilation and object file emission in parallel
bjorn3 [Tue, 23 Aug 2022 16:05:29 +0000 (16:05 +0000)]
Do asm compilation and object file emission in parallel

23 months agoAdd a jobserver based concurrency limiter
bjorn3 [Tue, 23 Aug 2022 15:44:39 +0000 (15:44 +0000)]
Add a jobserver based concurrency limiter

23 months agoStore symbol name as owned string
bjorn3 [Fri, 19 Aug 2022 10:27:00 +0000 (10:27 +0000)]
Store symbol name as owned string

23 months agoSuggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexing
Chayim Refael Friedman [Tue, 23 Aug 2022 15:15:34 +0000 (15:15 +0000)]
Suggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexing

The error can be quite confusing to newcomers.

23 months agoAuto merge of #100920 - Dylan-DPC:rollup-vlcw3sr, r=Dylan-DPC
bors [Tue, 23 Aug 2022 15:12:09 +0000 (15:12 +0000)]
Auto merge of #100920 - Dylan-DPC:rollup-vlcw3sr, r=Dylan-DPC

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

23 months agoRollup merge of #100909 - nnethercote:minor-ast-LitKind-improvement, r=petrochenkov
Dylan DPC [Tue, 23 Aug 2022 15:10:09 +0000 (20:40 +0530)]
Rollup merge of #100909 - nnethercote:minor-ast-LitKind-improvement, r=petrochenkov

Minor `ast::LitKind` improvements

r? `@petrochenkov`

23 months agoRollup merge of #100907 - Nilstrieb:unrachable-typo-lol, r=Dylan-DPC
Dylan DPC [Tue, 23 Aug 2022 15:10:08 +0000 (20:40 +0530)]
Rollup merge of #100907 - Nilstrieb:unrachable-typo-lol, r=Dylan-DPC

Fix typo in UnreachableProp

r? ``@Dylan-DPC``

23 months agoRollup merge of #100857 - camsteffen:query-parse-refactor, r=davidtwco
Dylan DPC [Tue, 23 Aug 2022 15:10:07 +0000 (20:40 +0530)]
Rollup merge of #100857 - camsteffen:query-parse-refactor, r=davidtwco

Refactor query modifier parsing

Reduce redundancy and improve error spans.

23 months agoRollup merge of #100851 - Alexendoo:rpf-width-prec-spans, r=fee1-dead
Dylan DPC [Tue, 23 Aug 2022 15:10:06 +0000 (20:40 +0530)]
Rollup merge of #100851 - Alexendoo:rpf-width-prec-spans, r=fee1-dead

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

23 months agoRollup merge of #100835 - devnexen:listener_followups, r=devnexen
Dylan DPC [Tue, 23 Aug 2022 15:10:05 +0000 (20:40 +0530)]
Rollup merge of #100835 - devnexen:listener_followups, r=devnexen

net listen backlog update, follow-up from #97963.

FreeBSD and using system limit instead for others.

23 months agoRollup merge of #100768 - Facel3ss1:plugin-impl-translation, r=davidtwco
Dylan DPC [Tue, 23 Aug 2022 15:10:04 +0000 (20:40 +0530)]
Rollup merge of #100768 - Facel3ss1:plugin-impl-translation, r=davidtwco

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.

23 months agoRollup merge of #100368 - chenyukang:fix-100321, r=lcnr
Dylan DPC [Tue, 23 Aug 2022 15:10:03 +0000 (20:40 +0530)]
Rollup merge of #100368 - chenyukang:fix-100321, r=lcnr

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.

23 months agoRollup merge of #100309 - compiler-errors:issue-100300, r=sanxiyn
Dylan DPC [Tue, 23 Aug 2022 15:10:02 +0000 (20:40 +0530)]
Rollup merge of #100309 - compiler-errors:issue-100300, r=sanxiyn

Extend comma suggestion to cases where fields arent missing

Fixes #100300

23 months agoRollup merge of #99249 - cjgillot:no-reparse-fn, r=fee1-dead
Dylan DPC [Tue, 23 Aug 2022 15:10:01 +0000 (20:40 +0530)]
Rollup merge of #99249 - cjgillot:no-reparse-fn, r=fee1-dead

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.

23 months agoRemove aliases for old atomic intrinsics names
Tomasz Miąsko [Sat, 13 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Remove aliases for old atomic intrinsics names

23 months agoUse renamed atomic intrinsics in panic_unwind
Tomasz Miąsko [Sat, 13 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Use renamed atomic intrinsics in panic_unwind

23 months agoUpdate stdarch submodule
Tomasz Miąsko [Sat, 13 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Update stdarch submodule

23 months agoUse CRATE_HIR_ID and CRATE_DEF_ID for obligations from foreign crates
Santiago Pastorino [Tue, 23 Aug 2022 12:08:30 +0000 (09:08 -0300)]
Use CRATE_HIR_ID and CRATE_DEF_ID for obligations from foreign crates

23 months agoDo not use unneeded extra errors variable
Santiago Pastorino [Mon, 22 Aug 2022 18:54:02 +0000 (15:54 -0300)]
Do not use unneeded extra errors variable

23 months agoPermit negative impls coherence to take advantage of implied bounds
Santiago Pastorino [Mon, 22 Aug 2022 18:52:49 +0000 (15:52 -0300)]
Permit negative impls coherence to take advantage of implied bounds

23 months agoMove InferCtxtExt to rustc_trait_selection
Santiago Pastorino [Mon, 22 Aug 2022 19:53:34 +0000 (16:53 -0300)]
Move InferCtxtExt to rustc_trait_selection

23 months agoUse par_body_owners for liveness
Seo Sanghyeon [Tue, 23 Aug 2022 11:53:02 +0000 (20:53 +0900)]
Use par_body_owners for liveness

23 months agoRevert "Avoid masking shift amounts (#1268)"
bjorn3 [Tue, 23 Aug 2022 11:10:44 +0000 (11:10 +0000)]
Revert "Avoid masking shift amounts (#1268)"

This reverts commit 156bda8bc708cca60e9de18743d833c8d97dd7ff.

This breaks the mir_overflow_off rustc test:
https://github.com/bjorn3/rustc_codegen_cranelift/runs/7971362755?check_suite_focus=true#step:7:2904

23 months agoUse native scalar `fma` instruction (#1267)
Afonso Bordado [Tue, 23 Aug 2022 10:42:35 +0000 (11:42 +0100)]
Use native scalar `fma` instruction (#1267)

Cranelift 0.87 now supports lowering `fma` as a libcall on x86 [0].
With 0.88 enabling the native x86 instruction under the `has_fma` flag.

aarch64 and s390x already support this as a native instruction, so it's
nice that we emit it for those.

We can't lower the SIMD version using the `fma` instruction since the
lowering can fail if the x86 `has_fma` flag is not enabled. Cranelift
doesn't yet know how to fallback for these cases

[0]: https://github.com/bytecodealliance/wasmtime/commit/709716bb8e6adaf7e65f3497168af23ce0cf09ef

23 months agoAvoid masking shift amounts (#1268)
Afonso Bordado [Tue, 23 Aug 2022 10:42:24 +0000 (11:42 +0100)]
Avoid masking shift amounts (#1268)

Cranelift 0.87 now follows its own documentation regarding
shift amounts, and implicitly masks them if the arch requires it. [0]

[0]: https://github.com/bytecodealliance/wasmtime/commit/05089321740a07757dff0a285176b2651a49aae2

23 months agoparser will not give wrong help message for 'public'
yukang [Tue, 23 Aug 2022 09:02:40 +0000 (17:02 +0800)]
parser will not give wrong help message for 'public'

23 months agoAuto merge of #100782 - thomcc:fix-android-sigaddset, r=Mark-Simulacrum
bors [Tue, 23 Aug 2022 08:09:19 +0000 (08:09 +0000)]
Auto merge of #100782 - thomcc:fix-android-sigaddset, r=Mark-Simulacrum

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.

23 months agoDiagnose missing includes in run-make tests
Tomasz Miąsko [Tue, 23 Aug 2022 00:00:00 +0000 (00:00 +0000)]
Diagnose missing includes in run-make tests

23 months agoRemove the symbol from `ast::LitKind::Err`.
Nicholas Nethercote [Mon, 22 Aug 2022 03:27:52 +0000 (13:27 +1000)]
Remove the symbol from `ast::LitKind::Err`.

Because it's never used meaningfully.

23 months agoAdd some useful comments to `LitKind`.
Nicholas Nethercote [Mon, 22 Aug 2022 03:38:19 +0000 (13:38 +1000)]
Add some useful comments to `LitKind`.

23 months agoFix typo in UnreachableProp
nils [Tue, 23 Aug 2022 06:18:18 +0000 (08:18 +0200)]
Fix typo in UnreachableProp

23 months agoAuto merge of #100904 - matthiaskrgr:rollup-z3yzivj, r=matthiaskrgr
bors [Tue, 23 Aug 2022 05:22:05 +0000 (05:22 +0000)]
Auto merge of #100904 - matthiaskrgr:rollup-z3yzivj, r=matthiaskrgr

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

23 months agoRollup merge of #100893 - thinety:master, r=scottmcm
Matthias Krüger [Tue, 23 Aug 2022 04:55:31 +0000 (06:55 +0200)]
Rollup merge of #100893 - thinety:master, r=scottmcm

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.

23 months agoRollup merge of #100887 - eholk:codegen_call_terminator-cleanup, r=fee1-dead
Matthias Krüger [Tue, 23 Aug 2022 04:55:30 +0000 (06:55 +0200)]
Rollup merge of #100887 - eholk:codegen_call_terminator-cleanup, r=fee1-dead

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.

23 months agoRollup merge of #100862 - ehuss:tidy-crossbeam, r=Mark-Simulacrum
Matthias Krüger [Tue, 23 Aug 2022 04:55:29 +0000 (06:55 +0200)]
Rollup merge of #100862 - ehuss:tidy-crossbeam, r=Mark-Simulacrum

tidy: remove crossbeam-utils

crossbeam-utils is no longer needed now that scoped threads are available in 1.63.

23 months agoRollup merge of #100861 - RalfJung:const-ice, r=oli-obk
Matthias Krüger [Tue, 23 Aug 2022 04:55:28 +0000 (06:55 +0200)]
Rollup merge of #100861 - RalfJung:const-ice, r=oli-obk

fix ICE with extra-const-ub-checks

Fixes https://github.com/rust-lang/rust/issues/100771

23 months agoRollup merge of #100832 - ehuss:bootstrap-cleanup, r=jyn514
Matthias Krüger [Tue, 23 Aug 2022 04:55:27 +0000 (06:55 +0200)]
Rollup merge of #100832 - ehuss:bootstrap-cleanup, r=jyn514

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.

23 months agoRollup merge of #100789 - compiler-errors:issue-99662, r=spastorino
Matthias Krüger [Tue, 23 Aug 2022 04:55:26 +0000 (06:55 +0200)]
Rollup merge of #100789 - compiler-errors:issue-99662, r=spastorino

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``

23 months agoRollup merge of #100641 - corwinkuiper:add-armv4t-target, r=oli-obk
Matthias Krüger [Tue, 23 Aug 2022 04:55:25 +0000 (06:55 +0200)]
Rollup merge of #100641 - corwinkuiper:add-armv4t-target, r=oli-obk

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``

23 months agoRollup merge of #100565 - TaKO8Ki:suggest-adding-missing-semicolon-before-item, r...
Matthias Krüger [Tue, 23 Aug 2022 04:55:24 +0000 (06:55 +0200)]
Rollup merge of #100565 - TaKO8Ki:suggest-adding-missing-semicolon-before-item, r=compiler-errors

Suggest adding a missing semicolon before an item

fixes #100533

23 months agoRollup merge of #100382 - jackh726:gat-self-outlives-input, r=compiler-errors
Matthias Krüger [Tue, 23 Aug 2022 04:55:23 +0000 (06:55 +0200)]
Rollup merge of #100382 - jackh726:gat-self-outlives-input, r=compiler-errors

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``

23 months agoAuto merge of #100678 - GuillaumeGomez:improve-rustdoc-json-tests, r=aDotInTheVoid
bors [Tue, 23 Aug 2022 02:40:52 +0000 (02:40 +0000)]
Auto merge of #100678 - GuillaumeGomez:improve-rustdoc-json-tests, r=aDotInTheVoid

Improve rustdoc json tests

Fixes #100588.

r? `@aDotInTheVoid`

23 months ago./x.py test --bless
Tomasz Miąsko [Tue, 23 Aug 2022 00:00:00 +0000 (00:00 +0000)]
./x.py test --bless

23 months agoRemove support for adding statement to all successors
Tomasz Miąsko [Sat, 30 Jul 2022 00:00:00 +0000 (00:00 +0000)]
Remove support for adding statement to all successors

This feature of MIR patch system is no longer used.

23 months agoElide storage markers for internal locals when inlining
Tomasz Miąsko [Sat, 30 Jul 2022 00:00:00 +0000 (00:00 +0000)]
Elide storage markers for internal locals when inlining

23 months agoElide storage markers when elaborating deref projections
Tomasz Miąsko [Sat, 30 Jul 2022 00:00:00 +0000 (00:00 +0000)]
Elide storage markers when elaborating deref projections

23 months agoElide storage markers when elaborating box derefs
Tomasz Miąsko [Sat, 30 Jul 2022 00:00:00 +0000 (00:00 +0000)]
Elide storage markers when elaborating box derefs

23 months agoAuto merge of #99963 - cjgillot:iter-submodule, r=compiler-errors
bors [Mon, 22 Aug 2022 23:09:35 +0000 (23:09 +0000)]
Auto merge of #99963 - cjgillot:iter-submodule, r=compiler-errors

Simplify implementation for par_for_each_module

23 months agoRemove out-of-context comment in `mem::MaybeUninit` documentation
Thiago Trannin [Mon, 22 Aug 2022 23:03:53 +0000 (20:03 -0300)]
Remove out-of-context comment in `mem::MaybeUninit` documentation

23 months agoMark suggestion as MaybeIncorrect.
Camille GILLOT [Mon, 22 Aug 2022 22:09:58 +0000 (00:09 +0200)]
Mark suggestion as MaybeIncorrect.

23 months agoRemove FnItemRibKind.
Camille GILLOT [Thu, 14 Jul 2022 15:40:43 +0000 (17:40 +0200)]
Remove FnItemRibKind.

23 months agoRemove generate_fn_name_span and generate_local_type_param_snippet.
Camille GILLOT [Thu, 14 Jul 2022 15:28:34 +0000 (17:28 +0200)]
Remove generate_fn_name_span and generate_local_type_param_snippet.

23 months agoDo not call generate_fn_name_span in typeck.
Camille GILLOT [Thu, 14 Jul 2022 15:27:49 +0000 (17:27 +0200)]
Do not call generate_fn_name_span in typeck.

23 months agoImprove local generic parameter suggestions.
Camille GILLOT [Thu, 14 Jul 2022 13:09:30 +0000 (15:09 +0200)]
Improve local generic parameter suggestions.

23 months agoCreate specific ConstantHasGenerics for ConstantItemRibKind.
Camille GILLOT [Thu, 14 Jul 2022 12:54:53 +0000 (14:54 +0200)]
Create specific ConstantHasGenerics for ConstantItemRibKind.

23 months agoMove error trait into core
Jane Losare-Lusby [Fri, 29 Jul 2022 18:54:47 +0000 (18:54 +0000)]
Move error trait into core

23 months agoAuto merge of #99762 - Nilstrieb:unreachable-prop, r=oli-obk
bors [Mon, 22 Aug 2022 20:28:16 +0000 (20:28 +0000)]
Auto merge of #99762 - Nilstrieb:unreachable-prop, r=oli-obk

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).

23 months agoUpdate to Cranelift 0.87.0
bjorn3 [Mon, 22 Aug 2022 18:53:10 +0000 (18:53 +0000)]
Update to Cranelift 0.87.0

23 months agoRefactor part of codegen_call_terminator
Eric Holk [Mon, 22 Aug 2022 18:25:56 +0000 (11:25 -0700)]
Refactor part of codegen_call_terminator

23 months agoRemove use of DiagnosticArgFromDisplay
Giacomo Stevanato [Mon, 22 Aug 2022 13:58:26 +0000 (15:58 +0200)]
Remove use of DiagnosticArgFromDisplay

23 months agoerrors: `IntoDiagnosticArg` for `io::Error`/paths
David Wood [Fri, 19 Aug 2022 13:45:54 +0000 (14:45 +0100)]
errors: `IntoDiagnosticArg` for `io::Error`/paths

Add impls of `IntoDiagnosticArg` for `std::io::Error`, `std::path::Path`
and `std::path::PathBuf`.

Signed-off-by: David Wood <david.wood@huawei.com>
23 months agoAuto merge of #100881 - Dylan-DPC:rollup-q9rr658, r=Dylan-DPC
bors [Mon, 22 Aug 2022 17:46:57 +0000 (17:46 +0000)]
Auto merge of #100881 - Dylan-DPC:rollup-q9rr658, r=Dylan-DPC

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

23 months agoMigrate rustc_plugin_impl to SessionDiagnostic
Peter Medus [Fri, 19 Aug 2022 17:29:33 +0000 (18:29 +0100)]
Migrate rustc_plugin_impl to SessionDiagnostic

23 months agonet listen backlog update, follow-up from #97963.
David CARLIER [Sun, 21 Aug 2022 05:58:51 +0000 (06:58 +0100)]
net listen backlog update, follow-up from #97963.

FreeBSD and using system limit instead for others.

23 months agoRollup merge of #100872 - JanBeh:PR_vec_default_alloc_doc, r=fee1-dead
Dylan DPC [Mon, 22 Aug 2022 15:04:16 +0000 (20:34 +0530)]
Rollup merge of #100872 - JanBeh:PR_vec_default_alloc_doc, r=fee1-dead

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).

23 months agoRollup merge of #100820 - WaffleLapkin:use_ptr_is_aligned_methods, r=scottmcm
Dylan DPC [Mon, 22 Aug 2022 15:04:15 +0000 (20:34 +0530)]
Rollup merge of #100820 - WaffleLapkin:use_ptr_is_aligned_methods, r=scottmcm

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_

23 months agoRollup merge of #100713 - Xiretza:parser-expr-session-diagnostics, r=estebank
Dylan DPC [Mon, 22 Aug 2022 15:04:14 +0000 (20:34 +0530)]
Rollup merge of #100713 - Xiretza:parser-expr-session-diagnostics, r=estebank

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.

23 months agoRollup merge of #100336 - fee1-dead-contrib:fix-wf-const-trait, r=oli-obk
Dylan DPC [Mon, 22 Aug 2022 15:04:13 +0000 (20:34 +0530)]
Rollup merge of #100336 - fee1-dead-contrib:fix-wf-const-trait, r=oli-obk

Fix two const_trait_impl issues

r? ``@oli-obk``

Fixes #100222.
Fixes #100543.

23 months agoRollup merge of #100331 - lo48576:try-reserve-preserve-on-failure, r=thomcc
Dylan DPC [Mon, 22 Aug 2022 15:04:12 +0000 (20:34 +0530)]
Rollup merge of #100331 - lo48576:try-reserve-preserve-on-failure, r=thomcc

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.

23 months agoRollup merge of #99957 - chotchki:ip-globally-reachable_rebase, r=Mark-Simulacrum
Dylan DPC [Mon, 22 Aug 2022 15:04:10 +0000 (20:34 +0530)]
Rollup merge of #99957 - chotchki:ip-globally-reachable_rebase, 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

23 months agoRollup merge of #99770 - Nilstrieb:mir-pass-unit-test, r=oli-obk
Dylan DPC [Mon, 22 Aug 2022 15:04:09 +0000 (20:34 +0530)]
Rollup merge of #99770 - Nilstrieb:mir-pass-unit-test, r=oli-obk

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.

23 months agoRollup merge of #98200 - ouz-a:issue-98177, r=oli-obk
Dylan DPC [Mon, 22 Aug 2022 15:04:08 +0000 (20:34 +0530)]
Rollup merge of #98200 - ouz-a:issue-98177, r=oli-obk

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_

23 months agoAuto merge of #99908 - Nilstrieb:mir-opt-span, r=oli-obk
bors [Mon, 22 Aug 2022 14:59:21 +0000 (14:59 +0000)]
Auto merge of #99908 - Nilstrieb:mir-opt-span, r=oli-obk

Show absolute line numbers if span is outside relative span

In the MIR pretty printing, it can sometimes happen that the span of the statement is outside the span of the body (for example through inlining). In this case, don't display a relative span but an absolute span. This will make the mir-opt-tests a little more prone to diffs again, but the impact should be small.

Fixes #99854

r? `@oli-obk`

23 months agoremove hack fix since we don't have no overflow diagnostic
yukang [Mon, 22 Aug 2022 14:22:15 +0000 (22:22 +0800)]
remove hack fix since we don't have no overflow diagnostic

23 months agoInferCtxt emit error when incorrectly tainted by errors
yukang [Wed, 10 Aug 2022 14:21:34 +0000 (22:21 +0800)]
InferCtxt emit error when incorrectly tainted by errors

23 months agobless mir-opt tests
Nilstrieb [Fri, 29 Jul 2022 16:52:38 +0000 (18:52 +0200)]
bless mir-opt tests

23 months agoPrefix fluent resources with interface_
Giacomo Stevanato [Mon, 22 Aug 2022 12:59:41 +0000 (14:59 +0200)]
Prefix fluent resources with interface_

23 months agobless ui tests
Nilstrieb [Fri, 29 Jul 2022 16:52:04 +0000 (18:52 +0200)]
bless ui tests

23 months agoFix span for consts in mir builder
Nilstrieb [Fri, 29 Jul 2022 16:49:27 +0000 (18:49 +0200)]
Fix span for consts in mir builder

23 months agoShow absolute line numbers if span is outside relative span
Nilstrieb [Fri, 29 Jul 2022 14:34:06 +0000 (16:34 +0200)]
Show absolute line numbers if span is outside relative span

In the MIR pretty printing, it can sometimes happen that the span of the
statement is outside the span of the body (for example through
inlining). In this case, don't display a relative span but an absolute
span. This will make the mir-opt-tests a little more prone to diffs
again, but the impact should be small.

23 months agofix tidy
Deadbeef [Mon, 22 Aug 2022 11:41:38 +0000 (11:41 +0000)]
fix tidy

23 months agoAuto merge of #99702 - SparrowLii:transtive_relation, r=oli-obk
bors [Mon, 22 Aug 2022 11:39:53 +0000 (11:39 +0000)]
Auto merge of #99702 - SparrowLii:transtive_relation, r=oli-obk

get rid of `RefCell` in `TransitiveRelation`

This is one of the jobs in `Pending refactorings` in #48685. The parallel-compiler's work has been suspended for quite some time, but I think I can pick it up gradually. I think this PR should be a start.

Regarding the refactoring of `TransitiveRelation`, `@nikomatsakis`  has proposed [two(three?) schemes](https://github.com/rust-lang/rust/pull/48587#issuecomment-369336651). In order to satisfy both compilation efficiency and robustness, I think adding the `freeze` method may be the best solution, although it requires relatively more code changes.

23 months agoOverhaul 100222 test; wf always remap to nonconst
Deadbeef [Mon, 22 Aug 2022 11:28:01 +0000 (11:28 +0000)]
Overhaul 100222 test; wf always remap to nonconst

23 months agoDeny diagnostic lints in rustc_interface
Giacomo Stevanato [Sat, 20 Aug 2022 16:33:35 +0000 (18:33 +0200)]
Deny diagnostic lints in rustc_interface

23 months agoMove rustc_interface diagnostics to struct SessionDiagnostic derives
Giacomo Stevanato [Sat, 20 Aug 2022 16:33:02 +0000 (18:33 +0200)]
Move rustc_interface diagnostics to struct SessionDiagnostic derives

23 months agoMove existing diagnostic struct to a new errors module
Giacomo Stevanato [Sat, 20 Aug 2022 16:30:49 +0000 (18:30 +0200)]
Move existing diagnostic struct to a new errors module

23 months agoremove stray comment
Deadbeef [Mon, 22 Aug 2022 11:06:07 +0000 (11:06 +0000)]
remove stray comment

23 months agoFix wf check on `#[const_trait]` return types
Deadbeef [Tue, 9 Aug 2022 17:41:49 +0000 (17:41 +0000)]
Fix wf check on `#[const_trait]` return types

23 months agoAdd guarantee that Vec::default() does not alloc
Jan Behrens [Mon, 22 Aug 2022 10:36:44 +0000 (12:36 +0200)]
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.

23 months agore-base and use `OutlivesEnvironment::with_bounds`
SparrowLii [Mon, 22 Aug 2022 10:36:02 +0000 (18:36 +0800)]
re-base and use `OutlivesEnvironment::with_bounds`

23 months agouse type alias impl trait in `outlives_bounds::InferCtxtExt`
SparrowLii [Mon, 1 Aug 2022 02:23:09 +0000 (10:23 +0800)]
use type alias impl trait in `outlives_bounds::InferCtxtExt`

23 months agoadd `with_bounds` to `OutlivesEnvironment` and `implied_bounds_tys` to `outlives_boun...
SparrowLii [Fri, 29 Jul 2022 07:08:50 +0000 (15:08 +0800)]
add `with_bounds` to `OutlivesEnvironment` and `implied_bounds_tys` to `outlives_bounds::InferCtxtExt`

23 months agoget rid of `RefCell` in `TransitiveRelation`
SparrowLii [Mon, 25 Jul 2022 03:06:22 +0000 (11:06 +0800)]
get rid of `RefCell` in `TransitiveRelation`

23 months agomake some methods private
Takayuki Maeda [Mon, 22 Aug 2022 09:12:18 +0000 (18:12 +0900)]
make some methods private

23 months agoAuto merge of #100868 - Dylan-DPC:rollup-a1hfi1r, r=Dylan-DPC
bors [Mon, 22 Aug 2022 08:32:41 +0000 (08:32 +0000)]
Auto merge of #100868 - Dylan-DPC:rollup-a1hfi1r, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #93162 (Std module docs improvements)
 - #99386 (Add tests that check `Vec::retain` predicate execution order.)
 - #99915 (Recover keywords in trait bounds)
 - #100694 (Migrate rustc_ast_passes diagnostics to `SessionDiagnostic` and translatable messages (first part))
 - #100757 (Catch overflow early)

Failed merges:

 - #99917 (Move Error trait into core)

r? `@ghost`
`@rustbot` modify labels: rollup

23 months agofluent: update tests
Xiretza [Wed, 17 Aug 2022 11:05:13 +0000 (13:05 +0200)]
fluent: update tests