about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-11-08target: move base specs to spec/baseDavid Wood-449/+453
Signed-off-by: David Wood <david@davidtw.co>
2023-11-08Auto merge of #117692 - matthiaskrgr:rollup-umaf5pr, r=matthiaskrgrbors-252/+334
Rollup of 4 pull requests Successful merges: - #113925 (Improve diagnostic for const ctors in array repeat expressions) - #116399 (Small changes w/ `query::Erase<_>`) - #117625 (Fix some clippy perf lints) - #117655 (Method suggestion code tweaks) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-08Rollup merge of #117655 - compiler-errors:method-tweaks, r=estebankMatthias Krüger-198/+178
Method suggestion code tweaks I was rummaging around the method suggestion code after https://github.com/rust-lang/rust/pull/117006#discussion_r1384153722 and saw a few things to simplify. This is two unrelated commits, both in the same file. Review them separately, if you'd like. r? estebank
2023-11-08Rollup merge of #117625 - nnethercote:clippy-perf, r=cuviperMatthias Krüger-20/+14
Fix some clippy perf lints `@matthiaskrgr` gave me the output of a clippy run with perf lints enabled. This PR fixes ones that I thought were worth fixing. r? `@cuviper`
2023-11-08Rollup merge of #116399 - WaffleLapkin:erase_small_things, r=cjgillotMatthias Krüger-6/+16
Small changes w/ `query::Erase<_>` r? `@cjgillot` cc `@Zoxc`
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-08rustdoc: minor changes suggested by clippy perf lints.Nicholas Nethercote-12/+10
2023-11-07Auto merge of #117672 - lqd:ci-gcc-lld, r=Kobzolbors-1/+7
ci: bump gcc on dist x64 linux builder to 9.5 Support for `-fuse-ld=lld` was added in GCC 9, so this PR bumps gcc to the latest 9.x release, to prepare for switching to LLD. `-Clinker-flavor=gnu-lld-cc -Clink-self-contained=+linker` will require our CI's GCC to understand `-fuse-ld=lld` when bootstrapping in a future where `x86_64-unknown-linux-gnu` is using `rust-lld` by default.
2023-11-08rustc: minor changes suggested by clippy perf lints.Nicholas Nethercote-8/+4
2023-11-07Add an explanation for `transmute_unchecked`Maybe Waffle-0/+9
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-07add note to remember to update a url when bumping to gcc 10.1.0Rémy Rakic-0/+6
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-07ci: bump gcc on dist x64 linux builder to 9.5Rémy Rakic-1/+1
Support for `-fuse-ld=lld` was added in GCC 9
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-07Rework print_disambiguation_helpMichael Goulet-113/+93
2023-11-07Yeet MethodCallComponentsMichael Goulet-90/+90
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