Commit Graph

219183 Commits

Author SHA1 Message Date
bors
d5833423a0 Auto merge of #102256 - cjgillot:let-under, r=lcnr
Introduce a no-op `PlaceMention` statement for `let _ =`.

Fixes https://github.com/rust-lang/rust/issues/54003
Fixes https://github.com/rust-lang/rust/issues/80059
Split from https://github.com/rust-lang/rust/pull/101500

This PR introduces a new `PlaceMention` statement dedicated to matches that neither introduce bindings nor ascribe types.  Without this, all traces of the match would vanish from MIR, making it impossible to diagnose unsafety or use in #101500.

This allows to mark `let _ = <unsafe union access or dereference>` as requiring an unsafe block.
Nominating for lang team, as this introduces an extra error.
2023-03-10 11:55:59 +00:00
bors
104f4300cf Auto merge of #108934 - matthiaskrgr:rollup-vm414p5, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #106915 (Only load one CSS theme by default)
 - #108294 (Place binder correctly for arbitrary trait bound suggestion)
 - #108778 (x fmt: Don't print all modified files if there's more than 10)
 - #108854 (feat/refactor: improve errors in case of ident with number at start)
 - #108870 (Fix invalid inlining of reexport of reexport of private item)
 - #108917 (Consider target_family as pal)
 - #108922 (Add auto notification for changes to stable mir)
 - #108929 (Fix typo in span_map.rs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-10 08:09:25 +00:00
bors
f37f854994 Auto merge of #108951 - cuviper:solaris-debs, r=Mark-Simulacrum
ci: use `apt install --download-only` for solaris debs
2023-03-10 03:23:00 +00:00
Josh Stone
258c7e73c4 ci: use apt install --download-only for solaris debs 2023-03-09 12:23:18 -08:00
Camille GILLOT
684de0418f Update coverage info. 2023-03-09 17:51:38 +00:00
Camille GILLOT
2eccd52157 Test let _ = for const_mut_refs. 2023-03-09 17:45:13 +00:00
Camille GILLOT
09dc10c9c2 Bug on PlaceMention in dest-prop. 2023-03-09 17:45:13 +00:00
Camille GILLOT
45f2a1af3b Document borrowck behaviour. 2023-03-09 17:45:13 +00:00
Camille GILLOT
b34a8a294d Pacify tidy. 2023-03-09 17:45:13 +00:00
Camille GILLOT
a5ef6bac28 Also test destructuring assignment. 2023-03-09 17:45:13 +00:00
Camille GILLOT
e107194b66 Ignore AscribeUserType in unsafeck to avoid duplicate diagnostics. 2023-03-09 17:45:13 +00:00
Camille GILLOT
4462bb54e3 Introduce a no-op PlaceMention statement for let _ =. 2023-03-09 17:45:13 +00:00
Camille GILLOT
be758ef5ab Add ui test. 2023-03-09 17:45:13 +00:00
Matthias Krüger
5b3f84d8af
Rollup merge of #108929 - eltociear:patch-20, r=GuillaumeGomez
Fix typo in span_map.rs

correspondance -> correspondence
2023-03-09 12:11:55 +01:00
Matthias Krüger
ceff836bfe
Rollup merge of #108922 - celinval:stable-mir-bot, r=oli-obk
Add auto notification for changes to stable mir

Adds a new entry to the triagebot configuration file to notify subscribers about changes to the stable MIR. I added myself and `@oli-obk` for now.

r?oli-obk
2023-03-09 12:11:55 +01:00
Matthias Krüger
972ea7fd84
Rollup merge of #108917 - Ayush1325:tidy-improve, r=workingjubilee
Consider target_family as pal

Currently, tidy does not consider code in target_family as platform-specific. This is erroneous and should be fixed.

r? `@workingjubilee`
2023-03-09 12:11:54 +01:00
Matthias Krüger
506495a4b3
Rollup merge of #108870 - GuillaumeGomez:rustdoc-reexport-of-reexport-of-private, r=notriddle
Fix invalid inlining of reexport of reexport of private item

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

