- 25 1月, 2022 10 次提交
-
-
由 Matthias Krüger 提交于
Use error-on-mismatch policy for PAuth module flags. This agrees with Clang, and avoids an error when using LTO with mixed C/Rust. LLVM considers different behaviour flags to be a mismatch, even when the flag value itself is the same. This also makes the flag setting explicit for all uses of LLVMRustAddModuleFlag. ---- I believe that this fixes #92885, but have only reproduced it locally on Linux hosts so cannot confirm that it fixes the issue as reported. I have not included a test for this because it is covered by an existing test (`src/test/run-make-fulldeps/cross-lang-lto-clang`). It is not without its problems, though: * The test requires Clang and `--run-clang-based-tests-with=...` to run, and this is not the case on the CI. * Any test I add would have a similar requirement. * With this patch applied, the test gets further, but it still fails (for other reasons). I don't think that affects #92885.
-
由 Matthias Krüger 提交于
rustdoc settings: use radio buttons for theme This reduces the number of clicks required to change theme. Also, simplify the UI a bit (remove setting grouping), and add a "Back" link close to the settings icon. Demo: https://rustdoc.crud.net/jsha/theme-radio/settings.html r? ``@GuillaumeGomez`` New: ![image](https://user-images.githubusercontent.com/220205/150702647-4826d525-54fa-439a-b24c-6d5bca6f95bf.png) Old: ![image](https://user-images.githubusercontent.com/220205/150702669-6a4214ed-1dab-4fee-b1aa-59acfce3dbca.png)
-
由 Matthias Krüger 提交于
Implement stable overlap check considering negative traits This PR implement the new disjointness rules for overlap check described in https://rust-lang.github.io/negative-impls-initiative/explainer/coherence-check.html#new-disjointness-rules r? ``@nikomatsakis``
-
由 Matthias Krüger 提交于
Fix inconsistency of local blanket impls When a blanket impl is local, go through HIR instead of middle. This fixes inconsistencies with data detected during JSON generation. Expected this change to take longer. I also tried doing the whole item through existing clean architecture, but it didn't work out trivially, and felt like it would have added more complexity than it removed. Properly fixes #83718
-
由 Matthias Krüger 提交于
Work around missing code coverage data causing llvm-cov failures If we do not add code coverage instrumentation to the `Body` of a function, then when we go to generate the function record for it, we won't write any data and this later causes llvm-cov to fail when processing data for the entire coverage report. I've identified two main cases where we do not currently add code coverage instrumentation to the `Body` of a function: 1. If the function has a single `BasicBlock` and it ends with a `TerminatorKind::Unreachable`. 2. If the function is created using a proc macro of some kind. For case 1, this is typically not important as this most often occurs as a result of function definitions that take or return uninhabited types. These kinds of functions, by definition, cannot even be called so they logically should not be counted in code coverage statistics. For case 2, I haven't looked into this very much but I've noticed while testing this patch that (other than functions which are covered by case 1) the skipped function coverage debug message is occasionally triggered in large crate graphs by functions generated from a proc macro. This may have something to do with weird spans being generated by the proc macro but this is just a guess. I think it's reasonable to land this change since currently, we fail to generate *any* results from llvm-cov when a function has no coverage instrumentation applied to it. With this change, we get coverage data for all functions other than the two cases discussed above. Fixes #93054 which occurs because of uncallable functions which shouldn't have code coverage anyway. I will open an issue for missing code coverage of proc macro generated functions and leave a link here once I have a more minimal repro. r? ``@tmandry`` cc ``@richkadel``
-
由 Matthias Krüger 提交于
Move param count error emission to end of `check_argument_types` The error emission here isn't exactly what is done in #92364, but replicating that is hard . The general move should make for a smaller diff. Also included the `(usize, Ty, Ty)` to -> `Option<(Ty, Ty)>` commit. r? ``@estebank``
-
由 Matthias Krüger 提交于
Properly track `DepNode`s in trait evaluation provisional cache Fixes #92987 During evaluation of an auto trait predicate, we may encounter a cycle. This causes us to store the evaluation result in a special 'provisional cache;. If we later end up determining that the type can legitimately implement the auto trait despite the cycle, we remove the entry from the provisional cache, and insert it into the evaluation cache. Additionally, trait evaluation creates a special anonymous `DepNode`. All queries invoked during the predicate evaluation are added as outoging dependency edges from the `DepNode`. This `DepNode` is then store in the evaluation cache - if a different query ends up reading from the cache entry, it will also perform a read of the stored `DepNode`. As a result, the cached evaluation will still end up (transitively) incurring all of the same dependencies that it would if it actually performed the uncached evaluation (e.g. a call to `type_of` to determine constituent types). Previously, we did not correctly handle the interaction between the provisional cache and the created `DepNode`. Storing an evaluation result in the provisional cache would cause us to lose the `DepNode` created during the evaluation. If we later moved the entry from the provisional cache to the evaluation cache, we would use the `DepNode` associated with the evaluation that caused us to 'complete' the cycle, not the evaluatoon where we first discovered the cycle. As a result, future reads from the evaluation cache would miss some incremental compilation dependencies that would have otherwise been added if the evaluation was *not* cached. Under the right circumstances, this could lead to us trying to force a query with a no-longer-existing `DefPathHash`, since we were missing the (red) dependency edge that would have caused us to bail out before attempting forcing. This commit makes the provisional cache store the `DepNode` create during the provisional evaluation. When we move an entry from the provisional cache to the evaluation cache, we create a *new* `DepNode` that has dependencies going to *both* of the evaluation `DepNodes` we have available. This ensures that cached reads will incur all of the necessary dependency edges.
-
由 Matthias Krüger 提交于
Add a `try_clone()` function to `OwnedFd`. As suggested in #88564. This adds a `try_clone()` to `OwnedFd` by refactoring the code out of the existing `File`/`Socket` code. r? ``@joshtriplett``
-
由 bors 提交于
Use `indexmap` to avoid sorting `LocalDefId`s See discussion in https://github.com/rust-lang/rust/pull/90408#discussion_r745935459. Related to work on https://github.com/rust-lang/rust/issues/90317.
-
由 Jacob Bramley 提交于
This agrees with Clang, and avoids an error when using LTO with mixed C/Rust. LLVM considers different behaviour flags to be a mismatch, even when the flag value itself is the same. This also makes the flag setting explicit for all uses of LLVMRustAddModuleFlag.
-
- 24 1月, 2022 30 次提交
-
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #92513 (std: Implement try_reserve and try_reserve_exact on PathBuf) - #93152 (Fix STD compilation for the ESP-IDF target (regression from CVE-2022-21658)) - #93186 (Fix link to CVE-2022-21658) - #93188 (rustdoc: fix bump down typing search on Safari) - #93212 (Remove unneeded cursor pointer rule on mobile sidebar) - #93231 (adjust sidebar link brightness) - #93241 (Fix brief appearance of rust logo in the sidebar) - #93253 (Update theme on pageshow event) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Matthias Krüger 提交于
Update theme on pageshow event When a user goes forward or back, the page may be rendered from the back/forward cache (https://web.dev/bfcache/) rather than from scratch. If they have changed theme in the meantime, that means seeing an incorrect theme on the page they went forward or back to. The `pageshow` event fires on such navigations, so we can update the theme based on that event. Demo: https://rustdoc.crud.net/jsha/theme-on-show/std/string/trait.ToString.html r? `@GuillaumeGomez`
-
由 Matthias Krüger 提交于
Fix brief appearance of rust logo in the sidebar Part of #91374. I simply removed the CSS animation on the visibility, which now makes it all appear at once. I didn't change the CSS animation on the width though, which gives: https://user-images.githubusercontent.com/3050060/150689595-067a6e00-9875-40c8-9d8a-1e3031dbcaba.mp4 cc `@camelid` r? `@jsha`
-
由 Matthias Krüger 提交于
adjust sidebar link brightness Fairly simple change. I've taken the existing link colour and main body background colours, and made sure that the sidebar+link contrast is the same. ayu: - [main content contrast](https://colourcontrast.cc/0f1419/39afd7) - 7.31 - [current sidebar contrast](https://colourcontrast.cc/14191f/39afd7) - 6.97 - [new sidebar contrast](https://colourcontrast.cc/14191f/56b1d9) - 7.30 dark: - [main content contrast](https://colourcontrast.cc/353535/d2991d) - 4.86 - [current sidebar contrast](https://colourcontrast.cc/14191f/d2991d) - 3.19 - [new sidebar contrast](https://colourcontrast.cc/14191f/fdbf35) - 4.87 light: - [main content contrast](https://colourcontrast.cc/ffffff/3873ad) - 4.97 - [current sidebar contrast](https://colourcontrast.cc/f5f5f5/3873ad) - 4.56 - [new sidebar contrast](https://colourcontrast.cc/f5f5f5/356da4) - 4.97
-
由 Matthias Krüger 提交于
Remove unneeded cursor pointer rule on mobile sidebar Since it's on mobile, there isn't much point in this rule... r? `@jsha`
-
由 Matthias Krüger 提交于
rustdoc: fix bump down typing search on Safari Fixes #93184. For some reason, if the search input doesn't have a previous sibling, typing in the search box increases the search-container's size by about 5px on the bottom. Putting in a dummy sibling fixes it. https://rustdoc.crud.net/jsha/fix-safari-bumpy-search/std/string/struct.String.html r? `@camelid`
-
由 Matthias Krüger 提交于
Fix link to CVE-2022-21658 The link to CVE-2022-21658 contains a trailing bracket, which causes it to link to <https://www.cve.org/CVERecord?id=CVE-2022-21658%5D>.
-
由 Matthias Krüger 提交于
Fix STD compilation for the ESP-IDF target (regression from CVE-2022-21658) Commit https://github.com/rust-lang/rust/commit/54e22eb7dbb615bd44355028d3fd867aa93c0972 broke the compilation of STD for the ESP-IDF embedded "unix-like" Tier 3 target, because the fix for [CVE-2022-21658](https://blog.rust-lang.org/2022/01/20/Rust-1.58.1.html) uses [libc flags](https://github.com/esp-rs/esp-idf-svc/runs/4892221554?check_suite_focus=true) which are not supported on the ESP-IDF platform. This PR simply redirects the ESP-IDF compilation to the "classic" implementation, similar to REDOX. This should be safe because: * Neither of the two filesystems supported by ESP-IDF (spiffs and fatfs) support [symlinks](https://github.com/natevw/fatfs/blob/master/README.md) in the first place * There is no notion of fs permissions at all, as the ESP-IDF is an embedded platform that does not have the notion of users, groups, etc. * Similarly, ESP-IDF has just one "process" - the firmware itself - which contains the user code and the "OS" fused together and running with all permissions
-
由 Matthias Krüger 提交于
std: Implement try_reserve and try_reserve_exact on PathBuf Part of https://github.com/rust-lang/rust/issues/91789Signed-off-by: NXuanwo <github@xuanwo.io>
-
由 bors 提交于
Revert "Do not hash leading zero bytes of i64 numbers in Sip128 hasher" Reverts rust-lang/rust#92103. It had a (in retrospect, obvious) correctness problem where changing the order of two adjacent values would produce identical hashes, which is problematic in stable hashing (see [this comment](https://github.com/rust-lang/rust/pull/92103#issuecomment-1014625442)). I'll try to send the PR again with a fix for this issue. r? `@the8472`
-
由 Jakub Beránek 提交于
-
由 bors 提交于
Check `const Drop` impls considering `~const` Bounds This PR adds logic to trait selection to account for `~const` bounds in custom `impl const Drop` for types, elaborates the `const Drop` check in `rustc_const_eval` to check those bounds, and steals some drop linting fixes from #92922, thanks `@DrMeepster.` r? `@fee1-dead` `@oli-obk` <sup>(edit: guess I can't request review from two people, lol)</sup> since each of you wrote and reviewed #88558, respectively. Since the logic here is more complicated than what existed, it's possible that this is a perf regression. But it works correctly with tests, and that makes me happy. Fixes #92881
-
由 Jacob Hoffman-Andrews 提交于
When a user goes forward or back, the page may be rendered from the back/forward cache (https://web.dev/bfcache/) rather than from scratch. If they have changed theme in the meantime, that means seeing an incorrect theme on the page they went forward or back to. The `pageshow` event fires on such navigations, so we can update the theme based on that event.
-
由 Jacob Hoffman-Andrews 提交于
This reduces the number of clicks required to change theme. Also, simplify the UI a bit (remove setting grouping), and add a "Back" link close to the settings icon.
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #91526 (rustc_lint: Some early linting refactorings) - #92555 (Implement RFC 3151: Scoped threads.) - #93213 (Fix `let_chains` and `if_let_guard` feature flags) - #93219 (Add preliminary support for inline assembly for msp430.) - #93226 (Normalize field access types during borrowck) - #93227 (Liberate late bound regions when collecting GAT substs in wfcheck) - #93229 (Remove DiagnosticBuilder.quiet) - #93234 (rustc_mir_itertools: Avoid needless `collect` with itertools) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Jacob Hoffman-Andrews 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Conrad Ludgate 提交于
-
由 Matthias Krüger 提交于
rustc_mir_itertools: Avoid needless `collect` with itertools I don't think this should have measurable perf impact (at least not on perf.rlo benchmarks), it's mostly for readability.
-
由 Matthias Krüger 提交于
Remove DiagnosticBuilder.quiet r? `@EddyB` cc https://github.com/rust-lang/rust/issues/69426 `@GuillaumeGomez` `@Manishearth`
-
由 Matthias Krüger 提交于
Liberate late bound regions when collecting GAT substs in wfcheck The issue here is that the [`GATSubstCollector`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_typeck/src/check/wfcheck.rs#L604) does not currently do anything wrt `Binder`s, so the GAT substs it copies out have escaping late bound regions when it walks through types like `for<'x> fn() -> Self::Gat<'x>`. I made that visitor call `liberate_late_bound_regions`, not sure if that's the right thing here or we need to do something else to replace these bound vars with placeholders. I'm not familiar with other code doing anything similar.. But the issue is indeed no longer ICEing. Fixes #92954 r? `@jackh726` since you last touched this code, feel free to reassign
-
由 Matthias Krüger 提交于
Normalize field access types during borrowck I think a normalize was just left out here, since we normalize analogously throughout this file. Fixes #93141
-
由 Matthias Krüger 提交于
Add preliminary support for inline assembly for msp430. The `llvm_asm` macro was removed recently, and the MSP430 backend relies on inline assembly to build useful embedded apps. I conveniently "found" time to implement basic support for the new inline `asm` macro syntax with the help of `@Amanieu` :D. In addition to tests in the compiler, I have tested this locally against deployed MSP430 code and have not found any noticeable differences in firmware operation or `objdump` disassemblies between the old `llvm_asm` and the new `asm` syntax.
-
由 Matthias Krüger 提交于
Fix `let_chains` and `if_let_guard` feature flags Fixes https://github.com/rust-lang/rust/issues/93150 cc #53667
-
由 Matthias Krüger 提交于
Implement RFC 3151: Scoped threads. This implements https://github.com/rust-lang/rfcs/pull/3151 r? `@Amanieu`
-
由 Matthias Krüger 提交于
rustc_lint: Some early linting refactorings The first one removes and renames some fields and methods from `EarlyContext`. The second one uses the set of registered tools (for tool attributes and tool lints) in a more centralized way. The third one removes creation of a fake `ast::Crate` from `fn pre_expansion_lint`. Pre-expansion linting is done with per-module granularity on freshly loaded modules, and it previously synthesized an `ast::Crate` to visit non-root modules, now they are visited as modules. The node ID used for pre-expansion linting is also made more precise (the loaded module ID is used).
-
由 Michael Goulet 提交于
-
由 Guillaume Gomez 提交于
-