about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-06-30Rollup merge of #98677 - lyming2007:issue-98492-fix, r=lcnrMatthias Krüger-6/+37
For diagnostic information of Boolean, remind it as use the type: 'bool' Fixes #98492. It helps programmers coming from other languages modified: compiler/rustc_resolve/src/late/diagnostics.rs
2022-06-30Rollup merge of #98671 - GuillaumeGomez:source-sidebar-fixes, r=notriddleMatthias Krüger-4/+60
Fix source sidebar bugs This PR fixes the following two bugs: ![Screenshot from 2022-06-29 14-39-58](https://user-images.githubusercontent.com/3050060/176449070-3e3762da-2bfe-4acf-8eb0-34f6eb4c94ed.png) ![Screenshot from 2022-06-29 15-05-09](https://user-images.githubusercontent.com/3050060/176449073-b164820b-bd71-4b1a-990c-bba4e5fce196.png) I added regression tests to prevent them to happen again. I think we should backport it to beta as well. You can test it [here](https://rustdoc.crud.net/imperio/source-sidebar-fixes/src/std/lib.rs.html). cc ```@jsha``` r? ```@notriddle```
2022-06-30For diagnostic information of Boolean, remind it as use the type: 'bool'Yiming Lei-6/+37
It helps programmers coming from other languages modified: compiler/rustc_resolve/src/late/diagnostics.rs modified: src/test/ui/lint/recommend-literal.rs modified: src/test/ui/lint/recommend-literal.stderr modified: compiler/rustc_resolve/src/late/diagnostics.rs modified: src/test/ui/lint/recommend-literal.rs modified: src/test/ui/lint/recommend-literal.stderr modified: compiler/rustc_resolve/src/late/diagnostics.rs modified: src/test/ui/lint/recommend-literal.rs modified: src/test/ui/lint/recommend-literal.stderr
2022-06-30Add test to ensure that scroll position is kept when opening/closing source ↵Guillaume Gomez-0/+14
sidebar
2022-06-30Fix scroll when source sidebar is open on mobileGuillaume Gomez-0/+15
2022-06-30Auto merge of #98377 - davidv1992:add-lifetimes-to-argument-temporaries, ↵bors-0/+27
r=oli-obk Added llvm lifetime annotations to function call argument temporaries. The goal of this change is to ensure that llvm will do stack slot optimization on these temporaries. This ensures that in code like: ```rust const A: [u8; 1024] = [0; 1024]; fn copy_const() { f(A); f(A); } ``` we only use 1024 bytes of stack space, instead of 2048 bytes. I am new to developing for the rust compiler, and as such not entirely sure, but I believe this should be sufficient to close #98156. Also, this does not contain a test case to ensure this keeps working, primarily because I am not sure how to go about testing this. I would love some suggestions as to how that could be approached.
2022-06-30Auto merge of #98698 - RalfJung:miri, r=RalfJungbors-14/+7
update Miri Fixes https://github.com/rust-lang/rust/issues/98599 r? `@ghost`
2022-06-29update MiriRalf Jung-14/+7
2022-06-30Auto merge of #98691 - matthiaskrgr:rollup-ymsa64p, r=matthiaskrgrbors-189/+408
Rollup of 6 pull requests Successful merges: - #96727 (Make TAIT behave exactly like RPIT) - #98681 (rustdoc-json: Make default value of blanket impl assoc types work) - #98682 (add tests for ICE 94432) - #98683 (add test for ice 68875) - #98685 (Replace `sort_modules_alphabetically` boolean with enum) - #98687 (add test for 47814) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-30Rollup merge of #98687 - matthiaskrgr:test_47814, r=compiler-errorsMatthias Krüger-0/+27
add test for 47814 not sure if the issue should actually get closed though, hm r? ``@compiler-errors``
2022-06-30Rollup merge of #98685 - camelid:sorting-flag, r=GuillaumeGomezMatthias Krüger-17/+31
Replace `sort_modules_alphabetically` boolean with enum This fixes the long-standing FIXME there and makes the code easier to understand. The reference to modules in both the old and new names seems potentially wrong since I believe it applies to all items. r? ``@GuillaumeGomez``
2022-06-30Rollup merge of #98683 - matthiaskrgr:ice-test-68875, r=compiler-errorsMatthias Krüger-0/+19
add test for ice 68875 Fixes #68875
2022-06-30Rollup merge of #98682 - matthiaskrgr:test-94432, r=compiler-errorsMatthias Krüger-0/+10
add tests for ICE 94432 Fixes #94432
2022-06-30Rollup merge of #98681 - ↵Matthias Krüger-1/+10
Enselic:rustdoc-json-default-assoc-type-blanket-impl, r=GuillaumeGomez rustdoc-json: Make default value of blanket impl assoc types work Closes #98658 r? ``@GuillaumeGomez`` ``@rustbot`` labels +A-rustdoc-json
2022-06-30Rollup merge of #96727 - oli-obk:no_expect, r=lcnrMatthias Krüger-171/+311
Make TAIT behave exactly like RPIT fixes https://github.com/rust-lang/rust/issues/96552 This makes type-alias-impl-trait behave like return-position-impl-trait. Unfortunately it also causes some cases to stop compiling due to "needing type annotations" and makes panicking cause fallback for the hidden type to `()`. All of these are addressable, but we should probably address them for RPIT and TAIT together r? ``@lcnr``
2022-06-29Auto merge of #98520 - RalfJung:invalid, r=compiler-errorsbors-192/+192
interpret: adjust error from constructing an invalid value
2022-06-29Update browser-ui-test version to 0.9.7Guillaume Gomez-1/+1
2022-06-29add test for 47814Matthias Krüger-0/+27
not sure if the issue should actually get closed though, hm r? @compiler-errors
2022-06-29Replace `sort_modules_alphabetically` boolean with enumNoah Lev-17/+31
This fixes the long-standing FIXME there and makes the code easier to understand. The reference to modules in both the old and new names seems potentially wrong since I believe it applies to all items.
2022-06-29add test for ice 68875Matthias Krüger-0/+19
Fixes #68875
2022-06-29add tests for ICE 94432Matthias Krüger-0/+10
Fixes #94432
2022-06-29rustdoc-json: Make default value of blanket impl assoc types workMartin Nordholts-1/+10
2022-06-29Rollup merge of #98665 - ChrisDenton:deprecated-suggestion, r=compiler-errorsMatthias Krüger-5/+27
Use verbose help for deprecation suggestion Fixes #98631 r? `@compiler-errors`
2022-06-29Rollup merge of #98660 - eddyb:invalid-punct-stage1, r=lqdMatthias Krüger-14/+6
Unbreak stage1 tests via ignore-stage1 in `proc-macro/invalid-punct-ident-1.rs`. #98188 broke `./x.py test --stage 1` (which I thought we ran in PR CI, cc `@rust-lang/infra)` i.e. the default `./x.py test` in dev checkouts, as the panic in `src/test/ui/proc-macro/invalid-punct-ident-1.rs` moved from the server (`rustc`) to the client (proc macro), and that means it's now affected by #59998. I made the test look like `src/test/ui-fulldeps/issue-76270-panic-in-libproc-macro.rs` tho I'm a bit confused why that one is in `src/test/ui-fulldeps`, it should still work in `src/test/ui`, no? (cc `@Aaron1011)`
2022-06-29Rollup merge of #98652 - ojeda:warning-free-no_global_oom_handling, ↵Matthias Krüger-1/+1
r=joshtriplett `alloc`: clean and ensure `no_global_oom_handling` builds are warning-free Rust 1.62.0 introduced a couple new `unused_imports` warnings in `no_global_oom_handling` builds, making a total of 5 warnings. <details> ```txt warning: unused import: `Unsize` --> library/alloc/src/boxed/thin.rs:6:33 | 6 | use core::marker::{PhantomData, Unsize}; | ^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused import: `from_fn` --> library/alloc/src/string.rs:51:18 | 51 | use core::iter::{from_fn, FusedIterator}; | ^^^^^^^ warning: unused import: `core::ops::Deref` --> library/alloc/src/vec/into_iter.rs:12:5 | 12 | use core::ops::Deref; | ^^^^^^^^^^^^^^^^ warning: associated function `shrink` is never used --> library/alloc/src/raw_vec.rs:424:8 | 424 | fn shrink(&mut self, cap: usize) -> Result<(), TryReserveError> { | ^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: associated function `forget_remaining_elements` is never used --> library/alloc/src/vec/into_iter.rs:126:19 | 126 | pub(crate) fn forget_remaining_elements(&mut self) { | ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` </details> This PR cleans them and ensures no new ones are introduced so that projects compiling `alloc` without infallible allocations do not see them (and may want to enable `-Dwarnings`). The couple `dead_code` ones may be reverted when some fallible allocation support starts using them.
2022-06-29Rollup merge of #98647 - ehuss:update-cargo, r=ehussMatthias Krüger-0/+0
Update cargo 2 commits in a5e08c4703f202e30cdaf80ca3e7c00baa59c496..dbff32b27893b899ae2397f3d56d1be111041d56 2022-06-23 20:12:03 +0000 to 2022-06-24 19:25:13 +0000 - Fetch GitHub commits by long hash more efficiently (rust-lang/cargo#10079) - refactor(test): Clarify asserts are for UI (rust-lang/cargo#10778)
2022-06-29Rollup merge of #98646 - notriddle:notriddle/main.js, r=GuillaumeGomezMatthias Krüger-2/+25
rustdoc: fix bugs in main.js popover help and settings
2022-06-29Rollup merge of #98643 - voidc:valtree-ref-pretty, r=lcnrMatthias Krüger-0/+48
Improve pretty printing of valtrees for references This implements the changes outlined in https://github.com/rust-lang/rust/issues/66451#issuecomment-1168859638. r? `@lcnr` Fixes #66451
2022-06-29Rollup merge of #98642 - yanchen4791:issue-98260-fix, r=spastorinoMatthias Krüger-0/+21
Fix #98260 Fixes https://github.com/rust-lang/rust/issues/98260
2022-06-29Rollup merge of #98434 - dpaoliello:staticcrt, r=jyn514Matthias Krüger-30/+27
Ensure that `static_crt` is set in the bootstrapper whenever using `cc-rs` to get a compiler command line. When attempting to build rustc with LLVM on Windows, I noticed that the CRT flag provided to the C and C++ Compilers was inconsistent: ``` "-DCMAKE_C_FLAGS=-nologo -MT -Brepro" "-DCMAKE_CXX_FLAGS=-nologo -MD -Brepro" ``` Since the bootstrapper also sets the various `LLVM_USE_CRT` variables, this resulted in cl.exe reporting a bunch of warnings: ``` cl : Command line warning D9025 : overriding '/MD' with '/MT' ``` The root cause for this is that `cc_detect::find` was creating a `cc::Build` twice, but didn't set `static_crt` the second time. It's possible that this what is also causing #81381
2022-06-29fix stderr by hand since that test is not run on my systemRalf Jung-4/+4
2022-06-29interpret: adjust error from constructing an invalid valueRalf Jung-188/+188
2022-06-29Add test for source sidebar toggleGuillaume Gomez-1/+13
2022-06-29Fix display of toggle on expanded source sidebarGuillaume Gomez-0/+3
2022-06-29Update/add tests for source sidebar in mobile modeGuillaume Gomez-2/+12
2022-06-29Fix height for the source sidebar in mobile modeGuillaume Gomez-1/+3
2022-06-29Rollup merge of #98625 - RalfJung:retag, r=oli-obkDylan DPC-0/+2
emit Retag for compound types with reference fields I want to add an option to Miri to do retagging inside reference fields. But that means we first have to even emit `Retag` for types that *contain* references (rather than being of reference types). :) Stacked Borrows originally did that, but we stopped doing it when hitting bunch of issues in the standard library. However I have since realized that we actually do emit `noalias` for newtypes references, which means for soundness we should recurse into fields. Also it'd probably be bad news if newtypes lose out on optimizations (and they don't, for anything else). I want to add an option for that to Miri so that we can start experimenting with those semantics. r? ``@oli-obk``
2022-06-29Rollup merge of #98607 - compiler-errors:tuple-wrap-suggestion, r=oli-obkDylan DPC-17/+104
Clean up arg mismatch diagnostic, generalize tuple wrap suggestion This is based on top of #97542, so just look at the last commit which contains the relevant changes. 1. Remove `final_arg_types` which was one of the last places we were using raw (`usize`) indices instead of typed indices in the arg mismatch suggestion code. 2. Improve the tuple wrap suggestion, now we suggest things like `call(a, b, c, d)` -> `call(a, (b, c), d)` :smiley_cat: 3. Folded in fix #98645
2022-06-29Rollup merge of #98499 - JulianKnodt:erase_lifetime, r=lcnrDylan DPC-0/+33
Erase regions in New Abstract Consts When an abstract const is constructed, we previously included lifetimes in the set of substitutes, so it was not able to unify two abstract consts if their lifetimes did not match but the values did, despite the values not depending on the lifetimes. This caused code that should have compiled to not compile. Fixes #98452 r? ```@lcnr```
2022-06-29Rollup merge of #98415 - ↵Dylan DPC-18/+18
compiler-errors:rustc-borrowck-session-diagnostic-1, r=davidtwco Migrate some `rustc_borrowck` diagnostics to `SessionDiagnostic` Self-explanatory r? ```@davidtwco```
2022-06-29Auto merge of #98558 - nnethercote:smallvec-1.8.1, r=lqdbors-2/+2
Update `smallvec` to 1.8.1. This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc. r? `@lqd`
2022-06-29Add more testsOli Scherer-2/+28
2022-06-29Make RPIT and TAIT work exactly the sameOli Scherer-183/+297
2022-06-29Use verbose help for deprecation suggestionChris Denton-5/+27
2022-06-29Unbreak stage1 tests via ignore-stage1 in `proc-macro/invalid-punct-ident-1.rs`.Eduard-Mihai Burtescu-14/+6
2022-06-29Auto merge of #98656 - Dylan-DPC:rollup-hhytn0c, r=Dylan-DPCbors-254/+424
Rollup of 7 pull requests Successful merges: - #97423 (Simplify memory ordering intrinsics) - #97542 (Use typed indices in argument mismatch algorithm) - #97786 (Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths) - #98277 (Fix trait object reborrow suggestion) - #98525 (Add regression test for #79224) - #98549 (interpret: do not prune requires_caller_location stack frames quite so early) - #98603 (Some borrowck diagnostic fixes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-29Rollup merge of #98603 - compiler-errors:minor-borrowck-diagnostic-fixes, ↵Dylan DPC-25/+108
r=davidtwco Some borrowck diagnostic fixes 1. Remove some redundant `.as_ref` suggestion logic from borrowck, this has the consequence of also not suggesting `.as_ref` after `Option` methods, but (correctly) before. 2. Fix a bug where we were replacing a binding's name with a type. Instead, make it a note. This is somewhat incomplete. See `src/test/ui/borrowck/suggest-as-ref-on-mut-closure.rs` for more improvements.
2022-06-29Rollup merge of #98525 - JohnTitor:issue-79224, r=compiler-errorsDylan DPC-0/+53
Add regression test for #79224 Closes #79224 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-29Rollup merge of #98277 - compiler-errors:issue-93596, r=estebankDylan DPC-48/+83
Fix trait object reborrow suggestion Fixes #93596 Slightly generalizes the logic we use to suggest fix first implemented in #95609, specifically when we have a `Sized` obligation that comes from a struct's unsized tail.
2022-06-29Rollup merge of #97542 - compiler-errors:arg-mismatch, r=jackh726Dylan DPC-48/+47
Use typed indices in argument mismatch algorithm I kinda went overboard with the renames, but in general, "arg" is renamed to "expected", and "input" is renamed to "provided", and we use new typed indices to make sure we're indexing into the right sized array. Other drive-by changes: 1. Factor this logic into a new function, so we don't need to `break 'label` to escape it. 1. Factored out dependence on `final_arg_types`, which is never populated for arguments greater than the number of expected args. Instead, we just grab the final coerced expression type from `in_progress_typeck_results`. 1. Adjust the criteria we use to print (provided) type names, before we didn't suggest anything that had infer vars, but now we suggest thing that have infer vars but aren't `_`. ~Also, sorry in advance, I kinda want to backport this but I know I have folded in a lot of unnecessary drive-by changes that might discourage that. I would be open to brainstorming how to get some of these changes on beta at least.~ edit: Minimized the ICE-fixing changes to #97557 cc `@jackh726` as author of #92364, and `@estebank` as reviewer of the PR. fixes #97484