]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agorevert-overflow
ouz-a [Sat, 19 Nov 2022 19:43:12 +0000 (22:43 +0300)]
revert-overflow

20 months agoAuto merge of #104607 - matthiaskrgr:rollup-9s589me, r=matthiaskrgr
bors [Sat, 19 Nov 2022 15:40:04 +0000 (15:40 +0000)]
Auto merge of #104607 - matthiaskrgr:rollup-9s589me, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #103117 (Use `IsTerminal` in place of `atty`)
 - #103969 (Partial support for running UI tests with `download-rustc`)
 - #103989 (Fix build of std for thumbv7a-pc-windows-msvc)
 - #104076 (fix sysroot issue which appears for ci downloaded rustc)
 - #104469 (Make "long type" printing type aware and trim types in E0275)
 - #104497 (detect () to avoid redundant <> suggestion for type)
 - #104577 (Don't focus on notable trait parent when hiding it)
 - #104587 (Update cargo)
 - #104593 (Improve spans for RPITIT object-safety errors)
 - #104604 (Migrate top buttons style to CSS variables)

Failed merges:

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

20 months agoRollup merge of #104604 - GuillaumeGomez:migrate-top-button-to-css-var, r=notriddle
Matthias Krüger [Sat, 19 Nov 2022 14:35:23 +0000 (15:35 +0100)]
Rollup merge of #104604 - GuillaumeGomez:migrate-top-button-to-css-var, r=notriddle

Migrate top buttons style to CSS variables

No UI changes.

r? `@notriddle`

20 months agoRollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, r=fee1-dead
Matthias Krüger [Sat, 19 Nov 2022 14:35:23 +0000 (15:35 +0100)]
Rollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, r=fee1-dead

Improve spans for RPITIT object-safety errors

No reason why we can't point at the `impl Trait` that causes the object-safety violation.

