about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-03-29Walk return-position impl trait in trait deeply in associated_item_def_idsMichael Goulet-21/+35
2023-03-28Auto merge of #109692 - Nilstrieb:rollup-hq65rps, r=Nilstriebbors-748/+1014
Rollup of 8 pull requests Successful merges: - #91793 (socket ancillary data implementation for FreeBSD (from 13 and above).) - #92284 (Change advance(_back)_by to return the remainder instead of the number of processed elements) - #102472 (stop special-casing `'static` in evaluation) - #108480 (Use Rayon's TLV directly) - #109321 (Erase impl regions when checking for impossible to eagerly monomorphize items) - #109470 (Correctly substitute GAT's type used in `normalize_param_env` in `check_type_bounds`) - #109562 (Update ar_archive_writer to 0.1.3) - #109629 (remove obsolete `givens` from regionck) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-28Auto merge of #108080 - oli-obk:FnPtr-trait, r=lcnrbors-180/+476
Add a builtin `FnPtr` trait that is implemented for all function pointers r? `@ghost` Rebased version of https://github.com/rust-lang/rust/pull/99531 (plus adjustments mentioned in the PR). If perf is happy with this version, I would like to land it, even if the diagnostics fix in 9df8e1befb5031a5bf9d8dfe25170620642d3c59 only works for `FnPtr` specifically, and does not generally improve blanket impls.
2023-03-28Rollup merge of #109629 - aliemjay:remove-givens, r=lcnrnils-152/+114
remove obsolete `givens` from regionck Revives #107376. The only change is the last commit (https://github.com/rust-lang/rust/pull/109629/commits/2a3177a8bcc4c5a5285dc2908a0f1ce98e9a6377) which should fix the regression. Fixes https://github.com/rust-lang/rust/issues/106567 r? `@lcnr`
2023-03-28Rollup merge of #109562 - bjorn3:update_ar_archive_writer, r=Mark-Simulacrumnils-4/+4
Update ar_archive_writer to 0.1.3 This updates object to 0.30 and fixes a bug where the symbol table would be omitted for archives where there are object files yet none that export any symbol. This bug could lead to linker errors for crates like rustc_std_workspace_core which don't contain any code of their own but exist solely for their dependencies. This is likely the cause of the linker issues I was experiencing on Webassembly. It has been shown to cause issues on other platforms too. cc rust-lang/ar_archive_writer#5
2023-03-28Rollup merge of #109470 - compiler-errors:gat-normalize-bound, r=jackh726nils-53/+67
Correctly substitute GAT's type used in `normalize_param_env` in `check_type_bounds` Given: ```rust trait Foo { type Assoc<T>: PartialEq<Self::Assoc<i32>>; } impl Foo for () { type Assoc<T> = Wrapper<T>; } struct Wrapper<T>(T); impl<T> PartialEq<Wrapper<i32>> for Wrapper<T> { } ``` We add an additional predicate in the `normalize_param_env` in `check_type_bounds` that is used to normalize the GAT's bounds to check them in the impl. Problematically, though, that predicate is constructed to be `for<^0> <() as Foo>::Assoc<^0> => Wrapper<T>`, instead of `for<^0> <() as Foo>::Assoc<^0> => Wrapper<^0>`. That means `Self::Assoc<i32>` in the bounds that we're checking normalizes to `Wrapper<T>`, instead of `Wrapper<i32>`, and so the bound `Self::Assoc<T>: PartialEq<Self::Assoc<i32>>` normalizes to `Wrapper<T>: PartialEq<Wrapper<T>>`, which does not hold. Fixes this by properly substituting the RHS of that normalizes predicate that we add to the `normalize_param_env`. That means the bound is properly normalized to `Wrapper<T>: PartialEq<Wrapper<i32>>`, which *does* hold. --- The second commit in this PR just cleans up some substs stuff and some naming. r? `@jackh726` cc #87900
2023-03-28Rollup merge of #109321 - compiler-errors:illegal-mono-w-regions, r=cjgillotnils-19/+48
Erase impl regions when checking for impossible to eagerly monomorphize items We were inserting `ReErased` for method substs, but not for impl substs, leading to the call for `subst_and_check_impossible_predicates` being a bit weaker than it should be (since it ignores predicates that need substitution -- incl early-bound regions). Fixes #109297
2023-03-28Rollup merge of #108480 - Zoxc:rayon-tlv, r=cuvipernils-71/+38
Use Rayon's TLV directly This accesses Rayon's `TLV` thread local directly avoiding wrapper functions. This makes rustc work with https://github.com/rust-lang/rustc-rayon/pull/10. r? `@cuviper`
2023-03-28Rollup merge of #102472 - lcnr:static-in-eval, r=jackh726nils-102/+151
stop special-casing `'static` in evaluation fixes #102360 I have no idea whether this actually removed all places where `'static` matters. Without canonicalization it's very easy to accidentally rely on `'static` again. Blocked on changing the `order_dependent_trait_objects` future-compat lint to a hard error r? `@nikomatsakis`
2023-03-28Rollup merge of #92284 - the8472:simplify-advance-by, r=scottmcmnils-326/+383
Change advance(_back)_by to return the remainder instead of the number of processed elements When advance_by can't advance the iterator by the number of requested elements it now returns the amount by which it couldn't be advanced instead of the amount by which it did. This simplifies adapters like chain, flatten or cycle because the remainder doesn't have to be calculated as the difference between requested steps and completed steps anymore. Additionally switching from `Result<(), usize>` to `Result<(), NonZeroUsize>` reduces the size of the result and makes converting from/to a usize representing the number of remaining steps cheap.
2023-03-28Rollup merge of #91793 - devnexen:anc_data_fbsd, r=ChrisDentonnils-21/+209
socket ancillary data implementation for FreeBSD (from 13 and above). introducing new build config as well.
2023-03-28Auto merge of #109557 - fee1-dead-contrib:mv-const-traits, r=oli-obkbors-311/+428
Move const trait bounds checks to MIR constck Fixes #109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck. r? `@oli-obk`
2023-03-28fix long lineDeadbeef-23/+25
2023-03-28Move const trait bounds checks to MIR constckDeadbeef-311/+426
Fixes #109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck.
2023-03-28Auto merge of #109690 - matthiaskrgr:rollup-6p5m0es, r=matthiaskrgrbors-37/+211
Rollup of 9 pull requests Successful merges: - #108548 (Clarify the 'use a constant in a pattern' error message) - #109565 (Improve documentation for E0223) - #109661 (Fix LVI test post LLVM 16 update) - #109667 (Always set `RUSTC_BOOTSTRAP` with `x doc`) - #109669 (Update books) - #109678 (Don't shadow the `dep_node` var in `incremental_verify_ich_failed`) - #109682 (Add `#[inline]` to CStr trait implementations) - #109685 (Make doc comment a little bit more accurate) - #109687 (Document the heuristics IsTerminal uses on Windows) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-28Rollup merge of #109687 - ↵Matthias Krüger-0/+9
joshtriplett:document-windows-isterminal-heuristics, r=BurntSushi Document the heuristics IsTerminal uses on Windows Suggested by `@BurntSushi.`
2023-03-28Rollup merge of #109685 - est31:not_llvm_but_backend, r=jyn514Matthias Krüger-1/+1
Make doc comment a little bit more accurate It queries not LLVM in particular but the codegen backend *in general*. While cranelift does not provide target features, other codegen backends do. Found while looking for [this answer](https://github.com/rust-lang/rust/issues/108680#issuecomment-1484324690).
2023-03-28Rollup merge of #109682 - clubby789:c-str-inline, r=scottmcmMatthias Krüger-0/+5
Add `#[inline]` to CStr trait implementations Fixes #109674 I noticed other usages of traits on `CStr` weren't being inlined, so also added hints to the other implementations
2023-03-28Rollup merge of #109678 - ↵Matthias Krüger-2/+1
compiler-errors:dont-shadow-in-incremental_verify_ich_failed, r=Nilstrieb Don't shadow the `dep_node` var in `incremental_verify_ich_failed` It's better to debug print `DepNode` instead of `ErrorGuaranteed` one line below :^) fixes #109676
2023-03-28Rollup merge of #109669 - rustbot:docs-update, r=ehussMatthias Krüger-0/+0
Update books ## rust-lang/nomicon 1 commits in 1f3e4cd4fd88b5b5d45feb86a11b6d2f93e5a974..b5f7500fc40775096c2bbd204eae096612cf9047 2023-03-27 13:47:36 UTC to 2023-03-27 13:47:36 UTC - Fix typo in 3.8 Subtyping and Variance (rust-lang/nomicon#395) ## rust-lang/reference 4 commits in 24c87f6663aed55b05d2cc286878f28f21918825..3c47807a3131b3c7cacb508f52632078d253cd0a 2023-03-26 18:42:43 UTC to 2023-03-14 18:28:23 UTC - Relax ordering rules for `asm!` operands (rust-lang/reference#1323) - Improve labeled blocks documentation (rust-lang/reference#1342) - Inline assembly: Fix repeated and unordered items in guaranteed directives (rust-lang/reference#1341) - Clarify that free constants are always evaluated at compile time (rust-lang/reference#1328) ## rust-lang/rust-by-example 7 commits in af0998b7473839ca75563ba3d3e7fd0160bef235..cfbfd648ce33926c3490f24de9a5b56cce404b88 2023-03-21 12:05:17 UTC to 2023-03-21 11:58:20 UTC - Fix two typos in the asm chapter (rust-lang/rust-by-example#1692) - Change `runtime` error to `compile time` error (rust-lang/rust-by-example#1690) - Fix tests running on non-x86 platforms. (rust-lang/rust-by-example#1687) - Remove trailing semicolon from macro expression (rust-lang/rust-by-example#1683) - Explained why it should not work in Chapter 4.1 (rust-lang/rust-by-example#1682) - Fix comment to mention the correct type of error (rust-lang/rust-by-example#1680) - Improve the content for `read_lines` (rust-lang/rust-by-example#1679) ## rust-lang/rustc-dev-guide 9 commits in b1b6d693cd1461e53de4132c1b183ace31cd36e5..d08baa166b463537229eeb737c4ccadabd83cf78 2023-03-26 17:55:53 UTC to 2023-03-14 03:50:20 UTC - Add locale_resources (rust-lang/rustc-dev-guide#1651) - Don't require $GITHUB_TOKEN to build locally (rust-lang/rustc-dev-guide#1652) - bootsrapping stages overview list (rust-lang/rustc-dev-guide#1555) - Update labels overview (rust-lang/rustc-dev-guide#1639) - first mention of type, and add a link (rust-lang/rustc-dev-guide#1643) - Add SIP solution for macOS users (rust-lang/rustc-dev-guide#1636) - Add chapter on fuzzing (rust-lang/rustc-dev-guide#1646) - Fix "Crate disambiguator" in libs-and-metadata.md (rust-lang/rustc-dev-guide#1648) - Update rustdoc-internals.md (rust-lang/rustc-dev-guide#1644)
2023-03-28Rollup merge of #109667 - clubby789:fix-stage0-doc, r=ozkanonurMatthias Krüger-4/+5
Always set `RUSTC_BOOTSTRAP` with `x doc` Fixes #100060 Note that there is still a warning - the `unused_allocation` lint does not fire in stage 0, but that's just a matter of waiting for #104363 to land in beta
2023-03-28Rollup merge of #109661 - ↵Matthias Krüger-7/+7
fortanix:raoul/EDP-107-fix_lvi_mitigation_tests_llvm_16, r=cuviper Fix LVI test post LLVM 16 update #109474 updated LLVM to 16. This causes the LVI mitigation tests for the `x86_64-fortanix-unknown-sgx` platform to fail. This PR fixes those tests again. cc: `@jethrogb`
2023-03-28Rollup merge of #109565 - WaffleLapkin:better_docs_for_e0223, r=oli-obkMatthias Krüger-13/+15
Improve documentation for E0223 See discussion in https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Inconsistency.20in.20prohibiting.20.60Type.3A.3AAssocType.60
2023-03-28Rollup merge of #108548 - jamen:master, r=compiler-errorsMatthias Krüger-10/+168
Clarify the 'use a constant in a pattern' error message ```rs use std::borrow::Cow; const ERROR_CODE: Cow<'_, str> = Cow::Borrowed("23505"); fn main() { let x = Cow::from("23505"); match x { ERROR_CODE => {} } } ``` ``` error: to use a constant of type `Cow` in a pattern, `Cow` must be annotated with `#[derive(PartialEq, Eq)]` --> src/main.rs:9:9 | 9 | ERROR_CODE => {} | ^^^^^^^^^^ error: could not compile `playground` due to previous error ``` It seems helpful to link to StructuralEq in this message. I was a little confused, because `Cow<'_, str>` implements PartialEq and Eq, but they're not derived, which I learned is necessary for structural equality and using constants in patterns (thanks to the Rust community Discord server) For tests, should I update every occurrence of this message? I see tests where this is still a warning and I'm not sure if I should update those.
2023-03-28Auto merge of #109577 - jonhoo:long-tar-names, r=Mark-Simulacrumbors-4/+3
[rust-installer] Allow long link names in tar files Without this, users trying to run `x.py dist` under a sufficiently long path run into problems when we build the resulting tarballs due to length limits in the original tar spec. The error looks like: Finished release [optimized + debuginfo] target(s) in 0.34s Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-musl) Building stage0 tool rust-installer (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.35s Dist rust-std-1.67.1-x86_64-unknown-linux-musl Error: failed to generate installer Caused by: 0: failed to tar file '/home/AAAAAAAAAAAAAA/BBBBBB/CCCC/DDD/EEEEE/FFFFFFFFFFFF/GGGGGGGGGGGGGGGG/HHHHHHHHHH/IIIIIIIIIIIIIII/JJJJJ/KKKKKKK/src/build/tmp/tarball/rust-std/x86_64-unknown-linux-musl/rust-std-1.67.1-x86_64-unknown-linux-musl/rust-std-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/libc.a' 1: provided value is too long when setting link name for Build completed unsuccessfully in 0:00:03 The fix is to make use of the widely-supported GNU tar extensions which lift this restriction. Switching to [`tar::Builder::append_link`] takes care of that for us. See also alexcrichton/tar-rs#273. [`tar::Builder::append_link`]: https://docs.rs/tar/0.4.38/tar/struct.Builder.html#method.append_link
2023-03-28Add "Platform-specific behavior" heading and link to changes disclaimerJosh Triplett-0/+5
2023-03-28Erase impl regions when checking for impossible to eagerly monomorphize itemsMichael Goulet-19/+48
2023-03-28Document the heuristics IsTerminal uses on WindowsJosh Triplett-0/+4
2023-03-28Auto merge of #109561 - raphamorim:master, r=cuviperbors-1/+1
Use llvm 16.0.0 instead of 16.0.0-rc4 for build-clang.sh Ref: https://github.com/rust-lang/rust/pull/107224 This PR doesn't make any update on LLVM submodule used by Rust repo, but would be super keen to update it, if necessary (https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html). LLVM 16.0.0 has been [released](https://discourse.llvm.org/t/llvm-16-0-0-release/69326) on March 18, while Rust 1.70 will become stable on June 1. - https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html
2023-03-28Make doc comment a little bit more accurateest31-1/+1
It queries not LLVM in particular but the codegen backend *in general*. While cranelift does not provide target features, other codegen backends do.
2023-03-28Add `#[inline]` to CStr trait implementationsclubby789-0/+5
2023-03-27Auto merge of #109440 - WaffleLapkin:make_tidy_slower, r=jyn514bors-67/+87
Don't skip all directories when tidy-checking This fixes a regression from https://github.com/rust-lang/rust/pull/108772 which basically made it that tidy style checks only `README.md` and `COMPILER_TESTS.md`.
2023-03-27no shadow plzMichael Goulet-2/+1
2023-03-27Auto merge of #109668 - GuillaumeGomez:rollup-j01if4b, r=GuillaumeGomezbors-156/+235
Rollup of 6 pull requests Successful merges: - #109330 (rustdoc: Fix ICE for intra-doc link on intermediate re-export) - #109354 (Remove the `NodeId` of `ast::ExprKind::Async`) - #109445 (Allow passing the --nocapture flag to compiletest) - #109512 (bump `askama_derive` to 0.12.1) - #109637 (Add missing needs-asm-support annotation to ui/simple_global_asm.rs) - #109666 (Correct ASCII case comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-27Bless tidyMaybe Waffle-11/+11
2023-03-27Remove useless Clone boundsMaybe Waffle-2/+2
2023-03-27Don't skip all directories when tidy-checkingMaybe Waffle-56/+76
2023-03-27Improve documentation for E0223Maybe Waffle-13/+15
2023-03-27Update booksrustbot-0/+0
2023-03-27Rollup merge of #109666 - clubby789:ascii-case-comment, r=fee1-deadGuillaume Gomez-1/+1
Correct ASCII case comment Fixes #109508
2023-03-27Rollup merge of #109637 - bjorn3:add_test_annotation, r=tmiaskoGuillaume Gomez-0/+1
Add missing needs-asm-support annotation to ui/simple_global_asm.rs
2023-03-27Rollup merge of #109512 - fee1-dead-contrib:bump-askama_derive, ↵Guillaume Gomez-36/+47
r=Mark-Simulacrum bump `askama_derive` to 0.12.1 Which uses syn 2.0. cc #109302
2023-03-27Rollup merge of #109445 - Teapot4195:issue-109407-fix, r=ozkanonurGuillaume Gomez-4/+13
Allow passing the --nocapture flag to compiletest closes #109407
2023-03-27Rollup merge of #109354 - Swatinem:rm-closureid, r=compiler-errorsGuillaume Gomez-64/+56
Remove the `NodeId` of `ast::ExprKind::Async` This is a followup to https://github.com/rust-lang/rust/pull/104833#pullrequestreview-1314537416. In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`. It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
2023-03-27Rollup merge of #109330 - ↵Guillaume Gomez-51/+117
GuillaumeGomez:intermediate-reexport-intra-doc-ice, r=petrochenkov rustdoc: Fix ICE for intra-doc link on intermediate re-export Fixes https://github.com/rust-lang/rust/issues/109282. This PR is based on #109266 as it includes its commit to make this work. `@petrochenkov:` It was exactly as you predicted, adding the `DefId` to the attributes fixed the error for intermediate re-exports as well. Thanks a lot! r? `@petrochenkov`
2023-03-27Always set `RUSTC_BOOTSTRAP` with `x doc`clubby789-4/+5
2023-03-27socket ancillary data implementation for FreeBSD (from 13 and above).David CARLIER-21/+209
introducing new build config as well.
2023-03-27Add notes to non-structural const in pattern error messageJamen Marz-10/+168
2023-03-27Fix ASCII case commentclubby789-1/+1
2023-03-27fix advance_by impl for vec_deque and add testsThe 8472-7/+30