about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-05-19Auto merge of #97114 - klensy:cursor-ref, r=petrochenkovbors-2/+2
use CursorRef more This allows skipping clone of `TreeAndSpacing` (and `TokenTree`).
2022-05-19Auto merge of #97103 - luqmana:asm-unwind-cleanup, r=Amanieu,tmiaskobors-0/+40
Update MIR passes to handle unwinding Inline Asm Some more follow up fixes from https://github.com/rust-lang/rust/pull/95864#issuecomment-1094165398 r? `@Amanieu`
2022-05-18Add mir-opt test for asm_unwind + panic=abortLuqman Aden-0/+40
2022-05-19Rollup merge of #97152 - ehuss:update-cargo, r=ehussYuki Okushi-0/+0
Update cargo 3 commits in 3f052d8eed98c6a24f8b332fb2e6e6249d12d8c1..a4c1cd0eb6b18082a7e693f5a665548fe1534be4 2022-05-12 15:19:04 +0000 to 2022-05-18 01:52:07 +0000 - Add notes about pre-stabilization to contributor unstable docs (rust-lang/cargo#10675) - reference: Update syntax supported by `rustc-link-lib` (rust-lang/cargo#10674) - Correct the release dates for 1.61 and 1.62 (rust-lang/cargo#10665)
2022-05-19Rollup merge of #97139 - GuillaumeGomez:move-dom-settings-generation, ↵Yuki Okushi-20/+16
r=notriddle Move some settings DOM generation out of JS The first commit reduce the JS size a bit by moving some DOM content generation into the HTML file directly. The second commit is an update of the `browser-ui-test` version which improves `wait-for-*` command (if the element doesn't exist, it'll wait for it instead of failing). r? ``@notriddle``
2022-05-19Rollup merge of #96866 - Mark-Simulacrum:intelligent-tiering-ci, r=pietroalbiniYuki Okushi-1/+2
Switch CI bucket uploads to intelligent tiering We currently upload approximately 166 GB/day into this bucket (estimate based on duration of storage and total current size). My estimate is that this change should decrease our costs (which are currently in credits) and is in the worst case (if all objects are brought into hot storage due to unanticipated frequent access) only going to add an additional ~$4 to the monthly bill. If access is rare (as expected) to most objects then we expect to save approximately ~$350/month (after this change takes full effect in ~168 days). r? ``@pietroalbini``
2022-05-18Update cargoEric Huss-0/+0
2022-05-18Auto merge of #97019 - b-naber:transition-to-valtrees-pt1, r=oli-obkbors-6/+12
Transition to valtrees pt1 Compartmentalising https://github.com/rust-lang/rust/pull/96591 as much as possible. r? `@oli-obk`
2022-05-18Auto merge of #96863 - SparrowLii:let, r=michaelwoeristerbors-14/+20
use `hir::Let` in `hir::Guard::IfLet` This PR fixes the FIXME about using `hir::Let` in `hir::Guard::IfLet`
2022-05-18fix rustfmtklensy-2/+2
2022-05-18Auto merge of #96800 - nbdd0121:const, r=nagisabors-20/+73
Permit `asm_const` and `asm_sym` to reference generic params Related #96557 These constructs will be allowed: ```rust fn foofoo<const N: usize>() {} unsafe fn foo<const N: usize>() { asm!("/* {0} */", const N); asm!("/* {0} */", const N + 1); asm!("/* {0} */", sym foofoo::<N>); } fn barbar<T>() {} unsafe fn bar<T>() { asm!("/* {0} */", const std::mem::size_of::<T>()); asm!("/* {0} */", const std::mem::size_of::<(T, T)>()); asm!("/* {0} */", sym barbar::<T>); asm!("/* {0} */", sym barbar::<(T, T)>); } ``` `@Amanieu,` I didn't switch inline asms to use `DefKind::InlineAsm`, as I see little value doing that; given that no type inference is needed, it will only make typecking slower and more complex but will have no real gains. I did switch them to follow the same code path as inline asm during symbol resolution, though. The `error: unconstrained generic constant` you mentioned in #76001 is due to the fact that `to_const` will actually add a wfness obligation to the constant, which we don't need for `asm_const`, so I have that removed. `@rustbot` label: +A-inline-assembly +F-asm
2022-05-18Auto merge of #96867 - michaelwoerister:path-prefix-fixes-2, r=davidtwcobors-1/+84
--remap-path-prefix: Fix duplicated path components in debuginfo This PR fixes an issue with `--remap-path-prefix` where path components could appear twice in the remapped version of the path (e.g. https://github.com/rust-lang/rust/issues/78479). The underlying problem was that `--remap-path-prefix` is often used to map an absolute path to something that looks like a relative path, e.g.: ``` --remap-path-prefix=/home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823=crates.io", ``` and relative paths in debuginfo are interpreted as being relative to the compilation directory. So if Cargo invokes the compiler with `/home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823/some_crate-0.1.0/src/lib.rs` as input and `/home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823/some_crate-0.1.0` as the compiler's working directory, then debuginfo will state that the working directory was `crates.io/some_crate-0.1.0` and the file is question was `crates.io/some_crate-0.1.0/src/lib.rs`, which combined gives the path: ``` crates.io/some_crate-0.1.0/crates.io/some_crate-0.1.0/src/lib.rs ``` With this PR the compiler will detect this situation and set up debuginfo in LLVM in a way that makes it strip the duplicated path components when emitting DWARF. The PR also extracts the logic for making remapped paths absolute into a common helper function that is now used by debuginfo too (instead of just during crate metadata generation).
2022-05-18Properly apply path prefix remapping paths emitted into debuginfo.Michael Woerister-1/+84
2022-05-18Auto merge of #97110 - Kobzol:pgo-pid-in-profile, r=lqdbors-1/+5
Add PID to PGO profile data filename After experimenting with PGO, it looks like the generated profile data files can be sometimes overwritten if there is a race condition, because multiple `rustc` processes are usually invoked in parallel by `cargo`. Adding the PID to the resulting profile filename pattern makes sure that the profiles will be stored in separate files. This generates ~20 GiB more space on disk on the CI run, but that seems harmless (?). Merging the profiles is not a bottleneck, the perf. run took the same amount of time as usually (~1h 24m). r? `@lqd`
2022-05-18Update browser-ui-test versionGuillaume Gomez-1/+1
2022-05-18Move some DOM generation into the HTML settings file directlyGuillaume Gomez-19/+15
2022-05-18Rollup merge of #97123 - ricked-twice:issue-96223-clean-fix, r=jackh726Dylan DPC-10/+5
Clean fix for #96223 Okay, so here we are (hopefully) :+1: Closes #96223 Thanks a lot to `@jackh726` for your help and explanation :pray: - Modified `InferCtxt::mk_trait_obligation_with_new_self_ty` to take as argument a `Binder<(TraitPredicate, Ty)>` instead of a `Binder<TraitPredicate>` and a separate `Ty` with no bound vars. - Modified all call places to avoid calling `Binder::no_bounds_var` or `Binder::skip_binder` when it is not safe. r? `@jackh726`
2022-05-18Rollup merge of #96378 - compiler-errors:trait-upcast-error, r=nagisaDylan DPC-2/+4
Mention traits and types involved in unstable trait upcasting Fixes #95972 by printing the traits being upcasted and the types being coerced that cause that upcasting... --- the poor span mentioned in the original issue has nothing to do with trait upcasting diagnostic here... > The original example I had that made me run into this issue had an even longer expression there (multiple chained iterator methods) which just got all highlighted as one big block saying "somewhere here trait coercion is used and it's not allowed". I don't think I can solve that issue in general without fixing the ObligationCauseCode and span that gets passed into Coerce.
2022-05-18Rollup merge of #95979 - lcnr:coherence-docs, r=compiler-errorsDylan DPC-0/+82
update coherence docs, fix generator + opaque type ICE the world is confusing, this makes it slightly less so
2022-05-18Rollup merge of #94639 - compiler-errors:rval-mutref, r=wesleywiserDylan DPC-7/+181
Suggest dereferencing non-lval mutable reference on assignment 1. Adds deref suggestions for LHS of assignment (or assign-binop) when it implements `DerefMut` 2. Fixes missing deref suggestions for LHS when it isn't a place expr Fixes #46276 Fixes #93980
2022-05-17Mention traits being upcasted, types being coercedMichael Goulet-2/+4
2022-05-17better lvalue errors for things implementing DerefMutMichael Goulet-6/+132
2022-05-17better error for bad LHS in binop-assignMichael Goulet-11/+24
2022-05-17Suggest deref non-lvalue mutable referenceMichael Goulet-0/+35
2022-05-18Rollup merge of #97116 - RalfJung:ref-validity, r=oli-obkYuki Okushi-4/+4
interpret/validity: reject references to uninhabited types According to https://doc.rust-lang.org/reference/behavior-considered-undefined.html, this is definitely UB. And we can check this without actually looking up anything in memory, we just need the reference value and its type, making this a great candidate for a validity invariant IMO and my favorite resolution of https://github.com/rust-lang/unsafe-code-guidelines/issues/77. With this PR, Miri with `-Zmiri-check-number-validity` implements all my preferred options for what the validity invariants of our types could be. :) CTFE has been doing recursive checking anyway, so this is backwards compatible but might change the error output. I will submit a PR with the new Miri tests soon. r? `@oli-obk`
2022-05-18Rollup merge of #97113 - GuillaumeGomez:search-ui-fixes, r=notriddleYuki Okushi-9/+43
Search GUI fixes The first fix is about the duplicated "in": ![Screenshot from 2022-05-17 13-25-53](https://user-images.githubusercontent.com/3050060/168814186-a4e9064f-4325-469c-8bf6-46ea2737a24f.png) The second fix is about the `<select>` broken style: ![Screenshot from 2022-05-17 13-37-03](https://user-images.githubusercontent.com/3050060/168814182-b1c5ae66-d8cf-4fd5-a227-5aa8cd8453ab.png) ![Screenshot from 2022-05-17 13-36-55](https://user-images.githubusercontent.com/3050060/168814184-be9e56f8-fad4-477c-899e-9abff4d4910c.png) You can test it [here](https://rustdoc.crud.net/imperio/search-ui-fixes/doc/foo/index.html?search=test). r? `@notriddle`
2022-05-18Rollup merge of #97097 - chorman0773:add_tmm_clobers, r=joshtriplettYuki Okushi-4/+11
Add tmm_reg clobbers This adds support for naming the 8 tile registers from intel AMX as clobbers from `asm!` invocations on x86_64 (only). It does not add the registers as input or output operands.
2022-05-18Rollup merge of #97096 - tmiasko:reachable-constructor, r=petrochenkovYuki Okushi-0/+41
Types with reachable constructors are reachable Fixes #96934. r? `@petrochenkov`
2022-05-18Rollup merge of #96761 - klensy:no-rayon-here, r=CraftSpiderYuki Okushi-2/+9
rustdoc: don't build `rayon` for non-windows targets `rayon` used only on windows targets, so no need to build it otherwise.
2022-05-18Rollup merge of #96651 - ken-matsui:omit-unnecessary-help-to-add-cfg-test, ↵Yuki Okushi-0/+206
r=cjgillot Omit unnecessary help to add `#[cfg(test)]` when already annotated Closes: https://github.com/rust-lang/rust/issues/96611 The related PR is: https://github.com/rust-lang/rust/pull/91770
2022-05-18Rollup merge of #96647 - Enselic:fix-hrtb-for-wherepredicate, r=CraftSpiderYuki Okushi-8/+73
rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate Information about HRTBs are already present for `GenericBound:: TraitBound` and `FunctionPointer`. This PR adds HRTB info also to `WherePredicate::BoundPredicate`. Use the same field name and type as for the other ones (`generic_params: Vec<GenericParamDef>`). I have verified that this gives rustdoc JSON clients the data they need and in a format that is easy to work with (see https://github.com/Enselic/public-api/pull/92). I will be happy to add tests for this change (and bump `FORMAT_VERSION` which I just realized I forgot), but it is always nice to get one round of feedback first, so that I don't put a lot of effort into tests that then have to be discarded. `@rustbot` modify labels: +T-rustdoc +A-rustdoc-json
2022-05-17Taking review into accountricked-twice-10/+5
2022-05-17Auto merge of #92570 - jsha:rustdoc-search-refactor, r=GuillaumeGomezbors-313/+117
Simplify rustdoc search test Previously, rustdoc search attempted to parse search.js and extract out only certain methods and variables. This change makes search.js and search-index.js loadable as [CommonJS modules](https://nodejs.org/api/modules.html#modules-commonjs-modules), so they can be loaded directly. As part of that change, I had to separate execSearch from interacting with the DOM. This wound up being a nice cleanup that made more explicit what inputs it was taking. I removed search.js' dependency on storage.js by moving hasOwnPropertyRustdoc directly into search.js, and replacing onEach with forEach in a path that is called by the tester. r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/rustdoc-search-refactor/std/?search=foo
2022-05-17Add PID to rustc PGO profiles generated in CIJakub Beránek-1/+5
2022-05-17bless 32bitRalf Jung-2/+2
2022-05-17rustdoc: make search.js a moduleJacob Hoffman-Andrews-313/+117
Previously, search.js relied on the DOM and the `window` object. It can now be loaded in the absence of the DOM, for instance by Node. The same is true of search-index.js. This allows removing a lot of code from src/tools/rustdoc-js/tester.js that tried to parse search.js and extract specific functions that were needed for testing.
2022-05-17interpret/validity: reject references to uninhabited typesRalf Jung-2/+2
2022-05-17Auto merge of #96959 - nbdd0121:unwind, r=Amanieubors-8/+13
Prevent unwinding when `-C panic=abort` is used regardless declared ABI Ensures that Rust code will abort with `-C panic=abort` regardless ABI used. ```rust extern "C-unwind" { fn may_unwind(); } // Will be nounwind with `-C panic=abort`, despite `C-unwind` ABI. pub unsafe extern "C-unwind" fn rust_item_that_can_unwind() { may_unwind(); } ``` Current behaviour is that unwind will propagate through. While the current behaviour won't cause unsoundness it is inconsistent with the text reading of [RFC2945](https://rust-lang.github.io/rfcs/2945-c-unwind-abi.html). I tweaked `fn_can_unwind` instead of tweaking `AbortUnwindingCalls` because this approach would allow Rust (non-direct) callers to also see that this function is nounwind, so it can prevent excessive landing pads generation. For more discussions: https://rust-lang.zulipchat.com/#narrow/stream/210922-project-ffi-unwind/topic/soundness.20in.20mixed.20panic.20mode. cc `@alexcrichton,` `@BatmanAoD` r? `@Amanieu` `@rustbot` label: T-compiler T-lang F-c_unwind
2022-05-17Add GUI test for search crate filter select CSS propertiesGuillaume Gomez-0/+31
2022-05-17Fix display of search crate filter selectGuillaume Gomez-7/+7
2022-05-17Auto merge of #97111 - JohnTitor:rollup-x3vjf6u, r=JohnTitorbors-3/+137
Rollup of 7 pull requests Successful merges: - #96329 (Add a couple tests for #90887 fixes) - #97009 (Allow `unused_macro_rules` in path tests) - #97075 (Add regression test for #81804) - #97079 (Change `Successors` to `impl Iterator<Item = BasicBlock>`) - #97080 (remove the `RelateResultCompare` trait) - #97093 (Migrate `maybe_recover_from_bad_type_plus` diagnostic) - #97102 (Update function pointer call error message) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-17Add GUI test for search result "title"Guillaume Gomez-0/+3
2022-05-17Fix duplicated "in" in the search result textGuillaume Gomez-1/+1
2022-05-17Update browser-ui-test version to 0.9.2Guillaume Gomez-1/+1
2022-05-17fix clobber_abi testsConnor Horman-4/+4
2022-05-17Handle tmm_reg in rustc_codegen_gccConnor Horman-1/+1
2022-05-17Rollup merge of #97102 - mbartlett21:fn-pointer-error, r=lcnrYuki Okushi-1/+37
Update function pointer call error message It now uses the type of context. (fixes #97082)
2022-05-17Rollup merge of #97079 - SparrowLii:successors, r=lcnrYuki Okushi-2/+2
Change `Successors` to `impl Iterator<Item = BasicBlock>` This PR fixes the FIXME in `compiler\rustc_middle\src\mir\mod.rs`. This can omit several `&`, `*` or `cloned` operations on Successros' generated elements
2022-05-17Rollup merge of #97075 - JohnTitor:issue-81804, r=compiler-errorsYuki Okushi-0/+50
Add regression test for #81804 Closes #81804 r? ``@compiler-errors``
2022-05-17Rollup merge of #96329 - aliemjay:fixed-by-90887, r=jackh726Yuki Okushi-0/+48
Add a couple tests for #90887 fixes closes #56556 closes #90875 These are confirmed fixes by #90887, so r? ``@jackh726``