about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-11-08Rollup merge of #113925 - clubby789:const-ctor-repeat, r=estebankMatthias Krüger-28/+126
Improve diagnostic for const ctors in array repeat expressions Fixes #113912
2023-11-07Auto merge of #117680 - matthiaskrgr:rollup-kgaa4ma, r=matthiaskrgrbors-39/+127
Rollup of 4 pull requests Successful merges: - #115485 (Format macro const literals with pretty printer) - #117616 (warn when using an unstable feature with -Ctarget-feature) - #117639 (Update books) - #117675 (llvm-wrapper: Remove include of non-existant Vectorize.h) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-07Rollup merge of #117675 - zmodem:vectorize_h, r=durin42Matthias Krüger-1/+0
llvm-wrapper: Remove include of non-existant Vectorize.h LLVM recently removed the header: https://github.com/llvm/llvm-project/commit/2400c54c37d5afdfec016b9a71f161ac10a49b31 It only contained a declaration of `createLoadStoreVectorizerPass()`, which Rust doesn't reference.
2023-11-07Rollup merge of #117639 - rustbot:docs-update, r=ehussMatthias Krüger-0/+0
Update books ## rust-lang/reference 4 commits in 16fd3c06d9e558dae2d52000818274ae70c9e90a..cd8193e972f61b92117095fc73b67af767b4d6bc 2023-11-04 17:19:39 UTC to 2023-10-30 16:04:52 UTC - Guarantee that raw pointer conversions preserve slice element count (rust-lang/reference#1417) - some asm block flags also mean there can be no fences (rust-lang/reference#1413) - Guarantee `char` layout (rust-lang/reference#1401) - Doc: Add the RISC-V stabilized target features (rust-lang/reference#1415) ## rust-lang/rust-by-example 3 commits in 6709beeb7d0fbc5ffc91ac4893a24434123b9bfa..311b84962016b28c75525c86e7b3f49fd9101a39 2023-10-31 18:32:09 UTC to 2023-10-31 18:30:39 UTC - Fixed explanation mistake in comment (rust-lang/rust-by-example#1761) - Fix typos (rust-lang/rust-by-example#1759) - docs(9.2): fix typo (rust-lang/rust-by-example#1754) ## rust-lang/rustc-dev-guide 6 commits in b0ee9ec8fa59a6c7620165e061f4747202377a62..77dbe5782b2488af3bb489ad702eaff438f465bf 2023-11-06 16:14:34 UTC to 2023-10-29 17:16:02 UTC - add a new type system invariant (rust-lang/rustc-dev-guide#1822) - Update some outdated descriptions of coverage instrumentation (rust-lang/rustc-dev-guide#1809) - Add some documentation for unsizing (rust-lang/rustc-dev-guide#1817) - Bibliography: fixing author of "You Can't Spell Trust Without Rust" (rust-lang/rustc-dev-guide#1815) - remove change-id from sample build configuration (rust-lang/rustc-dev-guide#1813) - Update name of "active" features to "unstable" (rust-lang/rustc-dev-guide#1814)
2023-11-07Rollup merge of #117616 - RalfJung:unstable-target-features, r=compiler-errorsMatthias Krüger-23/+70
warn when using an unstable feature with -Ctarget-feature Setting or unsetting the wrong target features can cause ABI incompatibility (https://github.com/rust-lang/rust/issues/116344, https://github.com/rust-lang/rust/issues/116558). We need to carefully audit features for their ABI impact before stabilization. I just learned that we currently accept arbitrary unstable features on stable and if they are in the list of Rust target features, even unstable, then we don't even warn about that!1 That doesn't seem great, so I propose we introduce a warning here. This has an obvious loophole via `-Ctarget-cpu`. I'm not sure how to best deal with that, but it seems better to fix what we can and think about the other cases later, maybe once we have a better idea for how to resolve the general mess that are ABI-affecting target features.
2023-11-07Rollup merge of #115485 - DaniPopes:rustdoc-macro-consts, r=jackh726,fmeaseMatthias Krüger-15/+57
Format macro const literals with pretty printer Fixes #115295
2023-11-07Auto merge of #117617 - Urgau:bump-libc-0.2.150, r=Mark-Simulacrumbors-3/+3
Bump libc dependency This bumps the `libc` crate to version 0.2.150 which includes https://github.com/rust-lang/libc/pull/3410 which will help remove the old and deprecated check-cfg syntax. Extracted from https://github.com/rust-lang/rust/pull/117612
2023-11-07manually bless a wasm-only testRalf Jung-0/+6
2023-11-07llvm-wrapper: Remove include of non-existant Vectorize.hHans Wennborg-1/+0
2023-11-07Auto merge of #115904 - notriddle:notriddle/preload-bold, r=GuillaumeGomezbors-1/+0
rustdoc: stop preloading Source Serif 4 Bold According to #91170, italic fonts are not preloaded because they're rarely used, but bold fonts are. This seems to be true of bold Source Code Pro and bold Fira Sans, but bold and italic Source Serif Pro seem to be equally heavily used. This is, I assume, the result of using Fira Sans Bold and Source Code Bold headings, so you only get bold Serif text when the doc author uses strong `**` emphasis (or within certain kinds of tooltip, which shouldn't be preloaded because they only show up long after the page is loaded). To check this, run these two commands in the browser console to measure how much they're used. The measurement is extremely rough, but it gets the idea across: the two styles are about equally popular. // count bold elements Array.prototype.slice.call(document.querySelectorAll("*")).filter(x => { const y = document.defaultView.getComputedStyle(x); return y.fontFamily.indexOf("Source Serif 4") !== -1 && y.fontWeight > 400 }).length // count italic elements Array.prototype.slice.call(document.querySelectorAll("*")).filter(x => { const y = document.defaultView.getComputedStyle(x); return y.fontFamily.indexOf("Source Serif 4") !== -1 && y.fontStyle == "italic" }).length | URL | Bold | Italic | |--------------|-----:|-------:| | [std] | 2 | 9 | | [Vec] | 8 | 89 | | [regex] | 33 | 17 | | [test_suite] | 0 | 0 | [std]: https://doc.rust-lang.org/nightly/std/index.html [Vec]: https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html [regex]: https://docs.rs/regex/1.9.5/regex/index.html [test_suite]: https://docs.rs/test-suite/3.2.9/test_suite/
2023-11-07Auto merge of #117297 - clubby789:fn-trait-missing-paren, r=TaKO8Kibors-0/+73
Give a better diagnostic for missing parens in Fn* bounds Fixes #108109 It would be nice to try and recover here, but I'm not sure it's worth the effort, especially as the bounds on the recovered function would be incorrect.
2023-11-07Auto merge of #117229 - matthewjasper:thir-unsafeck-fixes, r=cjgillotbors-85/+489
Thir unsafeck fixes - Recognise thread local statics in THIR unsafeck - Add suggestion for unsafe_op_in_unsafe_fn - Fix unsafe checking of let expressions
2023-11-07Auto merge of #117610 - compiler-errors:object-hmm, r=aliemjaybors-14/+64
Only instantiate binder during dyn's built-in trait candidate probe once See UI test for demonstration of the issue. This was "caused" by #117131, but only because we're using the `normalize_param_env` (which has been augmented with a projection clause used to normalize GATs) which features non-lifetime bound vars in it. Fixes #117602 technically, though that's also fixed by #117542. r? types
2023-11-07Auto merge of #117418 - compiler-errors:better_error_body, r=oli-obkbors-29/+59
Build a better MIR body when errors are encountered Doesn't really have much of an effect on its own, but it does lead to a less confusing phony MIR body being generated when an error is detected during THIR/MIR/match building. This was quite confusing when I hacked `-Zunpretty=mir` to emit `mir_built` rather than `instance_mir`. This coincidentually also fixes #117413, but not as generally as #117416. cc `@Nadrieril`
2023-11-07Auto merge of #117006 - estebank:issue-69512, r=compiler-errorsbors-0/+138
When not finding assoc fn on type, look for builder fn When we have a resolution error when looking at a fully qualified path on a type, look for all associated functions on inherent impls that return `Self` and mention them to the user. ``` error[E0599]: no function or associated item named `new` found for struct `TcpStream` in the current scope --> tests/ui/resolve/fn-new-doesnt-exist.rs:4:28 | 4 | let stream = TcpStream::new(); | ^^^ function or associated item not found in `TcpStream` | note: if you're trying to build a new `TcpStream` consider using one of the following associated functions: TcpStream::connect TcpStream::connect_timeout --> /home/gh-estebank/rust/library/std/src/net/tcp.rs:156:5 | 156 | pub fn connect<A: ToSocketAddrs>(addr: A) -> io::Result<TcpStream> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 172 | pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result<TcpStream> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` Fix #69512.
2023-11-07When not finding assoc fn on type, look for builder fnEsteban Küber-0/+138
When we have a resolution error when looking at a fully qualified path on a type, look for all associated functions on inherent impls that return `Self` and mention them to the user. Fix #69512.
2023-11-07Auto merge of #117511 - gurry:117406-err-packed-structs, r=compiler-errorsbors-1/+290
Emit explanatory note for move errors in packed struct derives Derive expansions for packed structs with non-`Copy` fields cause move errors because they prefer copying over borrowing since borrowing the fields of a packed struct can result in unaligned access. This underlying cause of the errors, however, is not apparent to the user. This PR adds a diagnostic note to make it clear to the user (the new note is on the second last line): ``` tests/ui/derives/deriving-with-repr-packed-move-errors.rs:13:16 | 12 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)] | ----- in this derive macro expansion 13 | struct StructA(String); | ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait | = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) ``` Fixes #117406 Partially addresses #110777
2023-11-06Build a better MIR body when errors are encounteredMichael Goulet-29/+59
2023-11-06Don't instantiate the binder twice when assembling object candidateMichael Goulet-17/+45
2023-11-06Only check predicates for late-bound non-lifetime vars in object candidate ↵Michael Goulet-1/+23
assembly
2023-11-06Auto merge of #117641 - matthiaskrgr:rollup-f9c12td, r=matthiaskrgrbors-5/+58
Rollup of 4 pull requests Successful merges: - #117190 (add test for #113381) - #117516 (add test for #113375) - #117631 (Documentation cleanup for core::error::Request.) - #117637 (Check binders with bound vars for global bounds that don't hold) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-06Rollup merge of #117637 - lqd:trivial-bounds-with-binder-vars, r=compiler-errorsMatthias Krüger-1/+10
Check binders with bound vars for global bounds that don't hold This fixes `soa_derive-0.13.0` from #117589's crater run. r? `@compiler-errors`
2023-11-06Rollup merge of #117631 - smarnach:error-request-doc-fix, r=ChrisDentonMatthias Krüger-4/+4
Documentation cleanup for core::error::Request. This part of the documentation currently render like this: ![image](https://github.com/rust-lang/rust/assets/249196/b34cb907-4ce4-4e85-beca-510d8aa1fefb) The new version renders like this: ![image](https://github.com/rust-lang/rust/assets/249196/fe18398a-15fb-42a7-82a4-f1856d48bd79) Fixes: * Add missing closing back tick. * Remove spurious double back ticks. * Add missing newline to render bullet point correctly. * Fix grammar "there are methods calledrequest_ref and request_value are available" -> "there are methods calledrequest_ref and request_value". * Change "methods" to "functions", which seems more appropriate for free functions.
2023-11-06Rollup merge of #117516 - matthiaskrgr:test_effects_113375_oob, r=fee1-deadMatthias Krüger-0/+18
add test for #113375 Fixes #113375 r? `@fee1-dead`
2023-11-06Rollup merge of #117190 - matthiaskrgr:test_effects_113381, r=fee1-deadMatthias Krüger-0/+26
add test for #113381 Fixes #113381 r? fee1-dead
2023-11-06Auto merge of #117292 - estebank:issue-80446, r=davidtwcobors-0/+71
Detect misparsed binop caused by missing semi When encountering ```rust foo() *bar = baz; ``` We currently emit potentially two errors, one for the return type of `foo` not being multiplicative by the type of `bar`, and another for `foo() * bar` not being assignable. We now check for this case and suggest adding a semicolon in the right place and emit only a single error. Fix #80446.
2023-11-06Silence redundant error on typo resulting on binopEsteban Küber-33/+27
2023-11-06Update booksrustbot-0/+0
2023-11-06Visit patterns in THIR let expressionsMatthew Jasper-38/+66
This fixes some THIR unsafety checking errors not being emitted for let expressions in these situations.
2023-11-06Add suggestion to THIR unsafe_op_in_unsafe_fn lintMatthew Jasper-40/+367
2023-11-06Allow tests with rust-rustfix and revisionsMatthew Jasper-1/+1
2023-11-06Recognise thread local statics in THIR unsafeckMatthew Jasper-6/+55
2023-11-06Auto merge of #117603 - HKalbasi:make-feature-additive, r=Nilstriebbors-9/+7
Make the randomize feature of rustc_abi additive The goal here is to make rust-analyzer able to build with the `rustc_private` versions of the rustc crates it depends on. See #116847
2023-11-06add test for trivial bound not holding in `soa-derive`Rémy Rakic-0/+8
2023-11-06check binders with bound vars for global bounds that don't holdRémy Rakic-1/+2
(instead of just late bound vars)
2023-11-06Auto merge of #116988 - RalfJung:null, r=WaffleLapkinbors-0/+10
document that the null pointer has the 0 address Fixes https://github.com/rust-lang/rust/issues/116895 Will need t-lang FCP, but I think this is fairly uncontroversial -- there's probably already tons of code out there that relies on this.
2023-11-06Auto merge of #117630 - matthiaskrgr:rollup-v0d5p3f, r=matthiaskrgrbors-26/+25
Rollup of 3 pull requests Successful merges: - #117592 (Use the correct span when emitting the `env!` result) - #117613 (Remove from vacation and compiler review group) - #117615 (Couple of small changes) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-06Documentation cleanup for core::error::Request.Sven Marnach-4/+4
2023-11-06Rollup merge of #117615 - bjorn3:misc_changes, r=davidtwcoMatthias Krüger-22/+22
Couple of small changes These are unrelated to each other, but they are each small enough that opening separate PR's doesn't make sense to me either. * Remove a place where the parse driver query is stolen. * Update an outdated doc comment * Use correct crate name in `-Zprint-vtable-sizes` when using `#![crate_name = "..."]`.
2023-11-06Rollup merge of #117613 - jackh726:vacation, r=compiler-errorsMatthias Krüger-3/+2
Remove from vacation and compiler review group Staying on the types review rotation, but staying off the general review queue is good for me right now. Also move ``@compiler-errors`` since he's a full member now.
2023-11-06Rollup merge of #117592 - thomcc:env-span-wrong, r=davidtwcoMatthias Krüger-1/+1
Use the correct span when emitting the `env!` result The span used for the `env!` resut changed in 1.73, due to https://github.com/rust-lang/rust/commit/75df62d4a2c45175b8cb1eb4bdc10fa423c11c4c (from https://github.com/rust-lang/rust/pull/114014). This prevents [a lint in `plrustc`](https://github.com/tcdi/plrust/blob/main/plrustc/plrustc/src/lints/builtin_macros.rs#L54-L60)[^1] from working well, because the resulting span is not inside the region where the lint is `#[deny()]`ed. [^1]: Perhaps worth noting that the `env_macro` diagnostic item comes from [the std fork used with PL/Rust](https://github.com/tcdi/postgrestd/blob/rust-1.73.0/library/core/src/macros/mod.rs#L944). Unfortunately, I have no idea how to write a test for this since I don't think we can have a custom lint in a test. A suggestion was made to use a custom proc macro for it, but that seems pretty involved (frankly, I might not have time to do it). r? ``@davidtwco`` (since they're the author of the PR with the regression) P.S. We generally try to avoid bothering upstream about PL/Rust-specific stuff (we don't want to nag), but this seems like an actual bug, since the other similar macros, such as `option_env` use the other span (and are lintable as a result).
2023-11-06Auto merge of #117578 - compiler-errors:derive-encode-in-rustc_type_ir, ↵bors-486/+31
r=davidtwco Derive `TyEncodable`/`TyDecodable` in `rustc_type_ir` when `derive(TyEncodable)` or `derive(TyDecodable)` sees an `I` type parameter on a struct that has no `'tcx`, then parameterize the `TyEncoder`/`TyDecoder`'s interner over that variable rather than `TyCtxt<'tcx>`. Also, emit where clauses for fields rather than generics.
2023-11-06warn when using an unstable feature with -Ctarget-featureRalf Jung-23/+64
2023-11-06Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwcobors-13/+41
enable parallel rustc front end in nightly builds Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does: 1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option. 2. Set it up to serial front end for beta/stable builds via bootstrap. 3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel. r? `@oli-obk` cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2023-11-06Auto merge of #117607 - klensy:clang-17.0.4, r=Mark-Simulacrumbors-1/+1
bump clang version for dist-x86_64-linux from 17.0.2 to 17.0.4 This fixes few miscompiles, so nice to have. Release notes: https://discourse.llvm.org/t/llvm-17-0-3-released/74172 https://discourse.llvm.org/t/llvm-17-0-4-released/74548 >The next release will be 17.0.5, in two weeks 14th of November. Or maybe delay until 17.0.5?
2023-11-06Auto merge of #117585 - dnbln:feat/move-kw-span, r=cjgillotbors-20/+49
Add the `Span` of the `move` keyword to the HIR. This is required to implement a lint like the one described here: https://github.com/rust-lang/rust-clippy/issues/11721
2023-11-06use portable AtomicU64 for powerPC and MIPSSparrowLii-4/+28
2023-11-06Auto merge of #117576 - the8472:fix-io-copy-vec, r=Mark-Simulacrumbors-22/+54
Fix excessive initialization and reads beyond EOF in `io::copy(_, Vec<u8>)` specialization fixes #117545 and https://github.com/bczhc/bzip3-rs/pull/8
2023-11-05Auto merge of #96979 - SabrinaJewson:waker-update, r=workingjubileebors-1/+14
Override `Waker::clone_from` to avoid cloning `Waker`s unnecessarily This would be very useful for futures — I think it’s pretty much always what they want to do instead of `*waker = cx.waker().clone()`. Tracking issue: https://github.com/rust-lang/rust/issues/98287 r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs
2023-11-05Auto merge of #117191 - Skgland:easy-beta-channels, r=Mark-Simulacrumbors-0/+23
generate beta manifests as pre-requisit to rust-lang/rustup#1329 <https://github.com/rust-lang/rustup/issues/1329#issuecomment-1134946736> mentioned (a while ago) this would be the next step