Also [drive-by: Add is_async fn to hir::IsAsync](https://github.com/rust-lang/rust/pull/104593/commits/c4165f3a965e258531928180195637455299c6f3), which touches clippy too.

20 months agoRollup merge of #104587 - weihanglo:update-cargo, r=weihanglo
Matthias Krüger [Sat, 19 Nov 2022 14:35:22 +0000 (15:35 +0100)]
Rollup merge of #104587 - weihanglo:update-cargo, r=weihanglo

Update cargo

3 commits in 16b097879b6f117c8ae698aab054c87f26ff325e..eb5d35917b2395194593c9ca70c3778f60c1573b
2022-11-14 23:28:16 +0000 to 2022-11-17 22:08:43 +0000
- Fix several tests that are waiting 60 seconds for publishing to time out (rust-lang/cargo#11388)
- Implement RFC 3139: alternative registry authentication support (rust-lang/cargo#10592)
- Fix cargo install --index when used with registry.default (rust-lang/cargo#11302)

r? `@ghost`

20 months agoRollup merge of #104577 - GuillaumeGomez:remove-focus-on-blur, r=notriddle
Matthias Krüger [Sat, 19 Nov 2022 14:35:22 +0000 (15:35 +0100)]
Rollup merge of #104577 - GuillaumeGomez:remove-focus-on-blur, r=notriddle

Don't focus on notable trait parent when hiding it

I clicked on a notable trait icon so the popup remained and then clicked on the settings menu. When the settings menu was blurred, it scrolled back to when the notable trait was, which isn't great.

r? `@notriddle`

20 months agoRollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-dead
Matthias Krüger [Sat, 19 Nov 2022 14:35:21 +0000 (15:35 +0100)]
Rollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-dead

detect () to avoid redundant <> suggestion for type

fix #104379

20 months agoRollup merge of #104469 - estebank:long-types, r=oli-obk
Matthias Krüger [Sat, 19 Nov 2022 14:35:21 +0000 (15:35 +0100)]
Rollup merge of #104469 - estebank:long-types, r=oli-obk

Make "long type" printing type aware and trim types in E0275

Instead of simple string cutting, use a custom printer to hide parts of long printed types.

On E0275, check for type length before printing.

20 months agoRollup merge of #104076 - ozkanonur:fix-ci-rustc-sysroot, r=jyn514
Matthias Krüger [Sat, 19 Nov 2022 14:35:20 +0000 (15:35 +0100)]
Rollup merge of #104076 - ozkanonur:fix-ci-rustc-sysroot, r=jyn514

fix sysroot issue which appears for ci downloaded rustc

Currently when compiler is downloaded rather than compiled, sysroot is being `ci-rustc-sysroot` because of https://github.com/rust-lang/rust/blob/7eef946fc0e0eff40e588eab77b09b287accbec3/src/bootstrap/compile.rs#L1125-L1131 this.

And rustdoc is overriding the downloaded one at the end of the process.

With the condition I add, we simply check if the current compiler stage is target build stage, if so use the proper sysroot instead of `ci-rustc-sysroot`.

Resolves #103206

20 months agoRollup merge of #103989 - arlosi:arm32-panic, r=Amanieu
Matthias Krüger [Sat, 19 Nov 2022 14:35:20 +0000 (15:35 +0100)]
Rollup merge of #103989 - arlosi:arm32-panic, r=Amanieu

Fix build of std for thumbv7a-pc-windows-msvc

Attempting to build std for the tier-3 target `thumbv7a-pc-windows-msvc` fails with the following error:
```
Building stage1 std artifacts (x86_64-pc-windows-msvc -> thumbv7a-pc-windows-msvc)
..
LLVM ERROR: WinEH not implemented for this target
error: could not compile `panic_unwind`
```

EH (unwinding) is not supported by LLVM for 32 bit arm msvc targets. This changes panic unwind to use the dummy implementation for `thumbv7a-pc-windows-msvc`.

20 months agoRollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514
Matthias Krüger [Sat, 19 Nov 2022 14:35:19 +0000 (15:35 +0100)]
Rollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514

Partial support for running UI tests with `download-rustc`

Right now trying to run UI tests with `download-rustc` results in a bunch of test failures, requiring someone who wants to only work on tests to also build the full compiler. This PR **partially** addresses the problem by solving a lot of the errors (but not all).

* This installs the `rust-src` component on CI toolchains, since the test output depends on whether the standard library source code is installed; We can't just symlink the current source because the `rustc-dev` component already includes the compiler sources, but not the library sources, and mixing things is worse IMO.
* This ensures the `$SRC_DIR` normalization done by compiletest correctly handles the source code added above.
* This unconditionally sets `remap-prefix` to the prefix used in the downloaded toolchain, to ensure compiletest normalizes it.

20 months agoRollup merge of #103117 - joshtriplett:use-is-terminal, r=eholk
Matthias Krüger [Sat, 19 Nov 2022 14:35:18 +0000 (15:35 +0100)]
Rollup merge of #103117 - joshtriplett:use-is-terminal, r=eholk

Use `IsTerminal` in place of `atty`

In any crate that can use nightly features, use `IsTerminal` rather than
`atty`:

- Use `IsTerminal` in `rustc_errors`
- Use `IsTerminal` in `rustc_driver`
- Use `IsTerminal` in `rustc_log`
- Use `IsTerminal` in `librustdoc`

20 months agoAuto merge of #104571 - clubby789:remove-vec-rc-opt, r=the8472
bors [Sat, 19 Nov 2022 12:44:57 +0000 (12:44 +0000)]
Auto merge of #104571 - clubby789:remove-vec-rc-opt, r=the8472

Revert Vec/Rc storage reuse opt

Remove the optimization for using storage added by #104205.
The perf wins were pretty small, and it relies on non-guarenteed behaviour. On platforms that don't implement shrinking in place, the performance will be significantly worse.

While it could be gated to platforms that do this (such as GNU), I don't think it's worth the overhead of maintaining it for very small gains. (#104565, #104563)

cc `@RalfJung` `@matthiaskrgr`

Fixes #104565
Fixes #104563

20 months agoMigrate top buttons style to CSS variables
Guillaume Gomez [Sat, 19 Nov 2022 10:07:13 +0000 (11:07 +0100)]
Migrate top buttons style to CSS variables

20 months agoUpdate browser-ui-test version to 0.13.2
Guillaume Gomez [Fri, 18 Nov 2022 23:27:37 +0000 (00:27 +0100)]
Update browser-ui-test version to 0.13.2

20 months agoExtend GUI test to check notable traits blur behaviour
Guillaume Gomez [Fri, 18 Nov 2022 23:25:37 +0000 (00:25 +0100)]
Extend GUI test to check notable traits blur behaviour

20 months agoAuto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, r=oli-obk
bors [Sat, 19 Nov 2022 09:30:35 +0000 (09:30 +0000)]
Auto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, r=oli-obk

Revert "Normalize opaques with escaping bound vars"

This caused a perf regression in #103423, cc `@skyzh` this should fix #103423.

reverts #100980

r? `@oli-obk`

20 months agoAuto merge of #104600 - Dylan-DPC:rollup-glw1e8b, r=Dylan-DPC
bors [Sat, 19 Nov 2022 06:40:38 +0000 (06:40 +0000)]
Auto merge of #104600 - Dylan-DPC:rollup-glw1e8b, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #104001 (Improve generating Custom entry function)
 - #104411 (nll: correctly deal with bivariance)
 - #104528 (Properly link `{Once,Lazy}{Cell,Lock}` in docs)
 - #104553 (Improve accuracy of asinh and acosh)
 - #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)
 - #104566 (couple of clippy::perf fixes)
 - #104575 (deduplicate tests)
 - #104580 (diagnostics: only show one suggestion for method -> assoc fn)

Failed merges:

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

20 months agoRollup merge of #104580 - notriddle:notriddle/issue-102354-hide-sugg, r=compiler...
Dylan DPC [Sat, 19 Nov 2022 06:24:47 +0000 (11:54 +0530)]
Rollup merge of #104580 - notriddle:notriddle/issue-102354-hide-sugg, r=compiler-errors

diagnostics: only show one suggestion for method -> assoc fn

Fixes #102354

20 months agoRollup merge of #104575 - lcnr:dedup-tests, r=jackh726
Dylan DPC [Sat, 19 Nov 2022 06:24:46 +0000 (11:54 +0530)]
Rollup merge of #104575 - lcnr:dedup-tests, r=jackh726

deduplicate tests

originally added in #100514. Using revisions for this reduces the amount of tests in the repo

20 months agoRollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obk
Dylan DPC [Sat, 19 Nov 2022 06:24:46 +0000 (11:54 +0530)]
Rollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obk

couple of clippy::perf fixes

20 months agoRollup merge of #104554 - BoxyUwU:less_unchecked_pls, r=lcnr
Dylan DPC [Sat, 19 Nov 2022 06:24:45 +0000 (11:54 +0530)]
Rollup merge of #104554 - BoxyUwU:less_unchecked_pls, r=lcnr

Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less

there are only like 3 or 4 call sites left after this but it wasnt obvious to me how to remove them

20 months agoRollup merge of #104553 - mwillsey:asinh-acosh-accuracy, r=thomcc
Dylan DPC [Sat, 19 Nov 2022 06:24:45 +0000 (11:54 +0530)]
Rollup merge of #104553 - mwillsey:asinh-acosh-accuracy, r=thomcc

Improve accuracy of asinh and acosh

This PR addresses the inaccuracy of `asinh` and `acosh` identified by the [Herbie](http://herbie.uwplse.org/) tool, `@pavpanchekha,` `@finnbear` in #104548. It also adds a couple tests that failed in the existing implementations and now pass.

Closes #104548

r? rust-lang/libs

20 months agoRollup merge of #104528 - WaffleLapkin:lazy_lock_docfix, r=matklad
Dylan DPC [Sat, 19 Nov 2022 06:24:44 +0000 (11:54 +0530)]
Rollup merge of #104528 - WaffleLapkin:lazy_lock_docfix, r=matklad

Properly link `{Once,Lazy}{Cell,Lock}` in docs

See https://github.com/rust-lang/rust/issues/74465#issuecomment-1317947443

20 months agoRollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errors
Dylan DPC [Sat, 19 Nov 2022 06:24:44 +0000 (11:54 +0530)]
Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errors

nll: correctly deal with bivariance

fixes #104409

when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions.

r? types cc ``@RalfJung``

20 months agoRollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3
Dylan DPC [Sat, 19 Nov 2022 06:24:43 +0000 (11:54 +0530)]
Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3

Improve generating Custom entry function

This commit is aimed at making compiler-generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316.

Currently, this moves the entry function name and Call convention to the target spec.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
20 months agoImprove spans for RPITIT object-safety errors
Michael Goulet [Sat, 19 Nov 2022 02:32:55 +0000 (02:32 +0000)]
Improve spans for RPITIT object-safety errors

20 months agoAuto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser
bors [Sat, 19 Nov 2022 02:28:47 +0000 (02:28 +0000)]
Auto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiser

Use liballoc's specialised in-place vec collection

liballoc already specialises in-place vector collection, so manually
reimplementing it in `IdFunctor::try_map_id` was superfluous.

20 months agodrive-by: Add is_async fn to hir::IsAsync
Michael Goulet [Sat, 19 Nov 2022 02:22:24 +0000 (02:22 +0000)]
drive-by: Add is_async fn to hir::IsAsync

20 months agoFix invalid focus when blurring notable traits popover
Guillaume Gomez [Fri, 18 Nov 2022 23:25:21 +0000 (00:25 +0100)]
Fix invalid focus when blurring notable traits popover

20 months agoAuto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearth
bors [Fri, 18 Nov 2022 23:20:53 +0000 (23:20 +0000)]
Auto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearth

Rollup of 8 pull requests

Successful merges:

 - #102977 (remove HRTB from `[T]::is_sorted_by{,_key}`)
 - #103378 (Fix mod_inv termination for the last iteration)
 - #103456 (`unchecked_{shl|shr}` should use `u32` as the RHS)
 - #103701 (Simplify some pointer method implementations)
 - #104047 (Diagnostics `icu4x` based list formatting.)
 - #104338 (Enforce that `dyn*` coercions are actually pointer-sized)
 - #104498 (Edit docs for `rustc_errors::Handler::stash_diagnostic`)
 - #104556 (rustdoc: use `code-header` class to format enum variants)

Failed merges:

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

20 months agoRollup merge of #104556 - notriddle:notriddle/variant, r=GuillaumeGomez
Manish Goregaokar [Fri, 18 Nov 2022 22:48:19 +0000 (17:48 -0500)]
Rollup merge of #104556 - notriddle:notriddle/variant, r=GuillaumeGomez

rustdoc: use `code-header` class to format enum variants

The font size and weights should be exactly the same after this PR, but the spacing is changed to be the same as methods.

Preview: http://notriddle.com/notriddle-rustdoc-demos/variant/test_dingus_enum/enum.TestEnum.html

20 months agoRollup merge of #104498 - pierwill:stash-diag-docs, r=compiler-errors
Manish Goregaokar [Fri, 18 Nov 2022 22:48:19 +0000 (17:48 -0500)]
Rollup merge of #104498 - pierwill:stash-diag-docs, r=compiler-errors

Edit docs for `rustc_errors::Handler::stash_diagnostic`

Clarify that the diagnostic can be retrieved with `steal_diagnostic`.

r? ```@compiler-errors```

20 months agoRollup merge of #104338 - compiler-errors:pointer-sized, r=eholk
Manish Goregaokar [Fri, 18 Nov 2022 22:48:18 +0000 (17:48 -0500)]
Rollup merge of #104338 - compiler-errors:pointer-sized, r=eholk

Enforce that `dyn*` coercions are actually pointer-sized

Implement a perma-unstable, rudimentary `PointerSized` trait to enforce `dyn*` casts are `usize`-sized for now, at least to prevent ICEs and weird codegen issues from cropping up after monomorphization since currently we enforce *nothing*.

This probably can/should be removed in favor of a more sophisticated trait for handling `dyn*` conversions when we decide on one, but I just want to get something up for discussion and experimentation for now.

r? ```@eholk``` cc ```@tmandry``` (though feel free to claim/reassign)

Fixes #102141
Fixes #102173

20 months agoRollup merge of #104047 - crlf0710:icu_based_list_formatting, r=davidtwco
Manish Goregaokar [Fri, 18 Nov 2022 22:48:17 +0000 (17:48 -0500)]
Rollup merge of #104047 - crlf0710:icu_based_list_formatting, r=davidtwco

Diagnostics `icu4x` based list formatting.

This adds a new kind of `DiagnosticArg` and add the ability to convert it to a `FluentValue::Custom`. When emitting fluent output, it makes use of `ListFormatter` from `icu4x` project to convert it to localized version of list following the fluent locale, as a kind of eager translation.

Tested locally with locales like `en`, `ja`, etc, and they work fine. <del>Though neither `zh-CN` nor `zh-Hans` works correctly, it seems they fallback to `und` locale somehow, emitting only comma-based list. I believe this is an internal issue of `icu4x` itself.</del>(Works fine after https://github.com/rust-lang/rust/pull/104047#issuecomment-1304860940)

Would love to hear what others think.

r? `@davidtwco`
cc `@Manishearth`

20 months agoRollup merge of #103701 - WaffleLapkin:__points-at-implementation__--this-can-be...
Manish Goregaokar [Fri, 18 Nov 2022 22:48:17 +0000 (17:48 -0500)]
Rollup merge of #103701 - WaffleLapkin:__points-at-implementation__--this-can-be-simplified, r=scottmcm

Simplify some pointer method implementations

- Make `pointer::with_metadata_of` const (+simplify implementation) (cc #75091)
- Simplify implementation of various pointer methods

r? ```@scottmcm```

----

`from_raw_parts::<T>(this, metadata(self))` was annoying me for a while and I've finally figured out how it should _actually_ be done.

20 months agoRollup merge of #103456 - scottmcm:fix-unchecked-shifts, r=scottmcm
Manish Goregaokar [Fri, 18 Nov 2022 22:48:17 +0000 (17:48 -0500)]
Rollup merge of #103456 - scottmcm:fix-unchecked-shifts, r=scottmcm

`unchecked_{shl|shr}` should use `u32` as the RHS

The other shift methods, such as https://doc.rust-lang.org/nightly/std/primitive.u64.html#method.checked_shr and https://doc.rust-lang.org/nightly/std/primitive.i16.html#method.wrapping_shl, use `u32` for the shift amount.  That's consistent with other things, like `count_ones`, which also always use `u32` for a bit count, regardless of the size of the type.

This PR changes `unchecked_shl` and `unchecked_shr` to also use `u32` for the shift amount (rather than Self).

cc #85122, the `unchecked_math` tracking issue

20 months agoRollup merge of #103378 - nagisa:fix-infinite-offset, r=scottmcm
Manish Goregaokar [Fri, 18 Nov 2022 22:48:16 +0000 (17:48 -0500)]
Rollup merge of #103378 - nagisa:fix-infinite-offset, r=scottmcm

Fix mod_inv termination for the last iteration

On usize=u64 platforms, the 4th iteration would overflow the `mod_gate` back to 0. Similarly for usize=u32 platforms, the 3rd iteration would overflow much the same way.

I tested various approaches to resolving this, including approaches with `saturating_mul` and `widening_mul` to a double usize. Turns out LLVM likes `mul_with_overflow` the best. In fact now, that LLVM can see the iteration count is limited, it will happily unroll the loop into a nice linear sequence.

You will also notice that the code around the loop got simplified somewhat. Now that LLVM is handling the loop nicely, there isn’t any more reasons to manually unroll the first iteration out of the loop (though looking at the code today I’m not sure all that complexity was necessary in the first place).

Fixes #103361

20 months agoRollup merge of #102977 - lukas-code:is-sorted-hrtb, r=m-ou-se
Manish Goregaokar [Fri, 18 Nov 2022 22:48:16 +0000 (17:48 -0500)]
Rollup merge of #102977 - lukas-code:is-sorted-hrtb, r=m-ou-se

remove HRTB from `[T]::is_sorted_by{,_key}`

Changes the signature of `[T]::is_sorted_by{,_key}` to match `[T]::binary_search_by{,_key}` and make code like https://github.com/rust-lang/rust/issues/53485#issuecomment-885393452 compile.

Tracking issue: https://github.com/rust-lang/rust/issues/53485

~~Do we need an ACP for something like this?~~ Edit: Filed ACP here: https://github.com/rust-lang/libs-team/issues/121

20 months agoFix lockfile
Manish Goregaokar [Fri, 18 Nov 2022 22:46:52 +0000 (14:46 -0800)]
Fix lockfile

20 months agoUpdate crate documentation of `rustc_baked_icu_data` crate
Charles Lew [Tue, 15 Nov 2022 18:37:00 +0000 (02:37 +0800)]
Update crate documentation of `rustc_baked_icu_data` crate

20 months agoFix compilation issue after rebase
Charles Lew [Sat, 12 Nov 2022 10:50:57 +0000 (18:50 +0800)]
Fix compilation issue after rebase

20 months agoInclude `zh` locale in icu data
Charles Lew [Sun, 6 Nov 2022 17:34:22 +0000 (01:34 +0800)]
Include `zh` locale in icu data

20 months agoEnable icu sync feature for parallel compiler
Charles Lew [Sun, 6 Nov 2022 17:25:48 +0000 (01:25 +0800)]
Enable icu sync feature for parallel compiler

20 months agoImport icu locale fallback data
Charles Lew [Sun, 6 Nov 2022 06:58:22 +0000 (14:58 +0800)]
Import icu locale fallback data

20 months agoMigrate diagnostics list output to use icu list formatter.
Charles Lew [Sun, 6 Nov 2022 06:43:25 +0000 (14:43 +0800)]
Migrate diagnostics list output to use icu list formatter.

20 months agoAdd `rustc_baked_icu_data` crate.
Charles Lew [Sat, 5 Nov 2022 05:09:13 +0000 (13:09 +0800)]
Add `rustc_baked_icu_data` crate.

20 months agoUpdate cargo
Weihang Lo [Fri, 18 Nov 2022 21:35:07 +0000 (21:35 +0000)]
Update cargo

3 commits in 16b097879b6f117c8ae698aab054c87f26ff325e..eb5d35917b2395194593c9ca70c3778f60c1573b
2022-11-14 23:28:16 +0000 to 2022-11-17 22:08:43 +0000
- Fix several tests that are waiting 60 seconds for publishing to time out (rust-lang/cargo#11388)
- Implement RFC 3139: alternative registry authentication support (rust-lang/cargo#10592)
- Fix cargo install --index when used with registry.default (rust-lang/cargo#11302)

20 months agoAuto merge of #104573 - matthiaskrgr:rollup-k36ybtp, r=matthiaskrgr
bors [Fri, 18 Nov 2022 20:26:58 +0000 (20:26 +0000)]
Auto merge of #104573 - matthiaskrgr:rollup-k36ybtp, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1)
 - #103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting))
 - #103405 (Detect incorrect chaining of if and if let conditions and recover)
 - #103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets)
 - #104006 (Add variant_name function to `LangItem`)
 - #104494 (Migrate GUI test to use functions)
 - #104516 (rustdoc: clean up sidebar width CSS)
 - #104550 (fix a typo)

Failed merges:

 - #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)

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

20 months agoOnly enforce ABI-mandated align, not preferred align is compatible
Michael Goulet [Wed, 16 Nov 2022 04:29:41 +0000 (04:29 +0000)]
Only enforce ABI-mandated align, not preferred align is compatible

20 months agoCheck both align and size in PointerSized
Michael Goulet [Tue, 15 Nov 2022 22:26:28 +0000 (22:26 +0000)]
Check both align and size in PointerSized

20 months agoEnforce that dyn* casts are actually pointer-sized
Michael Goulet [Sat, 12 Nov 2022 22:27:18 +0000 (22:27 +0000)]
Enforce that dyn* casts are actually pointer-sized

20 months agoDelete miri test
Michael Goulet [Fri, 18 Nov 2022 18:06:32 +0000 (18:06 +0000)]
Delete miri test

20 months agoAdd test
Michael Goulet [Tue, 25 Oct 2022 02:11:24 +0000 (02:11 +0000)]
Add test

20 months agoRevert "Normalize opaques with escaping bound vars"
Michael Goulet [Mon, 24 Oct 2022 19:39:19 +0000 (19:39 +0000)]
Revert "Normalize opaques with escaping bound vars"

This reverts commit 43119d643857efc366bfca527ac2dadfc3f2e906.

20 months agodiagnostics: only show one suggestion for method -> assoc fn
Michael Howell [Fri, 18 Nov 2022 17:39:26 +0000 (10:39 -0700)]
diagnostics: only show one suggestion for method -> assoc fn

Fixes #102354

20 months agoAuto merge of #101562 - nnethercote:shrink-ast-Expr-harder, r=petrochenkov
bors [Fri, 18 Nov 2022 16:56:12 +0000 (16:56 +0000)]
Auto merge of #101562 - nnethercote:shrink-ast-Expr-harder, r=petrochenkov

Shrink `ast::Expr` harder

r? `@ghost`

20 months agoreview comment
Esteban Küber [Thu, 17 Nov 2022 17:24:46 +0000 (09:24 -0800)]
review comment

20 months agoOnly use `...` instead of `_` for type elision
Esteban Küber [Thu, 17 Nov 2022 04:07:15 +0000 (20:07 -0800)]
Only use `...` instead of `_` for type elision

`_` might confuse people into believing that the type isn't known,
while `...` is not used anywhere else for types and is not valid
syntax, making it more likely to convey the right understanding.

20 months agoOn E0275 do not print out the full type in the msg
Esteban Küber [Thu, 17 Nov 2022 03:33:45 +0000 (19:33 -0800)]
On E0275 do not print out the full type in the msg

When printing requirement overflow errors, do not print out the full
type name when it is longer than 50 characters long.

20 months agoOn overflow errors, do not print out long types
Esteban Küber [Thu, 17 Nov 2022 03:09:57 +0000 (19:09 -0800)]
On overflow errors, do not print out long types

20 months agoMake "long type" printing type aware
Esteban Küber [Wed, 16 Nov 2022 01:38:39 +0000 (17:38 -0800)]
Make "long type" printing type aware

Instead of simple string cutting, use a custom printer to hide parts of
long printed types.

20 months agodeduplicate tests
lcnr [Fri, 18 Nov 2022 13:51:24 +0000 (14:51 +0100)]
deduplicate tests

20 months agoreview comments 2 electric boogalo
Boxy [Fri, 18 Nov 2022 13:45:42 +0000 (13:45 +0000)]
review comments 2 electric boogalo

20 months agorequire an `ErrorGuaranteed` to taint infcx with errors
Boxy [Fri, 18 Nov 2022 11:30:21 +0000 (11:30 +0000)]
require an `ErrorGuaranteed` to taint infcx with errors

20 months agorename `is_tainted_by_errors`
Boxy [Fri, 18 Nov 2022 10:25:32 +0000 (10:25 +0000)]
rename `is_tainted_by_errors`

20 months ago`track_errors` use a delay_span_bug
Boxy [Thu, 17 Nov 2022 21:09:59 +0000 (21:09 +0000)]
`track_errors` use a delay_span_bug

20 months agomake `replaced_with_error` store `ErrorGuaranteed`
Boxy [Thu, 17 Nov 2022 21:03:06 +0000 (21:03 +0000)]
make `replaced_with_error` store `ErrorGuaranteed`

20 months ago`InferCtxt::is_tainted_by_errors` returns `ErrorGuaranteed`
Boxy [Thu, 17 Nov 2022 20:57:45 +0000 (20:57 +0000)]
`InferCtxt::is_tainted_by_errors` returns `ErrorGuaranteed`

20 months agodont unchecked create `ErrorGuaranteed` in `BorrowckErrors`
Boxy [Thu, 17 Nov 2022 20:45:11 +0000 (20:45 +0000)]
dont unchecked create `ErrorGuaranteed` in `BorrowckErrors`

20 months agoRollup merge of #104550 - RalfJung:typo, r=compiler-errors
Matthias Krüger [Fri, 18 Nov 2022 13:13:39 +0000 (14:13 +0100)]
Rollup merge of #104550 - RalfJung:typo, r=compiler-errors

fix a typo

r? `@lcnr`

20 months agoRollup merge of #104516 - notriddle:notriddle/flex-basis-sidebar-width, r=GuillaumeGomez
Matthias Krüger [Fri, 18 Nov 2022 13:13:38 +0000 (14:13 +0100)]
Rollup merge of #104516 - notriddle:notriddle/flex-basis-sidebar-width, r=GuillaumeGomez

rustdoc: clean up sidebar width CSS

This commit takes advantage of the ability to set [flex-basis] to a specific length instead of setting it to `auto` and changing min-/max-width, and setting flex-grow/-shrink both to 0.

This PR should not cause any visual changes.

preview: https://notriddle.com/notriddle-rustdoc-demos/flex-basis-sidebar-width/std/index.html

[flex-basis]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis

20 months agoRollup merge of #104494 - GuillaumeGomez:migrate-gui-test-to-func, r=notriddle
Matthias Krüger [Fri, 18 Nov 2022 13:13:38 +0000 (14:13 +0100)]
Rollup merge of #104494 - GuillaumeGomez:migrate-gui-test-to-func, r=notriddle

Migrate GUI test to use functions

r? `@notriddle`

20 months agoRollup merge of #104006 - flip1995:lang-items-clippy, r=oli-obk
Matthias Krüger [Fri, 18 Nov 2022 13:13:37 +0000 (14:13 +0100)]
Rollup merge of #104006 - flip1995:lang-items-clippy, r=oli-obk

Add variant_name function to `LangItem`

Clippy has an internal lint that checks for the usage of hardcoded def paths and suggests to replace them with a lang or diagnostic item, if possible. This was implemented with a hack, by getting all the variants of the `LangItem` enum and then index into it with the position of the `LangItem` in the `items` list. This is no longer possible, because the `items` list can't be accessed anymore.

Follow up to #103603

cc `@camsteffen`
r? `@oli-obk`

This is blocking the sync between Clippy and Rust. I'm not sure if this is the best solution here, or if I should add a method `items()` to `LanguageItems` and keep the code in Clippy unchanged.

20 months agoRollup merge of #103594 - maniwani:fix-issue-91417, r=thomcc
Matthias Krüger [Fri, 18 Nov 2022 13:13:36 +0000 (14:13 +0100)]
Rollup merge of #103594 - maniwani:fix-issue-91417, r=thomcc

Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets

This is a duplicate of #94100 (since the original author is unresponsive), which resolves #91417.

On `aarch64-apple-darwin` targets, the internal resolution of `Instant` is lower than that of `Duration`, so math between them becomes non-associative with small-enough durations.

This PR makes this target use the standard Unix implementation (where `Instant` has 1ns resolution), but with `CLOCK_UPTIME_RAW` so it still returns the same values as `mach_absolute_time`[^1].

(Edit: I need someone to confirm that this still works, I do not have access to an M1 device.)

[^1]: https://www.manpagez.com/man/3/clock_gettime/

20 months agoRollup merge of #103405 - chenyukang:yukang/fix-103381-and-if, r=compiler-errors
Matthias Krüger [Fri, 18 Nov 2022 13:13:36 +0000 (14:13 +0100)]
Rollup merge of #103405 - chenyukang:yukang/fix-103381-and-if, r=compiler-errors

Detect incorrect chaining of if and if let conditions and recover

Fixes #103381

20 months agoRollup merge of #103386 - compiler-errors:no-coerceunsized-to-dynstar, r=eholk
Matthias Krüger [Fri, 18 Nov 2022 13:13:35 +0000 (14:13 +0100)]
Rollup merge of #103386 - compiler-errors:no-coerceunsized-to-dynstar, r=eholk

Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting)

This makes sure we don't accidentally allow coercions like `Box<T>` -> `Box<dyn* Trait>`, or in the case of this ICE, `&T` to `&dyn* Trait`. These coercions don't make sense, at least not via the `CoerceUnsized` trait.

Fixes #102172
Fixes #102429

20 months agoRollup merge of #101162 - rajputrajat:master, r=davidtwco
Matthias Krüger [Fri, 18 Nov 2022 13:13:35 +0000 (14:13 +0100)]
Rollup merge of #101162 - rajputrajat:master, r=davidtwco

Migrate rustc_resolve to use SessionDiagnostic, part # 1

crate a somewhat on larger size, so plz allow some time to get it finished.

20 months agoAuto merge of #104330 - CastilloDel:ast_lowering, r=cjgillot
bors [Fri, 18 Nov 2022 13:12:18 +0000 (13:12 +0000)]
Auto merge of #104330 - CastilloDel:ast_lowering, r=cjgillot

Remove allow(rustc::potential_query_instability) from rustc_ast_lowering

Related to https://github.com/rust-lang/rust/issues/84447.

`@cjgillot` Thanks for helping me!

20 months agoDon't focus on notable trait parent when hiding it
Guillaume Gomez [Fri, 18 Nov 2022 12:36:18 +0000 (13:36 +0100)]
Don't focus on notable trait parent when hiding it

20 months agoRemove Vec/Rc storage reuse opt
clubby789 [Fri, 18 Nov 2022 10:38:51 +0000 (10:38 +0000)]
Remove Vec/Rc storage reuse opt

20 months agoAuto merge of #104555 - matthiaskrgr:rollup-tncyca8, r=matthiaskrgr
bors [Fri, 18 Nov 2022 10:06:28 +0000 (10:06 +0000)]
Auto merge of #104555 - matthiaskrgr:rollup-tncyca8, r=matthiaskrgr

Rollup of 11 pull requests

Successful merges:

 - #103852 (Don't remap early-bound regions for return-position `impl Trait` in trait originating from `impl`)
 - #104366 (Simplify settings theme choice)
 - #104433 (Fix `emit_unused_delims_expr` ICE)
 - #104444 (Fix ICE in in_operand for ty error)
 - #104483 (Convert predicates into Predicate in the Obligation constructor)
 - #104496 (Don't attempt to normalize compiler backtraces)
 - #104503 (rustdoc: remove redundant font-color CSS on `.where`)
 - #104508 (Check `dyn*` return type correctly)
 - #104515 (ICE fixing, remove is_tainted_by_errors since we have ty_error for delay bug)
 - #104532 (Migrate tooltip style to CSS variables)
 - #104545 (Readd the matches_macro diag item)

Failed merges:

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

20 months agocouple of clippy::perf fixes
Matthias Krüger [Fri, 18 Nov 2022 09:30:47 +0000 (10:30 +0100)]
couple of clippy::perf fixes

20 months agoAuto merge of #103179 - ferrocene:pa-run-in-run-make, r=jyn514
bors [Fri, 18 Nov 2022 06:54:37 +0000 (06:54 +0000)]
Auto merge of #103179 - ferrocene:pa-run-in-run-make, r=jyn514

Fix `src/test/run-make/issue-36710` on cross-compiled targets

This PR fixes the `src/test/run-make/issue-36710` test not working on cross-compiled targets by telling the make infra how to run tests remotely with `remote-test-server`.

This PR includes a revert of #102723 (cc `@pcc),` which disabled that test on all cross-compiled targets.

20 months agorustdoc: update tests for enum variant margin tweak
Michael Howell [Thu, 17 Nov 2022 22:35:36 +0000 (15:35 -0700)]
rustdoc: update tests for enum variant margin tweak

20 months agorustdoc: use `code-header` class to format enum variants
Michael Howell [Thu, 17 Nov 2022 22:24:39 +0000 (15:24 -0700)]
rustdoc: use `code-header` class to format enum variants

The font size and weights should be exactly the same after this commit,
but the spacing is changed to be exactly the same as methods.

20 months agoEdit docs for `rustc_errors::Handler::stash_diagnostic`
pierwill [Wed, 16 Nov 2022 18:21:15 +0000 (12:21 -0600)]
Edit docs for `rustc_errors::Handler::stash_diagnostic`

Clarify that the diagnostic can be retrieved with `steal_diagnostic`.

20 months agoRollup merge of #104545 - flip1995:diag_item_matches_macro, r=compiler-errors
Matthias Krüger [Thu, 17 Nov 2022 21:33:22 +0000 (22:33 +0100)]
Rollup merge of #104545 - flip1995:diag_item_matches_macro, r=compiler-errors

Readd the matches_macro diag item

This is now used by Clippy

r? `@compiler-errors`

This was removed in #104383. But in the meantime Clippy now makes use of it https://github.com/rust-lang/rust-clippy/blob/dac600e32fce89cb4b05ae6edb0c47982b99eb48/clippy_lints/src/manual_is_ascii_check.rs#L153

---

This is blocking the Clippy sync. (kinda. I could work around it, but I don't want to play ping-pong with this change.)

20 months agoRollup merge of #104532 - GuillaumeGomez:migrate-tooltip-css, r=notriddle
Matthias Krüger [Thu, 17 Nov 2022 21:33:22 +0000 (22:33 +0100)]
Rollup merge of #104532 - GuillaumeGomez:migrate-tooltip-css, r=notriddle

Migrate tooltip style to CSS variables

20 months agoRollup merge of #104515 - chenyukang:yukang/fix-104510-ice, r=compiler-errors
Matthias Krüger [Thu, 17 Nov 2022 21:33:21 +0000 (22:33 +0100)]
Rollup merge of #104515 - chenyukang:yukang/fix-104510-ice, r=compiler-errors

ICE fixing, remove is_tainted_by_errors since we have ty_error for delay bug

Fixes #104510

20 months agoRollup merge of #104508 - compiler-errors:dyn-return, r=oli-obk
Matthias Krüger [Thu, 17 Nov 2022 21:33:21 +0000 (22:33 +0100)]
Rollup merge of #104508 - compiler-errors:dyn-return, r=oli-obk

Check `dyn*` return type correctly

In `check_fn`, if the declared return type is `dyn Trait`, then we check the return type separately to produce better diagnostics, because this is never valid -- however, when `dyn*` was introduced, this check was never adjusted to only account for *unsized* `dyn Trait` and not *sized* `dyn* Trait`.

Fixes #104501

20 months agoRollup merge of #104503 - notriddle:notriddle/where, r=GuillaumeGomez
Matthias Krüger [Thu, 17 Nov 2022 21:33:20 +0000 (22:33 +0100)]
Rollup merge of #104503 - notriddle:notriddle/where, r=GuillaumeGomez

rustdoc: remove redundant font-color CSS on `.where`

Before 7f6ce7dddd49f453da15bb4d586a5990985814d8, light-theme where clauses had color `#4E4C4C` while the main color was `#000`. One of that commit's simplifications made it so that everything used the same black.

20 months agoRollup merge of #104496 - djkoloski:dont_normalize_compiler_backtraces, r=jackh726
Matthias Krüger [Thu, 17 Nov 2022 21:33:20 +0000 (22:33 +0100)]
Rollup merge of #104496 - djkoloski:dont_normalize_compiler_backtraces, r=jackh726

Don't attempt to normalize compiler backtraces

Backtraces can very significantly depending on environment and cause spurious test suite failures. Ensuring a proper failure-status should be sufficient to keep a crash properly documented.

This caused a failure in Fuchsia's test suite CI due to an extra newline between "stack" and "error" appearing after normalization.

cc ````@jackh726````
r? ````@tmandry````

20 months agoRollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errors
Matthias Krüger [Thu, 17 Nov 2022 21:33:19 +0000 (22:33 +0100)]
Rollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errors

Convert predicates into Predicate in the Obligation constructor

instead of having almost all callers do that.

This reduces a bit of boilerplate, and also paves the way for my work towards https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).

20 months agoRollup merge of #104444 - chenyukang:yukang/fix-104390, r=compiler-errors
Matthias Krüger [Thu, 17 Nov 2022 21:33:19 +0000 (22:33 +0100)]
Rollup merge of #104444 - chenyukang:yukang/fix-104390, r=compiler-errors

Fix ICE in in_operand for ty error

Fixes #104390

By the way, moving some test cases to proper directory for tidy bless.

20 months agoRollup merge of #104433 - TaKO8Ki:fix-104392, r=estebank
Matthias Krüger [Thu, 17 Nov 2022 21:33:18 +0000 (22:33 +0100)]
Rollup merge of #104433 - TaKO8Ki:fix-104392, r=estebank

Fix `emit_unused_delims_expr` ICE

Fixes #104392

20 months agoRollup merge of #104366 - GuillaumeGomez:simplify-settings-theme-choice, r=notriddle
Matthias Krüger [Thu, 17 Nov 2022 21:33:18 +0000 (22:33 +0100)]
Rollup merge of #104366 - GuillaumeGomez:simplify-settings-theme-choice, r=notriddle

Simplify settings theme choice

I removed the storage changes from https://github.com/rust-lang/rust/pull/98765 and only kept the UI changes.

You can test it [here](https://rustdoc.crud.net/imperio/simplify-settings-theme-choice/foo/index.html).

Discussion about this still in progress [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Last.20part.20of.20settings.20simplification).

r? ````@notriddle````

20 months agoRollup merge of #103852 - compiler-errors:rpitit-early-from-impl, r=lcnr
Matthias Krüger [Thu, 17 Nov 2022 21:33:17 +0000 (22:33 +0100)]
Rollup merge of #103852 - compiler-errors:rpitit-early-from-impl, r=lcnr

Don't remap early-bound regions for return-position `impl Trait` in trait originating from `impl`

long title :sweat:

We don't want to remap early-bound regions that originate from the `impl`s themselves, since they have no corresponding region in the trait. Not sure if there's a better condition than checking if the EBR's def-id's parent is the impl -- maybe we should be checking if the region comes from the method or RPITIT... :shrug:

r? types

Fixes #103850

20 months agoImprove accuracy of asinh and acosh
Max Willsey [Thu, 17 Nov 2022 20:50:33 +0000 (12:50 -0800)]
Improve accuracy of asinh and acosh

20 months agofix a typo
Ralf Jung [Thu, 17 Nov 2022 20:13:23 +0000 (21:13 +0100)]
fix a typo