about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-10-24Migrate from highfive to triagebotEric Huss-2/+157
2022-10-23Auto merge of #103062 - cuviper:dist-mips, r=Mark-Simulacrumbors-88/+3345
Upgrade dist-mips*-linux to ubuntu:22.04 + crosstool-ng These have no change in compatibility, still Linux 4.4 and glibc 2.23. The main motivation for upgrading is that LLVM 16 will require at least GCC 7.1. Using crosstool-ng lets us choose our own toolchain versions, and then the Ubuntu version doesn't matter so much, just for the host compilation while we cross-compile.
2022-10-23Auto merge of #103137 - dtolnay:readdir, r=Mark-Simulacrumbors-20/+65
Eliminate 280-byte memset from ReadDir iterator This guy: https://github.com/rust-lang/rust/blob/1536ab1b383f21b38f8d49230a2aecc51daffa3d/library/std/src/sys/unix/fs.rs#L589 It turns out `libc::dirent64` is quite big&mdash;https://docs.rs/libc/0.2.135/libc/struct.dirent64.html. In #103135 this memset accounted for 0.9% of the runtime of iterating a big directory. Almost none of the big zeroed value is ever used. We memcpy a tiny prefix (19 bytes) into it, and then read just 9 bytes (`d_ino` and `d_type`) back out. We can read exactly those 9 bytes we need directly from the original entry_ptr instead. ## History This code got added in #93459 and tweaked in #94272 and #94750. Prior to #93459, there was no memset but a full 280 bytes were being copied from the entry_ptr. <table><tr><td>copy 280 bytes</td></tr></table> This was not legal because not all of those bytes might be initialized, or even allocated, depending on the length of the directory entry's name, leading to a segfault. That PR fixed the segfault by creating a new zeroed dirent64 and copying just the guaranteed initialized prefix into it. <table><tr><td>memset 280 bytes</td><td>copy 19 bytes</td></tr></table> However this was still buggy because it used `addr_of!((*entry_ptr).d_name)`, which is considered UB by Miri in the case that the full extent of entry_ptr is not in bounds of the same allocation. (Arguably this shouldn't be a requirement, but here we are.) The UB got fixed by #94272 by replacing `addr_of` with some pointer manipulation based on `offset_from`, but still fundamentally the same operation. <table><tr><td>memset 280 bytes</td><td>copy 19 bytes</td></tr></table> Then #94750 noticed that only 9 of those 19 bytes were even being used, so we could pick out only those 9 to put in the ReadDir value. <table><tr><td>memset 280 bytes</td><td>copy 19 bytes</td><td>copy 9 bytes</td></tr></table> After my PR we just grab the 9 needed bytes directly from entry_ptr. <table><tr><td>copy 9 bytes</td></tr></table> The resulting code is more complex but I believe still worthwhile to land for the following reason. This is an extremely straightforward thing to accomplish in C and clearly libc assumes that; literally just `entry_ptr->d_name`. The extra work in comparison to accomplish it in Rust is not an example of any actual safety being provided by Rust. I believe it's useful to have uncovered that and think about what could be done in the standard library or language to support this obvious operation better. ## References - https://man7.org/linux/man-pages/man3/readdir.3.html
2022-10-23Auto merge of #101403 - bjorn3:dylib_lto, r=Mark-Simulacrumbors-27/+135
Enable LTO for rustc_driver.so Alternative to https://github.com/rust-lang/rust/pull/97154 This enables LTO'ing dylibs behind a feature flag and uses this feature for compiling rustc_driver.so.
2022-10-23Update LLVM submodulebjorn3-0/+0
2022-10-23Introduce dedicated `-Zdylib-lto` flag for enabling LTO on `dylib`sJakub Beránek-13/+66
2022-10-23Add `rust.lto` config optionJakub Beránek-2/+39
2022-10-23Allow LTO for dylibsbjorn3-24/+33
2022-10-23Add missing export for the oom strategy symbolbjorn3-1/+10
2022-10-23Auto merge of #103431 - Dylan-DPC:rollup-oozfo89, r=Dylan-DPCbors-264/+541
Rollup of 6 pull requests Successful merges: - #101293 (Recover when unclosed char literal is parsed as a lifetime in some positions) - #101908 (Suggest let for assignment, and some code refactor) - #103192 (rustdoc: Eliminate uses of `EarlyDocLinkResolver::all_traits`) - #103226 (Check `needs_infer` before `needs_drop` during HIR generator analysis) - #103249 (resolve: Revert "Set effective visibilities for imports more precisely") - #103305 (Move some tests to more reasonable places) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-23Rollup merge of #103305 - c410-f3r:moar-errors, r=petrochenkovDylan DPC-1/+1
Move some tests to more reasonable places r? `@petrochenkov`
2022-10-23Rollup merge of #103249 - petrochenkov:revaddids, r=oli-obkDylan DPC-36/+26
resolve: Revert "Set effective visibilities for imports more precisely" In theory the change was correct, but in practice the use of import items in HIR is limited and hacky, and it expects that (effective) visibilities for all (up to) 3 IDs of the import are set to the value reflecting (effective) visibility of the whole syntactic `use` item rather than its individual components. Fixes https://github.com/rust-lang/rust/issues/102352 r? `@oli-obk`
2022-10-23Rollup merge of #103226 - compiler-errors:delay-if-need-infer, r=lcnrDylan DPC-18/+23
Check `needs_infer` before `needs_drop` during HIR generator analysis This is kinda a revival of #103036, but with the understanding that after fallback, a generator-interior type will only have `needs_infer` true if there's an error that prevented int or float variable fallback to occur (modulo region variables, which are erased). Therefore the best choice here is to delay a bug and skip the `needs_drop` call altogether. r? `@lcnr` feel free to reassign though
2022-10-23Rollup merge of #103192 - petrochenkov:noalltraits, r=jyn514Dylan DPC-133/+117
rustdoc: Eliminate uses of `EarlyDocLinkResolver::all_traits` Another step to https://github.com/rust-lang/rust/pull/94857.
2022-10-23Rollup merge of #101908 - chenyukang:fix-101880, r=estebankDylan DPC-53/+165
Suggest let for assignment, and some code refactor Fixes #101880
2022-10-23Rollup merge of #101293 - compiler-errors:lt-is-actually-char, r=estebankDylan DPC-23/+209
Recover when unclosed char literal is parsed as a lifetime in some positions Fixes #101278
2022-10-23Auto merge of #103345 - Nilstrieb:diag-flat, r=compiler-errorsbors-1694/+1666
Flatten diagnostic slug modules This makes it easier to grep for the slugs in the code. See https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Localization.20infra.20interferes.20with.20grepping.20for.20error for more discussion about it. This was mostly done with a few regexes and a bunch of manual work. This also exposes a pretty annoying inconsistency for the extra labels. Some of the extra labels are defined as additional properties in the fluent message (which makes them not prefixed with the crate name) and some of them are new fluent messages themselves (which makes them prefixed with the crate name). I don't know whether we want to clean this up at some point but it's useful to know. r? `@davidtwco`
2022-10-23Update translation testsNilstrieb-342/+356
2022-10-23Migrate all diagnosticsNilstrieb-1318/+1279
2022-10-23Generate fluent message constant in a flat module for all cratesNilstrieb-34/+31
This will make it easier to grep for fluent message names.
2022-10-23Auto merge of #103426 - matthiaskrgr:rollup-n6dqdy8, r=matthiaskrgrbors-252/+471
Rollup of 9 pull requests Successful merges: - #103123 (Introduce `subst_iter` and `subst_iter_copied` on `EarlyBinder` ) - #103328 (Do not suggest trivially false const predicates) - #103354 (Escape string literals when fixing overlong char literal) - #103355 (Handle return-position `impl Trait` in traits properly in `register_hidden_type`) - #103368 (Delay ambiguity span bug in normalize query iff not rustdoc) - #103388 (rustdoc: remove unused CSS class `.result-description`) - #103399 (Change `unknown_lint` applicability to `MaybeIncorrect`) - #103401 (Use functions for headings rustdoc GUI test) - #103412 (Fix typo in docs of `String::leak`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-23Rollup merge of #103412 - finnbear:fix_docs_typo_string_leak, r=thomccMatthias Krüger-1/+1
Fix typo in docs of `String::leak`. I introduced a typo in #103280, this PR fixes it. See https://github.com/rust-lang/rust/pull/103280#discussion_r1002538265
2022-10-23Rollup merge of #103401 - GuillaumeGomez:gui-test-headings-cleanup, r=notriddleMatthias Krüger-100/+76
Use functions for headings rustdoc GUI test r? ````@notriddle````
2022-10-23Rollup merge of #103399 - smoelius:unknown-lint-maybe-incorrect, r=fee1-deadMatthias Krüger-1/+1
Change `unknown_lint` applicability to `MaybeIncorrect` This small PR changes the applicability of `unknown_lint` to `MaybeIncorrect`, because the suggested lint might not be the correct one. Here is one example where the current applicability causes a problem. Clippy has a set of internal lints guarded by a feature called `internal`. If the feature is not enabled, then the internal lints are "unknown." In that case, running `cargo clippy --fix ...` on `clippy_utils` causes lines such as the followig https://github.com/rust-lang/rust/blob/26c96e341639102afacbbcad0dc18ad0ac71ab18/src/tools/clippy/clippy_utils/src/paths.rs#L51-L52 to be changed to ```rust #[expect(clippy::invalid_regex)] // internal lints do not know about all external crates pub const FUTURES_IO_ASYNCREADEXT: [&str; 3] = ["futures_util", "io", "AsyncReadExt"]; ``` which is not correct.
2022-10-23Rollup merge of #103388 - notriddle:notriddle/result-description, ↵Matthias Krüger-3/+3
r=GuillaumeGomez rustdoc: remove unused CSS class `.result-description` It was added to the CSS in d8de2b4c338471aacaf0e8a096f9a7148b146ab4, but was never actually used in that PR.
2022-10-23Rollup merge of #103368 - compiler-errors:normalization-ambiguity-bug, r=oli-obkMatthias Krüger-2/+178
Delay ambiguity span bug in normalize query iff not rustdoc Oli and I decided that the compiler debt of adding another usage of `tcx.sess.opts.actually_rustdoc` is fine, because we don't really want to add more complexity to the normalize query, and moving rustdoc to use fulfill normalization (`fully_normalize`, i.e. not use the normalize query) is unnecessary overhead given that it's skipping binders and stuff. r? oli-obk Fixes #102827 Fixes #103181
2022-10-23Rollup merge of #103355 - compiler-errors:rpitit-default-check, r=oli-obkMatthias Krüger-14/+63
Handle return-position `impl Trait` in traits properly in `register_hidden_type` The bounds that we get by calling `bound_explicit_item_bounds` from an RPITIT have projections, not opaques, but when we're *registering* an opaque, we want to treat it like an opaque. Coincidentally fixes #102688 as well, which makes sense, since that was failing because we were inferring an opaque type to be equal to itself (opaque cycle error => "cannot resolve opaque type"). Fixes #103352 r? ```@oli-obk```
2022-10-23Rollup merge of #103354 - clubby789:escape-string-literals, r=compiler-errorsMatthias Krüger-8/+83
Escape string literals when fixing overlong char literal Fixes #103323 ````@rustbot```` label +A-diagnostics +A-suggestion-diagnostics
2022-10-23Rollup merge of #103328 - compiler-errors:trivial-false-const-sugg, r=jackh726Matthias Krüger-66/+7
Do not suggest trivially false const predicates Pass through constness to `predicate_can_apply` and don't suggest other impls if it's satisfied but not const. Fixes #103267
2022-10-23Rollup merge of #103123 - compiler-errors:early-binder-iter, r=cjgillotMatthias Krüger-57/+59
Introduce `subst_iter` and `subst_iter_copied` on `EarlyBinder` Makes working with bounds lists a bit easier, which I seem to do a lot. Specifically, means that we don't need to do `.transpose_iter().map(|(pred, _)| *pred)` every time we want to iterate through an `EarlyBinder<&'tcx [(Predicate, Span)]>` (and even then, still have to call `subst` later), which was a very awkward idiom imo.
2022-10-23Auto merge of #102660 - camsteffen:uninhabited-perf, r=oli-obkbors-354/+338
Remove ParamEnv from uninhabited query
2022-10-22Fix typo in docs of `String::leak`.Finn Bear-1/+1
2022-10-22Auto merge of #103240 - BelovDV:issue-102290, r=petrochenkovbors-0/+4
Add architectures to fn create_object_file Fixes #102290 r? `@petrochenkov`
2022-10-22Introduce InhabitedPredicateCameron Steffen-354/+338
2022-10-22Auto merge of #103400 - weihanglo:update-cargo, r=weihanglobors-8/+18
Update cargo 5 commits in 3ff044334f0567ce1481c78603aeee7211b91623..071eeaf210708219a5a1b2c4728ca2f97df7f2ae 2022-10-17 20:25:00 +0000 to 2022-10-22 01:17:55 +0000 - fix: Remove leading newline in vendor output (rust-lang/cargo#11273) - Fix publishing with a dependency on a sparse registry (rust-lang/cargo#11268) - Add missing edition (rust-lang/cargo#11265) - fix(publish): Check remote git registry more than once post-publish (rust-lang/cargo#11255) - Fix typo (rust-lang/cargo#11258) r? `@ghost`
2022-10-22Auto merge of #103398 - Dylan-DPC:rollup-cj6w00o, r=Dylan-DPCbors-67/+153
Rollup of 7 pull requests Successful merges: - #102602 (Slightly tweak comments wrt `lint_overflowing_range_endpoint`) - #103190 (rustdoc: render bounds of cross-crate GAT params) - #103224 (Allow semicolon after closure within parentheses in macros) - #103280 ((#102929) Implement `String::leak` (attempt 2)) - #103329 (Add a forgotten check for NonNull::new_unchecked's precondition) - #103346 (Adjust argument type for mutable with_metadata_of (#75091)) - #103360 (Reduce false positives in msys2 detection) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-22Use functions for headings rustodoc GUI testGuillaume Gomez-100/+76
2022-10-22Update cargoWeihang Lo-8/+18
5 commits in 3ff044334f0567ce1481c78603aeee7211b91623..071eeaf210708219a5a1b2c4728ca2f97df7f2ae 2022-10-17 20:25:00 +0000 to 2022-10-22 01:17:55 +0000 - fix: Remove leading newline in vendor output (rust-lang/cargo#11273) - Fix publishing with a dependency on a sparse registry (rust-lang/cargo#11268) - Add missing edition (rust-lang/cargo#11265) - fix(publish): Check remote git registry more than once post-publish (rust-lang/cargo#11255) - Fix typo (rust-lang/cargo#11258)
2022-10-22Change `unknown_lint` applicability to `MaybeIncorrect`Samuel Moelius-1/+1
2022-10-22Rollup merge of #103360 - ChrisDenton:isterm-filetype, r=thomccDylan DPC-2/+12
Reduce false positives in msys2 detection Currently msys2 will be detected by getting the file path and looking to see if it contains the substrings "msys-" and "-ptr" (or "cygwin-" and "-pty"). This risks false positives, especially with filesystem files and if `GetFileInformationByHandleEx` returns a [full path](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntqueryinformationfile#remarks). This PR adds a check to see if the handle is a pipe before doing the substring search. Additionally, for "msys2-" or "cygwin-" it only checks if the file name starts with the substring rather than looking at the whole path.
2022-10-22Rollup merge of #103346 - HeroicKatora:metadata_of_const_pointer_argument, ↵Dylan DPC-3/+7
r=dtolnay Adjust argument type for mutable with_metadata_of (#75091) The method takes two pointer arguments: one `self` supplying the pointer value, and a second pointer supplying the metadata. The new parameter type more clearly reflects the actual requirements. The provenance of the metadata parameter is disregarded completely. Using a mutable pointer in the call site can be coerced to a const pointer while the reverse is not true. In some cases, the current parameter type can thus lead to a very slightly confusing additional cast. [Example](https://github.com/HeroicKatora/static-alloc/commit/cad93775eb9adc62f744651e3abf19513e69e7d0). ```rust // Manually taking an unsized object from a `ManuallyDrop` into another allocation. let val: &core::mem::ManuallyDrop<T> = …; let ptr = val as *const _ as *mut T; let ptr = uninit.as_ptr().with_metadata_of(ptr); ``` This could then instead be simplified to: ```rust // Manually taking an unsized object from a `ManuallyDrop` into another allocation. let val: &core::mem::ManuallyDrop<T> = …; let ptr = uninit.as_ptr().with_metadata_of(&**val); ``` Tracking issue: https://github.com/rust-lang/rust/issues/75091 ``@dtolnay`` you're reviewed #95249, would you mind chiming in?
2022-10-22Rollup merge of #103329 - saethlin:nonnull-precondition, r=thomccDylan DPC-1/+5
Add a forgotten check for NonNull::new_unchecked's precondition Looks like I forgot this function a while ago in https://github.com/rust-lang/rust/pull/92686 r? ```@thomcc```
2022-10-22Rollup merge of #103280 - finnbear:impl_string_leak_2, r=joshtriplettDylan DPC-1/+30
(#102929) Implement `String::leak` (attempt 2) Implementation of `String::leak` (#102929) ACP: https://github.com/rust-lang/libs-team/issues/109 Supersedes #102941 (see previous reviews there) ```@rustbot``` label +T-libs-api -T-libs
2022-10-22Rollup merge of #103224 - compiler-errors:semi-after-closure-in-macro, ↵Dylan DPC-0/+18
r=fee1-dead Allow semicolon after closure within parentheses in macros #88546 added some parsing logic that if we're parsing a closure, and we're within parentheses, and a semicolon follows, then we must be parsing something erroneous like: `f(|| a; b)`, so it replaces the closure body with an error expression. However, it's valid to parse those tokens if we're within a macro, as in #103222. This is a bit unsatisfying fix. Is there a more robust way of checking that we're within a macro? I would also be open to removing this "_It is likely that the closure body is a block but where the braces have been removed_" check altogether at the expense of more verbose errors, since it seems very suspicious in the first place... Fixes #103222.
2022-10-22Rollup merge of #103190 - ↵Dylan DPC-22/+41
fmease:rustdoc-render-bounds-of-cross-crate-gat-params, r=GuillaumeGomez rustdoc: render bounds of cross-crate GAT params Follow-up to #102439. Render the trait bounds of type parameters of cross-crate (generic) associated types. `````@rustbot````` label T-rustdoc A-cross-crate-reexports r? `````@GuillaumeGomez`````
2022-10-22Rollup merge of #102602 - WaffleLapkin:linty_action, r=estebankDylan DPC-38/+40
Slightly tweak comments wrt `lint_overflowing_range_endpoint` From the review: https://github.com/rust-lang/rust/pull/101986#discussion_r975610611 It _seemed_ that the lint was not emitted when the `if` check failed, but _actually_ this happens already in a special case and the lint is emitted outside of this function, if this function doesn't. I've cleared up the code/comments a bit, so it's more obvious :) r? ```@estebank```
2022-10-22Auto merge of #103231 - ecnelises:le_fix, r=lcnrbors-4/+2
Remove byte swap of valtree hash on big endian This addresses problem reported in #103183. The code was originally introduced in https://github.com/rust-lang/rust/commit/e14b34c386ad2809e937e0e6e0379c5cc5474954. (see https://github.com/rust-lang/rust/pull/96591) On big-endian environment, this operation sequence actually put the other half from 128-bit result, thus we got different hash result on LE and BE.
2022-10-22Auto merge of #103227 - lcnr:bye-bye-unevaluated-const, r=oli-obkbors-191/+131
stop using `ty::UnevaluatedConst` directly best reviewed commit by commit. simplifies #99798 because we now don't have to expand `ty::UnevaluatedConst` to `ty::Const`. I also remember some other places where using `ty::UnevaluatedConst` directly was annoying and caused issues, though I don't quite remember what they were rn '^^ r? `@oli-obk` cc `@JulianKnodt`
2022-10-22Don't erroneously deny semicolons after closure expr within parentheses in a ↵Michael Goulet-0/+18
macro
2022-10-22Recover unclosed char literal being parsed as lifetimeMichael Goulet-23/+209