about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-10-26Rollup merge of #103430 - cjgillot:receiver-attrs, r=petrochenkovDylan DPC-14/+17
Workaround unstable stmt_expr_attributes for method receiver expressions Fixes https://github.com/rust-lang/rust/issues/103244 cc ``@Mark-Simulacrum`` ``@ehuss``
2022-10-26Rollup merge of #103416 - compiler-errors:rpit-named, r=cjgillotDylan DPC-23/+23
Name the `impl Trait` in region bound suggestions Slightly more descriptive message
2022-10-26Rollup merge of #103209 - Xiretza:multiple-suggestions, r=davidtwcoDylan DPC-2/+133
Diagnostic derives: allow specifying multiple alternative suggestions This allows porting `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-26Rollup merge of #102951 - SparrowLii:type_annotation, r=estebankDylan DPC-0/+98
suggest type annotation for local statement initialed by ref expression In a local statement with a type declaration, if a ref expression is used on the right side and not used on the left side, in addition to removing the `&` and `&mut` on the right side, we can add them on the left side alternatively Fixes #102892
2022-10-26Auto merge of #103158 - Bryanskiy:resolve_perf, r=petrochenkovbors-6/+6
Perf improvements for effective visibility calculating related to https://github.com/rust-lang/rust/pull/102026 r? `@petrochenkov`
2022-10-25Name impl trait in region bound suggestionMichael Goulet-23/+23
2022-10-25Auto merge of #103392 - RalfJung:miri, r=oli-obkbors-470/+1521
update Miri I had to use a hacked version of josh to create this, so let's be careful with merging this and maybe wait a bit to see if the josh issue becomes more clear. But the history looks good to me, we are not adding duplicates of rustc commits that were previously mirrored to Miri. Also I want to add some cross-testing of Miri in x.py.
2022-10-25Perf improvements for effective visibility calculatingBryanskiy-6/+6
2022-10-25Miri: disable macOS testing for nowRalf Jung-1/+2
2022-10-25Rollup merge of #103122 - ouz-a:mir-technical-debt, r=oli-obkDylan DPC-3/+3
Remove misc_cast and validate types when casting Continuing our work in #102675 r? ````@oli-obk````
2022-10-25Auto merge of #102988 - dpaoliello:inlinerawdylib, r=dpaoliellobors-0/+102
Support raw-dylib functions being used inside inlined functions Fixes #102714 Issue Details: When generating the import library for `raw-dylib` symbols, we currently only use the functions and variables declared within the current crate. This works fine if all crates are static libraries or `rlib`s as the generated import library will be contained in the static library or `rlib` itself, but if a dependency is a dynamic library AND the use of a `raw-dylib` function or variable is inlined or part of a generic instantiation then the current crate won't see its dependency's import library and so linking will fail. Fix Details: Instead, when we generate the import library for a `dylib` or `bin` crate, we will now generate it for the symbols both for the current crate and all upstream crates. We do this in two steps so that the import library for the current crate is passed into the linker first, thus it is preferred if there are any ambiguous symbols.
2022-10-24Support raw-dylib functions being used inside inlined functionsDaniel Paoliello-0/+102
2022-10-25Rollup merge of #103495 - Enselic:rustdoc-unix_sigpipe, r=notriddleYuki Okushi-1/+3
rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler` Do what was already done for `rustc` in #102587, namely start using `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`. After this has been merged, we can completely remove `rustc_driver::set_sigpipe_handler`. PR that added `set_sigpipe_handler`: https://github.com/rust-lang/rust/pull/49606 Tracking issue for `unix_sigpipe`: #97889 Verification of this change --------------------------- 1. Remove `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE 1. Add back `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE fixed ``@rustbot`` labels +T-rustdoc
2022-10-25Rollup merge of #103494 - notriddle:notriddle/test-arrow-hover, r=GuillaumeGomezYuki Okushi-3/+0
rustdoc: remove redundant CSS `a.test-arrow:hover` In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-25Rollup merge of #103493 - notriddle:notriddle/source-sidebar-logo, ↵Yuki Okushi-5/+7
r=GuillaumeGomez rustdoc: remove unused `.sidebar-logo` DOM on source pages
2022-10-25Rollup merge of #103486 - ↵Yuki Okushi-52/+89
GuillaumeGomez:cleanup-rustdoc-gui-highlight-colors, r=notriddle Use functions in highlight-colors rustdoc GUI test r? ``@notriddle``
2022-10-25Rollup merge of #103462 - notriddle:notriddle/source-pre-rust-white-space, ↵Yuki Okushi-1/+0
r=Dylan-DPC rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }` This rule, added in 49e6db7f3510a99ab3d3723b2430add985629c39, overrode a rule in normalize.css. https://github.com/rust-lang/rust/blob/49e6db7f3510a99ab3d3723b2430add985629c39/src/librustdoc/html/static/normalize.css#L169-L175 When normalize.css was updated, this rule went away. https://github.com/necolas/normalize.css/commit/a8edd0c5aa06b905e8e1550fd6a5c01e46375194
2022-10-25Rollup merge of #103410 - camsteffen:link-unstable-book, r=JohnTitorYuki Okushi-1/+1
-Z docs: Add link to unstable book
2022-10-25Rollup merge of #103409 - compiler-errors:rpitit-signature-mismatch, r=lcnrYuki Okushi-0/+37
Delay span bug when we can't map lifetimes back in `collect_trait_impl_trait_tys` When a lifetime is late-bound in a trait signature, but early-bound in an impl signature, we already emit an error -- however, we also ICE in `collect_trait_impl_trait_tys`, so just delay a bug here. Fixes #103407
2022-10-25Rollup merge of #103382 - compiler-errors:anon-apit-lt-region-ice, r=cjgillotYuki Okushi-0/+28
Don't ICE when reporting borrowck errors involving regions from `anonymous_lifetime_in_impl_trait` The issue here is that when we have: ``` trait Trait<'a> { .. } fn foo(arg: impl Trait) { .. } ``` The anonymous lifetime `'_` that we generate for `arg: impl Trait` doesn't end up in the argument type (which is a param) but in a where-clause of the function, in a predicate whose self type is that param ty. Fixes #101660 r? ``@cjgillot``
2022-10-25Rollup merge of #103350 - clubby789:refer-to-assoc-method, r=wesleywiserYuki Okushi-9/+44
Change terminology for assoc method suggestions when they are not called Fixes #103325 ```@rustbot``` label +A-diagnostics
2022-10-25Rollup merge of #103333 - chenyukang:yukang/fix-103143, r=wesleywiserYuki Okushi-0/+25
Fix assertion failed for break_last_token and trailing token Fixes #103143
2022-10-24Delay span bug when we can't map lifetimes back in collect_trait_impl_trait_tysMichael Goulet-0/+37
2022-10-24rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`Martin Nordholts-1/+3
Start using `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`. After this has been merged, we can completely remove `rustc_driver::set_sigpipe_handler`. Verification of this change --------------------------- 1. Remove `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE 1. Add back `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE fixed
2022-10-24rustdoc: remove redundant CSS `a.test-arrow:hover`Michael Howell-3/+0
In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-24rustdoc: remove unused `.sidebar-logo` DOM on source pagesMichael Howell-5/+7
2022-10-24Auto merge of #103337 - flip1995:clippyup, r=Manishearthbors-4206/+8511
Update Clippy r? `@Manishearth`
2022-10-24Use functions in highlight-colors rustdoc GUI testGuillaume Gomez-52/+89
2022-10-24Document link to unstable bookCameron Steffen-1/+1
2022-10-24Auto merge of #94063 - Aaron1011:pretty-print-rental, r=lcnrbors-106/+326
Only apply `ProceduralMasquerade` hack to older versions of `rental` The latest version of `rental` (v0.5.6) contains a fix that allows it to compile without relying on the pretty-print back-compat hack. Hopefully, there are no longer any crates relying on the affected versions of the (much less popular) `procedural-masquerade` crate. This should allow us to target the pretty-print back-compat hack specifically to older versions of `rental`, and specifically mention upgrading to `rental` v0.5.6 in the lint message.
2022-10-24Rollup merge of #103437 - bjorn3:sync_cg_clif-2022-10-23, r=bjorn3Yuki Okushi-0/+2
Sync rustc_codegen_cranelift r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2022-10-24Rollup merge of #99939 - saethlin:pre-sort-tests, r=thomcc,jackh726Yuki Okushi-1/+86
Sort tests at compile time, not at startup Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately. (except for doctests, because there is no compile-time harness)
2022-10-24also smoke-test 'cargo miri test'Ralf Jung-2/+36
2022-10-24add support for testing Miri on other targets, and do some cross-testing on CIRalf Jung-3/+17
2022-10-24suggest type annotation for local statement initialed by ref expressionSparrowLii-0/+98
2022-10-24Auto merge of #2615 - RalfJung:josh, r=oli-obkbors-3/+2
point to my fork of josh for now This is the version of josh that I used to create https://github.com/rust-lang/rust/pull/103392.
2022-10-24point to my fork of josh for nowRalf Jung-3/+2
2022-10-23rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }`Michael Howell-1/+0
This rule, added in 49e6db7f3510a99ab3d3723b2430add985629c39, overrode a rule in normalize.css. https://github.com/rust-lang/rust/blob/49e6db7f3510a99ab3d3723b2430add985629c39/src/librustdoc/html/static/normalize.css#L169-L175 When normalize.css was updated, this rule went away. https://github.com/necolas/normalize.css/commit/a8edd0c5aa06b905e8e1550fd6a5c01e46375194
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-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-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.