about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-06-26Rollup merge of #97743 - RalfJung:const-err-future-breakage, r=estebankMatthias Krüger-0/+2838
make const_err show up in future breakage reports As tracked in https://github.com/rust-lang/rust/issues/71800, const_err should become a hard error Any Day Now (TM). I'd love to move forward with that sooner rather than later; it has been deny-by-default for many years and a future incompat lint since https://github.com/rust-lang/rust/pull/80394 (landed more than a year ago). Some CTFE errors are already hard errors since https://github.com/rust-lang/rust/pull/86194. But before we truly make it a hard error in all cases, we now have one more intermediate step we can take -- to make it show up in future breakage reports. Cc `````@rust-lang/wg-const-eval`````
2022-06-26Rollup merge of #97295 - c410-f3r:yet-another-let-chain, r=compiler-errorsMatthias Krüger-192/+436
[rustc_parse] Forbid `let`s in certain places Currently only forbids in locals to resolve https://github.com/rust-lang/rust/pull/94927#issuecomment-1099605024 but feel free to point any other places.
2022-06-26Auto merge of #98518 - RalfJung:miri, r=RalfJungbors-8/+13
update Miri Fixes https://github.com/rust-lang/rust/issues/98493 (this is a flaky test, that's why the toolstate already says Miri is fixed) r? `@ghost` Cc `@rust-lang/miri`
2022-06-26Rollup merge of #98513 - ehuss:rebuild-llvm-download, r=Mark-SimulacrumYuki Okushi-0/+13
Fix LLVM rebuild with download-ci-llvm. This fixes an issue where updating a local checkout that includes a change in `src/version` causes a linking failure. The cause is that the `rustc_llvm` build script uses `rerun-if-changed` of `llvm-config` to know if it needs to rerun. Cargo only compares the timestamp of the last time the build script to the file. However, extracting the tar files retains the timestamps in the tarball which may be some time in the past. Since `src/version` is included in the LLVM `.so` filename, `rustc` attempts to load the wrong shared library since the `rustc_llvm` build script doesn't rerun. https://github.com/rust-lang/cargo/issues/10791 contains a more detailed explanation. The solution here is a hack which updates the timestamp of `llvm-config` to the current time when it is extracted. This is a bit of a hack, but seems to be the best solution I can think of until https://github.com/rust-lang/cargo/issues/10791 is fixed. There are likely several other situations where this is a problem (such as using system LLVM), and this isn't really a complete fix. Note that apple platforms are not directly affected by this problem because they don't have a version in the dylib filename. How to test this: 1. On a linux host, enable download-ci-llvm 2. Check out 7036449c774860a5b348dbbe01c20704c557382e (the commit just before the last version bump) 3. `./x.py build library/std` 4. Check out 5f015a24f99f52ea9b67beb420aff24f82acf1af (the commit that bumped the version) 5. `./x.py build library/std` Fixes #98495
2022-06-26Rollup merge of #98509 - rust-lang:notriddle/precise-pin-diag, r=compiler-errorsYuki Okushi-0/+24
diagnostics: consider parameter count when suggesting smart pointers Fixes #96834
2022-06-26Rollup merge of #98502 - GuillaumeGomez:source-sidebar-hover, r=notriddleYuki Okushi-6/+105
Fix source sidebar hover in ayu theme In the screenshot below, `rc.rs` should be orange: ![Screenshot from 2022-06-25 22-24-06](https://user-images.githubusercontent.com/3050060/175789532-99e8781d-2e62-43f7-bbd9-1b1151e1f8c1.png) It's because the CSS selector was not precise enough and was "overloaded" with another one. This PR fixes it and adds a test for the colors in the source sidebar. cc `@jsha` r? `@notriddle`
2022-06-26Rollup merge of #98491 - antoyo:fix/ui-test-backtrace-panic-abort, r=Dylan-DPCYuki Okushi-0/+1
Fix backtrace UI test when panic=abort is used The function `contains_verbose_expected` is only used when the panic strategy is not abort, so it caused a warning when it was abort, which made the UI test failed on stderr comparison.
2022-06-26Rollup merge of #98488 - Mark-Simulacrum:bump-rls, r=pietroalbiniYuki Okushi-0/+0
Bump RLS to latest master on rust-lang/rls Of primary interest, this merges rust-lang/rls@ece09b88c0365947af79c0ffdeea02bc6c1eec25 into rust-lang/rust, which brings in the changes that fix RLS tests broken by #97853. #97853 already introduced that commit's changes (under rust-lang/rls@27f4044df03d15c7c38a483c3e4635cf4f51807d) but without putting those changes on rust-lang/rls as a branch, so we ended up with an orphan commit that caused trouble when updating submodules in rust-lang/rust. This commit, once merged into rust-lang/rust, should continue to let RLS tests to pass on rust-lang/rust's side and move us back into a healthy state where tip of the submodule points to a valid master commit in the rust-lang/rls repository. cc https://github.com/rust-lang/rust/issues/98451, but not marking as fixed as I believe we need to add verification to prevent future oversights.
2022-06-26Rollup merge of #98371 - compiler-errors:better-opaque-printing, r=oli-obkYuki Okushi-1/+46
Fix printing `impl trait` under binders Before, we would render `impl for<'a> Trait<'a>` like `impl Trait<for<'a> 'a>`, lol.
2022-06-25update MiriRalf Jung-8/+13
2022-06-26Auto merge of #98140 - klensy:compiletest-strip, r=Mark-Simulacrumbors-4/+20
compiletest: strip debuginfo by default for mode=ui This reduces occupied disk space, for example for src/test/ui it drops from 1972mb to 132mb (x86_64-pc-windows-msvc). Individual tests that require debuginfo/symbols should turn this option off (as in fixed tests).
2022-06-25Fix LLVM rebuild with download-ci-llvm.Eric Huss-0/+13
2022-06-25diagnostics: consider parameter count when suggesting smart pointersMichael Howell-0/+24
2022-06-25Auto merge of #97513 - jyn514:submodule-handling, r=Mark-Simulacrumbors-150/+751
Fully remove submodule handling from bootstrap.py These submodules were previously updated in python because Cargo gives a hard error if toml files are missing from the workspace: ``` error: failed to load manifest for workspace member `/home/jnelson/rust-lang/rust/src/tools/rls` Caused by: failed to read `/home/jnelson/rust-lang/rust/src/tools/rls/Cargo.toml` Caused by: No such file or directory (os error 2) failed to run: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /home/jnelson/rust-lang/rust/src/bootstrap/Cargo.toml ``` However, bootstrap doesn't actually need to be part of the workspace. Remove it so we can move submodule handling fully to Rust, avoiding duplicate code between Rust and Python. Note that this does break `cargo run`; it has to be `cd src/bootstrap && cargo run` now. Given that we're planning to make the main entrypoint a shell script (or rust binary), I think this is a good tradeoff for reduced complexity in bootstrap.py. To get this working, I also had to remove support for vendoring when using the git sources, because `cargo vendor` requires all submodules to be checked out. I think this is ok; people who care about this are likely already using the pre-vendored `rustc-src` tarball. Fixes https://github.com/rust-lang/rust/issues/90764. Helps with #94829
2022-06-25Add test for source sidebar elements colorsGuillaume Gomez-0/+99
2022-06-25bless after rebaseRalf Jung-23/+750
2022-06-25Fix CSS rule for selected and hovered items in the source sidebarGuillaume Gomez-6/+6
2022-06-25Auto merge of #98412 - calebcartwright:sync-rustfmt, r=calebcartwrightbors-11633/+533
Sync rustfmt We had a bug in the update we made ~1 week ago, so running a somewhat early sync to pull the fix in
2022-06-25Fix backtrace UI test when panic=abort is usedAntoni Boucher-0/+1
2022-06-25Auto merge of #98486 - matthiaskrgr:rollup-u7m508x, r=matthiaskrgrbors-111/+284
Rollup of 9 pull requests Successful merges: - #96412 (Windows: Iterative `remove_dir_all`) - #98126 (Mitigate MMIO stale data vulnerability) - #98149 (Set relocation_model to Pic on emscripten target) - #98194 (Leak pthread_{mutex,rwlock}_t if it's dropped while locked.) - #98298 (Point to type parameter definition when not finding variant, method and associated item) - #98311 (Reverse folder hierarchy) - #98401 (Add tracking issues to `--extern` option docs.) - #98429 (Use correct substs in enum discriminant cast) - #98431 (Suggest defining variable as mutable on `&mut _` type mismatch in pats) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-25bless remaining testsRalf Jung-0/+104
2022-06-25make const_err show up in future breakage reportsRalf Jung-0/+2007
2022-06-25Bump RLS to latest master on rust-lang/rlsMark Rousskov-0/+0
Of primary interest, this merges rust-lang/rls@ece09b88c0365947af79c0ffdeea02bc6c1eec25 into rust-lang/rust, which brings in the changes that fix RLS tests broken by #97853. #97853 already introduced that commit's changes (under 27f4044df03d15c7c38a483c3e4635cf4f51807d) but without putting those changes on rust-lang/rls as a branch, so we ended up with an orphan commit that caused trouble when updating submodules in rust-lang/rust. This commit, once merged into rust-lang/rust, should continue to let RLS tests to pass on rust-lang/rust's side and move us back into a healthy state where tip of the submodule points to a valid master commit in the rust-lang/rls repository.
2022-06-25Rollup merge of #98431 - WaffleLapkin:mut_pat_suggestions, r=compiler-errorsMatthias Krüger-1/+122
Suggest defining variable as mutable on `&mut _` type mismatch in pats Suggest writing `mut a` where `&mut a` was written but a non-ref type provided. Since we still don't have "apply either one of the suggestions but not both" kind of thing, the interaction with the suggestion of removing `&[mut]` or moving it to the type is weird, and idk how to make it better.. r? ``@compiler-errors``
2022-06-25Rollup merge of #98429 - b-naber:use-correct-substs-discriminant-cast, r=lcnrMatthias Krüger-0/+10
Use correct substs in enum discriminant cast Fixes https://github.com/rust-lang/rust/issues/97634 r? ```@lcnr```
2022-06-25Rollup merge of #98401 - ehuss:extern-tracking, r=Dylan-DPCMatthias Krüger-0/+5
Add tracking issues to `--extern` option docs.
2022-06-25Rollup merge of #98298 - TaKO8Ki:point-to-type-param-definition, ↵Matthias Krüger-110/+147
r=compiler-errors Point to type parameter definition when not finding variant, method and associated item fixes #77391
2022-06-25Auto merge of #96820 - r-raymond:master, r=cuviperbors-5/+16
Make RwLockReadGuard covariant Hi, first time contributor here, if anything is not as expected, please let me know. `RwLockReadGoard`'s type constructor is invariant. Since it behaves like a smart pointer to an immutable reference, there is no reason that it should not be covariant. Take e.g. ``` fn test_read_guard_covariance() { fn do_stuff<'a>(_: RwLockReadGuard<'_, &'a i32>, _: &'a i32) {} let j: i32 = 5; let lock = RwLock::new(&j); { let i = 6; do_stuff(lock.read().unwrap(), &i); } drop(lock); } ``` where the compiler complains that &i doesn't live long enough. If `RwLockReadGuard` is covariant, then the above code is accepted because the lifetime can be shorter than `'a`. In order for `RwLockReadGuard` to be covariant, it can't contain a full reference to the `RwLock`, which can never be covariant (because it exposes a mutable reference to the underlying data structure). By reducing the data structure to the required pieces of `RwLock`, the rest falls in place. If there is a better way to do a test that tests successful compilation, please let me know. Fixes #80392
2022-06-25[rustc_parse] Forbid lets in certain placesCaio-192/+436
2022-06-24Auto merge of #98459 - pietroalbini:pa-1.64, r=pietroalbinibors-1/+1
Bump version to 1.64.0 r? `@ghost`
2022-06-24Use write! instead of p! to avoid having to use weird scopingMichael Goulet-1/+1
2022-06-24Fix printing impl trait under bindersMichael Goulet-0/+45
2022-06-24improve wording of a suggestionMaybe Waffle-8/+8
2022-06-24bump version to 1.64.0Pietro Albini-1/+1
2022-06-24fmtb-naber-1/+1
2022-06-24Auto merge of #98397 - RalfJung:miri, r=RalfJungbors-14/+8
update Miri Fixes https://github.com/rust-lang/rust/issues/98366 r? `@ghost` Cc `@rust-lang/miri`
2022-06-24Auto merge of #98447 - JohnTitor:rollup-pponoo3, r=JohnTitorbors-78/+336
Rollup of 9 pull requests Successful merges: - #91264 (Add macro support in jump to definition feature) - #96955 (Remove (transitive) reliance on sorting by DefId in pretty-printer) - #97633 (Session object: Set OS/ABI) - #98039 (Fix `panic` message for `BTreeSet`'s `range` API and document `panic` cases) - #98214 (rustc_target: Remove some redundant target properties) - #98280 (Improve suggestion for calling fn-like expr on type mismatch) - #98394 (Fixup missing renames from `#[main]` to `#[rustc_main]`) - #98411 (Update tendril) - #98419 (Remove excess rib while resolving closures) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-24add testb-naber-0/+10
2022-06-24Rollup merge of #98280 - compiler-errors:better-call-closure-on-type-err, ↵Yuki Okushi-11/+66
r=estebank Improve suggestion for calling fn-like expr on type mismatch 1.) Suggest calling values of with RPIT types (and probably TAIT) when we expect `Ty` and have `impl Fn() -> Ty` 2.) Suggest calling closures even when they're not assigned to a local variable first 3.) Drive-by fix of a pretty-printing bug (`impl Fn()-> Ty` => `impl Fn() -> Ty`) r? ```@estebank```
2022-06-24Rollup merge of #96955 - Aaron1011:pretty-print-sort, r=petrochenkovYuki Okushi-16/+16
Remove (transitive) reliance on sorting by DefId in pretty-printer This moves us a step closer to removing the `PartialOrd/`Ord` impls for `DefId`. See #90317
2022-06-24Rollup merge of #91264 - GuillaumeGomez:macro-jump-to-def, r=jshaYuki Okushi-51/+254
Add macro support in jump to definition feature Fixes #91174. To do so, I check if the span comes from an expansion, and if so, I infer the original macro `DefId` or `Span` depending if it's a defined in the current crate or not. There is one limitation due to macro expansion though: ```rust macro_rules! yolo { () => {}} fn foo() { yolo!(); } ``` In `foo`, `yolo!` won't be linked because after expansion, it is replaced by nothing (which seems logical). So I can't get an item from the `Visitor` from which I could tell if its `Span` comes from an expansion. I added a test for this specific limitation alongside others. Demo: https://rustdoc.crud.net/imperio/macro-jump-to-def/src/foo/check-source-code-urls-to-def-std.rs.html As for the empty macro issue that cannot create a jump to definition, you can see it [here](https://rustdoc.crud.net/imperio/macro-jump-to-def/src/foo/check-source-code-urls-to-def-std.rs.html#35). r? ```@jyn514```
2022-06-24Auto merge of #98109 - nikomatsakis:issue-98095, r=jackh726bors-146/+280
fix universes in the NLL type tests In the NLL code, we were not accommodating universes in the `type_test` logic. Fixes #98095. r? `@compiler-errors` This breaks some tests, however, so the purpose of this branch is more explanatory and perhaps to do a crater run.
2022-06-24Auto merge of #98395 - arlosi:update-cargo, r=ehussbors-0/+0
Update cargo 8 commits in 03a849043e25104e8b7ad0d4a96c525787b69379..a5e08c4703f202e30cdaf80ca3e7c00baa59c496 2022-06-20 14:47:36 +0000 to 2022-06-23 20:12:03 +0000 - Fix tests due to change in dead_code diagnostic. (rust-lang/cargo#10785) - Stabilize config-cli (rust-lang/cargo#10755) - Restrict duplicate deps warning only to published packages (rust-lang/cargo#10767) - Use fingerprint_hash when computing fingerprints for custom targets (rust-lang/cargo#10746) - Add preloading for workspace packages in `resolve_with_previous` (rust-lang/cargo#10761) - capitalise, for consistency (rust-lang/cargo#10772) - remove unused dependency from benchsuite (rust-lang/cargo#10774) - docs(contrib): Add documentation for ui tests (rust-lang/cargo#10758)
2022-06-23Update cargoArlo Siemsen-0/+0
8 commits in 03a849043e25104e8b7ad0d4a96c525787b69379..a5e08c4703f202e30cdaf80ca3e7c00baa59c496 2022-06-20 14:47:36 +0000 to 2022-06-23 20:12:03 +0000 - Fix tests due to change in dead_code diagnostic. (rust-lang/cargo#10785) - Stabilize config-cli (rust-lang/cargo#10755) - Restrict duplicate deps warning only to published packages (rust-lang/cargo#10767) - Use fingerprint_hash when computing fingerprints for custom targets (rust-lang/cargo#10746) - Add preloading for workspace packages in `resolve_with_previous` (rust-lang/cargo#10761) - capitalise, for consistency (rust-lang/cargo#10772) - remove unused dependency from benchsuite (rust-lang/cargo#10774) - docs(contrib): Add documentation for ui tests (rust-lang/cargo#10758)
2022-06-23Rollup merge of #98422 - GuillaumeGomez:browser-ui-test-update, r=Dylan-DPCMichael Goulet-1/+1
Update browser-ui-test version to 0.9.6 This update provides a better error message when chromium crashes. cc ``@jsha`` r? ``@Dylan-DPC``
2022-06-23Rollup merge of #98410 - ehuss:update-books, r=ehussMichael Goulet-0/+0
Update books ## reference 6 commits in 683bfe5cd64d589c6a1645312ab5f93b6385ccbb..9fce337a55ee4a4629205f6094656195cecad231 2022-05-27 11:54:20 -0700 to 2022-06-22 13:59:28 -0700 - Remove outdated restriction on recursive types (rust-lang/reference#1231) - Clarify "string continue" for (byte) string literals (rust-lang/reference#1042) - Add a note to the turbofish section about impl Trait (rust-lang/reference#1212) - modify confusing variance example (rust-lang/reference#1224) - Add stable references of `macro_metavar_expr` (rust-lang/reference#1192) - Document native library modifier `bundle` (rust-lang/reference#1210) ## book 33 commits in 396fdb69de7fb18f24b15c7ad13491b1c1fa7231..efbafdba3618487fbc9305318fcab9775132ac15 2022-06-08 10:02:35 -0400 to 2022-06-19 21:06:50 -0400 - Propagate tech review edits to appendices to src - Tech review comments and further edits to the appendices - Duplicate fragment "mutation and borrowing" - Propagate ch20 tech review edits to src - Edits in response to tech review of chapter 20 - Comments from tech review on chapter 20 - Propagate ch7 tech review edits to src - Responding to tech review of ch7 - Tech review comments on ch7 - Propagate ch19 tech review edits to src - Responses to tech review of ch19 - Tech review comments on ch 19 - Update ch03-01-variables-and-mutability.md - Add more explanation to CONTRIBUTING about the nostarch directory - Duplicate sentence - Missing period - Regenerate ch09-02 error messages - Change some print formatting styles in ch18 - Propagate tech review ch18 edits to src - Responses to tech review comments of chapter 18 - Chapter 18 from tech review - Snapshot of introduction for nostarch - Propagate edits of ch1 to src - Edits to edits to chapter 1 - Edits from nostarch for chapter 1 - Update Visual Studio instructions for 2022 - bugfix/typo-ch10-01 Fix typo in chapter ch10-01 - Tweak rustfmt slightly for these listings - Propagate edits to ch13 to src - Responses to nostarch edits to ch13 - Edits to ch13 from nostarch - Apply complex Clippy recommendation - Apply Clippy recommendations: `cargo clippy --fix` ## rust-by-example 4 commits in dbb7e5e2345ee26199ffba218156b6009016a20c..1095df2a5850f2d345fad43a30633133365875ba 2022-06-02 16:30:51 -0300 to 2022-06-18 21:47:12 -0300 - Add example for `array.get()` (rust-lang/rust-by-example#1554) - Example improvements (rust-lang/rust-by-example#1552) - Fix for a set of typos (rust-lang/rust-by-example#1551) - Make guard examples clearer around `_` (rust-lang/rust-by-example#1550) ## rustc-dev-guide 11 commits in 6e4d6435db89bcc027b1bba9742e4f59666f5412..048d925f0a955aac601c4160c0e7f05771bcf63b 2022-06-08 08:06:32 +0900 to 2022-06-21 22:25:34 +0900 - not obvious what Ex is, so rather get rid (rust-lang/rustc-dev-guide#1372) - small improves (rust-lang/rustc-dev-guide#1371) - make clear that other versions can work (rust-lang/rustc-dev-guide#1373) - Fix small `src/diagnostics.md` typo (rust-lang/rustc-dev-guide#1370) - Add an "is" and rearange "We next" to "Next, we" (rust-lang/rustc-dev-guide#1369) - diagnostics: add translation documentation - diagnostics: line wrapping/heading changes - later -&gt; latter - Remove mention of -Zborrowck=mir with Polonius. (rust-lang/rustc-dev-guide#1367) - Remove nll compare mode. (rust-lang/rustc-dev-guide#1366) - add section on user types (rust-lang/rustc-dev-guide#1359) ## embedded-book 1 commits in cbb494f96da3268c2925bdadc65ca83d42f2d4ef..e17dcef5e96346ee3d7fa56820ddc7e5c39636bc 2022-05-26 06:58:43 +0000 to 2022-06-19 10:28:00 +0000 - Fix a typo (rust-embedded/book#319)
2022-06-23Rollup merge of #98390 - GuillaumeGomez:keyword-rustdoc-json, r=notriddleMichael Goulet-7/+25
Fixes handling of keywords in rustdoc json output Fixes #98002. Instead of panicking, we just filter them out. cc ```@matthiaskrgr``` r? ```@notriddle```
2022-06-23Rollup merge of #98365 - jyn514:improve-obligation-errors-review-comments, ↵Michael Goulet-8/+8
r=eholk Address review comments from #98259 It got approved so fast I didn't have time to make changes xD r? ``@eholk``
2022-06-23Rollup merge of #98353 - beetrees:builtin-macros-cfg-diag, r=davidtwcoMichael Goulet-1/+10
Migrate two diagnostics from the `rustc_builtin_macros` crate Migrate two diagnostics to use the struct derive and be translatable. r? ```@davidtwco```
2022-06-23Rollup merge of #98310 - jsha:defer-source-sidebar, r=GuillaumeGomezMichael Goulet-26/+42
rustdoc: optimize loading of source sidebar The source sidebar has a setting to remember whether it should be open or closed. Previously, this setting was handled in source-script.js, which is loaded with `defer`, meaning it is often run after the document is rendered. Since CSS renders the source sidebar as closed by default, changing this after the initial render results in a relayout. Instead, handle the setting in storage.js, which is the first script to load and is the only script that blocks render. This avoids a relayout and means navigating between files with the sidebar open is faster. Demo: https://rustdoc.crud.net/jsha/defer-source-sidebar/src/alloc/ffi/c_str.rs.html r? ````@GuillaumeGomez````