The problem is that a reexport is always resolving to the end type, so if the end type is private, the reexport inlines. Except that if you reexport a public reexport (which reexports the private item), then it should not be inlined again.

r? `@notriddle`
2023-03-09 12:11:54 +01:00
Matthias Krüger
bec7011a2c
Rollup merge of #108854 - Ezrashaw:improve-int-idents, r=oli-obk
feat/refactor: improve errors in case of ident with number at start

Improve parser code when we parse a integer (or float) literal but expect an identifier. We emit an error message saying that identifiers can't begin with numbers. This PR just improves that code and expands it to all identifiers. Note that I haven't implemented error recovery (this didn't exist before anyway), I might do that in a follow up PR.
2023-03-09 12:11:53 +01:00
Matthias Krüger
aedd94fcab
Rollup merge of #108778 - jyn514:quiet-fmt, r=albertlarsan68
x fmt: Don't print all modified files if there's more than 10

This avoids spam for dozens of modified files.

Fixes https://github.com/rust-lang/rust/issues/106920.
2023-03-09 12:11:53 +01:00
Matthias Krüger
ac258e9e02
Rollup merge of #108294 - compiler-errors:arbitary-sugg-binder, r=TaKO8Ki
Place binder correctly for arbitrary trait bound suggestion

suggest `for<'a> &'a T: Trait` instead of `&'a T: for<'a> T`.
2023-03-09 12:11:52 +01:00
Matthias Krüger
83791f9de7
Rollup merge of #106915 - notriddle:notriddle/load-only-one-theme, r=GuillaumeGomez,jsha
Only load one CSS theme by default

This is a tweaked version of #103971 that uses `document.write` to create the stylesheet link at startup, avoiding a FOUC during page navigation. It also rebases the PR, making it work with the new hashed filenames.

Fixes #82614

Preview: http://notriddle.com/notriddle-rustdoc-demos/load-only-one-theme-v2/std/index.html
2023-03-09 12:11:52 +01:00
Ezra Shaw
252e0b3385
feat/refactor: improve errors in case of ident with number at start 2023-03-09 21:29:32 +13:00
bors
39f2657d11 Auto merge of #108920 - matthiaskrgr:rollup-qrr9a0u, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #108754 (Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous)
 - #108759 (1.41.1 supported 32-bit Apple targets)
 - #108839 (Canonicalize root var when making response from new solver)
 - #108856 (Remove DropAndReplace terminator)
 - #108882 (Tweak E0740)
 - #108898 (Set `LIBC_CHECK_CFG=1` when building Rust code in bootstrap)
 - #108911 (Improve rustdoc-gui/tester.js code a bit)
 - #108916 (Remove an unused return value in `rustc_hir_typeck`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-09 08:21:17 +00:00
Ikko Eltociear Ashimine
18667722e2
Fix typo in span_map.rs
correspondance -> correspondence
2023-03-09 14:47:42 +09:00
bors
66a2d62210 Auto merge of #108178 - cjgillot:ssa-deref, r=oli-obk
Do not consider `&mut *x` as mutating `x` in `CopyProp`

This PR removes an unfortunate overly cautious case from the current implementation.

Found by https://github.com/rust-lang/rust/pull/105274 cc `@saethlin`
2023-03-09 04:50:38 +00:00
Joshua Nelson
eb9b031232 Don't print all modified files if there's more than 10
This avoids spam for dozens of modified files.
2023-03-09 03:43:34 +00:00
bors
6a179026de Auto merge of #108919 - matthiaskrgr:rollup-g271pm2, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #108686 (rustdoc: include link on all.html location header)
 - #108846 (StableMIR: Proof-of-concept implementation + test )
 - #108873 (Simplify `sort_by` calls)
 - #108883 (Suppress copy impl error when post-normalized type references errors)
 - #108884 (Tweak illegal `Copy` impl message)
 - #108887 (Rename `MapInPlace` as `FlatMapInPlace`.)
 - #108901 (fix: evaluate with wrong obligation stack)
 - #108903 (Move Clippy tests back to their intended directory)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-08 22:48:17 +00:00
Celina G. Val
d326ae7b85 Add auto notification for changes to stable mir 2023-03-08 12:37:18 -08:00
Matthias Krüger
a22c5f9581
Rollup merge of #108916 - fmease:rm-unused-ret-val, r=compiler-errors
Remove an unused return value in `rustc_hir_typeck`

Unused since #89580. Just something I noticed a while ago.

`@rustbot` label C-cleanup
2023-03-08 21:26:53 +01:00
Matthias Krüger
e6f39f7225
Rollup merge of #108911 - GuillaumeGomez:improve-rustdoc-gui-tester-code, r=notriddle
Improve rustdoc-gui/tester.js code a bit

Just a small clean-up.

r? `@notriddle`
2023-03-08 21:26:53 +01:00
Matthias Krüger
2ebb5b1ddc
Rollup merge of #108898 - ferrocene:pa-libc-check-cfg, r=Mark-Simulacrum
Set `LIBC_CHECK_CFG=1` when building Rust code in bootstrap

Downstream forks of the Rust compiler might want to use a custom `libc` to add support for targets that are not yet available upstream. Adding a patch to replace `libc` with a custom one would cause compilation errors though, because Cargo would interpret the custom `libc` as part of the workspace, and apply the check-cfg lints on it.

Since https://github.com/rust-lang/libc/pull/3037, the `libc` build script emits check-cfg flags only when the `LIBC_CHECK_CFG` environment variable is set, so this PR allows the use of custom `libc`s.
2023-03-08 21:26:52 +01:00
Matthias Krüger
e6e82db307
Rollup merge of #108882 - compiler-errors:E0740, r=eholk
Tweak E0740

Also drive-by suppress E0740 if it's an unresolved type.
2023-03-08 21:26:52 +01:00
Matthias Krüger
4e84fbf8a0
Rollup merge of #108856 - Zeegomo:remove-drop-and-rep, r=tmiasko
Remove DropAndReplace terminator

#107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-03-08 21:26:51 +01:00
Matthias Krüger
2428083558
Rollup merge of #108839 - compiler-errors:canonicalize-the-root-var, r=lcnr
Canonicalize root var when making response from new solver

During trait solving, if we equate two inference variables `?0` and `?1` but don't equate them with any rigid types, then `InferCtxt::probe_ty_var` will return `Err` for both of these. The canonicalizer code will then canonicalize the variables independently(!), and the response will not reflect the fact that these two variables have been made equal.

This hinders inference and I also don't think it's sound? I haven't thought too much about it past that, so let's talk about it.

r? ``@lcnr``
2023-03-08 21:26:51 +01:00
Matthias Krüger
23f46c50b2
Rollup merge of #108759 - workingjubilee:pedantically-correct-release-notes-for-1.41.1-apple32, r=Mark-Simulacrum
1.41.1 supported 32-bit Apple targets

This question was raised by #108556.
2023-03-08 21:26:50 +01:00
Matthias Krüger
9408af97f5
Rollup merge of #108754 - compiler-errors:retry, r=oli-obk
Retry `pred_known_to_hold_modulo_regions` with fulfillment if ambiguous

Fixes #108721

The problem here is that when we're checking `is_sized_raw` during codegen on some type that has a lot of opaques in it, something emits several nested obligations that are individually ambiguous, but when processed together in a loop then apply modulo regions. Since the `evaluate_predicates_recursively` inner loop doesn't process predicates until they stop changing, we return `EvaluatedToAmbig`, which makes the sized check return false incorrectly. See:

f15f0ea739/compiler/rustc_trait_selection/src/traits/select/mod.rs (L596-L606)

... Compared to the analogous loop in the new solver:

f15f0ea739/compiler/rustc_trait_selection/src/solve/mod.rs (L481-L512)

To fix this, if we get ambiguous during `pred_known_to_hold_modulo_regions`, just retry the obligation in a fulfillment context.

--

Unfortunately... I don't have a test for this. I've only tested this locally. Pending minimization :/

r? types
2023-03-08 21:26:50 +01:00
Matthias Krüger
7732cccd99
Rollup merge of #108903 - rust-lang:pa-fix-clippy-tests, r=flip1995
Move Clippy tests back to their intended directory

See https://github.com/rust-lang/rust/pull/108674#issuecomment-1459736086.

r? `@flip1995`
2023-03-08 21:24:54 +01:00
Matthias Krüger
33c3036826
Rollup merge of #108901 - LYF1999:yf/108897, r=lcnr
fix: evaluate with wrong obligation stack

fix #108897
r? ``@lcnr``
2023-03-08 21:24:53 +01:00
Matthias Krüger
a95943b77d
Rollup merge of #108887 - nnethercote:rename-MapInPlace, r=lqd
Rename `MapInPlace` as `FlatMapInPlace`.

After removing the `map_in_place` method, which isn't much use because modifying every element in a collection such as a `Vec` can be done trivially with iteration.

r? ``@lqd``
2023-03-08 21:24:53 +01:00
Matthias Krüger
031b528052
Rollup merge of #108884 - compiler-errors:tweak-illegal-copy-impl-message, r=WaffleLapkin
Tweak illegal `Copy` impl message

The phrase "may not" can both mean "is not able to" and "possibly does not". Disambiguate this by just using "cannot".
``@Lokathor`` expressed being annoyed by this [here](https://twitter.com/Lokathor/status/1633200313544089602?s=20).

Also drive-by fix for this extremely noisy message: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6a37275bc810f7846bfe191845b7d11d.

r? diagnostics
2023-03-08 21:24:52 +01:00
Matthias Krüger
f6b8a9f6db
Rollup merge of #108883 - compiler-errors:post-norm-copy-err, r=BoxyUwU
Suppress copy impl error when post-normalized type references errors

Suppress spurious errors from the `Copy` impl validity check when fields have bad types *post*-normalization, instead of just pre-normalization.

----

The const-generics test regressed recently due to #107965, cc `````@BoxyUwU.`````
 * I think it's because `[_; 0u32]: Copy` now fails to hold because a nested obligation `ConstArgHasType(0u32, usize)` fails.
 * It's interesting that `[const_error]` shows up in the type only after normalization, though, but I'm pretty sure that it's due to the evaluate call that happens when normalizing unevaluated consts.
2023-03-08 21:24:51 +01:00
Matthias Krüger
1a9376dc47
Rollup merge of #108873 - WaffleLapkin:cmp, r=cjgillot
Simplify `sort_by` calls

small cleanup
2023-03-08 21:24:51 +01:00
Matthias Krüger
9b6b7a3e84
Rollup merge of #108846 - celinval:smir-poc, r=oli-obk
StableMIR: Proof-of-concept implementation + test

This PR is part of the [project Stable MIR](https://github.com/rust-lang/project-stable-mir). The PR deletes old re-exports from rustc_smir and introduces a proof-of-concept implementation for APIs to retrieve crate information.

The implementation follows the [design described here](https://hackmd.io/XhnYHKKuR6-LChhobvlT-g?view), but instead of using separate crates for the implementation, it uses separate modules inside `rustc_smir`.

The API introduced at this point should be seen just as an example on how we are planning to structure the communication between tools and the compiler.

I have not explored yet what should be the right granularity, the best starting point for users, neither the best way to implement it.

r? ``````@oli-obk``````
2023-03-08 21:24:50 +01:00
Matthias Krüger
6c91ce27c3
Rollup merge of #108686 - notriddle:notriddle/jank-all, r=jsha
rustdoc: include link on all.html location header

This avoids a subtle layout shift when switching from the crate page to all items.

## Before

| index.html | all.html |
|------------|----------|
| ![image](https://user-images.githubusercontent.com/1593513/222607866-4eac3f55-314c-4273-9664-503f2a79ad0a.png) | ![image](https://user-images.githubusercontent.com/1593513/222607895-2d6bac3b-f66a-47d4-b234-360f6f8e1ee3.png) |

## After

| index.html | all.html |
|------------|----------|
| ![image](https://user-images.githubusercontent.com/1593513/222607866-4eac3f55-314c-4273-9664-503f2a79ad0a.png) | ![image](https://user-images.githubusercontent.com/1593513/222607997-e72c48a0-02c7-42a7-80c2-cd6bed48bd15.png) |
2023-03-08 21:24:50 +01:00
bors
900c354037 Auto merge of #108665 - weihanglo:update-cargo, r=weihanglo
Update cargo

25 commits in 9880b408a3af50c08fab3dbf4aa2a972df71e951..7d3033d2e59383fd76193daf9423c3d141972a7d
2023-02-28 19:39:39 +0000 to 2023-03-08 17:05:08 +0000

- Revert "rust-lang/cargo#11738" - Use test name for dir when running tests (rust-lang/cargo#11812)
- Update CHANGELOG for 1.68 backports (rust-lang/cargo#11810)
- Add `CARGO_PKG_README` (rust-lang/cargo#11645)
- path dependency: fix cargo-util version (rust-lang/cargo#11807)
- Adding display of which target failed to compile (rust-lang/cargo#11636)
- Fix `CARGO_CFG_` vars for configs defined both with and without value (rust-lang/cargo#11790)
- Breaking endless loop on cyclic features in added dependency in cargo-add (rust-lang/cargo#11805)
- Enhance the doc of timing report with graphs (rust-lang/cargo#11798)
- Make `sparse` the default protocol for crates.io (rust-lang/cargo#11791)
- Use sha2 to calculate SHA256 (rust-lang/cargo#11795)
- gitoxide progress bar fixes (rust-lang/cargo#11800)
- Check publish_to_alt_registry publish content (rust-lang/cargo#11799)
- chore: fix missing files in autolabel trigger_files (rust-lang/cargo#11797)
- chore: Update base64 (rust-lang/cargo#11796)
- Fix some doc typos (rust-lang/cargo#11794)
- chore(ci): Enforce cargo-deny in CI (rust-lang/cargo#11761)
- Some cleanup for unstable docs (rust-lang/cargo#11793)
- gitoxide integration: fetch (rust-lang/cargo#11448)
- patch can conflict on not activated packages (rust-lang/cargo#11770)
- fix(toml): Provide a way to show unused manifest keys for dependencies (rust-lang/cargo#11630)
- Improve error for missing crate in --offline mode for sparse index (rust-lang/cargo#11783)
- feat(resolver): `-Zdirect-minimal-versions` (rust-lang/cargo#11688)
- feat: Use test name for dir when running tests (rust-lang/cargo#11738)
- Jobserver cleanup (rust-lang/cargo#11764)
- Fix help string for  "--charset" option of "cargo tree" (rust-lang/cargo#11785)

---

~~This update is primarily for making rust-lang/cargo#11630 into 1.69~~ (will file a beta backport then). However, just look into the licenses and dependencies permitted list, it looks a bit unfortunate but inevitable I guess?

r? `@ehuss`
cc `@Muscraft`
2023-03-08 20:04:27 +00:00
Michael Howell
255fdb398e Update src/librustdoc/html/static/js/storage.js
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2023-03-08 12:49:35 -07:00
Michael Howell
d4dce3e200 Update browser-ui-test version
Use NEAR check to allow one pixel difference between scroll positions.
2023-03-08 12:49:35 -07:00
Michael Howell
c5e92e06b5 rustdoc: fix test case for custom themes 2023-03-08 12:49:35 -07:00
Guillaume Gomez
5db516b809 Fix eslint errors 2023-03-08 12:49:34 -07:00
Michael Howell
f916681d8d Only load one CSS theme by default
To avoid generating a FOUC at startup, this commit uses `document.write` to
load the stylesheet initially.

Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2023-03-08 12:49:34 -07:00