about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-10-23rustdoc: don't mark Box<T> as Iterator, Read, etcJacob Hoffman-Andrews-0/+47
Because Box<T> has pass-through implementations, rustdoc was giving it the "Notable Traits" treatment for Iterator, Read, Write, and Future, even when the type of T was unspecified. Pin had the same problem, but just for Future.
2022-10-24fix #103425, remove extra type error after missing semicolon erroryukang-0/+44
2022-10-23Override linker in cargotest on windowsAaron Hill-0/+4
2022-10-24Auto merge of #103452 - notriddle:rollup-peewevm, r=notriddlebors-129/+196
Rollup of 11 pull requests Successful merges: - #100462 (Clarify `array::from_fn` documentation) - #101644 (Document surprising and dangerous fs::Permissions behaviour on Unix) - #103005 (kmc-solid: Handle errors returned by `SOLID_FS_ReadDir`) - #103140 (Add diagnostic for calling a function with the same name with unresolved Macro) - #103254 (rustdoc: do not filter out cross-crate `Self: Sized` bounds) - #103347 (bootstrap: also create rustc-src component in sysroot) - #103402 (Fix wrapped valid-range handling in ty_find_init_error) - #103414 (Pretty print lifetimes captured by RPIT) - #103424 (rustdoc: remove no-op CSS `.code-header { border-bottom: none }`) - #103434 (Use functions for jump-to-def-background rustdoc GUI test) - #103447 (`MaybeUninit`: use `assume_init_drop()` in the partially initialized array example) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-23Cleanup message and bless testsJack Huey-15/+15
2022-10-23Enable varargs support for calling conventions other than C or cdeclSoveu-21/+114
This patch makes it possible to use varargs for calling conventions, which are either based on C (like efiapi) or C is based on them (for example sysv64 and win64).
2022-10-23Rollup merge of #103434 - ↵Michael Howell-38/+17
GuillaumeGomez:gui-test-jump-to-def-background-cleanup, r=notriddle Use functions for jump-to-def-background rustdoc GUI test r? `@notriddle`
2022-10-23Rollup merge of #103424 - ↵Michael Howell-1/+0
notriddle:notriddle/code-header-border-bottom-none, r=GuillaumeGomez rustdoc: remove no-op CSS `.code-header { border-bottom: none }` The code headers are always h3 or h4, which don't have border-bottom by default anyway.
2022-10-23Rollup merge of #103414 - compiler-errors:rpit-print-lt, r=cjgillotMichael Howell-21/+21
Pretty print lifetimes captured by RPIT This specifically makes the output in #103409 change from: ```diff error: `impl` item signature doesn't match `trait` item signature --> $DIR/signature-mismatch.rs:15:5 | LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>; | ----------------------------------------------------------------- expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` ... LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2` | = note: expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` - found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` + found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2` = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output error: aborting due to previous error ``` Along with the UI tests in this PR, which I think are all improvements! r? `@oli-obk` though feel free to re-roll
2022-10-23Rollup merge of #103402 - joshtriplett:niche-wrap-fix, r=oli-obkMichael Howell-51/+69
Fix wrapped valid-range handling in ty_find_init_error Rust's niche handling allows for wrapping valid ranges with end < start; for instance, a valid range with start=43 and end=41 means a niche of 42. Most places in the compiler handle this correctly, but `ty_find_init_error` assumed that `lo > 0` means the type cannot contain a zero. Fix it to handle wrapping ranges.
2022-10-23Rollup merge of #103347 - RalfJung:rustc-src, r=Mark-SimulacrumMichael Howell-0/+14
bootstrap: also create rustc-src component in sysroot Fixes https://github.com/rust-lang/rust-analyzer/issues/12926
2022-10-23Rollup merge of #103254 - fmease:fix-24183, r=GuillaumeGomezMichael Howell-18/+56
rustdoc: do not filter out cross-crate `Self: Sized` bounds All type parameters **except `Self`** are implicitly `Sized` ([via](https://doc.rust-lang.org/nightly/std/marker/trait.Sized.html)). Previously, we disregarded the exception of `Self` and omitted cross-crate `Sized` bounds of *any* type parameter *including* `Self` when rendering. From now on, we *do* render cross-crate `Self: Sized` bounds. Most notably, in `std` we now finally properly render the `Sized` bound of the `Clone` trait as well as the `Self: Sized` bound on `Iterator::map`. Fixes #24183. ``@rustbot`` label T-rustdoc A-cross-crate-reexports r? rustdoc
2022-10-23Rollup merge of #103140 - chenyukang:yukang/fix-103112, r=estebankMichael Howell-0/+19
Add diagnostic for calling a function with the same name with unresolved Macro Fixes #103112
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-23Fix windows compilationGary Guo-1/+2
2022-10-23Do not consider repeated lifetime params for elision.Camille GILLOT-1/+16
2022-10-23Add test case for foreign Rust exceptionsGary Guo-0/+25
2022-10-23test attr: point at return type if Termination bound unsatisfiedLeón Orell Valerian Liehr-7/+5
2022-10-23Add normalize hack backMichael Goulet-0/+31
2022-10-23Annotate static lifetimes tooMichael Goulet-19/+19
2022-10-23Allow specifying multiple alternative suggestionsXiretza-2/+133
This allows porting uses of span_suggestions() to diagnostic structs. Doesn't work for multipart_suggestions() because the rank would be reversed - the struct would specify multiple spans, each of which has multiple possible replacements, while multipart_suggestions() creates multiple possible replacements, each with multiple spans.
2022-10-23remove misc_cast and validate typesouz-a-3/+3
2022-10-23Auto merge of #101403 - bjorn3:dylib_lto, r=Mark-Simulacrumbors-2/+60
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 list of allowed cranelift dependenciesbjorn3-0/+2
2022-10-23Use functions for jump-to-def-background rustodoc GUI testGuillaume Gomez-38/+17
2022-10-23Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyupflip1995-4206/+8511
2022-10-23Update LLVM submodulebjorn3-0/+0
2022-10-23Introduce dedicated `-Zdylib-lto` flag for enabling LTO on `dylib`sJakub Beránek-4/+30
2022-10-23Add `rust.lto` config optionJakub Beránek-2/+34
2022-10-23Auto merge of #103431 - Dylan-DPC:rollup-oozfo89, r=Dylan-DPCbors-142/+332
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-23Auto merge of #2613 - RalfJung:scalar-only-field-retagging, r=RalfJungbors-10/+128
add scalar-abi-only field retagging option `@saethlin` has requested a Stacked Borrows field retagging mode that matches when we do in terms of emitting `noalias` for LLVM. So here you go! Types with `Scalar` and `ScalarPair` ABI are being recursively retagged, everything else is not. Given that many types can get `ScalarPair` ABI, I don't think this actually helps to make many things sound that are unsound under full field retagging -- but it might still be useful for some experimentation.
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-1/+8
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 #103192 - petrochenkov:noalltraits, r=jyn514Dylan DPC-128/+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-0/+94
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-12/+112
Recover when unclosed char literal is parsed as a lifetime in some positions Fixes #101278
2022-10-23Workaround unstable stmt_expr_attributes for method receiver expressions.Camille GILLOT-14/+17
2022-10-23Auto merge of #103345 - Nilstrieb:diag-flat, r=compiler-errorsbors-342/+356
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-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 #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-0/+159
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-13/+50
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-4/+45
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-61/+0
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-11/+5
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-22rustdoc: remove no-op CSS `.code-header { border-bottom: none }`Michael Howell-1/+0
The code headers are always h3 or h4, which don't have border-bottom by default anyway.
2022-10-23Fix wrapped valid-range handling in ty_find_init_errorJosh Triplett-51/+69
Rust's niche handling allows for wrapping valid ranges with end < start; for instance, a valid range with start=43 and end=41 means a niche of 42. Most places in the compiler handle this correctly, but ty_find_init_error assumed that `lo > 0` means the type cannot contain a zero. Fix it to handle wrapping ranges. Add a test to cover this case.
2022-10-22Bump cargotest servo to 785a344e32db58d4e631fd3cae17fd1f29a721abAaron Hill-1/+1
This updates the 'cssparser' and 'procedural-masquerade' deps to versions that no longer depend on the proc-macro back-compat hack.
2022-10-22add scalar-abi-only field retagging optionRalf Jung-10/+128