about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-05-13Add bound_impl_trait_refJack Huey-25/+28
2022-05-13Add bound_fn_sigJack Huey-36/+59
2022-05-13Add bound_type_ofJack Huey-83/+90
2022-05-10Introduce EarlyBinderJack Huey-235/+340
2022-05-10Auto merge of #96232 - sunfishcode:sunfishcode/io-safety-const-fns, ↵bors-5/+5
r=joshtriplett Make `BorrowedFd::borrow_raw` a const fn. Making `BorrowedFd::borrow_raw` a const fn allows it to be used to create a constant `BorrowedFd<'static>` holding constants such as `AT_FDCWD`. This will allow [`rustix::fs::cwd`] to become a const fn. For consistency, make similar changes to `BorrowedHandle::borrow_raw` and `BorrowedSocket::borrow_raw`. [`rustix::fs::cwd`]: https://docs.rs/rustix/latest/rustix/fs/fn.cwd.html r? `@joshtriplett`
2022-05-10Auto merge of #96905 - jyn514:revert-96803-faster-assemble, r=Mark-Simulacrumbors-3/+9
Revert "Make "Assemble stage1 compiler" orders of magnitude faster" Reverts rust-lang/rust#96803. This caused `llvm-tools-nightly` to fail when installing with `rustup-toolchain-install-master` because of the presence of symlinks. I'm not sure how the symlinks got in there, but revert the PR for now while I figure it out. r? `@Mark-Simulacrum` cc `@RalfJung`
2022-05-10Revert "Make "Assemble stage1 compiler" orders of magnitude faster"Joshua Nelson-3/+9
2022-05-10Auto merge of #96904 - JohnTitor:rollup-f1sz5x0, r=JohnTitorbors-126/+368
Rollup of 6 pull requests Successful merges: - #96717 (Handle mismatched generic param kinds in trait impls betterly) - #96725 (Expose process windows_process_extensions_main_thread_handle on Windows) - #96849 (Move some tests to more reasonable places) - #96861 (Use Rust 2021 prelude in std itself.) - #96879 (rustdoc: search result ranking fix) - #96882 (Don't subst an AdtDef with its own substs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-11Rollup merge of #96882 - jackh726:no-subst, r=oli-obkYuki Okushi-7/+3
Don't subst an AdtDef with its own substs
2022-05-11Rollup merge of #96879 - notriddle:notriddle/search-ranking, r=GuillaumeGomezYuki Okushi-1/+36
rustdoc: search result ranking fix # Before ![image](https://user-images.githubusercontent.com/1593513/167477286-91049761-67f9-4a73-8fb7-09dbb19ca76c.png) # After ![image](https://user-images.githubusercontent.com/1593513/167477345-6733bc0f-4bb2-4625-9f7f-094031e36414.png)
2022-05-11Rollup merge of #96861 - m-ou-se:std-use-prelude-2021, r=joshtriplettYuki Okushi-43/+7
Use Rust 2021 prelude in std itself.
2022-05-11Rollup merge of #96849 - c410-f3r:z-errors, r=petrochenkovYuki Okushi-2/+2
Move some tests to more reasonable places cc https://github.com/rust-lang/rust/issues/73494 r? `@petrochenkov`
2022-05-11Rollup merge of #96725 - nico-abram:win_tid, r=ChrisDentonYuki Okushi-7/+52
Expose process windows_process_extensions_main_thread_handle on Windows ~~I did not find any tests in https://github.com/rust-lang/rust/blob/7d3e03666a93bd2b0f78b3933f9305832af771a5/library/std/src/sys/windows/process/tests.rs that actually launch processes, so I haven't added tests for this.~~ I ran the following locally, to check that it works as expected: ```rs #![feature(windows_process_extensions_main_thread_handle)] fn main() { use std::os::windows::process::{ChildExt, CommandExt}; const CREATE_SUSPENDED: u32 = 0x00000004; let proc = std::process::Command::new("cmd") .args(["/C", "echo hello"]) .creation_flags(CREATE_SUSPENDED) .spawn() .unwrap(); extern "system" { fn ResumeThread(_: *mut std::ffi::c_void) -> u32; } unsafe { ResumeThread(proc.main_thread_handle()); } let output = proc.wait_with_output().unwrap(); let str_output = std::str::from_utf8(&output.stdout[..]).unwrap(); println!("{}", str_output); } ``` Without the feature attribute it wouldn't compile, and commenting the `ResumeThread` line makes it hang forever, showing that it works. Trakcing issue https://github.com/rust-lang/rust/issues/96723
2022-05-11Rollup merge of #96717 - BoxyUwU:gats_const_param_types_mismatch_err, r=lcnrYuki Okushi-66/+268
Handle mismatched generic param kinds in trait impls betterly - Check that generic params on a generic associated type are the same as in the trait definition - Check that const generics are not used in place of type generics (and the other way round too) r? `@lcnr`
2022-05-10Auto merge of #96736 - oli-obk:tait_missing_wf_check, r=davidtwcobors-140/+301
Check hidden types for well formedness at the definition site instead of only at the opaque type itself work towards #90409 . We'll need to look into closure and generator bodies of closures and generators nested inside the hidden type in order to fix that. In hindsight this PR is not necessary for that, but it may be a bit easier with it and we'll get better diagnostics from it on its own.
2022-05-10Auto merge of #94799 - lcnr:list-ty-perf, r=petrochenkovbors-7/+5
update `hash_stable` for `List<Ty<'tcx>>` cc https://github.com/rust-lang/rust/pull/93505#issuecomment-1047538798 this is the hottest part changed since the pre-merge perf run
2022-05-10Auto merge of #96891 - Dylan-DPC:rollup-echa4wg, r=Dylan-DPCbors-119/+422
Rollup of 5 pull requests Successful merges: - #93661 (Add missing rustc arg docs) - #96674 (docs: add link explaining variance to NonNull docs) - #96812 (Do not lint on explicit outlives requirements from external macros.) - #96823 (Properly fix #96638) - #96872 (make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-10Check hidden types for well formedness at the definition site instead of ↵Oli Scherer-140/+301
only at the opaque type itself
2022-05-10Rollup merge of #96872 - RalfJung:layout-sanity, r=eddybDylan DPC-31/+237
make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks `@eddyb` suggested that it might be reasonable for `ScalarPair` enums to simply adjust the ABI of their variants accordingly, such that the layout invariant Miri expects actually holds. This PR implements that. I should note though that I don't know much about this layout computation code and what non-Miri consumers expect from it, so tread with caution! I also added a function to sanity-check that computed layouts are internally consistent. This helped a lot in figuring out the final shape of this PR, though I am also not 100% sure that these sanity checks are the right ones. Cc `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/96221
2022-05-10Rollup merge of #96823 - jackh726:params-heuristics-fix, r=estebankDylan DPC-86/+89
Properly fix #96638 Closes #96638 The main part of this change is `Error::Invalid` now returns both the input and arg indices. However, I realized the code here was kind of confusing and not internally consistent (and thus I was having trouble getting the right behavior). So I've also switched `input_indices` and `arg_indices` to more closely match some naming in `checks` (although I think a more thorough cleanup there could be beneficial). I've added comments, but essentially `input_indices` refers to *user provided* inputs and `arg_indices` refers to *expected* args.
2022-05-10Rollup merge of #96812 - cjgillot:no-lint-outllives-macro, r=petrochenkovDylan DPC-1/+50
Do not lint on explicit outlives requirements from external macros. The current implementation of the list rightfully skipped where predicates from external macros. However, if the where predicate came from the current macro but the bounds were from an external macro, the lint still fired. Closes https://github.com/rust-lang/rust/issues/96640
2022-05-10Rollup merge of #96674 - bstrie:vardoc, r=thomccDylan DPC-1/+2
docs: add link explaining variance to NonNull docs
2022-05-10Rollup merge of #93661 - ehuss:add-missing-rustc-arg-docs, ↵Dylan DPC-0/+44
r=estebank,Mark-Simulacrum Add missing rustc arg docs Add documentation for recently added rustc args `-C symbol-mangling-version` was stabilized in #90128. `--json=future-incompat` was stabilized in #91535.
2022-05-10Expose process main_thread_handle on Windowsunknown-7/+52
2022-05-10Auto merge of #96808 - cjgillot:impossible-trait, r=compiler-errorsbors-0/+14
Detect trait fulfillment in `subst_and_check_impossible_predicates` Split from https://github.com/rust-lang/rust/pull/91743 r? `@compiler-errors`
2022-05-10Auto merge of #96803 - jyn514:faster-assemble, r=Mark-Simulacrumbors-9/+3
Make "Assemble stage1 compiler" orders of magnitude faster This used to take upwards of 5 seconds for me locally. I found that the culprit was copying the downloaded LLVM shared object: ``` [22:28:03] Install "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so" to "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-14-rust-1.62.0-nightly.so" [22:28:09] c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) } } ``` It turned out that `install()` used full copies unconditionally. Change it to try using a hard-link before falling back to copying.
2022-05-10Auto merge of #96715 - cjgillot:trait-alias-loop, r=compiler-errorsbors-20/+69
Fortify handing of where bounds on trait & trait alias definitions Closes https://github.com/rust-lang/rust/issues/96664 Closes https://github.com/rust-lang/rust/issues/96665 Since https://github.com/rust-lang/rust/pull/93803, when listing all bounds and predicates we now need to account for the possible presence of predicates on any of the generic parameters. Both bugs were hidden by the special handling of bounds at the generic parameter declaration position. Trait alias expansion used to confuse predicates on `Self` and where predicates. Exiting too late when listing all the bounds caused a cycle error.
2022-05-09Auto merge of #96838 - tmiasko:lazy-switch-sources, r=oli-obkbors-10/+11
Optimize switch sources representation and usage * Avoid constructing switch sources unless necessary - switch sources are used by backward analysis with a custom switch int edge effects, but are otherwise unnecessarily computed. * Use sparse representation of switch sources to avoid quadratic space overhead.
2022-05-09Don't subst an adt defJack Huey-7/+3
2022-05-09Auto merge of #96473 - lcnr:querify-codegen-fn-attrs, r=cjgillotbors-122/+229
store `codegen_fn_attrs` in crate metadata extracted from #95562 because the change isn't trivial.
2022-05-09also sanity-check Abi::Vector, and slight refactoringRalf Jung-26/+43
2022-05-09Add test case for `hashset::insert` rankingMichael Howell-0/+12
2022-05-09rustdoc: search result ranking fixMichael Howell-1/+24
2022-05-09Properly fix issue 96638Jack Huey-86/+89
2022-05-09Auto merge of #96877 - matthiaskrgr:rollup-evlh6ot, r=matthiaskrgrbors-215/+472
Rollup of 6 pull requests Successful merges: - #95483 (Improve floating point documentation) - #96008 (Warn on unused `#[doc(hidden)]` attributes on trait impl items) - #96841 (Revert "Implement [OsStr]::join", which was merged without FCP.) - #96844 (Actually fix ICE from #96583) - #96854 (Some subst cleanup) - #96858 (Remove unused param from search.js::checkPath) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-09Point to the empty trait alias.Camille GILLOT-1/+19
2022-05-09Rollup merge of #96858 - notriddle:notriddle/cleanup-search-js, r=GuillaumeGomezMatthias Krüger-2/+2
Remove unused param from search.js::checkPath
2022-05-09Rollup merge of #96854 - jackh726:subst-cleanup, r=compiler-errorsMatthias Krüger-73/+26
Some subst cleanup Two separate things here. Both changes are useful for some refactoring I'm doing to add an "EarlyBinder" newtype. (Part of chalkification). 1) Remove `subst_spanned` and just use `subst`. It wasn't used much anyways. In practice, I think we can probably get most of the info just from the actual error message. If not, outputting logs should do the trick. (The specific line probably wouldn't help much anyways). 2) Call `.subst()` before `replace_bound_vars_with_fresh_vars` and `erase_late_bound_regions` in three places that do the opposite. I think there might have been some time in the past that the order here matter for something, but this shouldn't be the case anymore. Conceptually, it makes more sense to the of the *early bound* vars on `fn`s as "outside" the late bound vars.
2022-05-09Rollup merge of #96844 - Badel2:actually-fix-96583, r=compiler-errorsMatthias Krüger-13/+37
Actually fix ICE from #96583 PR #96746 fixed a very similar bug, so the same logic is used in a different place. I originally concluded that the two issues (#96583 and #96738) were identical by comparing the backtrace, but I didn't look close enough.
2022-05-09Rollup merge of #96841 - thomcc:revert-osstr-join, r=m-ou-seMatthias Krüger-33/+0
Revert "Implement [OsStr]::join", which was merged without FCP. This reverts commit 4fcbc53820ab423bbeb41f07822369aa05da1d68, see https://github.com/rust-lang/rust/pull/96744. (I'm terribly sorry, and truly don't remember r+ing it, or even having seen it before yesterday, which is... genuinely very worrisome for me). r? `@m-ou-se`
2022-05-09Rollup merge of #96008 - ↵Matthias Krüger-26/+225
fmease:warn-on-useless-doc-hidden-on-assoc-impl-items, r=lcnr Warn on unused `#[doc(hidden)]` attributes on trait impl items [Zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Validy.20checks.20for.20.60.23.5Bdoc.28hidden.29.5D.60). Whether an associated item in a trait impl is shown or hidden in the documentation entirely depends on the corresponding item in the trait declaration. Rustdoc completely ignores `#[doc(hidden)]` attributes on impl items. No error or warning is emitted: ```rust pub trait Tr { fn f(); } pub struct Ty; impl Tr for Ty { #[doc(hidden)] fn f() {} } // ^^^^^^^^^^^^^^ ignored by rustdoc and currently // no error or warning issued ``` This may lead users to the wrong belief that the attribute has an effect. In fact, several such cases are found in the standard library (I've removed all of them in this PR). There does not seem to exist any incentive to allow this in the future either: Impl'ing a trait for a type means the type *fully* conforms to its API. Users can add `#[doc(hidden)]` to the whole impl if they want to hide the implementation or add the attribute to the corresponding associated item in the trait declaration to hide the specific item. Hiding an implementation of an associated item does not make much sense: The associated item can still be found on the trait page. This PR emits the warn-by-default lint `unused_attribute` for this case with a future-incompat warning. `@rustbot` label T-compiler T-rustdoc A-lint
2022-05-09Rollup merge of #95483 - golddranks:improve_float_docs, r=joshtriplettMatthias Krüger-68/+182
Improve floating point documentation This is my attempt to improve/solve https://github.com/rust-lang/rust/issues/95468 and https://github.com/rust-lang/rust/issues/73328 . Added/refined explanations: - Refine the "NaN as a special value" top level explanation of f32 - Refine `const NAN` docstring: add an explanation about there being multitude of NaN bitpatterns and disclaimer about the portability/stability guarantees. - Refine `fn is_sign_positive` and `fn is_sign_negative` docstrings: add disclaimer about the sign bit of NaNs. - Refine `fn min` and `fn max` docstrings: explain the semantics and their relationship to the standard and libm better. - Refine `fn trunc` docstrings: explain the semantics slightly more. - Refine `fn powi` docstrings: add disclaimer that the rounding behaviour might be different from `powf`. - Refine `fn copysign` docstrings: add disclaimer about payloads of NaNs. - Refine `minimum` and `maximum`: add disclaimer that "propagating NaN" doesn't mean that propagating the NaN bit patterns is guaranteed. - Refine `max` and `min` docstrings: add "ignoring NaN" to bring the one-row explanation to parity with `minimum` and `maximum`. Cosmetic changes: - Reword `NaN` and `NAN` as plain "NaN", unless they refer to the specific `const NAN`. - Reword "a number" to `self` in function docstrings to clarify. - Remove "Returns NAN if the number is NAN" from `abs`, as this is told to be the default behavior in the top explanation.
2022-05-09reviewlcnr-59/+73
2022-05-09only compute `codegen_fn_attrs` where neededlcnr-51/+154
2022-05-09fix codegen test failureRalf Jung-1/+1
2022-05-09make sure ScalarPair enums have ScalarPair variants; add some layout sanity ↵Ralf Jung-32/+221
checks
2022-05-09Auto merge of #96845 - Patryk27:upgrade-llvm, r=nikicbors-0/+0
Upgrade llvm-project (rustc + avr = lovelove back again!) See: https://github.com/rust-lang/llvm-project/pull/139 tl;dr: - closes https://github.com/rust-lang/rust/issues/83633, - closes https://github.com/rust-lang/rust/issues/82104, - closes https://github.com/rust-lang/rust/issues/79889, - closes https://github.com/rust-lang/compiler-builtins/issues/400. 🙂
2022-05-09only cache `codegen_fn_attrs` on disk if its locallcnr-1/+2
2022-05-09move `panic-in-drop=abort` check for `drop_in_place`lcnr-37/+29
Whether `drop_in_place` can abort does depend on the `panic-in-drop` option while compiling the current crate, not `core`
2022-05-09store `codegen_fn_attrs` in crate metadatalcnr-34/+31