profile
viewpoint
Julian Knodt JulianKnodt hackreactor => Brigade San Fran https://julianknodt.github.io/ Just a programmer

JulianKnodt/artPanel 2

Render images in terminal

JulianKnodt/AN-Kotlin-Template 1

Android Kotlin Template

CoordinatedTortoises/ironic-anagrams 0

Legacy Project for The Coordinated Tortoises (Nick Olszowy, Pete Herbert, Clarabelle Cheng-Yue, Julian Knodt)

CoordinatedTortoises/server 0

All back-end files for ironic anagrams

GEOFBOT/afterthought 0

postscript interpreter

JulianKnodt/arm_sim 0

ARM emulator

push eventJulianKnodt/rust

kadmin

commit sha 605d520178cab32e2d1970ef3bea7ef67a60ce7f

Use more efficient scheme for display u128/i128 Add zero padding Add benchmarks for fmt u128 This tests both when there is the max amount of work(all characters used) And least amount of work(1 character used)

view details

push time in 2 hours

push eventJulianKnodt/rust

Jonas Schievink

commit sha 581524e53777a3721cad1b8c33323e3ef46c8aad

Rollup merge of #76441 - jyn514:parallel, r=jonas-schievink Note that parallel-compiler = true causes tests to fail Mentioning #75760.

view details

Jonas Schievink

commit sha e5389a4a34e640359ef04ebc99962e196c5bfabe

Rollup merge of #76527 - fusion-engineering-forks:cleanup-uninit, r=jonas-schievink Remove internal and unstable MaybeUninit::UNINIT. Looks like it is no longer necessary, as `uninit_array()` can be used instead in the few cases where it was needed. (I wanted to just add `#[doc(hidden)]` to remove clutter from the documentation, but looks like it can just be removed entirely.)

view details

Jonas Schievink

commit sha 148b24f7963e4242563dfb91455047426e60f140

Rollup merge of #76629 - pickfire:patch-4, r=jonas-schievink Simplify iter zip struct doc

view details

Jonas Schievink

commit sha f9b9467866cf828fb53789ee2a86700c0cf76b9a

Rollup merge of #76640 - fusion-engineering-forks:synconcecell-drop, r=matklad Simplify SyncOnceCell's `take` and `drop`. Prevents copies by using `assume_init_read` and `assume_init_drop`.

view details

Jonas Schievink

commit sha 3d0ac15958245f00f9f5d8a81ad619f5b4e49bca

Rollup merge of #76646 - CDirkx:mailmap, r=Mark-Simulacrum Add mailmap entry

view details

Jonas Schievink

commit sha e460f8508efb9551859ed7499fa011e17006ea32

Rollup merge of #76651 - nicholasbishop:bishop-remove-windows-note, r=Mark-Simulacrum Remove Windows details from Unix and VmWorks symlink() docstrings This note is not relevant to other operating systems.

view details

Jonas Schievink

commit sha 11a63bcdde74e16c58fad3296d1ed7da06121fc2

Rollup merge of #76663 - pickfire:patch-7, r=jonas-schievink Simplify iter chain struct doc

view details

Jonas Schievink

commit sha 305d63c2a430c5d252c21b51f4d24a4288d08062

Rollup merge of #76665 - RalfJung:slice-from-raw, r=sfackler slice::from_raw_parts: explicitly mention that data must be initialized This reflects the status quo, until the discussion in https://github.com/rust-lang/unsafe-code-guidelines/issues/77 reaches a conclusion.

view details

Jonas Schievink

commit sha 51cf121e6d5c633c819e37c6eea591bc8f2c8475

Rollup merge of #76667 - matklad:patch-llvm, r=Mark-Simulacrum Fix CI LLVM to work on NixOS out of the box r? @Mark-Simulacrum Tested locally, seems to work!

view details

Jonas Schievink

commit sha 7b7f6f919df54fda2655ac228b836e3c9701e7f7

Rollup merge of #76668 - pickfire:patch-9, r=jonas-schievink Add visualization of rustc span in doc It took me quite some time to figure out what Span::to means. A picture is worth a thousand words.

view details

Jonas Schievink

commit sha fe716d0447208825de8ddb815b31905d905950c7

Rollup merge of #76677 - RalfJung:stable-pointers, r=jonas-schievink note that test_stable_pointers does not reflect a stable guarantee Just to be sure...

view details

bors

commit sha 231444d989db23ab53001e29af53fa844e0b08a1

Auto merge of #6035 - matthiaskrgr:try_into_show_type, r=flip1995 useless_conversion: show type in error message. changelog: useless_conversion: show type in error message.

view details

Tshepang Lekhonkhobe

commit sha b7ce5b44dd2e0fa8d6f7131a246ecad77328921e

remove orphaned files Should been part of https://github.com/rust-lang/rust/pull/74163

view details

Joshua Nelson

commit sha 245f69ad3c16c1f7355c3901e131fa01b588bf36

Refactor `resolve_link` into a separate function

view details

Bastian Kauschke

commit sha e5b82a56c5a9dd5c40f2abe8ee5398fc8acdd4b4

allow concrete self types in consts

view details

Bastian Kauschke

commit sha c552717e9da86f70d49390bba1e4b305054d9ed4

review, improve note span

view details

Bastian Kauschke

commit sha 90dd798cf53320b3478119d06d2d8c47880c9247

bless tests

view details

Joshua Nelson

commit sha 7dc0d335bcc819c770320635a055c9cfe076339a

Refactor `resolve_with_disambiguator` into a separate function

view details

Joshua Nelson

commit sha 8a13fc494d4365e57d8f343219f0201458b68591

Require `module_id` param to `resolve` to be non-empty Previously, `resolve` would immediately check that `module_id` was non-empty and give an error if not. This had two downsides: - It introduced `Option`s everywhere, even if the calling function knew it had a valid module, and - It checked the module on each namespace, which is unnecessary: it only needed to be checked once. This makes the caller responsible for checking the module exists, making the code a lot simpler.

view details

Rich Kadel

commit sha 79aa9b15d7403ce2dc40b525a1d16e6c4ad1973c

Optimize behavior of vec.split_off(0) (take all) Optimization improvement to `split_off()` so the performance meets the intuitively expected behavior when `at == 0`, avoiding the current behavior of copying the entire vector. The change honors documented behavior that the method leaves the original vector's "previous capacity unchanged". This improvement better supports the pattern for building and flushing a buffer of elements, such as the following: ```rust let mut vec = Vec::new(); loop { vec.push(something); if condition_is_met { process(vec.split_off(0)); } } ``` `Option` wrapping is the first alternative I thought of, but is much less obvious and more verbose: ```rust let mut capacity = 1; let mut vec: Option<Vec<Stuff>> = None; loop { vec.get_or_insert_with(|| Vec::with_capacity(capacity)).push(something); if condition_is_met { capacity = vec.capacity(); process(vec.take().unwrap()); } } ``` Directly applying `mem::replace()` could work, but `mem::` functions are typically a last resort, when a developer is actively seeking better performance than the standard library provides, for example. The benefit of the approach to this change is it does not change the existing API contract, but improves the peformance of `split_off(0)` for `Vec`, `String` (which delegates `split_off()` to `Vec`), and any other existing use cases. This change adds tests to validate the behavior of `split_off()` with regard to capacity, as originally documented, and confirm that behavior still holds, when `at == 0`. The change is an implementation detail, and does not require a documentation change, but documenting the new behavior as part of its API contract may benefit future users. (Let me know if I should make that documentation update.) Note, for future consideration: I think it would be helpful to introduce an additional method to `Vec` (if not also to `String`): ``` pub fn take_all(&mut self) -> Self { self.split_off(0) } ``` This would make it more clear how `Vec` supports the pattern, and make it easier to find, since the behavior is similar to other `take()` methods in the Rust standard library.

view details

push time in 2 hours

push eventJulianKnodt/rust

Tyler Mandry

commit sha 0d20cf8568114986c4ed8eddcb91c5a998383ad7

Rollup merge of #76481 - moonheart08:vec_deque_constify, r=sfackler Convert repetitive target_pointer_width checks to const solution. Simply a quick code tidying change. Not sure if more needs to be said.

view details

Tyler Mandry

commit sha 342b40628542a5a505e4ac0a8e747edad99a2081

Rollup merge of #76493 - moonheart08:unique-quick, r=jyn514 Remove a stray ignore-tidy-undocumented-unsafe There were no undocumented unsafe blocks in the file. This shouldn't require any special review.

view details

Tyler Mandry

commit sha c18fa460a41066fee1489b725425e8d0eb8e8f0c

Rollup merge of #76504 - Flying-Toast:master, r=lcnr Capitalize safety comments

view details

Tyler Mandry

commit sha 98f59bc2aab4b76c97360991cc99289be1b077ed

Rollup merge of #76515 - jumbatm:issue76496-reproducibility-regression, r=oli-obk SessionDiagnostic: Fix non-determinism in generated format string. Fixes #76496. r? @oli-obk

view details

Tyler Mandry

commit sha 09a364e9842d3a2852a10664bd0989fdbb82fdde

Rollup merge of #76516 - pietroalbini:github-releases, r=Mark-Simulacrum Enable GitHub Releases synchronization This PR enables the triagebot feature to automatically populate [GitHub Releases](https://github.com/rust-lang/rust/releases) for this repository based on the changelog. See https://github.com/rust-lang/triagebot/pull/811 for the implementation of this feature on triagebot's side, and more insights on how it works. Note: once this lands people subscribed to the ~~firehose~~ rust-lang/rust repository will probably receive a ton of notifications for all the releases being created, but this should be a one-time thing. r? @Mark-Simulacrum cc @rust-lang/release

view details

Tyler Mandry

commit sha 09c614948f2499322151a12cea704885dc28f42f

Rollup merge of #76522 - matthiaskrgr:redundant_clone, r=jonas-schievink remove redundant clones (clippy::redundant_clone)

view details

Tyler Mandry

commit sha 32714eb6bc3cbfe48774e85472ad8431fba3c7c8

Rollup merge of #76523 - tmiasko:non-use-context-coverage, r=wesleywiser Remove unused PlaceContext::NonUse(NonUseContext::Coverage) r? @richkadel / @wesleywiser

view details

bors

commit sha 97eb606e4b2becd17d46a67d87169f52b210e67c

Auto merge of #76540 - tmandry:rollup-5ogt8x0, r=tmandry Rollup of 14 pull requests Successful merges: - #75094 (Add `-Z combine_cgu` flag) - #75984 (Improve unresolved use error message) - #76141 (Address review comments about config.toml from rustc-dev-guide PR) - #76313 (Improved the MIR spanview output) - #76430 (Add align to rustc-attrs unstable book) - #76465 (Add a script to automatically update Rust/Clang versions in documentation) - #76473 (Add missed spaces to GCC-WARNING.txt) - #76481 (Convert repetitive target_pointer_width checks to const solution.) - #76493 (Remove a stray ignore-tidy-undocumented-unsafe) - #76504 (Capitalize safety comments) - #76515 (SessionDiagnostic: Fix non-determinism in generated format string.) - #76516 (Enable GitHub Releases synchronization) - #76522 (remove redundant clones) - #76523 (Remove unused PlaceContext::NonUse(NonUseContext::Coverage)) Failed merges: r? `@ghost`

view details

Stein Somers

commit sha f42dac0ce04e372d413dcc374f2e0cf1e40dff6a

Document btree's unwrap_unchecked

view details

Tomasz Miąsko

commit sha 00e64ba476fa5bbc515bd6ff11151f8064748e88

Validate removal of AscribeUserType, FakeRead, and Shallow borrow Those statements are removed by CleanupNonCodegenStatements pass in drop lowering phase, and should not occur afterwards.

view details

Tyler Mandry

commit sha fdff7defc9a21fc63a1586efab87694723144793

Revert "Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov" This reverts commit 85cee57fd791d670d92dc61e0ad71594128dd45a, reversing changes made to b4d387302416c90a3f70211770292d8d8ab5e07d.

view details

Andrew Lilley Brinker

commit sha 01bf35010fb76154475fb722773731073fb50fa3

Reword `trivial_casts` lint to better explain. The current description of the trivial casts lint under the "allowed by default" listing in the rustc book indicates the lint is for lints which may be removed, which is less clear than saying it's for lints which may be replaced by coercion (which is the wording used by the error message included in the doc). This commit changes the wording slightly to better describe what the lint does.

view details

Tyler Mandry

commit sha f09372ab609236510187bd61ab1c6b30cfa69014

Rollup merge of #74787 - petrochenkov:rustllvm, r=cuviper Move `rustllvm` into `compiler/rustc_llvm` The `rustllvm` directory is not self-contained, it contains C++ code built by a build script of the `rustc_llvm` crate which is then linked into that crate. So it makes sense to make `rustllvm` a part of `rustc_llvm` and move it into its directory. I replaced `rustllvm` with more obvious `llvm-wrapper` as the subdirectory name, but something like `llvm-adapter` would work as well, other suggestions are welcome. To make things more confusing, the Rust side of FFI functions defined in `rustllvm` can be found in `rustc_codegen_llvm` rather than in `rustc_llvm`. Perhaps they need to be moved as well, but this PR doesn't do that. The presence of multiple LLVM-related directories in `src` (`llvm-project`, `rustllvm`, `librustc_llvm`, `librustc_codegen_llvm` and their predecessors) historically confused me and made me wonder about their purpose. With this PR we will have LLVM itself (`llvm-project`), a FFI crate (`rustc_llvm`, kind of `llvm-sys`) and a codegen backend crate using LLVM through the FFI crate (`rustc_codegen_llvm`).

view details

Tyler Mandry

commit sha fa56cf537ffbb5a1614692422c4f0c728eea037f

Rollup merge of #76458 - mbrubeck:hash_drain_filter, r=Amanieu Add drain_filter method to HashMap and HashSet Add `HashMap::drain_filter` and `HashSet::drain_filter`, implementing part of rust-lang/rfcs#2140. These new methods are unstable. The tracking issue is #59618. The added iterators behave the same as `BTreeMap::drain_filter` and `BTreeSet::drain_filter`, except their iteration order is arbitrary. The unit tests are adapted from `alloc::collections::btree`. This branch rewrites `HashSet` to be a wrapper around `hashbrown::HashSet` rather than `std::collections::HashMap`. (Both are themselves wrappers around `hashbrown::HashMap`, so the in-memory representation is the same either way.) This lets `std` re-use more iterator code from `hashbrown`. Without this change, we would need to duplicate much more code to implement `HashSet::drain_filter`. This branch also updates the `hashbrown` crate to version 0.9.0. Aside from changes related to the `DrainFilter` iterators, this version only changes features that are not used in libstd or rustc. And it updates `indexmap` to version 1.6.0, whose only change is compatibility with `hashbrown` 0.9.0.

view details

Tyler Mandry

commit sha 9fa079420354c4a416e1dac232dcaa09e4313117

Rollup merge of #76472 - matthiaskrgr:llvm_cmake_vars, r=Mark-Simulacrum rustbuild: don't set PYTHON_EXECUTABLE and WITH_POLLY cmake vars since they are no longer supported by llvm This resolves CMake Warning: Manually-specified variables were not used by the project: PYTHON_EXECUTABLE WITH_POLLY

view details

Tyler Mandry

commit sha d013e60ad479e086aae044a2e613510976bcb261

Rollup merge of #76497 - camelid:intra-doc-links-for-core-ptr, r=jyn514 Use intra-doc links in `core::ptr` Part of #75080. The only link that I did not change is a link to a function on the `pointer` primitive because intra-doc links for the `pointer` primitive don't work yet (see #63351). --- @rustbot modify labels: A-intra-doc-links T-doc

view details

Tyler Mandry

commit sha ba6e2b3a31c3f63db69880b8d74eae3faf73947d

Rollup merge of #76500 - richkadel:mir-graphviz-dark, r=tmandry Add -Zgraphviz_dark_mode and monospace font fix Many developers use a dark theme with editors and IDEs, but this typically doesn't extend to graphviz output. When I bring up a MIR graphviz document, the white background is strikingly bright. This new option changes the colors used for graphviz output to work better in dark-themed UIs. <img width="1305" alt="Screen Shot 2020-09-09 at 3 00 31 PM" src="https://user-images.githubusercontent.com/3827298/92659478-4b9bff00-f2ad-11ea-8894-b40d3a873cb9.png"> Also fixed the monospace font for common graphviz renders (e.g., VS Code extensions), as described in https://github.com/rust-lang/rust/pull/76500#issuecomment-689837948 **Before:** <img width="943" alt="Screen Shot 2020-09-09 at 2 48 44 PM" src="https://user-images.githubusercontent.com/3827298/92658939-47231680-f2ac-11ea-97ac-96727e4dd622.png"> **Now with fix:** <img width="943" alt="Screen Shot 2020-09-09 at 2 49 02 PM" src="https://user-images.githubusercontent.com/3827298/92658959-51451500-f2ac-11ea-9aae-de982d466d6a.png">

view details

Tyler Mandry

commit sha 8bf03c3f62bf750ddde66b0bd566a674674b6226

Rollup merge of #76543 - ssomers:btree_cleanup_4, r=Mark-Simulacrum Document btree's unwrap_unchecked #74693's second wind

view details

Tyler Mandry

commit sha 193503eb62aba269b505b99dc1c143645a115e31

Rollup merge of #76556 - tmandry:revert-76285, r=tmandry Revert #76285 Fixes #76399. Reverting because the issue is P-critical and there are no PRs up to fix it. r? @Mark-Simulacrum cc @matklad @dtolnay

view details

bors

commit sha a1894e4afe1a39f718cc27232a5a2f0d02b501f6

Auto merge of #76558 - tmandry:rollup-bskim2r, r=tmandry Rollup of 7 pull requests Successful merges: - #74787 (Move `rustllvm` into `compiler/rustc_llvm`) - #76458 (Add drain_filter method to HashMap and HashSet) - #76472 (rustbuild: don't set PYTHON_EXECUTABLE and WITH_POLLY cmake vars since they are no longer supported by llvm) - #76497 (Use intra-doc links in `core::ptr`) - #76500 (Add -Zgraphviz_dark_mode and monospace font fix) - #76543 (Document btree's unwrap_unchecked) - #76556 (Revert #76285) Failed merges: r? `@ghost`

view details

push time in 2 days

issue commentrust-lang/rust

Tracking issue for slice_partition_at_index

What about something like bisect_at_* or bisect_nth_*? Altho I worry that bisect is not used commonly enough for it to be immediately clear. I personally am fine with any name, but bisect seems to fit what is missing.

Mokosha

comment created time in 4 days

issue commentrust-lang/rust

Tracking Issue for `array_map`

Hm, fair questions. It does usually make sense to take &self since you'd need to make a whole new array of items, but if you want to take ownership of the elements, maybe there is a use case I imagine that probably finding an iterator solution there might be more elegant and is in the works. It would be helpful to post this in the general issues, and link to this Tracking issue for this sort of thing. For &mut self, if you want to modify elements in place, I think it makes most sense to just use a for loop over the elements and modify them that way instead of thru a method.

JulianKnodt

comment created time in 4 days

pull request commentrust-lang/rust

Use less divisions in display u128/i128

No worries, this is not important at all, just a minor optimization, so if there are more pressing things those should take priority.

JulianKnodt

comment created time in 9 days

issue commentmitsuba-renderer/mitsuba2

[🐛 bug report] Runtime Error with Unhelpful Messages

ah I was running on a shared server where I didn't have direct access to the resources, so I think I had to expose something more to my local env to get it to work. It probably depends a lot on your specific environment to debug by checking in usr/lib/ to see if the correct nvidia headers are there

JulianKnodt

comment created time in 9 days

push eventJulianKnodt/rust

kadmin

commit sha f240abc1dc9e59bfabfb5ea765fa9eae0aad3122

Add array window fn Updated issue to #75027 Update to rm oob access And hopefully fix docs as well Fixed naming conflict in test Fix test which used 1-indexing Nth starts from 0, woops Fix a bunch of off by 1 errors See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a Add even more off by 1 errors And also write `next` and `next_back` in terms of `nth` and `nth_back`. Run fmt Fix forgetting to change fn name in test add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha 8af967715a6ef4e77b7f5debff367af4f606aced

Add array window fn Updated issue to #75027 Update to rm oob access And hopefully fix docs as well Fixed naming conflict in test Fix test which used 1-indexing Nth starts from 0, woops Fix a bunch of off by 1 errors See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a Add even more off by 1 errors And also write `next` and `next_back` in terms of `nth` and `nth_back`. Run fmt Fix forgetting to change fn name in test add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha a5fc8d3c75d1a37a3be4634be0c8aba80471dd9b

Add array window fn Updated issue to #75027 Update to rm oob access And hopefully fix docs as well Fixed naming conflict in test Fix test which used 1-indexing Nth starts from 0, woops Fix a bunch of off by 1 errors See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a Add even more off by 1 errors And also write `next` and `next_back` in terms of `nth` and `nth_back`. Run fmt Fix forgetting to change fn name in test add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha fb832d07f9c9c7002d976e5bbb161414dc01d61c

Add array window fn Updated issue to #75027 Update to rm oob access And hopefully fix docs as well Fixed naming conflict in test Fix test which used 1-indexing Nth starts from 0, woops Fix a bunch of off by 1 errors See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a Add even more off by 1 errors And also write `next` and `next_back` in terms of `nth` and `nth_back`. Run fmt Fix forgetting to change fn name in test add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha a739978cf62b4e3a340ad6d5188560bb66e21239

Add array window fn Updated issue to #75027 Update to rm oob access And hopefully fix docs as well Fixed naming conflict in test Fix test which used 1-indexing Nth starts from 0, woops Fix a bunch of off by 1 errors See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a Add even more off by 1 errors And also write `next` and `next_back` in terms of `nth` and `nth_back`. Run fmt Fix forgetting to change fn name in test add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha 833910b80ba466372f83b4c74418cd15f7af7eb6

Add array window fn Updated issue to #75027 Update to rm oob access And hopefully fix docs as well Fixed naming conflict in test Fix test which used 1-indexing Nth starts from 0, woops Fix a bunch of off by 1 errors See https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=757b311987e3fae1ca47122969acda5a Add even more off by 1 errors And also write `next` and `next_back` in terms of `nth` and `nth_back`. Run fmt Fix forgetting to change fn name in test add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha c686cc6f92bef1768aec10f7fdc921455d12a33a

add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha fb3f8ec8cd9505e6caa415711680daf8c4847620

add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha 5f3b08a9623914ea298445e0614311a54a11d065

add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha bdae194c8ac4ff404e783f4889d888817356746b

add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha 6e315ba7599320bad89fbce9f4247a304e75d4f3

add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

kadmin

commit sha 22c45eee7499f610175662a0044deae5e1744dfb

add nth_back test & document unsafe Remove as_ref().unwrap() Documented occurrences of unsafe, noting what invariants are maintained

view details

push time in 12 days

push eventJulianKnodt/rust

Marcel Hellwig

commit sha 73e27b3e18dcbbef3a36620c4a44306e2bbdcd13

deny(unsafe_op_in_unsafe_fn) in libstd/process.rs

view details

Ivan Tham

commit sha a7468705cbf0fb551b8b1d8b420123262f7d92b2

Use translated variable for test string Test should be educative, added english translation and pronounciation.

view details

CDirkx

commit sha ea5dc0909ea1ed4135f1bdecbaa3423051be578d

Make some Ordering methods const Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Stabilizes these methods as const under the `const_ordering` feature. Also adds a test for these methods in a const context. Possible because of #49146 (Allow `if` and `match` in constants).

view details

Jethro Beekman

commit sha 0b5e681f5af0d3989b49121969f09cf29f029263

Improve SGX RWLock initializer test

view details

Tomasz Miąsko

commit sha 9daf8fd5b1d369cd2f91ac919dc5d17f4fd43c0c

inliner: Emit storage markers for introduced arg temporaries When introducing argument temporaries during inlining, emit storage marker statements just before the assignment and in the beginning of the return block. This ensures that such temporaries will not be considered live across yield points after inlining inside a generator.

view details

Bastian Kauschke

commit sha ccf1f580812b25eda231d4f2ac2e20c445fe7b62

rustdoc: fix min_const_generics with ty::Param

view details

Christiaan Dirkx

commit sha 79d563c819483eaf6e67b6aaaef9d0ca6030337d

Move const tests for `Ordering` to `library\core` Part of #76268

view details

Tomasz Miąsko

commit sha b54386ab7a9da8a4f22db3a35a9ec7b0f2b98b6c

Detect overflow in proc_macro_server subspan

view details

Tomasz Miąsko

commit sha d98bac4e4e3cc87ec9b848c173d570ebe2aa30b6

Add tests for overflow in Vec::drain

view details

Tomasz Miąsko

commit sha f8cfb2f5ad847b871399dfef9b8b8ff4e84a75cb

Add tests for overflow in String / VecDeque operations using ranges

view details

Tomasz Miąsko

commit sha 01510612ee20d14a3397427891a4042a34d53956

NRVO: Allow occurrences of the return place in var debug info The non-use occurrence of the return place in var debug info does not currently inhibit NRVO optimization, but it will fail assertion in `visit_place` when optimization is performed. Relax assertion check to allow the return place in var debug info. This case might be impossible to hit in optimization pipelines as of now, but can be encountered in customized mir-opt-level=2 pipeline with copy propagation disabled. For example in: ``` pub fn b(s: String) -> String { a(s) } #[inline] pub fn a(s: String) -> String { let x = s; let y = x; y } ```

view details

Joshua Nelson

commit sha 3797f29aadb51ed038e8b9eaf1b2098cfa26d547

[WIP] give better errors for broken intra doc links

view details

Joshua Nelson

commit sha f45e7b586259b795babf49231cd7de4a4534a2e7

Update .stderr

view details

Joshua Nelson

commit sha 4ace4e75201d5bfc187bd40cf918cd2df6009419

Use fewer `.to_string()`s

view details

Joshua Nelson

commit sha fcb21999a7989792c9405a89e9c788ac143e0574

Report if the thing exists in another namespace

view details

Joshua Nelson

commit sha 42bed035001b9a0bd6282326a243a926ea3d0424

Pass on the DefId so rustdoc can name it in suggestions Look at this beauty: ```rust error: unresolved link to `S::h` --> intra-link-errors.rs:51:6 | 51 | /// [type@S::h] | ^^^^^^^^^ help: to link to the associated function, use its disambiguator: `S::h()` | = note: this link resolves to the associated function `h`, which is not in the type namespace ```

view details

Joshua Nelson

commit sha f4e6ebd11aaea9fc412d78371fd3060468625056

Fix tests and improve error message if `::` isn't found

view details

Joshua Nelson

commit sha 002d3a922c06c11a45e001d2737951a00e40687a

Don't give misleading errors for `f::A`, where f is in the value namespace

view details

Joshua Nelson

commit sha 7b8d0befd67ad2472052e3f84cf310b7866b829f

Remove some TODOs

view details

Joshua Nelson

commit sha e2d69f2eb115b0b6a433977ae7c5a73c249a4f98

Make errors more concise and helpful Before: ``` = note: this link partially resolves to the struct `S` = note: no `fmt` in `S` ``` After: ``` = note: the struct `S` has no field or associated item named `fmt` ```

view details

push time in 12 days

pull request commentrust-lang/rust

Add array_windows fn

This seems to be a spurious error, is it possible for tests to be rerun?

JulianKnodt

comment created time in 16 days

push eventJulianKnodt/rust

Jon Gjengset

commit sha 2f96ce89d03b248c269513b011d328bff2c8dc21

Stabilize deque_make_contiguous Closes #70929.

view details

Christian Duerr

commit sha f3d7645fb79d641de447d4af02d5f3cee91b4af3

Add trailing comma support to matches macro

view details

dylni

commit sha bb70e52f5f5ee25012193f9f4f4372702b97b20e

Add `slice::check_range`

view details

dylni

commit sha 202b242d87c30c2fe1475342f9b93a8dfc65cd17

Fix links

view details

dylni

commit sha ed02b90e9b76b9ce2e8e99a99dbadd96ab4dfb42

Fix links again

view details

Ivan Tham

commit sha 2b7f87b5fa43336ed1237747f60fd9095a41ea3d

Liballoc tweak use *const T instead of *const i8 *const T is also used in the same parts and also used for arith_offset.

view details

Ivan Tham

commit sha cc0d6345500932e8118ba65e98944a6a3bac3277

Liballoc IntoIter limit unsafe to pointer arithmethic

view details

Ivan Tham

commit sha 50315238aa8ffae08f29b260aa36511e03b5e070

Liballoc DoubleEndedIterator limit unsafe to pointer arithmethic

view details

The8472

commit sha 1316c786a08344c965a97b1b67c76a300a479eec

Workaround for copy_file_range spuriously returning EOPNOTSUPP when attemted on a NFS mount under RHEL/CentOS 7. The syscall is supposed to return ENOSYS in most cases but when calling it on NFS it may leak through EOPNOTSUPP even though that's supposed to be handled by the kernel and not returned to userspace. Since it returns ENOSYS in some cases anyway this will trip the HAS_COPY_FILE_RANGE detection anyway, so treat EOPNOTSUPP as if it were a ENOSYS. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.8_release_notes/deprecated_functionality#the_literal_copy_file_range_literal_call_has_been_disabled_on_local_file_systems_and_in_nfs https://bugzilla.redhat.com/show_bug.cgi?id=1783554

view details

The8472

commit sha f0783632d315db90c0ca34d79d56207d132f3764

more concise error matching

view details

CDirkx

commit sha 6b0d44e92a529962792d3a5f1e7b44b6e3c6ed05

Make some Ordering methods const Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Possible because of #49146 (Allow `if` and `match` in constants).

view details

The8472

commit sha 4ddedd521418d67e845ecb43dc02c09b0af53022

perform copy_file_range until EOF is reached instead of basing things on file size This solves several problems - race conditions where a file is truncated while copying from it. if we blindly trusted the file size this would lead to an infinite loop - proc files appearing empty to copy_file_range but not to read/write https://github.com/coreutils/coreutils/commit/4b04a0c - copy_file_range returning 0 for some filesystems (overlay? bind mounts?) inside docker, again leading to an infinite loop

view details

dylni

commit sha d04e6b8de5fe6bbf203c534c35e6f55e8960ab46

Replace ad hoc implementations with `slice::check_range`

view details

Yuki Okushi

commit sha 18ad5a594ec4ee039897eb03d90dfeb117b4c6d6

Add a regression test for issue-72793

view details

Stein Somers

commit sha e5f9d7ff92f62cde3ef1b7301ac4ac3adab990d9

BTreeMap: introduce marker::ValMut and reserve marker::Mut for unique access

view details

Tim Nielens

commit sha 2ecc2ac864739cff6aed2609021e2467dedb117a

unit-arg - improve suggestion

view details

dylni

commit sha d9e877fb98212a47dd425e145b8b3e4283e6b487

Add more information to safety comment

view details

Yoshua Wuyts

commit sha 688f4471fd553c83ae3ff0306956d89b7d7c2d28

Stabilize future readiness fns

view details

Camelid

commit sha acd396225e0228f297474524396e08e0f594347e

Fix typo in release notes

view details

Amjad Alsharafi

commit sha d39cc45cf251be63f3066c6002d409274aa9d2a4

Added a lot of min_const_generics revisions

view details

push time in 16 days

push eventJulianKnodt/rust

kadmin

commit sha 14ab09a24f0bf012bb9d09c929e0f323f0a994a0

Add fix to error msg which relied on order Previously types needed to be ordered before consts. Since relaxing that restriction, this created a bug wherever relying on that. This produces a strange error message, so it's not awful but should still be fixed. Add ParamKindOrd instead of &str Switches from using strings to ParamKindOrd, as dealing with enums provides better guarantees to not miss things. Add test Add new loop for checking types/consts Update to check const & type in 1 loop

view details

push time in 16 days

push eventJulianKnodt/rust

kadmin

commit sha 4b132eefb48880a7a3781efe844d13845b070c07

Initial commit

view details

kadmin

commit sha 8d9187597a5e8ebcf17acba6b234884252b1a543

Update to use multipart suggestion Nice.

view details

kadmin

commit sha 96bb2c86f2cfe03ad870d12b3b838e8b75eb1978

Add further tests and liberalize type checking

view details

Vadim Petrochenkov

commit sha 8754884b78ee6cff99bd72ebdab39629f6ff88c3

rustbuild: Do not use `rust-mingw` component when bootstrapping windows-gnu targets

view details

Stein Somers

commit sha 2b54ab880c1803ff1178205b9b0a1c02238c37bf

BTreeMap: pull the map's root out of NodeRef

view details

Mark Rousskov

commit sha 4f2d94180ddffcb23cb1f3682242df735eeac03f

Only copy LLVM into rust-dev with internal LLVM This avoids needing to figure out where to locate each of the components with an external LLVM.

view details

Aaron Hill

commit sha de4bd9f0f8aeb4b89e55ba33b755c9a93e999e1c

Attach `TokenStream` to `ast::Block` A `Block` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher

view details

Aaron Hill

commit sha 1823dea7df9e125022dfda8126b6713f142f0e73

Attach `TokenStream` to `ast::Ty` A `Ty` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher

view details

Aaron Hill

commit sha d5a04a9927d1685d63f1d59039ea7dd03ee090a5

Collect tokens when handling `:literal` matcher An `NtLiteral` just wraps an `Expr`, so we don't need to add a new `tokens` field to an AST struct.

view details

Aaron Hill

commit sha 3815e91ccd8c7c8ed564476425bca6f1dc5e9607

Attach tokens to `NtMeta` (`ast::AttrItem`) An `AttrItem` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher

view details

Aaron Hill

commit sha 55082ce41334d9685d619182e71b84b495a6aff8

Attach `TokenStream` to `ast::Path`

view details

Aaron Hill

commit sha c1011165e63480dabf1913e308da8b344dfa8f8a

Attach `TokenStream` to `ast::Visibility` A `Visibility` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher

view details

Aaron Hill

commit sha 156ef2bee8f3941d4d7e3414652b803348ccd165

Attach tokens to `ast::Stmt` We currently only attach tokens when parsing a `:stmt` matcher for a `macro_rules!` macro. Proc-macro attributes on statements are still unstable, and need additional work.

view details

Aaron Hill

commit sha fec047907572ef84bf128da9c4026e5ae5bcaa34

Fully integrate token collection for additional AST structs This commit contains miscellaneous changes that don't fit into any of the other commits in this PR

view details

bors

commit sha ee04f9a4dac3e72914862e9f2046eee70aedcbfd

Auto merge of #74437 - ssomers:btree_no_root_in_noderef, r=Mark-Simulacrum BTreeMap: move up reference to map's root from NodeRef Since the introduction of `NodeRef` years ago, it also contained a mutable reference to the owner of the root node of the tree (somewhat disguised as *const). Its intent is to be used only when the rest of the `NodeRef` is no longer needed. Moving this to where it's actually used, thought me 2 things: - Some sort of "postponed mutable reference" is required in most places that it is/was used, and that's exactly where we also need to store a reference to the length (number of elements) of the tree, for the same reason. The length reference can be a normal reference, because the tree code does not care about tree length (just length per node). - It's downright obfuscation in `from_sorted_iter` (transplanted to #75329) - It's one of the reasons for the scary notice on `reborrow_mut`, the other one being addressed in #73971. This does repeat the raw pointer code in a few places, but it could be bundled up with the length reference. r? `@Mark-Simulacrum`

view details

bors

commit sha 94b4de0e0793c8921d30e0fb886be712d17db6e5

Auto merge of #75800 - Aaron1011:feature/full-nt-tokens, r=petrochenkov Attach tokens to all AST types used in `Nonterminal` We perform token capturing when we have outer attributes (for nonterminals that support attributes - e.g. `Stmt`), or when we parse a `Nonterminal` for a `macro_rules!` argument. The full list of `Nonterminals` affected by this PR is: * `NtBlock` * `NtStmt` * `NtTy` * `NtMeta` * `NtPath` * `NtVis` * `NtLiteral` Of these nonterminals, only `NtStmt` and `NtLiteral` (which is actually just an `Expr`), support outer attributes - the rest only ever have token capturing perform when they match a `macro_rules!` argument. This makes progress towards solving https://github.com/rust-lang/rust/issues/43081 - we now collect tokens for everything that might need them. However, we still need to handle `#[cfg]`, inner attributes, and misc pretty-printing issues (e.g. #75734) I've separated the changes into (mostly) independent commits, which could be split into individual PRs for each `Nonterminal` variant. The purpose of having them all in one PR is to do a single Crater run for all of them. Most of the changes in this PR are trivial (adding `tokens: None` everywhere we construct the various AST structs). The significant changes are: * `ast::Visibility` is changed from `type Visibility = Spanned<VisibilityKind>` to a `struct Visibility { kind, span, tokens }`. * `maybe_collect_tokens` is made generic, and used for both `ast::Expr` and `ast::Stmt`. * Some of the statement-parsing functions are refactored so that we can capture the trailing semicolon. * `Nonterminal` and `Expr` both grew by 8 bytes, as some of the structs which are stored inline (rather than behind a `P`) now have an `Option<TokenStream>` field. Hopefully the performance impact of doing this is negligible.

view details

bors

commit sha f5b7dd8181b0f483a890f8f3c19d08d6de03a444

Auto merge of #76381 - petrochenkov:nomingwcomp, r=Mark-Simulacrum rustbuild: Do not use `rust-mingw` component when bootstrapping windows-gnu targets Addresses https://github.com/rust-lang/rust/pull/76326#issuecomment-687273473 (ancient `x86_64-w64-mingw32-gcc` is selected as a linker wrapper, which is not usable in `use_lld=true` mode). Perhaps the comment about incompatible mingw was true in the past, but many things changed since then. With this change I was able to build everything successfully locally using a newer mingw toolchain, if it passes through the older toolchain on CI, then it should be good, I think.

view details

bors

commit sha a7425476e81207c7ff3d229b69172e78a732da5d

Auto merge of #75611 - JulianKnodt:cg_enum_err, r=lcnr Add help note when using type in place of const This adds a small help note when it might be possible that wrapping a parameter in braces might resolve the issue of having a type where a const was expected. Currently, I am displaying the `HirId`, and I'm not particularly sure where to get the currently displayed path(?). r? `@lcnr`

view details

bors

commit sha d778203da2157f47af6d1f7ba5f44eb933ee2df1

Auto merge of #76573 - Mark-Simulacrum:bootstrap-with-external-llvm, r=alexcrichton Only copy LLVM into rust-dev with internal LLVM This avoids needing to figure out where to locate each of the components with an external LLVM. This component isn't manifested for rustup consumption and generally shouldn't matter for anyone except Rust's CI, so it is fine for it to not be complete elsewhere. Fixes #76572. r? `@alexcrichton`

view details

Mark Rousskov

commit sha 3193d52a21576b8c93f00132c784cce1159f733e

Remove host parameter from step configurations rustc is a natively cross-compiling compiler, and generally none of our steps should care whether they are using a compiler built of triple A or B, just the --target directive being passed to the running compiler. e.g., when building for some target C, you don't generally want to build two stds: one with a host A compiler and the other with a host B compiler. Just one std is sufficient.

view details

push time in 16 days

push eventJulianKnodt/rust

Jon Gjengset

commit sha 2f96ce89d03b248c269513b011d328bff2c8dc21

Stabilize deque_make_contiguous Closes #70929.

view details

Christian Duerr

commit sha f3d7645fb79d641de447d4af02d5f3cee91b4af3

Add trailing comma support to matches macro

view details

dylni

commit sha bb70e52f5f5ee25012193f9f4f4372702b97b20e

Add `slice::check_range`

view details

dylni

commit sha 202b242d87c30c2fe1475342f9b93a8dfc65cd17

Fix links

view details

dylni

commit sha ed02b90e9b76b9ce2e8e99a99dbadd96ab4dfb42

Fix links again

view details

The8472

commit sha 1316c786a08344c965a97b1b67c76a300a479eec

Workaround for copy_file_range spuriously returning EOPNOTSUPP when attemted on a NFS mount under RHEL/CentOS 7. The syscall is supposed to return ENOSYS in most cases but when calling it on NFS it may leak through EOPNOTSUPP even though that's supposed to be handled by the kernel and not returned to userspace. Since it returns ENOSYS in some cases anyway this will trip the HAS_COPY_FILE_RANGE detection anyway, so treat EOPNOTSUPP as if it were a ENOSYS. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.8_release_notes/deprecated_functionality#the_literal_copy_file_range_literal_call_has_been_disabled_on_local_file_systems_and_in_nfs https://bugzilla.redhat.com/show_bug.cgi?id=1783554

view details

The8472

commit sha f0783632d315db90c0ca34d79d56207d132f3764

more concise error matching

view details

CDirkx

commit sha 6b0d44e92a529962792d3a5f1e7b44b6e3c6ed05

Make some Ordering methods const Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Possible because of #49146 (Allow `if` and `match` in constants).

view details

The8472

commit sha 4ddedd521418d67e845ecb43dc02c09b0af53022

perform copy_file_range until EOF is reached instead of basing things on file size This solves several problems - race conditions where a file is truncated while copying from it. if we blindly trusted the file size this would lead to an infinite loop - proc files appearing empty to copy_file_range but not to read/write https://github.com/coreutils/coreutils/commit/4b04a0c - copy_file_range returning 0 for some filesystems (overlay? bind mounts?) inside docker, again leading to an infinite loop

view details

dylni

commit sha d04e6b8de5fe6bbf203c534c35e6f55e8960ab46

Replace ad hoc implementations with `slice::check_range`

view details

Yuki Okushi

commit sha 18ad5a594ec4ee039897eb03d90dfeb117b4c6d6

Add a regression test for issue-72793

view details

Stein Somers

commit sha e5f9d7ff92f62cde3ef1b7301ac4ac3adab990d9

BTreeMap: introduce marker::ValMut and reserve marker::Mut for unique access

view details

Tim Nielens

commit sha 2ecc2ac864739cff6aed2609021e2467dedb117a

unit-arg - improve suggestion

view details

dylni

commit sha d9e877fb98212a47dd425e145b8b3e4283e6b487

Add more information to safety comment

view details

Camelid

commit sha acd396225e0228f297474524396e08e0f594347e

Fix typo in release notes

view details

Amjad Alsharafi

commit sha d39cc45cf251be63f3066c6002d409274aa9d2a4

Added a lot of min_const_generics revisions

view details

Amjad Alsharafi

commit sha d89d2a972d3174504594ff2eba70423dacaddcfb

Added more min_const_generics revisions to tests

view details

Amjad Alsharafi

commit sha 7a7a28d6bbfa6bbbbd3c4d65a11e9b33995cd63f

Fixed file formatting and made `tidy` happy

view details

Arkadiusz Piekarz

commit sha aa40c028fcb20a47fb214fea2899ff9a8ae88840

Unstable Book: add links to tracking issues for FFI features

view details

Camelid

commit sha 294c1160bb693a77ad2683321b9196352bd837dc

Improve docs for the `const` keyword

view details

push time in 17 days

Pull request review commentrust-lang/rust

Add `has_default` to `GenericParamDefKind::Const`

 impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {     }      fn visit_generic_param(&mut self, param: &'hir GenericParam<'hir>) {+        if let hir::GenericParamKind::Const { default: Some(ref default), .. } = param.kind {+          self.visit_anon_const(default);+        }

ah hm I think I already updated that file with the change tho, it would be visiting it twice now which would cause the bug

JulianKnodt

comment created time in 17 days

PullRequestReviewEvent

push eventJulianKnodt/rust

The8472

commit sha 1316c786a08344c965a97b1b67c76a300a479eec

Workaround for copy_file_range spuriously returning EOPNOTSUPP when attemted on a NFS mount under RHEL/CentOS 7. The syscall is supposed to return ENOSYS in most cases but when calling it on NFS it may leak through EOPNOTSUPP even though that's supposed to be handled by the kernel and not returned to userspace. Since it returns ENOSYS in some cases anyway this will trip the HAS_COPY_FILE_RANGE detection anyway, so treat EOPNOTSUPP as if it were a ENOSYS. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.8_release_notes/deprecated_functionality#the_literal_copy_file_range_literal_call_has_been_disabled_on_local_file_systems_and_in_nfs https://bugzilla.redhat.com/show_bug.cgi?id=1783554

view details

The8472

commit sha f0783632d315db90c0ca34d79d56207d132f3764

more concise error matching

view details

The8472

commit sha 4ddedd521418d67e845ecb43dc02c09b0af53022

perform copy_file_range until EOF is reached instead of basing things on file size This solves several problems - race conditions where a file is truncated while copying from it. if we blindly trusted the file size this would lead to an infinite loop - proc files appearing empty to copy_file_range but not to read/write https://github.com/coreutils/coreutils/commit/4b04a0c - copy_file_range returning 0 for some filesystems (overlay? bind mounts?) inside docker, again leading to an infinite loop

view details

Yuki Okushi

commit sha 18ad5a594ec4ee039897eb03d90dfeb117b4c6d6

Add a regression test for issue-72793

view details

Stein Somers

commit sha e5f9d7ff92f62cde3ef1b7301ac4ac3adab990d9

BTreeMap: introduce marker::ValMut and reserve marker::Mut for unique access

view details

Tim Nielens

commit sha 2ecc2ac864739cff6aed2609021e2467dedb117a

unit-arg - improve suggestion

view details

Arkadiusz Piekarz

commit sha aa40c028fcb20a47fb214fea2899ff9a8ae88840

Unstable Book: add links to tracking issues for FFI features

view details

Eduardo Broto

commit sha baf62e7a38854ff6a0039ddccb124ff329a32143

Update changelog to beta 1.47

view details

Tim Nielens

commit sha f3ccbef2af24d5d83f82f1fb50bd97a9b75e609f

unit-arg - pr comments

view details

mental32

commit sha f03d0b38d6a33a64307d83f8ddd3df8ef57ca537

`impl Rc::new_cyclic`

view details

Hirochika Matsumoto

commit sha 5574182b4d2d08c848a88a1ac5633fc194e0465e

Add a new lint to prevent `create_dir` from being used

view details

Hirochika Matsumoto

commit sha 607905d126c55422668007737c22d7a7a89c0d57

Add STD_FS_CREATE_DIR into paths

view details

Hirochika Matsumoto

commit sha 34e302e67c08c9b97d58d062ea83cc1fd860c56e

Fix clippy error

view details

Hirochika Matsumoto

commit sha eebd2483654456e332d7cf53218b56b9cbd6f2f5

Fix errors

view details

bors

commit sha c88c6149415dd47b5f05e69d7307e0a1967c33f2

Auto merge of #5970 - ebroto:changelog_beta_1_47, r=flip1995 Update changelog to beta 1.47 [Rendered](https://github.com/ebroto/rust-clippy/blob/changelog_beta_1_47/CHANGELOG.md) changelog: none

view details

flip1995

commit sha 282c59820b8e1d8c76f440484b81a190c576f91b

Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup

view details

Eduardo Broto

commit sha 7a66e6502dc3c7085b3f4078c01d4957d96175ed

or_fn_call: ignore nullary associated const fns

view details

Hirochika Matsumoto

commit sha 5b7590f841974255f74c64d573189aecc7a30b2e

Downgrade applicability of `create_dir`

view details

mental

commit sha 42fb27001e07e832cb40604c7daeaa6aada07675

typo Co-authored-by: Andrew Hickman <andrew.hickman1@sky.com>

view details

Ivan Tham

commit sha bb5e79cbd11dbb8aa91840108b67085e5d5d04f8

Link vec doc to & reference It is not always obvious that people could see the docs for `&` especially for beginners, it also helps learnability.

view details

push time in 17 days

issue commentrust-lang/compiler-team

Add StatementKind::Intrinsic to MIR

ah yes, yes it is

JulianKnodt

comment created time in 17 days

push eventJulianKnodt/rust

kadmin

commit sha ee55c1f1d2c427fecedd68e28a7dc4e6c68738b5

Add regression test and help note

view details

push time in 20 days

pull request commentrust-lang/rust

Add `has_default` to `GenericParamDefKind::Const`

yea no worries, there's a lot happening these days!

JulianKnodt

comment created time in 21 days

push eventJulianKnodt/rust

kadmin

commit sha a1fcdff374551c213f986f226505f64cb26a011e

Add regression test and help note

view details

push time in 21 days

Pull request review commentrust-lang/rust

Add help note to unconstrained const parameter

 fn enforce_impl_params_are_constrained( }  fn report_unused_parameter(tcx: TyCtxt<'_>, span: Span, kind: &str, name: &str) {-    struct_span_err!(+    let mut err = struct_span_err!(         tcx.sess,         span,         E0207,         "the {} parameter `{}` is not constrained by the \         impl trait, self type, or predicates",         kind,         name-    )-    .span_label(span, format!("unconstrained {} parameter", kind))-    .emit();+    );+    err.span_label(span, format!("unconstrained {} parameter", kind));+    if kind == "const" {+        err.note(+            "proving expressions using a const parameter map each value to a distinct output is not supported",+        );

Hm I do agree it does need rewording, but the output is not a type, but I agree proving that it's unique is secondary to what must be satisfied

JulianKnodt

comment created time in 21 days

PullRequestReviewEvent

push eventJulianKnodt/rust

kadmin

commit sha 7943955c70fe696a75c0aeb0b4e25246b663d515

Add regression test and help note

view details

push time in 21 days

push eventJulianKnodt/rust

kadmin

commit sha 75c26a780627c732bee869c5a54e182a8876dee6

Add regression test and help note

view details

push time in 21 days

push eventJulianKnodt/rust

kadmin

commit sha f9a20d403036d9e03df519ffe9df942b3ab759aa

Add regression test and help note

view details

push time in 21 days

push eventJulianKnodt/rust

kadmin

commit sha 20e023ff452106b28dcf07d3867b4875c7bf05e0

Add regression test and help note

view details

push time in 21 days

push eventJulianKnodt/rust

kadmin

commit sha 041d156fba553395df38485a9f1e31501d32ce4a

Add regression test and help note

view details

push time in 22 days

push eventJulianKnodt/rust

kadmin

commit sha d2249f46580912d24be1bad39a6736000c228423

Add regression test and help note

view details

push time in 22 days

PR opened rust-lang/rust

Add help note to unconstrained const parameter

Resolves #68366, since it is currently intended behaviour. If demonstrating T -> U is injective, there should be an additional message that it is not yet supported.

r? @lcnr

+22 -0

0 comment

2 changed files

pr created time in 22 days

create barnchJulianKnodt/rust

branch : i68366

created branch time in 22 days

push eventJulianKnodt/rust

kadmin

commit sha e95726a4357a01cad82392418974a3a049fabb5b

Attempt to fix lowering bugs

view details

push time in 22 days

Pull request review commentrust-lang/rust

Add `has_default` to `GenericParamDefKind::Const`

 impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {                             tcx.ty_error().into()                         }                     }-                    GenericParamDefKind::Const => {+                    GenericParamDefKind::Const { has_default } => {                         let ty = tcx.at(span).type_of(param.def_id);-                        // FIXME(const_generics:defaults)-                        if infer_args {+                        if !infer_args && has_default {+                            if default_needs_object_self(param) {+                                missing_type_params.push(param.name.to_string());+                                tcx.ty_error().into()+                            } else {+                                // This is a default type parameter.+                                self.normalize_ty(+                                    span,+                                    tcx.at(span).type_of(param.def_id).subst_spanned(+                                        tcx,+                                        substs.unwrap(),+                                        Some(span),+                                    ),+                                )+                                .into()+                            }

I changed this as well, not sure if it's correct either as I had to change this code block quite a bit

JulianKnodt

comment created time in 23 days

PullRequestReviewEvent

push eventJulianKnodt/rust

Christian Duerr

commit sha f3d7645fb79d641de447d4af02d5f3cee91b4af3

Add trailing comma support to matches macro

view details

dylni

commit sha bb70e52f5f5ee25012193f9f4f4372702b97b20e

Add `slice::check_range`

view details

dylni

commit sha 202b242d87c30c2fe1475342f9b93a8dfc65cd17

Fix links

view details

dylni

commit sha ed02b90e9b76b9ce2e8e99a99dbadd96ab4dfb42

Fix links again

view details

dylni

commit sha d04e6b8de5fe6bbf203c534c35e6f55e8960ab46

Replace ad hoc implementations with `slice::check_range`

view details

dylni

commit sha d9e877fb98212a47dd425e145b8b3e4283e6b487

Add more information to safety comment

view details

Camelid

commit sha 294c1160bb693a77ad2683321b9196352bd837dc

Improve docs for the `const` keyword

view details

Hanif Bin Ariffin

commit sha cc3b2f9e1da2bb1bf2eda2e265687ed028cb0e22

Add more examples to lexicographic cmp on Iterators. The most important rule of lexicographical comparison is that two arrays of equal length will be compared until the first difference occured. The examples provided only focuses on the second rule that says that the shorter array will be filled with some T2 that is less than every T. Which is only possible because of the first rule.

view details

Camelid

commit sha 4aae7814075ffe94486e2cc04ff5d08351eb8fd3

Add info about `!` and `impl Trait`

view details

Camelid

commit sha fd985e29dd97f053f31a2e282fb59363f6b6db3f

cannot have divergence -> cannot diverge

view details

Camelid

commit sha 0d9a2abe698e84c8b3c473659db321606d7d5c02

It's only an issue without an `impl Trait for !`

view details

Camelid

commit sha 26eab6a0d51b9a023471210e35fdec969c662363

Specify `0` of type `u32`

view details

Camelid

commit sha 80dcad9e5b060ba6f9e06499c799423037ce7733

Be more specific about polymorphic return types I no longer say "polymorphic" since it's a bit ambiguous here.

view details

Camelid

commit sha bd3196282ba61ba284f4e176db3537f61b11892c

other branch -> `else` branch

view details

Andy Russell

commit sha e0822ecdbc43a6128136661bb73fb6f3c3db2b4a

rustdoc: do not use plain summary for trait impls Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474.

view details

Andy Russell

commit sha 98232ece14bdd68aeac3d761039d9a7c88c30b3f

fix broken trait method links

view details

Aaron Hill

commit sha a97dcfa3755990062fd7905370cddd3843541db0

Run cfg-stripping on generic parameters before invoking derive macros Fixes #75930 This changes the tokens seen by a proc-macro. However, ising a `#[cfg]` attribute on a generic paramter is unusual, and combining it with a proc-macro derive is probably even more unusual. I don't expect this to cause any breakage.

view details

Camelid

commit sha 7e2548fe69ff5ec4e5e06c8c28351cbf2ebf7eee

Import `Debug` instead of redefining it

view details

Camelid

commit sha 37ea97cc10212711411e6dbb6b260e668b7ac2b5

Explain why the `0` is a `u32`

view details

Lukas Kalbertodt

commit sha 104a02301ca3cbc9f6056e9ebab8b928dad706af

Add `[T; N]::as_[mut_]slice` These methods are like the ones on `std::array::FixedSizeArray` and in the crate `arraytools`.

view details

push time in 23 days

push eventJulianKnodt/rust

dylni

commit sha bb70e52f5f5ee25012193f9f4f4372702b97b20e

Add `slice::check_range`

view details

dylni

commit sha 202b242d87c30c2fe1475342f9b93a8dfc65cd17

Fix links

view details

dylni

commit sha ed02b90e9b76b9ce2e8e99a99dbadd96ab4dfb42

Fix links again

view details

dylni

commit sha d04e6b8de5fe6bbf203c534c35e6f55e8960ab46

Replace ad hoc implementations with `slice::check_range`

view details

dylni

commit sha d9e877fb98212a47dd425e145b8b3e4283e6b487

Add more information to safety comment

view details

Andy Russell

commit sha e0822ecdbc43a6128136661bb73fb6f3c3db2b4a

rustdoc: do not use plain summary for trait impls Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474.

view details

Andy Russell

commit sha 98232ece14bdd68aeac3d761039d9a7c88c30b3f

fix broken trait method links

view details

Niels Sascha Reedijk

commit sha 0f6bcb797a8be743f6c60e20d3e0e324a89372c9

Link to zlib while cross-compiling LLVM on Haiku PR #72696 enabled the option LLVM_ENABLE_ZLIB for the LLVM builds. On Haiku, zlib is linked as a shared library. When cross-compiling LLVM, rustbuild should be instructed to explicitly linking to libz.

view details

Dan Aloni

commit sha 75a042e74b797a74763db075b038284657b4a03a

Fix some unwanted uses of Debug formatting on user-facing messages While formatting for user diagnostics used `Display` for all most cases, some small amount of cases used `Debug` instead. Until now, `Display` and `Debug` yielded the same output for many types. However, with path trimming, we want to show a shorter path for the user, these cases need fixing.

view details

Dan Aloni

commit sha 7b2deb562822112cc30d23958e7459564e2c6ef9

rustc_{errors,session}: add `delay_good_path_bug` The first use case of this detection of regression for trimmed paths computation, that is in the case of rustc, which should be computed only in case of errors or warnings. Our current user of this method is deeply nested, being a side effect from `Display` formatting on lots of rustc types. So taking only the caller to the error message is not enough - we should collect the traceback instead.

view details

Dan Aloni

commit sha 07e7823c01be1733df2480de19fbbe6b8e9384cf

pretty: trim paths of unique symbols If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.

view details

Dan Aloni

commit sha c5a61319da34e931072f2ffe3d12e530034c8c07

rustc_driver: have TrimmedDefPaths::GoodPath only for rustc `run_compiler` is used by clippy and other tools, which should not have the trimmed paths feature enabled by default, until we see it works well for them. Would also be nice to rename `TimePassesCallbacks` however it's a submodule change.

view details

Rich Kadel

commit sha 51d692cf7709de563cac6b5ee0080b8adf96f1df

Tools, tests, and experimenting with MIR-derived coverage counters Adds a new mir_dump output file in HTML/CSS to visualize code regions and the MIR features that they came from (including overlapping spans). See example below: Includes a basic, MIR-block-based implementation of coverage injection, available via `-Zexperimental-coverage`. This implementation has known flaws and omissions, but is simple enough to validate the new tools and tests. The existing `-Zinstrument-coverage` option currently enables function-level coverage only, which at least appears to generate accurate coverage reports at that level. Experimental coverage is not accurate at this time. When branch coverage works as intended, the `-Zexperimental-coverage` option should be removed. This PR replaces the bulk of PR #75828, with the remaining parts of that PR distributed among other separate and indentpent PRs. This PR depends on three of those other PRs: #76000, #76002, and Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation ![Screen-Recording-2020-08-21-at-2](https://user-images.githubusercontent.com/3827298/90972923-ff417880-e4d1-11ea-92bb-8713c6198f6d.gif)

view details

Ralf Jung

commit sha 615c1460dd4964beeef5578f04c113d0bca34f44

update miri

view details

Dan Aloni

commit sha 51742be6d8c828c956f662a8e9a472cd31886b4a

specialization_graph: avoid trimmed paths for OverlapError

view details

Dan Aloni

commit sha e7d7615105332f269a27cbd7273029377a96ccdf

rustc_lint: avoid trimmed paths for ty_find_init_error

view details

bors

commit sha 3edf11cf811707cde49b30a80896c24189649d95

Auto merge of #76283 - RalfJung:miri, r=RalfJung update miri Fixes https://github.com/rust-lang/rust/issues/76190 Cc @rust-lang/miri r? @ghost

view details

The8472

commit sha 076417e978d86676bc403bb7ed963c107a8f72db

unrelated typo fix

view details

The8472

commit sha 038394a330f24e5ec63d78657a32f3279b8b276b

bench

view details

The8472

commit sha bb2d533bb9b5c247f48f7932f7e533475b59e402

in-place collect for Vec. Box<[]> and BinaryHeap IntoIter and some adapters

view details

push time in 23 days

push eventJulianKnodt/rust

kadmin

commit sha 4bfdcea3d9cc70b299f32a9eae6f4fee430a9aff

Add regression test

view details

push time in 23 days

push eventJulianKnodt/rust

dylni

commit sha bb70e52f5f5ee25012193f9f4f4372702b97b20e

Add `slice::check_range`

view details

dylni

commit sha 202b242d87c30c2fe1475342f9b93a8dfc65cd17

Fix links

view details

dylni

commit sha ed02b90e9b76b9ce2e8e99a99dbadd96ab4dfb42

Fix links again

view details

dylni

commit sha d04e6b8de5fe6bbf203c534c35e6f55e8960ab46

Replace ad hoc implementations with `slice::check_range`

view details

dylni

commit sha d9e877fb98212a47dd425e145b8b3e4283e6b487

Add more information to safety comment

view details

Camelid

commit sha 294c1160bb693a77ad2683321b9196352bd837dc

Improve docs for the `const` keyword

view details

Andy Russell

commit sha e0822ecdbc43a6128136661bb73fb6f3c3db2b4a

rustdoc: do not use plain summary for trait impls Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474.

view details

Andy Russell

commit sha 98232ece14bdd68aeac3d761039d9a7c88c30b3f

fix broken trait method links

view details

Lukas Kalbertodt

commit sha 104a02301ca3cbc9f6056e9ebab8b928dad706af

Add `[T; N]::as_[mut_]slice` These methods are like the ones on `std::array::FixedSizeArray` and in the crate `arraytools`.

view details

Lukas Kalbertodt

commit sha d7afe2a223ab0a118bcdae39e8e2affbccaa61ae

Fix tests using `FixedSizeArray` methods (which are now shadowed)

view details

CDirkx

commit sha fbb367333190128015d35c0211877d71796f8deb

Make more Ipv4Addr methods const Constify the following methods of `std::net::Ipv4Addr`: - `octets` - `is_loopback` - `is_private` - `is_link_local` - `is_shared` - `is_ietf_protocol_assignment` - `is_benchmarking` - `is_multicast` - `is_documentation` Also insta-stabilizes these methods as const. Possible because of the stabilization of const integer arithmetic and control flow.

view details

Lzu Tao

commit sha a74d4e4889c02dd49fe69e533e92104920832d09

Link to slice pattern in array docs

view details

Niels Sascha Reedijk

commit sha 0f6bcb797a8be743f6c60e20d3e0e324a89372c9

Link to zlib while cross-compiling LLVM on Haiku PR #72696 enabled the option LLVM_ENABLE_ZLIB for the LLVM builds. On Haiku, zlib is linked as a shared library. When cross-compiling LLVM, rustbuild should be instructed to explicitly linking to libz.

view details

CDirkx

commit sha ee9e48bafcc9667f08027e50ed84578e9861a456

Make methods unstable const under `const_ipv4`

view details

Mateusz Mikuła

commit sha 770231e54d0266406791bab1fda7e300d074ebda

Replace MinGW library hack with heuristic controlling link mode

view details

Christiaan Dirkx

commit sha fb64e6dcf0a7ea0518c8f2d499327a2b6974f859

Add test for `Ipv4Addr` methods in a const context

view details

Leonora Tindall

commit sha d0af12560c9672546a6434e2e1e9ec72ad8f8e70

Rename and expose LoopState as ControlFlow

view details

Christiaan Dirkx

commit sha 0c77257e56a20a81f5b4e4452cae5e460ad30140

Make all remaining methods of `std::net::Ipv4Addr` const Makes the following methods of `std::net::Ipv4Addr` unstable const under the `const_ipv4` feature: - `is_global` - `is_reserved` - `is_broadcast` - `to_ipv6_compatible` - `to_ipv6_mapped` This results in all methods of `Ipv4Addr` being const. Also adds tests for these methods in a const context.

view details

Denis Vasilik

commit sha 07cd4c8778a219f681f78dfb3c8ee123f630b06d

Use intra-doc links

view details

Tomasz Miąsko

commit sha 6c51ec96bb5b6679645be1651d4ff1d079412af6

inliner: Avoid query cycles when optimizing generators The HIR Id trick is insufficient to prevent query cycles when optimizing generators, since merely requesting a layout of a generator also computes its `optimized_mir`. Make no attempts to inline functions into generators within the same crate to avoid query cycles.

view details

push time in 24 days

pull request commentrust-lang/rust

Add `has_default` to `GenericParamDefKind::Const`

Currently the error is:

running 1 test
test [ui] ui/const-generics/defaults/const-default.rs ... FAILED

failures:

---- [ui] ui/const-generics/defaults/const-default.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit code: 101
command: "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/kadmin/projects/rust/src/test/ui/const-generics/defaults/const-default.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/test/ui/const-generics/defaults/const-default/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/test/ui/const-generics/defaults/const-default/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: internal compiler error: compiler/rustc_middle/src/hir/map/mod.rs:163:13: local_def_id: no entry for `HirId { owner: DefId(0:3 ~ const_default[317d]::ConstDefault[0]), local_id: 10 }`, which has a map of `Some(Entry { parent: HirId { owner: DefId(0:3 ~ const_default[317d]::ConstDefault[0]), local_id: 0 }, node: AnonConst(AnonConst { hir_id: HirId { owner: DefId(0:3 ~ const_default[317d]::ConstDefault[0]), local_id: 10 }, body: BodyId { hir_id: HirId { owner: DefId(0:3 ~ const_default[317d]::ConstDefault[0]), local_id: 11 } } }) })`

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:918:9
stack backtrace:
   0: std::panicking::begin_panic
             at ./library/std/src/panicking.rs:505
   1: rustc_errors::HandlerInner::bug
             at ./compiler/rustc_errors/src/lib.rs:918
   2: rustc_errors::Handler::bug
             at ./compiler/rustc_errors/src/lib.rs:668
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
             at ./compiler/rustc_middle/src/util/bug.rs:33
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1790
   5: rustc_middle::ty::context::tls::with_context_opt
             at ./compiler/rustc_middle/src/ty/context.rs:1742
   6: rustc_middle::ty::context::tls::with_opt
             at ./compiler/rustc_middle/src/ty/context.rs:1790
   7: rustc_middle::util::bug::opt_span_bug_fmt
             at ./compiler/rustc_middle/src/util/bug.rs:29
   8: rustc_middle::util::bug::bug_fmt
             at ./compiler/rustc_middle/src/util/bug.rs:14
   9: rustc_middle::hir::map::Map::local_def_id::{{closure}}
             at ./compiler/rustc_middle/src/hir/map/mod.rs:163
  10: core::option::Option<T>::unwrap_or_else
             at ./library/core/src/option.rs:411
  11: rustc_middle::hir::map::Map::local_def_id
             at ./compiler/rustc_middle/src/hir/map/mod.rs:162
  12: rustc_middle::hir::map::Map::body_owner_def_id
             at ./compiler/rustc_middle/src/hir/map/mod.rs:352
  13: <rustc_passes::check_const::CheckConstVisitor as rustc_hir::intravisit::Visitor>::visit_body
             at ./compiler/rustc_passes/src/check_const.rs:193
  14: rustc_hir::intravisit::Visitor::visit_nested_body
             at ./compiler/rustc_hir/src/intravisit.rs:289
  15: rustc_hir::intravisit::walk_anon_const
             at ./compiler/rustc_hir/src/intravisit.rs:1068
  16: <rustc_passes::check_const::CheckConstVisitor as rustc_hir::intravisit::Visitor>::visit_anon_const::{{closure}}
             at ./compiler/rustc_passes/src/check_const.rs:189
  17: rustc_passes::check_const::CheckConstVisitor::recurse_into
             at ./compiler/rustc_passes/src/check_const.rs:174
  18: <rustc_passes::check_const::CheckConstVisitor as rustc_hir::intravisit::Visitor>::visit_anon_const
             at ./compiler/rustc_passes/src/check_const.rs:189
  19: rustc_hir::intravisit::walk_generic_param
             at ./compiler/rustc_hir/src/intravisit.rs:863
  20: rustc_hir::intravisit::Visitor::visit_generic_param
             at ./compiler/rustc_hir/src/intravisit.rs:358
  21: rustc_hir::intravisit::walk_generics
             at ./compiler/rustc_hir/src/intravisit.rs:871
  22: rustc_hir::intravisit::Visitor::visit_generics
             at ./compiler/rustc_hir/src/intravisit.rs:361
  23: rustc_hir::intravisit::walk_item
             at ./compiler/rustc_hir/src/intravisit.rs:613
  24: rustc_hir::intravisit::Visitor::visit_item
             at ./compiler/rustc_hir/src/intravisit.rs:299
  25: <rustc_hir::intravisit::DeepVisitor<V> as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_item
             at ./compiler/rustc_hir/src/intravisit.rs:57
  26: rustc_middle::hir::map::Map::visit_item_likes_in_module
             at ./compiler/rustc_middle/src/hir/map/mod.rs:463
  27: rustc_passes::check_const::check_mod_const_bodies
             at ./compiler/rustc_passes/src/check_const.rs:62
  28: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_const_bodies>::compute
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:381
  29: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
             at ./compiler/rustc_query_system/src/dep_graph/graph.rs:303
  30: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
             at ./compiler/rustc_query_system/src/dep_graph/graph.rs:200
  31: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
             at ./compiler/rustc_query_system/src/query/plumbing.rs:599
  32: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:72
  33: stacker::maybe_grow
             at /home/kadmin/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.11/src/lib.rs:52
  34: rustc_data_structures::stack::ensure_sufficient_stack
             at ./compiler/rustc_data_structures/src/stack.rs:16
  35: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:72
  36: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1725
  37: rustc_middle::ty::context::tls::set_tlv
             at ./compiler/rustc_middle/src/ty/context.rs:1709
  38: rustc_middle::ty::context::tls::enter_context
             at ./compiler/rustc_middle/src/ty/context.rs:1725
  39: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:71
  40: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1769
  41: rustc_middle::ty::context::tls::with_context::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1753
  42: rustc_middle::ty::context::tls::with_context_opt
             at ./compiler/rustc_middle/src/ty/context.rs:1742
  43: rustc_middle::ty::context::tls::with_context
             at ./compiler/rustc_middle/src/ty/context.rs:1753
  44: rustc_middle::ty::context::tls::with_related_context
             at ./compiler/rustc_middle/src/ty/context.rs:1766
  45: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:60
  46: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./compiler/rustc_query_system/src/query/plumbing.rs:589
  47: rustc_query_system::query::plumbing::with_diagnostics
             at ./compiler/rustc_query_system/src/query/plumbing.rs:296
  48: rustc_query_system::query::plumbing::force_query_with_job
             at ./compiler/rustc_query_system/src/query/plumbing.rs:588
  49: rustc_query_system::query::plumbing::try_execute_query
             at ./compiler/rustc_query_system/src/query/plumbing.rs:415
  50: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./compiler/rustc_query_system/src/query/plumbing.rs:639
  51: <rustc_query_system::query::caches::DefaultCache<K,V> as rustc_query_system::query::caches::QueryCache>::lookup
             at ./compiler/rustc_query_system/src/query/caches.rs:110
  52: rustc_query_system::query::plumbing::try_get_cached
             at ./compiler/rustc_query_system/src/query/plumbing.rs:369
  53: rustc_query_system::query::plumbing::get_query_impl
             at ./compiler/rustc_query_system/src/query/plumbing.rs:631
  54: rustc_query_system::query::plumbing::ensure_query_impl
             at ./compiler/rustc_query_system/src/query/plumbing.rs:679
  55: rustc_query_system::query::plumbing::ensure_query
             at ./compiler/rustc_query_system/src/query/plumbing.rs:741
  56: rustc_middle::ty::query::TyCtxtEnsure::check_mod_const_bodies
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:408
  57: rustc_interface::passes::analysis::{{closure}}::{{closure}}::{{closure}}
             at ./compiler/rustc_interface/src/passes.rs:817
  58: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}
             at ./library/core/src/iter/traits/iterator.rs:642
  59: core::iter::traits::iterator::Iterator::fold
             at ./library/core/src/iter/traits/iterator.rs:1998
  60: core::iter::traits::iterator::Iterator::for_each
             at ./library/core/src/iter/traits/iterator.rs:645
  61: rustc_interface::passes::analysis::{{closure}}::{{closure}}
             at ./compiler/rustc_interface/src/passes.rs:812
  62: core::ops::function::FnOnce::call_once
             at ./library/core/src/ops/function.rs:227
  63: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at ./library/std/src/panic.rs:308
  64: std::panicking::try::do_call
             at ./library/std/src/panicking.rs:381
  65: std::panicking::try
             at ./library/std/src/panicking.rs:345
  66: std::panic::catch_unwind
             at ./library/std/src/panic.rs:382
  67: rustc_interface::passes::analysis::{{closure}}
             at ./compiler/rustc_interface/src/passes.rs:800
  68: rustc_data_structures::profiling::VerboseTimingGuard::run
             at ./compiler/rustc_data_structures/src/profiling.rs:573
  69: rustc_session::utils::<impl rustc_session::session::Session>::time
             at ./compiler/rustc_session/src/utils.rs:9
  70: rustc_interface::passes::analysis
             at ./compiler/rustc_interface/src/passes.rs:799
  71: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:381
  72: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
             at ./compiler/rustc_query_system/src/dep_graph/graph.rs:303
  73: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
  74: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:72
  75: stacker::maybe_grow
             at /home/kadmin/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.11/src/lib.rs:52
  76: rustc_data_structures::stack::ensure_sufficient_stack
             at ./compiler/rustc_data_structures/src/stack.rs:16
  77: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:72
  78: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1725
  79: rustc_middle::ty::context::tls::set_tlv
             at ./compiler/rustc_middle/src/ty/context.rs:1709
  80: rustc_middle::ty::context::tls::enter_context
             at ./compiler/rustc_middle/src/ty/context.rs:1725
  81: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:71
  82: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1769
  83: rustc_middle::ty::context::tls::with_context::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1753
  84: rustc_middle::ty::context::tls::with_context_opt
             at ./compiler/rustc_middle/src/ty/context.rs:1742
  85: rustc_middle::ty::context::tls::with_context
             at ./compiler/rustc_middle/src/ty/context.rs:1753
  86: rustc_middle::ty::context::tls::with_related_context
             at ./compiler/rustc_middle/src/ty/context.rs:1766
  87: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:60
  88: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./compiler/rustc_query_system/src/query/plumbing.rs:589
  89: rustc_query_system::query::plumbing::with_diagnostics
             at ./compiler/rustc_query_system/src/query/plumbing.rs:296
  90: rustc_query_system::query::plumbing::force_query_with_job
             at ./compiler/rustc_query_system/src/query/plumbing.rs:588
  91: rustc_query_system::query::plumbing::try_execute_query
             at ./compiler/rustc_query_system/src/query/plumbing.rs:415
  92: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./compiler/rustc_query_system/src/query/plumbing.rs:639
  93: <rustc_query_system::query::caches::DefaultCache<K,V> as rustc_query_system::query::caches::QueryCache>::lookup
             at ./compiler/rustc_query_system/src/query/caches.rs:110
  94: rustc_query_system::query::plumbing::try_get_cached
             at ./compiler/rustc_query_system/src/query/plumbing.rs:369
  95: rustc_query_system::query::plumbing::get_query_impl
             at ./compiler/rustc_query_system/src/query/plumbing.rs:631
  96: rustc_query_system::query::plumbing::get_query
             at ./compiler/rustc_query_system/src/query/plumbing.rs:731
  97: rustc_middle::ty::query::TyCtxtAt::analysis
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:491
  98: rustc_middle::ty::query::<impl rustc_middle::ty::context::TyCtxt>::analysis
             at ./compiler/rustc_middle/src/ty/query/plumbing.rs:452
  99: rustc_driver::run_compiler::{{closure}}::{{closure}}::{{closure}}
             at ./compiler/rustc_driver/src/lib.rs:382
 100: rustc_interface::passes::QueryContext::enter::{{closure}}
             at ./compiler/rustc_interface/src/passes.rs:722
 101: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1725
 102: rustc_middle::ty::context::tls::set_tlv
             at ./compiler/rustc_middle/src/ty/context.rs:1709
 103: rustc_middle::ty::context::tls::enter_context
             at ./compiler/rustc_middle/src/ty/context.rs:1725
 104: rustc_interface::passes::QueryContext::enter
             at ./compiler/rustc_interface/src/passes.rs:722
 105: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at ./compiler/rustc_driver/src/lib.rs:382
 106: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at ./compiler/rustc_interface/src/queries.rs:385
 107: rustc_driver::run_compiler::{{closure}}
             at ./compiler/rustc_driver/src/lib.rs:283
 108: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at ./compiler/rustc_interface/src/interface.rs:191
 109: rustc_span::with_source_map
             at ./compiler/rustc_span/src/lib.rs:750
 110: rustc_interface::interface::create_compiler_and_run
             at ./compiler/rustc_interface/src/interface.rs:185
 111: rustc_interface::interface::run_compiler::{{closure}}
             at ./compiler/rustc_interface/src/interface.rs:207
 112: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
             at ./compiler/rustc_interface/src/util.rs:149
 113: scoped_tls::ScopedKey<T>::set
             at /home/kadmin/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
 114: rustc_span::with_session_globals
             at ./compiler/rustc_span/src/lib.rs:91
 115: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
             at ./compiler/rustc_interface/src/util.rs:145
 116: rustc_interface::util::scoped_thread::{{closure}}
             at ./compiler/rustc_interface/src/util.rs:120
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.48.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [check_mod_const_bodies] checking consts in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error


------------------------------------------



failures:
    [ui] ui/const-generics/defaults/const-default.rs

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 10740 filtered out



command did not execute successfully: "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/stage1/lib" "--run-lib-path" "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "--src-base" "/home/kadmin/projects/rust/src/test/ui" "--build-base" "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage1-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/home/kadmin/projects/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python" "--lldb-python" "/usr/bin/python" "const-generics/defaults/const-default.rs" "--llvm-version" "11.0.0-rust-dev" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine extensions frontendopenmp fuzzmutate globalisel gtest gtest_main hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target testingsupport textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info xray" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" ""
expected success, got: exit code: 101


failed to run: /home/kadmin/projects/rust/build/bootstrap/debug/bootstrap test src/test/ui/const-generics/defaults/const-default.rs
Build completed unsuccessfully in 0:00:01
JulianKnodt

comment created time in 24 days

push eventJulianKnodt/satsuma

Matt Brubeck

commit sha 59d5d7562200589cbcc4f11a1767c2226d3633cd

Update to hashbrown 0.9 The behavior of `drain_filter` has changed in this release: https://github.com/rust-lang/hashbrown/issues/186

view details

Julian Knodt

commit sha b4f3c4a4759551c829ab16ad8e3eda8911d1b0e5

Merge pull request #1 from mbrubeck/deps Update to hashbrown 0.9

view details

push time in 24 days

PR merged JulianKnodt/satsuma

Update to hashbrown 0.9

The behavior of drain_filter has changed in this release:

https://github.com/rust-lang/hashbrown/issues/186

+4 -4

1 comment

2 changed files

mbrubeck

pr closed time in 24 days

pull request commentJulianKnodt/satsuma

Update to hashbrown 0.9

Thanks for this!

mbrubeck

comment created time in 24 days

push eventJulianKnodt/rust

kadmin

commit sha c6ab3ff19aed41d8a451d16c9a63bc06ecb0a9c4

Add test for checking if-let or-patterns

view details

push time in 24 days

push eventJulianKnodt/rust

marmeladema

commit sha a1dfa0f230bb6dd9ca0a272d1bf884d010229be4

Only measure time spent dropping the AST

view details

bors

commit sha f032cba02e53a8538f3c1cd431edc01a9fa1b3f8

Auto merge of #75575 - marmeladema:only-measure-drop-ast, r=eddyb Only measure time spent dropping the AST r? @eddyb

view details

bors

commit sha 86bccb684dd4d24258d2cb9aa6249bc332085c00

Auto merge of #75541 - camelid:intra-doc-links-for-core-option, r=jyn514 Switch to intra-doc links in `core::option` Part of #75080. I didn't change some of the links since they link into `std` and you can't link from `core` to `std` (#74481). Also, at least one other link can't be switched to an intra-doc link because it's not supported yet (#74489).

view details

bors

commit sha 9d38dc22e5d543b9c350dd48ac014135547e7953

Auto merge of #75553 - denisvasilik:intra-doc-links-convert, r=jyn514 Move to intra-doc links for /library/core/src/char/convert.rs Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

view details

bors

commit sha 243c725c2401e00c83ac68e80fa18d3b0dd3f551

Auto merge of #75561 - kornelski:stringcol, r=Dylan-DPC Doc: String isn't a collection On forums one user was confused by this text, interpreting it as saying that `String` is a `Vec<char>` literally, rather than figuratively for the purpose of collect. I've reworded that paragraph.

view details

bors

commit sha de32266a1780aa4ef748ce7f6200a1554fad0aca

Auto merge of #75565 - nixphix:docs/vxworks-ext, r=jyn514 Switch to intra-doc links in std/src/sys/vxworks/ext/{fs,process}.rs Partial fix for #75080 @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc r? @jyn514

view details

bors

commit sha 97ba0c7171c4d2d9b899a2bd8e40a8974c47b86d

Auto merge of #75536 - estebank:e0255-suggestion, r=varkor Tweak output of E0225 When encountering multiple non-auto trait bounds suggest creating a new trait and explain what auto-traits are. _Inspired by https://fasterthanli.me/articles/frustrated-its-not-you-its-rust_

view details

Alexis Bourget

commit sha 5fc187cd971ef3a4440878916b516e5a5c23ae57

Fix a link, improve method resolution

view details

bors

commit sha 7a4fb355c6ce4e534e0998d83b68591bbe234ddb

Auto merge of #75567 - poliorcetics:intra-links-std-net, r=jyn514 Move to intra doc links in std::net Helps with #75080. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc The links for `true` and `false` had to stay else `rustdoc` complained, it is intended ?

view details

David Wood

commit sha 764dc3dc2f8a2a421fa9d9c6144ad75310a26b99

lang_items: add support for lang items on variants This commit adds support for lang items (`#[lang = "..."]` attributes) on enum variants. Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha 734441c1ae5f0766842d37db68f606a1bca49836

tests: add test for #61019's current behaviour This commit adds a test for #61019 where a extern crate is imported as `std` which results in name resolution to fail due to the uses of `std` types introduced from lowering. Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha 7dee5f824dad65d9edffb4de22aad248bd83faf9

hir: introduce lang items for AST lowering This commit adds new lang items which will be used in AST lowering once `QPath::LangItem` is introduced. Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha 762137e2121ac8998b5bb916453eb24ec6523450

hir: introduce `QPath::LangItem` This commit introduces `QPath::LangItem` to the HIR and uses it in AST lowering instead of constructing a `hir::Path` from a slice of symbols. This might be better for performance, but is also much cleaner as the previous approach is fragile. In addition, it resolves a bug (#61019) where an extern crate imported as "std" would result in the paths created during AST lowering being resolved incorrectly (or not at all). Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha 1e2f350d921e73d7165fe9d7a5f0f6cfe613e3df

save_analysis: support `QPath::LangItem` This commit implements support for `QPath::LangItem` and `GenericBound::LangItemTrait` in save analysis. Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha 664ecf1085b1bab9d7444eb54dccfeeabd99446e

hir: simplify `is_range_literal` This commit simplifies `is_range_literal` by checking for `QPath::LangItem` containing range-related lang items, rather than using a heuristic. Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha 8367af469b9005c8f5c1777a48548a80e4658076

resolve: support `GenericBound::LangItemTrait` This commit modifies name resolution to ensure that new scopes are introduced from lang-item generic bounds. Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>

view details

David Wood

commit sha dde93c9ba61e441bcafab84a1e42cddb32aa0178

rustdoc: clean `QPath::LangItem` This commit adds support for cleaning `QPath::LangItem` and `hir::GenericBound::LangItemTrait` in rustdoc. `QPath::LangItem` does not require lowering, and `hir::GenericBound::LangItemTrait` is lowered to a `GenericBound::TraitBound`. Signed-off-by: David Wood <david@davidtw.co>

view details

Ralf Jung

commit sha 20aea2059264109e615478d05988e1b200b1adec

miri engine: add option to use force_int for alignment check

view details

Mark Rousskov

commit sha 172e67e487f59e58a3ce61886bfec61ec5f21fa5

Adjust installation place for compiler docs This avoids conflicts when installing with rustup; rustup does not currently support overlapping installations.

view details

bors

commit sha f8db258b224bb5616fb550a2a6b780beec9ff3c4

Auto merge of #5912 - ebroto:needless_doctest_main_improvements, r=Manishearth,flip1995 Parse doctests in needless_doctest_main This switches from text-based search to running the parser to avoid false positives. Inspired by how [rustdoc](https://github.com/rust-lang/rust/blob/3f3250500fe152b5759c21453ba9a9129808d0d8/src/librustdoc/test.rs#L366) handles this and by #4729. cc @llogiq changelog: Fix multiple false positives in [`needless_doctest_main`]. Fixes #5879 Fixes #4906 Fixes #5103 Fixes #4698

view details

push time in 25 days

push eventJulianKnodt/rust

Jon Gjengset

commit sha 2f96ce89d03b248c269513b011d328bff2c8dc21

Stabilize deque_make_contiguous Closes #70929.

view details

Christian Duerr

commit sha f3d7645fb79d641de447d4af02d5f3cee91b4af3

Add trailing comma support to matches macro

view details

Camelid

commit sha 294c1160bb693a77ad2683321b9196352bd837dc

Improve docs for the `const` keyword

view details

DPC

commit sha 5e208efaa850efaa97495e81c49cf0f5767e8f49

rename get_{ref, mut} to assume_init_{ref,mut} in Maybeuninit

view details

DPC

commit sha ea800d529a8d7c1b4e9de639637fce971a458c4f

fix tests

view details

khyperia

commit sha 81650f485c8cafbb6f06d43e90236f34c53175cf

Make to_immediate/from_immediate configurable by backends librustc_codegen_ssa has the concept of an immediate vs. memory type, and librustc_codegen_llvm uses this distinction to implement bools being i8 in memory, and i1 in immediate contexts. However, some of that implementation leaked into codegen_ssa when converting to/from immediate values. So, move those methods into builder traits, so that behavior can be configured by backends. This is useful if a backend is able to keep bools as bools, or, needs to do more trickery than just bools to bytes.

view details

Hanif Bin Ariffin

commit sha cc3b2f9e1da2bb1bf2eda2e265687ed028cb0e22

Add more examples to lexicographic cmp on Iterators. The most important rule of lexicographical comparison is that two arrays of equal length will be compared until the first difference occured. The examples provided only focuses on the second rule that says that the shorter array will be filled with some T2 that is less than every T. Which is only possible because of the first rule.

view details

Camelid

commit sha 4aae7814075ffe94486e2cc04ff5d08351eb8fd3

Add info about `!` and `impl Trait`

view details

Ivan Tham

commit sha 00cf550c2bee5f492cc8d86e43eb8bfd1f2454e6

Env use shorter intra-doc links in path vars() rather than vars function Co-authored-by: Joshua Nelson <joshua@yottadb.com> Use [xxx()] rather than the [xxx] function Co-authored-by: Joshua Nelson <joshua@yottadb.com> Env text representation of function intra-doc link Suggested by @jyn514 Link join_paths in env doc for parity Change xxx to env::xxx for lib env doc Add link requsted by @jyn514 Fix doc build with same link Co-authored-by: Joshua Nelson <joshua@yottadb.com> Fix missing intra-doc link Fix added whitespace in doc Co-authored-by: Joshua Nelson <joshua@yottadb.com> Add brackets for `join_paths` Co-authored-by: Joshua Nelson <joshua@yottadb.com> Use unused link join_paths Removed same link for join_paths Co-authored-by: Joshua Nelson <joshua@yottadb.com> Remove unsed link join_paths

view details

Camelid

commit sha fd985e29dd97f053f31a2e282fb59363f6b6db3f

cannot have divergence -> cannot diverge

view details

Camelid

commit sha 0d9a2abe698e84c8b3c473659db321606d7d5c02

It's only an issue without an `impl Trait for !`

view details

Camelid

commit sha 26eab6a0d51b9a023471210e35fdec969c662363

Specify `0` of type `u32`

view details

Camelid

commit sha 80dcad9e5b060ba6f9e06499c799423037ce7733

Be more specific about polymorphic return types I no longer say "polymorphic" since it's a bit ambiguous here.

view details

Camelid

commit sha bd3196282ba61ba284f4e176db3537f61b11892c

other branch -> `else` branch

view details

khyperia

commit sha 1663bfba02b7c1545a3c241b6b08cc9d9b97c475

Fix matching on field.abi instead of self.layout.abi

view details

DPC

commit sha b3d7b7bdcbea782d15a34861acfb8c4bdb1b96c1

update fixmes

view details

Ivan Tham

commit sha 1d017eb6a4602d18ccae9e8dfcc209fb8382982e

Fix env doc vars_os broken link

view details

Aaron Hill

commit sha a97dcfa3755990062fd7905370cddd3843541db0

Run cfg-stripping on generic parameters before invoking derive macros Fixes #75930 This changes the tokens seen by a proc-macro. However, ising a `#[cfg]` attribute on a generic paramter is unusual, and combining it with a proc-macro derive is probably even more unusual. I don't expect this to cause any breakage.

view details

Camelid

commit sha 7e2548fe69ff5ec4e5e06c8c28351cbf2ebf7eee

Import `Debug` instead of redefining it

view details

Camelid

commit sha 37ea97cc10212711411e6dbb6b260e668b7ac2b5

Explain why the `0` is a `u32`

view details

push time in 25 days

Pull request review commentrust-lang/rust

Add help note when using type in place of const

 impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {             for span in spans {                 err.span_label(span, label.as_str());             }-            err.emit(); -            Err(true)+            assert_ne!(bound, provided);+            Err((bound as i32 - provided as i32, Some(err)))         }; -        let mut arg_count_correct = Ok(());         let mut unexpected_spans = vec![]; +        let mut lifetime_count_correct = Ok(());         if !infer_lifetimes || arg_counts.lifetimes > param_counts.lifetimes {-            arg_count_correct = check_kind_count(+            lifetime_count_correct = check_kind_count(                 "lifetime",                 param_counts.lifetimes,                 param_counts.lifetimes,                 arg_counts.lifetimes,                 0,                 &mut unexpected_spans,                 explicit_late_bound == ExplicitLateBound::Yes,-            )-            .and(arg_count_correct);+            );         }+         // FIXME(const_generics:defaults)+        let mut const_count_correct = Ok(());         if !infer_args || arg_counts.consts > param_counts.consts {-            arg_count_correct = check_kind_count(+            const_count_correct = check_kind_count(                 "const",                 param_counts.consts,                 param_counts.consts,                 arg_counts.consts,                 arg_counts.lifetimes + arg_counts.types,                 &mut unexpected_spans,                 false,-            )-            .and(arg_count_correct);+            );         }+         // Note that type errors are currently be emitted *after* const errors.+        let mut type_count_correct = Ok(());         if !infer_args || arg_counts.types > param_counts.types - defaults.types - has_self as usize         {-            arg_count_correct = check_kind_count(+            type_count_correct = check_kind_count(                 "type",                 param_counts.types - defaults.types - has_self as usize,                 param_counts.types - has_self as usize,                 arg_counts.types,                 arg_counts.lifetimes,                 &mut unexpected_spans,                 false,-            )-            .and(arg_count_correct);+            );         } +        // Emit a help message if it's possible that a type could be surrounded in braces+        if let Err((c_mismatch, Some(ref mut _const_err))) = const_count_correct {+            if let Err((_, Some(ref mut type_err))) = type_count_correct {+                let possible_matches = args.args[arg_counts.lifetimes..]+                    .iter()+                    .filter(|arg| matches!(arg, GenericArg::Type(..)))

Ah I misunderstood, my bad

JulianKnodt

comment created time in 25 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Add help note when using type in place of const

 impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {             for span in spans {                 err.span_label(span, label.as_str());             }-            err.emit(); -            Err(true)+            assert_ne!(bound, provided);+            Err((bound as i32 - provided as i32, Some(err)))         }; -        let mut arg_count_correct = Ok(());         let mut unexpected_spans = vec![]; +        let mut lifetime_count_correct = Ok(());         if !infer_lifetimes || arg_counts.lifetimes > param_counts.lifetimes {-            arg_count_correct = check_kind_count(+            lifetime_count_correct = check_kind_count(                 "lifetime",                 param_counts.lifetimes,                 param_counts.lifetimes,                 arg_counts.lifetimes,                 0,                 &mut unexpected_spans,                 explicit_late_bound == ExplicitLateBound::Yes,-            )-            .and(arg_count_correct);+            );         }+         // FIXME(const_generics:defaults)+        let mut const_count_correct = Ok(());         if !infer_args || arg_counts.consts > param_counts.consts {-            arg_count_correct = check_kind_count(+            const_count_correct = check_kind_count(                 "const",                 param_counts.consts,                 param_counts.consts,                 arg_counts.consts,                 arg_counts.lifetimes + arg_counts.types,                 &mut unexpected_spans,                 false,-            )-            .and(arg_count_correct);+            );         }+         // Note that type errors are currently be emitted *after* const errors.+        let mut type_count_correct = Ok(());         if !infer_args || arg_counts.types > param_counts.types - defaults.types - has_self as usize         {-            arg_count_correct = check_kind_count(+            type_count_correct = check_kind_count(                 "type",                 param_counts.types - defaults.types - has_self as usize,                 param_counts.types - has_self as usize,                 arg_counts.types,                 arg_counts.lifetimes,                 &mut unexpected_spans,                 false,-            )-            .and(arg_count_correct);+            );         } +        // Emit a help message if it's possible that a type could be surrounded in braces+        if let Err((c_mismatch, Some(ref mut _const_err))) = const_count_correct {+            if let Err((_, Some(ref mut type_err))) = type_count_correct {+                let possible_matches = args.args[arg_counts.lifetimes..]+                    .iter()+                    .filter(|arg| matches!(arg, GenericArg::Type(..)))

Ah wait I assumed earlier that what you meant was to do this for all types, but I can isolate it to paths instead

JulianKnodt

comment created time in 25 days

PullRequestReviewEvent

push eventJulianKnodt/rust

kadmin

commit sha acac5c6d23044898b870bb4d04051a74ac068ac3

Add regression test

view details

push time in 25 days

pull request commentrust-lang/rust

Add regression test

cc: @Dylan-DPC Probs can just roll up, but I need to actually run the test on my machine.

JulianKnodt

comment created time in 25 days

PR opened rust-lang/rust

Add regression test

This adds a regression test for #75777, effectively closing it since it is solved on nightly and beta.

+13 -0

0 comment

1 changed file

pr created time in 25 days

create barnchJulianKnodt/rust

branch : i75777

created branch time in 25 days

push eventJulianKnodt/rust

kadmin

commit sha 2ab5e6903671ca053a8c894e6f843fdee880dbfe

Change P<Expr> to AnonConst This matches the arguments passed to instantiations of const generics, and makes it specific to just anonymous constants.

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha c0a811a24ee926431f6e8fea6984430138a5fee0

Add regression test for matching on u8

view details

Esteban Küber

commit sha 643258ff6c6f545debeb2ce5b7405522843d6ca0

Tweak suggestion for `this` -> `self`

view details

Esteban Küber

commit sha 360388b160ca5be560fec59acb84a86e813524f3

Suggest adding `&self` when accessing `self` in static assoc `fn`

view details

kadmin

commit sha fd740266de93f89195eee78a0feaa770bf90a47e

Add fix This also explicitly checks that the types are `bool`. `try_eval_bool` also appears to just succeed for `u8`, so this ensures that it actually is a bool before casting.

view details

Esteban Küber

commit sha b77c40e42d9249de3ac38829c8cfa22aa609e3a9

Do not emit E0228 when it is implied by E0106 Emit E0288 (lifetime bound for trait object cannot be deduced) only on bare trait objects. When the trait object is in the form of `&dyn Trait`, E0106 (missing lifetime specifier) will have been emitted, making the former redundant.

view details

Ivan Tham

commit sha dba647ef32e8f076bdc1338249932ed08b61a127

Remove liballoc unneeded explicit link

view details

Ivan Tham

commit sha e0d215ff9e6ab644b244518616f7979966220e79

Update src/liballoc/vec.rs Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

Ivan Tham

commit sha d2ecfcf21dc6c9c2a136c8cfefe2b9f8af7ca549

Update liballoc vec doc link

view details

Esteban Küber

commit sha 2e9b45e1dd8d3a248e2aea60314787650e3abcc9

Recover gracefully from `struct ` parse errors

view details

Jubilee

commit sha 28bca67708aa4565311ef4fc53cec57b75fdedfd

Bump std's libc version to 0.2.74

view details

Ralf Jung

commit sha 6e11329b54c2fc4e3ed73f84c1bce13f253cfed7

mention 'lifetime extension' in promotion doc comments

view details

Ralf Jung

commit sha 7805c200d982f11ab6dc3ead72bca89e9be4d294

answer an old question re: intern kinds

view details

Ralf Jung

commit sha d0d9048d6ced47e95d90c0213dc3b35f979bbb40

add a FIXME concerning interning of promoteds

view details

Jonas Berlin

commit sha 90e4c905d352dc5c5de71af717200c879fec88f7

Improve documentation on process::Child.std* fields As a relative beginner, it took a while for me to figure out I could just steal the references to avoid partially moving the child and thus retain ability to call functions on it (and store it in structs etc).

view details

Christoph Walcher

commit sha 8514b8407ac83dc02532c82c9188c49967d9a5d6

appreciative too_large_for_stack in useless `vec!` Fixes: #5847

view details

chansuke

commit sha 8e549978e58fe724c4637ab71808ff8785743c61

Don't use `to_string` in impl Display

view details

Stein Somers

commit sha 421e0ff3d9aab9f0a1d262d9b4e0f34b49eb2465

BTreeMap: refactor splitpoint and move testing over to unit test

view details

Takayuki Nakata

commit sha f98ffa271d0112d04b482e1d61228d99bf006ccf

Fix FP for `same_item_push` Don't emit a lint when `pushed_item` was declared as mutable variable.

view details

Stein Somers

commit sha 8d1c3c116b6a3e26ab23f662fbf03d645068b228

BTreeMap: refactor splitpoint and move testing over to unit test

view details

Prabakaran Kumaresshan

commit sha 232e3d04b359a5867b530f26698f986ba1732d85

Switch to intra-doc links in os/raw/*.md

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha 714c59b0c72cf92617e4b33d54204e4727f3e99e

Add further tests and liberalize type checking

view details

push time in a month

push eventJulianKnodt/rust

CDirkx

commit sha 6b0d44e92a529962792d3a5f1e7b44b6e3c6ed05

Make some Ordering methods const Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Possible because of #49146 (Allow `if` and `match` in constants).

view details

Camelid

commit sha acd396225e0228f297474524396e08e0f594347e

Fix typo in release notes

view details

Amjad Alsharafi

commit sha d39cc45cf251be63f3066c6002d409274aa9d2a4

Added a lot of min_const_generics revisions

view details

Amjad Alsharafi

commit sha d89d2a972d3174504594ff2eba70423dacaddcfb

Added more min_const_generics revisions to tests

view details

Amjad Alsharafi

commit sha 7a7a28d6bbfa6bbbbd3c4d65a11e9b33995cd63f

Fixed file formatting and made `tidy` happy

view details

Amjad Alsharafi

commit sha 91e4aaa736004284ec9116f7ff439fb9bbfc471e

Use intra-doc links for `core/src/slice.mod.rs` - most are using primitive types links, which cannot be used with intra links at the moment - also `std` cannot be referenced in any link

view details

Amjad Alsharafi

commit sha 8e33137159b3b7a8a524bb7bebc270a9bfbcb822

Fixes `intra-doc` same scope links

view details

Amjad Alsharafi

commit sha a04e12002a0c86a099f8ee8d84a755897535d857

Used intra-doc links for `NonNull::dangling()` occurrences

view details

Amjad Alsharafi

commit sha 6aae4a2fe68f0025d0bae0e97e614bfd3540eb97

Used intra-doc links for `ptr#safety` occurrences

view details

Ivan Tham

commit sha 2d6ab122b7fc4dc94912ec174082cd71c43ea557

Liballoc extend use intra doc link

view details

Camelid

commit sha 7be129e53a8dd2bb84fe99a9e4406099fd181eb0

Add missing hyphen reference counted pointer -> reference-counted pointer

view details

Ivan Tham

commit sha c7e428e862384492460872300519bad19ad7c13d

Liballoc vec doc use associated function Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

asrar

commit sha 7ee515579ea5230b3fac0b7b33f752e28ff13224

GH-66816: Removes disable before return Passing --disable-per-crate-search removes the create search inputs so moved code around so that the search input is enabled first before the function returns

view details

asrar

commit sha eb2bb9902141e228549c30f39d99f11e0cff4ee4

GH-66816: Process before enabling search

view details

Ivan Tham

commit sha d504d553f101bd36aebed28122d43e9fcae0b60e

Keep doc standard for Vec DrainFilter

view details

Ivan Tham

commit sha d727442f2d79e746ce0dad2da519bed91ff4ccda

Remove brackets in drain filter docs

view details

Ivan Tham

commit sha 12b4cf8c6c79239cd7c3c2e7dbb2ea97351da02e

Use assertions on Vec doc Clarify what the state of Vec after with_capacity on doc.

view details

Ivan Tham

commit sha 237c5005d65b28ea135821b2e0e7c66cf2cefa4c

Use explicit intra-doc link in path for Vec resize

view details

Ivan Tham

commit sha be8b5eb529adbb0e62dcc8872918e9c09aba56a4

Reuse description from drain_filter Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

Ivan Tham

commit sha 2d1ab838342c880892a5243bf338b7ead7472928

Remove empty vec assertion flow distrupt Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

push time in a month

Pull request review commentrust-lang/rust

Add help note when using type in place of const

 impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {             for span in spans {                 err.span_label(span, label.as_str());             }-            err.emit(); -            Err(true)+            assert_ne!(bound, provided);+            Err((bound as i32 - provided as i32, Some(err)))         };+        let emit_correct =+            |correct: Result<(), (_, Option<rustc_errors::DiagnosticBuilder<'_>>)>| match correct {+                Ok(()) => Ok(()),+                Err((_, None)) => Err(()),+                Err((_, Some(mut err))) => {+                    err.emit();+                    Err(())+                }+            }; -        let mut arg_count_correct = Ok(());         let mut unexpected_spans = vec![]; +        let mut lifetime_count_correct = Ok(());         if !infer_lifetimes || arg_counts.lifetimes > param_counts.lifetimes {-            arg_count_correct = check_kind_count(+            lifetime_count_correct = check_kind_count(                 "lifetime",                 param_counts.lifetimes,                 param_counts.lifetimes,                 arg_counts.lifetimes,                 0,                 &mut unexpected_spans,                 explicit_late_bound == ExplicitLateBound::Yes,-            )-            .and(arg_count_correct);+            );         }+         // FIXME(const_generics:defaults)+        let mut const_count_correct = Ok(());         if !infer_args || arg_counts.consts > param_counts.consts {-            arg_count_correct = check_kind_count(+            const_count_correct = check_kind_count(                 "const",                 param_counts.consts,                 param_counts.consts,                 arg_counts.consts,                 arg_counts.lifetimes + arg_counts.types,                 &mut unexpected_spans,                 false,-            )-            .and(arg_count_correct);+            );         }+         // Note that type errors are currently be emitted *after* const errors.+        let mut type_count_correct = Ok(());         if !infer_args || arg_counts.types > param_counts.types - defaults.types - has_self as usize         {-            arg_count_correct = check_kind_count(+            type_count_correct = check_kind_count(                 "type",                 param_counts.types - defaults.types - has_self as usize,                 param_counts.types - has_self as usize,                 arg_counts.types,                 arg_counts.lifetimes,                 &mut unexpected_spans,                 false,-            )-            .and(arg_count_correct);+            );         } +        // Emit a help message if it's possible that a type could be surrounded in braces+        if let Err((c_mismatch, Some(ref mut _const_err))) = const_count_correct {+            if let Err((t_mismatch, Some(ref mut type_err))) = type_count_correct {+                if c_mismatch == -t_mismatch && t_mismatch < 0 {+                    for i in 0..c_mismatch as usize {

ah yea I kept this very conservative, but I can extend it to be more open of course.

JulianKnodt

comment created time in a month

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Add help note when using type in place of const

 impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {             for span in spans {                 err.span_label(span, label.as_str());             }-            err.emit(); -            Err(true)+            assert_ne!(bound, provided);+            Err((bound as i32 - provided as i32, Some(err)))         };+        let emit_correct =+            |correct: Result<(), (_, Option<rustc_errors::DiagnosticBuilder<'_>>)>| match correct {+                Ok(()) => Ok(()),+                Err((_, None)) => Err(()),+                Err((_, Some(mut err))) => {+                    err.emit();+                    Err(())+                }+            }; -        let mut arg_count_correct = Ok(());         let mut unexpected_spans = vec![]; +        let mut lifetime_count_correct = Ok(());         if !infer_lifetimes || arg_counts.lifetimes > param_counts.lifetimes {-            arg_count_correct = check_kind_count(+            lifetime_count_correct = check_kind_count(                 "lifetime",                 param_counts.lifetimes,                 param_counts.lifetimes,                 arg_counts.lifetimes,                 0,                 &mut unexpected_spans,                 explicit_late_bound == ExplicitLateBound::Yes,-            )-            .and(arg_count_correct);+            );         }+         // FIXME(const_generics:defaults)+        let mut const_count_correct = Ok(());         if !infer_args || arg_counts.consts > param_counts.consts {-            arg_count_correct = check_kind_count(+            const_count_correct = check_kind_count(                 "const",                 param_counts.consts,                 param_counts.consts,                 arg_counts.consts,                 arg_counts.lifetimes + arg_counts.types,                 &mut unexpected_spans,                 false,-            )-            .and(arg_count_correct);+            );         }+         // Note that type errors are currently be emitted *after* const errors.+        let mut type_count_correct = Ok(());         if !infer_args || arg_counts.types > param_counts.types - defaults.types - has_self as usize         {-            arg_count_correct = check_kind_count(+            type_count_correct = check_kind_count(                 "type",                 param_counts.types - defaults.types - has_self as usize,                 param_counts.types - has_self as usize,                 arg_counts.types,                 arg_counts.lifetimes,                 &mut unexpected_spans,                 false,-            )-            .and(arg_count_correct);+            );         } +        // Emit a help message if it's possible that a type could be surrounded in braces+        if let Err((c_mismatch, Some(ref mut _const_err))) = const_count_correct {+            if let Err((t_mismatch, Some(ref mut type_err))) = type_count_correct {+                if c_mismatch == -t_mismatch && t_mismatch < 0 {+                    for i in 0..c_mismatch as usize {+                        let arg = &args.args[arg_counts.lifetimes + i];+                        match arg {+                            GenericArg::Type(hir::Ty {+                                kind: hir::TyKind::Path { .. }, ..+                            }) => {}+                            _ => continue,+                        }+                        let suggestions = vec![+                            (arg.span().shrink_to_lo(), String::from("{ ")),+                            (arg.span().shrink_to_hi(), String::from(" }")),+                        ];+                        type_err.multipart_suggestion(+                            "If this generic argument was intended as a const parameter, \+                            try surrounding it with braces:",+                            suggestions,+                            Applicability::MaybeIncorrect,+                        );+                    }+                }+            }+        }++        let arg_count_correct = emit_correct(lifetime_count_correct)+            .and(emit_correct(const_count_correct))+            .and(emit_correct(type_count_correct));+         GenericArgCountResult {             explicit_late_bound,-            correct: arg_count_correct.map_err(|reported_err| GenericArgCountMismatch {

Yea since I have 2 PRs open now both of these change this line to be unconditional errors

JulianKnodt

comment created time in a month

PullRequestReviewEvent

issue commentrust-lang/rust

Tracking Issue for `array_map`

Ah I didn't know this crate existed, thanks for the heads up. I'm not quite sure how to resolve this, but will investigate.

JulianKnodt

comment created time in a month

push eventJulianKnodt/rust

Brian Cain

commit sha 2ca1e59bb60e27abc858fc271b91ef5ba4f6b6a6

Hexagon libstd: update type defs

view details

Philippe Nadon

commit sha 2d1515a2c532b0cceec4a14da6f21e48fdca2da5

Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - src/librustc_codegen_llvm/consts.rs - src/librustc_middle/mir/interpret/ - src/librustc_middle/ty/print/pretty.rs - src/librustc_mir/ - src/tools/clippy/clippy_lints/src/consts.rs Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193

view details

Aaron Hill

commit sha 5f7436b5fd27e534b2800389067b169cbe7864b7

Be consistent when describing a move as a 'partial' in diagnostics When an error occurs due to a partial move, we would use the world "partial" in some parts of the error message, but not in others. This commit ensures that we use the word 'partial' in either all or none of the diagnostic messages. Additionally, we no longer describe a move out of a `Box` via `*` as a 'partial move'. This was a pre-existing issue, but became more noticable when the word 'partial' is used in more places.

view details

Wim Looman

commit sha a8de713e26cb0f8e8ae4a7ecb0bf8a413b539926

Improve rendering of crate features via doc(cfg)

view details

Wim Looman

commit sha 234ec956ab91d4aef51b63f25b78d176aa364a60

Render longhand multiple crate/target features nicer

view details

Tim Nielens

commit sha a77e881ec9f324cdc544150f897d8b34281f92e4

should_impl_trait - ignore methods with lifetime params

view details

Tim Nielens

commit sha 2bc0ecd44b4d09476eade641e02451d949a1c8e2

should_implement_trait - add test cases for every checked trait method

view details

Tim Nielens

commit sha e6b2254f9e55743dbace44cc73c6447b6bda58e5

should_implement_trait - pr remarks

view details

Tim Nielens

commit sha 7cc1a2ed879e45605a53b802cfa5291c9a51284c

should_implement_trait - filter on explicit lifetime param only

view details

Tim Nielens

commit sha 166c520e9a8b1a45819255e75dee737136aa6ec8

should_impl_trait - pr comments

view details

Tim Nielens

commit sha f9ba829f6701ae03a5c226044dbbde13ce87e123

should_impl_trait - self linting

view details

Ryan Levick

commit sha 57572cf8096ccb332370f7a711641a061bfd7434

Call into fastfail on abort in libpanic_abort on Windows x86(_64)

view details

Ryan Wiedemann

commit sha 3e3e50bf0fa6282c7265e34589170033c2301edd

Add example of false positive to PTR_ARG docs. Fixes #214

view details

Ryan Wiedemann

commit sha fbf637d12c95528846bfa65ce67bd652f2affb43

formatting

view details

Ryan Levick

commit sha 6778baf516cf00d6ba2d3f448aa312b4ac2e43b5

Fix up docs

view details

Ryan Levick

commit sha b9b8b5c96b60789b6b7846a4036d3cbf2d393014

Reverse formatting

view details

Yuki Okushi

commit sha 91aa55d891e029831e2eceb662184afc8d2e0415

Rollup merge of #75226 - pnadon:miri-undef-uninit, r=RalfJung Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - `src/librustc_codegen_llvm/consts.rs` - `src/librustc_middle/mir/interpret/` - `src/librustc_middle/ty/print/pretty.rs` - `src/librustc_mir/` - `src/tools/clippy/clippy_lints/src/consts.rs` Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193

view details

Matthias Krüger

commit sha b8713e3854cb90b974eceaa1d50484831591619c

unnecessary-mut-passed: make lint message say if fn is a function or a method.

view details

bors

commit sha 3337f7956cf6100c9e5acfd72d42ec312efb6a7f

Auto merge of #5892 - matthiaskrgr:redundant_mut, r=flip1995 unnecessary-mut-passed: make lint message say if fn is a function or a method changelog: refine "unnecessary-mut-passed" lint message

view details

Matthias Krüger

commit sha c0a9d64818d7076b72fd6c3a9e6172eca659034b

stable-sort-primitive: make lint adhere to lint message convention

view details

push time in a month

push eventJulianKnodt/rust

Ryan Levick

commit sha 57572cf8096ccb332370f7a711641a061bfd7434

Call into fastfail on abort in libpanic_abort on Windows x86(_64)

view details

Ryan Wiedemann

commit sha 3e3e50bf0fa6282c7265e34589170033c2301edd

Add example of false positive to PTR_ARG docs. Fixes #214

view details

Ryan Wiedemann

commit sha fbf637d12c95528846bfa65ce67bd652f2affb43

formatting

view details

Ryan Levick

commit sha 6778baf516cf00d6ba2d3f448aa312b4ac2e43b5

Fix up docs

view details

Ryan Levick

commit sha b9b8b5c96b60789b6b7846a4036d3cbf2d393014

Reverse formatting

view details

Ivan Tham

commit sha 8ec348afdd35752677914ba28146d7b82e901817

Remove branch in optimized is_ascii Performs slightly better in short or medium bytes by eliminating the last branch check on `byte_pos == len` and always check the last byte as it is always at most one `usize`. Benchmark, before `libcore`, after `libcore_new`. It improves medium and short by 1ns but regresses unaligned_tail by 2ns, either way we can get unaligned_tail have a tiny chance of 1/8 on a 64 bit machine. I don't think we should bet on that, the probability is worse than dice. test long::case00_libcore ... bench: 38 ns/iter (+/- 1) = 183947 MB/s test long::case00_libcore_new ... bench: 38 ns/iter (+/- 1) = 183947 MB/s test long::case01_iter_all ... bench: 227 ns/iter (+/- 6) = 30792 MB/s test long::case02_align_to ... bench: 40 ns/iter (+/- 1) = 174750 MB/s test long::case03_align_to_unrolled ... bench: 19 ns/iter (+/- 1) = 367894 MB/s test medium::case00_libcore ... bench: 5 ns/iter (+/- 0) = 6400 MB/s test medium::case00_libcore_new ... bench: 4 ns/iter (+/- 0) = 8000 MB/s test medium::case01_iter_all ... bench: 20 ns/iter (+/- 1) = 1600 MB/s test medium::case02_align_to ... bench: 6 ns/iter (+/- 0) = 5333 MB/s test medium::case03_align_to_unrolled ... bench: 5 ns/iter (+/- 0) = 6400 MB/s test short::case00_libcore ... bench: 7 ns/iter (+/- 0) = 1000 MB/s test short::case00_libcore_new ... bench: 6 ns/iter (+/- 0) = 1166 MB/s test short::case01_iter_all ... bench: 5 ns/iter (+/- 0) = 1400 MB/s test short::case02_align_to ... bench: 5 ns/iter (+/- 0) = 1400 MB/s test short::case03_align_to_unrolled ... bench: 5 ns/iter (+/- 1) = 1400 MB/s test unaligned_both::case00_libcore ... bench: 4 ns/iter (+/- 0) = 7500 MB/s test unaligned_both::case00_libcore_new ... bench: 4 ns/iter (+/- 0) = 7500 MB/s test unaligned_both::case01_iter_all ... bench: 26 ns/iter (+/- 0) = 1153 MB/s test unaligned_both::case02_align_to ... bench: 13 ns/iter (+/- 2) = 2307 MB/s test unaligned_both::case03_align_to_unrolled ... bench: 11 ns/iter (+/- 0) = 2727 MB/s test unaligned_head::case00_libcore ... bench: 5 ns/iter (+/- 0) = 6200 MB/s test unaligned_head::case00_libcore_new ... bench: 5 ns/iter (+/- 0) = 6200 MB/s test unaligned_head::case01_iter_all ... bench: 19 ns/iter (+/- 1) = 1631 MB/s test unaligned_head::case02_align_to ... bench: 10 ns/iter (+/- 0) = 3100 MB/s test unaligned_head::case03_align_to_unrolled ... bench: 14 ns/iter (+/- 0) = 2214 MB/s test unaligned_tail::case00_libcore ... bench: 3 ns/iter (+/- 0) = 10333 MB/s test unaligned_tail::case00_libcore_new ... bench: 5 ns/iter (+/- 0) = 6200 MB/s test unaligned_tail::case01_iter_all ... bench: 19 ns/iter (+/- 0) = 1631 MB/s test unaligned_tail::case02_align_to ... bench: 10 ns/iter (+/- 0) = 3100 MB/s test unaligned_tail::case03_align_to_unrolled ... bench: 13 ns/iter (+/- 0) = 2384 MB/s Rough (unfair) maths on improvements for fun: 1ns * 7/8 - 2ns * 1/8 = 0.625ns Inspired by fish and zsh clever trick to highlight missing linefeeds (⏎) and branchless implementation of binary_search in rust.

view details

Yuki Okushi

commit sha 91aa55d891e029831e2eceb662184afc8d2e0415

Rollup merge of #75226 - pnadon:miri-undef-uninit, r=RalfJung Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - `src/librustc_codegen_llvm/consts.rs` - `src/librustc_middle/mir/interpret/` - `src/librustc_middle/ty/print/pretty.rs` - `src/librustc_mir/` - `src/tools/clippy/clippy_lints/src/consts.rs` Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193

view details

Oliver Scherer

commit sha 34c3c0dae5389b345e2a53991425972c02a98abc

Make `<*const T>::is_null` const fn

view details

Stein Somers

commit sha 3a02e06002e3c34cd63c1237d0998414c56f7efc

BTreeMap: purge innocent use of into_kv_mut

view details

Matthias Krüger

commit sha b8713e3854cb90b974eceaa1d50484831591619c

unnecessary-mut-passed: make lint message say if fn is a function or a method.

view details

bors

commit sha 3337f7956cf6100c9e5acfd72d42ec312efb6a7f

Auto merge of #5892 - matthiaskrgr:redundant_mut, r=flip1995 unnecessary-mut-passed: make lint message say if fn is a function or a method changelog: refine "unnecessary-mut-passed" lint message

view details

Matthias Krüger

commit sha c0a9d64818d7076b72fd6c3a9e6172eca659034b

stable-sort-primitive: make lint adhere to lint message convention

view details

Matthias Krüger

commit sha ac194cafc124276d4614bf023ca7ea6e9be9c6ed

map_clone: make lint adhere to lint message convention

view details

Matthias Krüger

commit sha 04867e004ebc0f2edf66d0a457e785848451f13a

mutex-atomic: make lint adhere to lint message convention

view details

Matthias Krüger

commit sha 6af297f80e59050c87078f1ba6f05c97d6f90fd7

iter-next-slice: make lint adhere to lint message convention

view details

Matthias Krüger

commit sha f171f89aed11043e459c3baab305e7f859debb94

int_plus_one: make lint adhere to lint message convention

view details

Matthias Krüger

commit sha bdf4dc3abd9a49f699d9de209a1f4d55ce770191

implicit-saturating-sub: make lint adhere to lint message convention

view details

Matthias Krüger

commit sha 1f17c3b02bce95c7c95a320e9e6e8e88b216d235

multiple_inherent_impl: make lint adhere to lint message convention

view details

Matthias Krüger

commit sha 423615693ba27f77f2e01a82948bbe592f48f6d0

pub-enum-variant-names: make lint adhere to lint message convention

view details

Matthias Krüger

commit sha 2de290d5c5e1d2f0c0f112a51f0cba2e0cb91636

duration-subsec: make lint adhere to lint message convention

view details

push time in a month

push eventJulianKnodt/rust

Brian Cain

commit sha 2ca1e59bb60e27abc858fc271b91ef5ba4f6b6a6

Hexagon libstd: update type defs

view details

Leon Matthes

commit sha e6c83dd57b920d2069797736ae0a1c9fe14a97cb

Document that slice means pointer to a sequence Also document that slices are twice as large as pointers to Sized types

view details

Leon Matthes

commit sha a9af93beebe183d716c0e7313ff8a0fb79b27b6b

Add missing period

view details

Leon Matthes

commit sha 41d3e1cf738b6bfe1c7f85ad09b2adea9c8744e8

Add missing import to Rc

view details

Amos Onn

commit sha 361f668c4996c1f21aee39ea1a105a3067612c11

Use alloc_zeroed in {Rc,Arc}::new_zeroed

view details

Amos Onn

commit sha ab204c5b20742d153968390bae0f3ff1095e2946

Add {Box,Rc,Arc}::new_zeroed_slice

view details

Lzu Tao

commit sha 57c5da8f1c1d36da3b69e98a75ed54efb4b45329

Gate to if-let guard feature

view details

Lzu Tao

commit sha 0a8d4ce055d40bb4897d1cd5c110174ede8ed505

Fallback to pase_expr because match guard accepts struct literals

view details

Lzu Tao

commit sha ef50477c786016bf1712a34155d067b407e35cc0

Add a regression test for match guard Unlike if condition, match guard accepts struct literal.

view details

Philippe Nadon

commit sha 2d1515a2c532b0cceec4a14da6f21e48fdca2da5

Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - src/librustc_codegen_llvm/consts.rs - src/librustc_middle/mir/interpret/ - src/librustc_middle/ty/print/pretty.rs - src/librustc_mir/ - src/tools/clippy/clippy_lints/src/consts.rs Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193

view details

Aaron Hill

commit sha 5f7436b5fd27e534b2800389067b169cbe7864b7

Be consistent when describing a move as a 'partial' in diagnostics When an error occurs due to a partial move, we would use the world "partial" in some parts of the error message, but not in others. This commit ensures that we use the word 'partial' in either all or none of the diagnostic messages. Additionally, we no longer describe a move out of a `Box` via `*` as a 'partial move'. This was a pre-existing issue, but became more noticable when the word 'partial' is used in more places.

view details

Wim Looman

commit sha a8de713e26cb0f8e8ae4a7ecb0bf8a413b539926

Improve rendering of crate features via doc(cfg)

view details

Wim Looman

commit sha 234ec956ab91d4aef51b63f25b78d176aa364a60

Render longhand multiple crate/target features nicer

view details

Tim Nielens

commit sha a77e881ec9f324cdc544150f897d8b34281f92e4

should_impl_trait - ignore methods with lifetime params

view details

Tim Nielens

commit sha 2bc0ecd44b4d09476eade641e02451d949a1c8e2

should_implement_trait - add test cases for every checked trait method

view details

Tim Nielens

commit sha e6b2254f9e55743dbace44cc73c6447b6bda58e5

should_implement_trait - pr remarks

view details

Tim Nielens

commit sha 7cc1a2ed879e45605a53b802cfa5291c9a51284c

should_implement_trait - filter on explicit lifetime param only

view details

Tim Nielens

commit sha 166c520e9a8b1a45819255e75dee737136aa6ec8

should_impl_trait - pr comments

view details

Tim Nielens

commit sha f9ba829f6701ae03a5c226044dbbde13ce87e123

should_impl_trait - self linting

view details

Ryan Levick

commit sha 57572cf8096ccb332370f7a711641a061bfd7434

Call into fastfail on abort in libpanic_abort on Windows x86(_64)

view details

push time in a month

push eventJulianKnodt/rust

Brian Cain

commit sha 2ca1e59bb60e27abc858fc271b91ef5ba4f6b6a6

Hexagon libstd: update type defs

view details

Leon Matthes

commit sha e6c83dd57b920d2069797736ae0a1c9fe14a97cb

Document that slice means pointer to a sequence Also document that slices are twice as large as pointers to Sized types

view details

Leon Matthes

commit sha a9af93beebe183d716c0e7313ff8a0fb79b27b6b

Add missing period

view details

Leon Matthes

commit sha 41d3e1cf738b6bfe1c7f85ad09b2adea9c8744e8

Add missing import to Rc

view details

Amos Onn

commit sha 361f668c4996c1f21aee39ea1a105a3067612c11

Use alloc_zeroed in {Rc,Arc}::new_zeroed

view details

Amos Onn

commit sha ab204c5b20742d153968390bae0f3ff1095e2946

Add {Box,Rc,Arc}::new_zeroed_slice

view details

Lzu Tao

commit sha 57c5da8f1c1d36da3b69e98a75ed54efb4b45329

Gate to if-let guard feature

view details

Lzu Tao

commit sha 0a8d4ce055d40bb4897d1cd5c110174ede8ed505

Fallback to pase_expr because match guard accepts struct literals

view details

Lzu Tao

commit sha ef50477c786016bf1712a34155d067b407e35cc0

Add a regression test for match guard Unlike if condition, match guard accepts struct literal.

view details

Philippe Nadon

commit sha 2d1515a2c532b0cceec4a14da6f21e48fdca2da5

Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - src/librustc_codegen_llvm/consts.rs - src/librustc_middle/mir/interpret/ - src/librustc_middle/ty/print/pretty.rs - src/librustc_mir/ - src/tools/clippy/clippy_lints/src/consts.rs Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193

view details

Aaron Hill

commit sha 5f7436b5fd27e534b2800389067b169cbe7864b7

Be consistent when describing a move as a 'partial' in diagnostics When an error occurs due to a partial move, we would use the world "partial" in some parts of the error message, but not in others. This commit ensures that we use the word 'partial' in either all or none of the diagnostic messages. Additionally, we no longer describe a move out of a `Box` via `*` as a 'partial move'. This was a pre-existing issue, but became more noticable when the word 'partial' is used in more places.

view details

Wim Looman

commit sha a8de713e26cb0f8e8ae4a7ecb0bf8a413b539926

Improve rendering of crate features via doc(cfg)

view details

Wim Looman

commit sha 234ec956ab91d4aef51b63f25b78d176aa364a60

Render longhand multiple crate/target features nicer

view details

Tim Nielens

commit sha a77e881ec9f324cdc544150f897d8b34281f92e4

should_impl_trait - ignore methods with lifetime params

view details

Tim Nielens

commit sha 2bc0ecd44b4d09476eade641e02451d949a1c8e2

should_implement_trait - add test cases for every checked trait method

view details

Tim Nielens

commit sha e6b2254f9e55743dbace44cc73c6447b6bda58e5

should_implement_trait - pr remarks

view details

Tim Nielens

commit sha 7cc1a2ed879e45605a53b802cfa5291c9a51284c

should_implement_trait - filter on explicit lifetime param only

view details

Tim Nielens

commit sha 166c520e9a8b1a45819255e75dee737136aa6ec8

should_impl_trait - pr comments

view details

Tim Nielens

commit sha f9ba829f6701ae03a5c226044dbbde13ce87e123

should_impl_trait - self linting

view details

Ryan Levick

commit sha 57572cf8096ccb332370f7a711641a061bfd7434

Call into fastfail on abort in libpanic_abort on Windows x86(_64)

view details

push time in a month

pull request commentrust-lang/rfcs

[RFC]: Standardize methods for leaking containers

Hi, looking through this doc it appears that there is some codification of standard methods across multiple types. Would it make sense to codify this into a trait? For example FromRaw/IntoRaw? It might not need to be approached in this RFC, but I think it might be useful to do so just to signify to a user that these are all similar operations.

KodrAus

comment created time in a month

Pull request review commentrust-lang/rust

Add fix to error msg which relied on order

+error[E0106]: missing lifetime specifier+  --> $DIR/intermixed-correct-error.rs:10:23+   |+LL | type Consts = Example<3, 3, 3>;+   |                       ^ expected named lifetime parameter+   |+help: consider introducing a named lifetime parameter+   |+LL | type Consts<'a> = Example<'a, 3, 3, 3>;+   |            ^^^^           ^^^++error[E0106]: missing lifetime specifier+  --> $DIR/intermixed-correct-error.rs:13:22+   |+LL | type Types = Example<f32, f32, f32>;+   |                      ^ expected named lifetime parameter+   |+help: consider introducing a named lifetime parameter+   |+LL | type Types<'a> = Example<'a, f32, f32, f32>;+   |           ^^^^           ^^^++error[E0106]: missing lifetime specifier+  --> $DIR/intermixed-correct-error.rs:39:25+   |+LL | type ConstTy1 = Example<3, f32, f32>;+   |                         ^ expected named lifetime parameter+   |+help: consider introducing a named lifetime parameter+   |+LL | type ConstTy1<'a> = Example<'a, 3, f32, f32>;+   |              ^^^^           ^^^++error[E0106]: missing lifetime specifier+  --> $DIR/intermixed-correct-error.rs:42:25+   |+LL | type ConstTy2 = Example<f32, 3, f32>;+   |                         ^ expected named lifetime parameter+   |+help: consider introducing a named lifetime parameter+   |+LL | type ConstTy2<'a> = Example<'a, f32, 3, f32>;+   |              ^^^^           ^^^++error[E0106]: missing lifetime specifier+  --> $DIR/intermixed-correct-error.rs:45:25+   |+LL | type ConstTy3 = Example<f32, f32, 3>;+   |                         ^ expected named lifetime parameter+   |+help: consider introducing a named lifetime parameter+   |+LL | type ConstTy3<'a> = Example<'a, f32, f32, 3>;+   |              ^^^^           ^^^++error[E0106]: missing lifetime specifier+  --> $DIR/intermixed-correct-error.rs:68:25+   |+LL | type TyConst1 = Example<f32, 3, 3>;+   |                         ^ expected named lifetime parameter+   |+help: consider introducing a named lifetime parameter+   |+LL | type TyConst1<'a> = Example<'a, f32, 3, 3>;+   |              ^^^^           ^^^++error[E0106]: missing lifetime specifier+  --> $DIR/intermixed-correct-error.rs:72:25+   |+LL | type TyConst2 = Example<3, f32, 3>;+   |                         ^ expected named lifetime parameter+   |+help: consider introducing a named lifetime parameter+   |+LL | type TyConst2<'a> = Example<'a, 3, f32, 3>;+   |              ^^^^           ^^^++error[E0106]: missing lifetime specifier+  --> $DIR/intermixed-correct-error.rs:75:25+   |+LL | type TyConst3 = Example<3, 3, f32>;+   |                         ^ expected named lifetime parameter+   |+help: consider introducing a named lifetime parameter+   |+LL | type TyConst3<'a> = Example<'a, 3, 3, f32>;+   |              ^^^^           ^^^++error[E0107]: wrong number of const arguments: expected 1, found 3+  --> $DIR/intermixed-correct-error.rs:10:26+   |+LL | type Consts = Example<3, 3, 3>;+   |                          ^  ^ unexpected const argument+   |                          |+   |                          expected type, found const++error[E0107]: wrong number of const arguments: expected 1, found 0+  --> $DIR/intermixed-correct-error.rs:13:14+   |+LL | type Types = Example<f32, f32, f32>;+   |              ^^^^^^^^^^^^^^^^^^^^^^ expected 1 const argument++error[E0107]: wrong number of type arguments: expected at most 1, found 3+  --> $DIR/intermixed-correct-error.rs:13:14+   |+LL | type Types = Example<f32, f32, f32>;+   |              ^^^^^^^^^^^^^^^^^^^^^^+   |              |       |         |+   |              |       |         unexpected type argument+   |              |       expected const, found type+   |              expected at most 1 type argument++error[E0107]: wrong number of lifetime arguments: expected 1, found 3+  --> $DIR/intermixed-correct-error.rs:17:35+   |+LL | type Lifetimes = Example<'static, 'static, 'static>;+   |                                   ^^^^^^^  ^^^^^^^ unexpected lifetime argument+   |                                   |+   |                                   unexpected lifetime argument++error[E0107]: wrong number of const arguments: expected 1, found 0+  --> $DIR/intermixed-correct-error.rs:17:18+   |+LL | type Lifetimes = Example<'static, 'static, 'static>;+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^+   |                  |                |+   |                  |                expected const, found lifetime+   |                  expected 1 const argument++error[E0107]: misplaced type arguments+  --> $DIR/intermixed-correct-error.rs:17:18+   |+LL | type Lifetimes = Example<'static, 'static, 'static>;+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^+   |                  |                         |+   |                  |                         expected type, found lifetime+   |                  expected at most 1 type argument

Ah wait, I'm a bit confused, since the struct has the order <'a, type, const>, shouldn't it just stick to that order

JulianKnodt

comment created time in a month

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Use less divisions in display u128/i128

 mod imp {     impl_Exp!(i8, u8, i16, u16, i32, u32, isize, usize as u32 via to_u32 named exp_u32);     impl_Exp!(i64, u64 as u64 via to_u64 named exp_u64); }--impl_Display!(i128, u128 as u128 via to_u128 named fmt_u128); impl_Exp!(i128, u128 as u128 via to_u128 named exp_u128);++/// Helper function for writing a u64 into `buf` going from last to first, with `curr`.+fn parse_u64_into<const N: usize>(mut n: u64, buf: &mut [MaybeUninit<u8>; N], curr: &mut isize) {+    let buf_ptr = MaybeUninit::first_ptr_mut(buf);+    let lut_ptr = DEC_DIGITS_LUT.as_ptr();+    assert!(*curr > 19);++    // SAFETY:+    // Writes at most 19 characters into the buffer. Guaranteed that any ptr into LUT is at most+    // 198, so will never OOB. There is a check above that there are at least 19 characters+    // remaining.+    unsafe {+        if n >= 1e16 as u64 {+            let to_parse = n % 1e16 as u64;+            n /= 1e16 as u64;++            // Some of these are nops but it looks more elegant this way.+            let d1 = ((to_parse / 1e14 as u64) % 100) << 1;+            let d2 = ((to_parse / 1e12 as u64) % 100) << 1;+            let d3 = ((to_parse / 1e10 as u64) % 100) << 1;+            let d4 = ((to_parse / 1e8 as u64) % 100) << 1;+            let d5 = ((to_parse / 1e6 as u64) % 100) << 1;+            let d6 = ((to_parse / 1e4 as u64) % 100) << 1;+            let d7 = ((to_parse / 1e2 as u64) % 100) << 1;+            let d8 = ((to_parse / 1e0 as u64) % 100) << 1;++            *curr -= 16;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d3 as isize), buf_ptr.offset(*curr + 4), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d4 as isize), buf_ptr.offset(*curr + 6), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d5 as isize), buf_ptr.offset(*curr + 8), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d6 as isize), buf_ptr.offset(*curr + 10), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d7 as isize), buf_ptr.offset(*curr + 12), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d8 as isize), buf_ptr.offset(*curr + 14), 2);+        }+        if n >= 1e8 as u64 {+            let to_parse = n % 1e8 as u64;+            n /= 1e8 as u64;++            // Some of these are nops but it looks more elegant this way.+            let d1 = ((to_parse / 1e6 as u64) % 100) << 1;+            let d2 = ((to_parse / 1e4 as u64) % 100) << 1;+            let d3 = ((to_parse / 1e2 as u64) % 100) << 1;+            let d4 = ((to_parse / 1e0 as u64) % 100) << 1;+            *curr -= 8;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d3 as isize), buf_ptr.offset(*curr + 4), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d4 as isize), buf_ptr.offset(*curr + 6), 2);+        }+        // `n` < 1e8 < (1 << 32)+        let mut n = n as u32;+        if n >= 1e4 as u32 {+            let to_parse = n % 1e4 as u32;+            n /= 1e4 as u32;++            let d1 = (to_parse / 100) << 1;+            let d2 = (to_parse % 100) << 1;+            *curr -= 4;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+        }++        // `n` < 1e4 < (1 << 16)+        let mut n = n as u16;+        if n >= 100 {+            let d1 = (n % 100) << 1;+            n /= 100;+            *curr -= 2;+            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr), 2);+        }++        // decode last 1 or 2 chars+        if n < 10 {+            *curr -= 1;+            *buf_ptr.offset(*curr) = (n as u8) + b'0';+        } else {+            let d1 = n << 1;+            *curr -= 2;+            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr), 2);+        }+    }+}++#[stable(feature = "rust1", since = "1.0.0")]+impl fmt::Display for u128 {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        fmt_u128(*self, true, f)+    }+}++#[stable(feature = "rust1", since = "1.0.0")]+impl fmt::Display for i128 {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        let is_nonnegative = *self >= 0;+        let n = if is_nonnegative {+            self.to_u128()+        } else {+            // convert the negative num to positive by summing 1 to it's 2 complement+            (!self.to_u128()).wrapping_add(1)+        };+        fmt_u128(n, is_nonnegative, f)+    }+}++/// Specialized optimization for u128. Instead of taking two items at a time, it splits+/// into at most 2 u64s, and then chunks by 10e16, 10e8, 10e4, 10e2, and then 10e1.+/// It also has to handle 1 last item, as 10^40 > 2^128 > 10^39, whereas+/// 10^20 > 2^64 > 10^19.+fn fmt_u128(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::Result {+    // 2^128 is about 3*10^38, so 39 gives an extra byte of space+    let mut buf = [MaybeUninit::<u8>::uninit(); 39];+    let mut curr = buf.len() as isize;+    let buf_ptr = MaybeUninit::first_ptr_mut(&mut buf);++    let (n, rem) = udiv_1e9(n);+    parse_u64_into(rem, &mut buf, &mut curr);++    if n != 0 {+        // 0 pad up to point+        let target = (buf.len() - 19) as isize;+        // SAFETY: Guaranteed that we wrote at most 19 bytes, and there must be space+        // remaining since it has length 39+        unsafe {+            ptr::write_bytes(buf_ptr.offset(target), b'0', (curr - target) as usize);+        }+        curr = target;++        let (n, rem) = udiv_1e9(n);+        parse_u64_into(rem, &mut buf, &mut curr);+        // Should this following branch be annotated with unlikely?+        if n != 0 {+            let target = (buf.len() - 38) as isize;+            // SAFETY: At this point we wrote at most 38 bytes, pad up to that point,+            // There can only be at most 1 digit remaining.+            unsafe {+                ptr::write_bytes(buf_ptr.offset(target), b'0', (curr - target) as usize);+                curr = target - 1;+                *buf_ptr.offset(curr) = (n as u8) + b'0';+            }+        }+    }++    // SAFETY: `curr` > 0 (since we made `buf` large enough), and all the chars are valid+    // UTF-8 since `DEC_DIGITS_LUT` is+    let buf_slice = unsafe {+        str::from_utf8_unchecked(slice::from_raw_parts(+            buf_ptr.offset(curr),+            buf.len() - curr as usize,+        ))+    };+    f.pad_integral(is_nonnegative, "", buf_slice)+}++/// Partition of `n` into n > 1e19 and rem <= 1e19+fn udiv_1e9(n: u128) -> (u128, u64) {

Would it be alright to update this, not resolve the issues, and leave a marker to update in the future?

JulianKnodt

comment created time in a month

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Use less divisions in display u128/i128

 mod imp {     impl_Exp!(i8, u8, i16, u16, i32, u32, isize, usize as u32 via to_u32 named exp_u32);     impl_Exp!(i64, u64 as u64 via to_u64 named exp_u64); }--impl_Display!(i128, u128 as u128 via to_u128 named fmt_u128); impl_Exp!(i128, u128 as u128 via to_u128 named exp_u128);++/// Helper function for writing a u64 into `buf` going from last to first, with `curr`.+fn parse_u64_into<const N: usize>(mut n: u64, buf: &mut [MaybeUninit<u8>; N], curr: &mut isize) {+    let buf_ptr = MaybeUninit::first_ptr_mut(buf);+    let lut_ptr = DEC_DIGITS_LUT.as_ptr();+    assert!(*curr > 19);++    // SAFETY:+    // Writes at most 19 characters into the buffer. Guaranteed that any ptr into LUT is at most+    // 198, so will never OOB. There is a check above that there are at least 19 characters+    // remaining.+    unsafe {+        if n >= 1e16 as u64 {+            let to_parse = n % 1e16 as u64;+            n /= 1e16 as u64;++            // Some of these are nops but it looks more elegant this way.+            let d1 = ((to_parse / 1e14 as u64) % 100) << 1;+            let d2 = ((to_parse / 1e12 as u64) % 100) << 1;+            let d3 = ((to_parse / 1e10 as u64) % 100) << 1;+            let d4 = ((to_parse / 1e8 as u64) % 100) << 1;+            let d5 = ((to_parse / 1e6 as u64) % 100) << 1;+            let d6 = ((to_parse / 1e4 as u64) % 100) << 1;+            let d7 = ((to_parse / 1e2 as u64) % 100) << 1;+            let d8 = ((to_parse / 1e0 as u64) % 100) << 1;++            *curr -= 16;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d3 as isize), buf_ptr.offset(*curr + 4), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d4 as isize), buf_ptr.offset(*curr + 6), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d5 as isize), buf_ptr.offset(*curr + 8), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d6 as isize), buf_ptr.offset(*curr + 10), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d7 as isize), buf_ptr.offset(*curr + 12), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d8 as isize), buf_ptr.offset(*curr + 14), 2);+        }+        if n >= 1e8 as u64 {+            let to_parse = n % 1e8 as u64;+            n /= 1e8 as u64;++            // Some of these are nops but it looks more elegant this way.+            let d1 = ((to_parse / 1e6 as u64) % 100) << 1;+            let d2 = ((to_parse / 1e4 as u64) % 100) << 1;+            let d3 = ((to_parse / 1e2 as u64) % 100) << 1;+            let d4 = ((to_parse / 1e0 as u64) % 100) << 1;+            *curr -= 8;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d3 as isize), buf_ptr.offset(*curr + 4), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d4 as isize), buf_ptr.offset(*curr + 6), 2);+        }+        // `n` < 1e8 < (1 << 32)+        let mut n = n as u32;+        if n >= 1e4 as u32 {+            let to_parse = n % 1e4 as u32;+            n /= 1e4 as u32;++            let d1 = (to_parse / 100) << 1;+            let d2 = (to_parse % 100) << 1;+            *curr -= 4;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+        }++        // `n` < 1e4 < (1 << 16)+        let mut n = n as u16;+        if n >= 100 {+            let d1 = (n % 100) << 1;+            n /= 100;+            *curr -= 2;+            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr), 2);+        }++        // decode last 1 or 2 chars+        if n < 10 {+            *curr -= 1;+            *buf_ptr.offset(*curr) = (n as u8) + b'0';+        } else {+            let d1 = n << 1;+            *curr -= 2;+            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr), 2);+        }+    }+}++#[stable(feature = "rust1", since = "1.0.0")]+impl fmt::Display for u128 {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        fmt_u128(*self, true, f)+    }+}++#[stable(feature = "rust1", since = "1.0.0")]+impl fmt::Display for i128 {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        let is_nonnegative = *self >= 0;+        let n = if is_nonnegative {+            self.to_u128()+        } else {+            // convert the negative num to positive by summing 1 to it's 2 complement+            (!self.to_u128()).wrapping_add(1)+        };+        fmt_u128(n, is_nonnegative, f)+    }+}++/// Specialized optimization for u128. Instead of taking two items at a time, it splits+/// into at most 2 u64s, and then chunks by 10e16, 10e8, 10e4, 10e2, and then 10e1.+/// It also has to handle 1 last item, as 10^40 > 2^128 > 10^39, whereas+/// 10^20 > 2^64 > 10^19.+fn fmt_u128(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::Result {+    // 2^128 is about 3*10^38, so 39 gives an extra byte of space+    let mut buf = [MaybeUninit::<u8>::uninit(); 39];+    let mut curr = buf.len() as isize;+    let buf_ptr = MaybeUninit::first_ptr_mut(&mut buf);++    let (n, rem) = udiv_1e9(n);+    parse_u64_into(rem, &mut buf, &mut curr);++    if n != 0 {+        // 0 pad up to point+        let target = (buf.len() - 19) as isize;+        // SAFETY: Guaranteed that we wrote at most 19 bytes, and there must be space+        // remaining since it has length 39+        unsafe {+            ptr::write_bytes(buf_ptr.offset(target), b'0', (curr - target) as usize);+        }+        curr = target;++        let (n, rem) = udiv_1e9(n);+        parse_u64_into(rem, &mut buf, &mut curr);+        // Should this following branch be annotated with unlikely?+        if n != 0 {+            let target = (buf.len() - 38) as isize;+            // SAFETY: At this point we wrote at most 38 bytes, pad up to that point,+            // There can only be at most 1 digit remaining.+            unsafe {+                ptr::write_bytes(buf_ptr.offset(target), b'0', (curr - target) as usize);+                curr = target - 1;+                *buf_ptr.offset(curr) = (n as u8) + b'0';+            }+        }+    }++    // SAFETY: `curr` > 0 (since we made `buf` large enough), and all the chars are valid+    // UTF-8 since `DEC_DIGITS_LUT` is+    let buf_slice = unsafe {+        str::from_utf8_unchecked(slice::from_raw_parts(+            buf_ptr.offset(curr),+            buf.len() - curr as usize,+        ))+    };+    f.pad_integral(is_nonnegative, "", buf_slice)+}++/// Partition of `n` into n > 1e19 and rem <= 1e19+fn udiv_1e9(n: u128) -> (u128, u64) {

By this algorithm, you mean the division into u128 and u64? I've taken that component from itoa, so I'm afraid my understanding of it it lacking. After doing some googling to figure out what strength reduction, I'm not sure if this is the place to do such, as it would seem pretty one-off as you say, but I do wonder if it could be added somewhere upstream.

JulianKnodt

comment created time in a month

PullRequestReviewEvent

push eventJulianKnodt/rust

kadmin

commit sha 1087590679b03416be3d3d26a92cebe1a69b026f

Add benchmarks for fmt u128 This tests both when there is the max amount of work(all characters used) And least amount of work(1 character used)

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha ed49201aa36b2b045c5a12e82abad92cdbff9aac

Add benchmarks for fmt u128 This tests both when there is the max amount of work(all characters used) And least amount of work(1 character used)

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha d4632f81b4d3902041a99ccb281b147b407642d6

Add benchmarks for fmt u128 This tests both when there is the max amount of work(all characters used) And least amount of work(1 character used)

view details

push time in a month

push eventJulianKnodt/rust

Wim Looman

commit sha a8de713e26cb0f8e8ae4a7ecb0bf8a413b539926

Improve rendering of crate features via doc(cfg)

view details

Wim Looman

commit sha 234ec956ab91d4aef51b63f25b78d176aa364a60

Render longhand multiple crate/target features nicer

view details

Nathan West

commit sha 3aa233d3dc0ad43f8693e4638e33e81ddf03b96b

Rebase the LineWriter refactor to the new stdlib layout

view details

Wim Looman

commit sha 3328bd9a0f19b4c7bb8932b262583b8edf885338

Add long cfg description to tooltip on short description

view details

Camelid

commit sha 511ee052a0c2381bb2e6b3cecefb9ee69ebf2467

Use intra-doc links in `core::macros` Also cleaned up some things and added a few more links.

view details

Guillaume Gomez

commit sha c73d4cddcc828a0822c29bf8649db3f5eb35c5ec

Clean up E0761 explanation

view details

Elichai Turkel

commit sha 0cca5978a454fe7087d0182a8bfa1372a6aae320

Fix potential UB in align_offset docs

view details

Ivan Tham

commit sha 16d8d4b899c8f23456027d0baec6ed83d256507c

Error use explicit intra-doc link and fix text

view details

Ivan Tham

commit sha 9ea45935728651e985d70649a476ad89d0bee15e

Use [xxx()] rather than the [xxx] function Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

aticu

commit sha 39f5ebcd7401b050ca948a28db9bf105b9ca6a88

Fix typo in `std::hint::black_box` docs

view details

kadmin

commit sha ed9df28655607a17f01714b67930bdddba14fb26

Fix ICE due to carriage return w/ multibyte char Based off of https://github.com/kfitch/rust/commit/972560b83f80e1219b5735ff3d751c034115b08e

view details

Ivan Tham

commit sha 3a814f3f579d94938ebdbbd7d4508236d7b64233

Reduce duplicate doc link in error Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

Aleksey Kladov

commit sha df975cf9c27681da7751c12f19850e67940593df

Rename rustdoc/test -> rustdoc/doctest This modules contains the implementation of doctests, and not the tests of rustdoc itself. This name is confusing, so let's rename it to doctest for clarity.

view details

Camelid

commit sha c933d697d826dc917161881bdb651eedd6ca5ffc

Use intra-doc links in `core::future::future`

view details

Camelid

commit sha 707298d52c2d4ef831a7987013f5a5517218c1ef

Use intra-doc links in `core::num::dec2flt`

view details

tinaun

commit sha 65b37ce09093ea9a657ac37dd24db2f6343d6710

fix wording in release notes C-like enums are still allowed to impl drop, you just can't cast them to numbers

view details

Rich Kadel

commit sha dd96996c7091c5c382e52e5faeacc2ef3288e9ec

Add InstrProfilingPlatformFuchsia.c to profiler_builtins All other Platform files included in `llvm-project/compiler-rt` were present, except Fuchsia. Now that there is a functional end-to-end version of `-Zinstrument-coverage`, I need to start building and testing coverage-enabled Rust programs on Fuchsia, and this file is required.

view details

Rich Kadel

commit sha 55cd2433dc2f5025137a96d65bf681dd64b6f7f7

Adds --bless support to test/run-make-fulldeps The ability to "bless" output for some of these tests is critical to making it practical to adapt tests to unrelated changes. This is needed for new coverage tests, as shown in PR #75828 (or its derivative).

view details

Nathan West

commit sha 017ed5a5792a85e290ac7ac87019e3507fe37ef9

Improvements to `LineWriter::write_all` `LineWriter::write_all` now only emits a single write when writing a newline when there's already buffered data.

view details

Camelid

commit sha 39cd1846061a15905469cd99f22868a7935c8a03

Remove unnecessary intra-doc link Co-authored-by: Joshua Nelson <joshua@yottadb.com>

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha 9dddbee421e47d35c11c9da738ce0205d534ff8a

Add benchmarks for fmt u128 This tests both when there is the max amount of work(all characters used) And least amount of work(1 character used)

view details

push time in a month

pull request commentrust-lang/rust

Use less divisions in display u128/i128

Seems that this increases the speed of fmt noticeably, will clean up the code and prep for review.

JulianKnodt

comment created time in a month

push eventJulianKnodt/rust

kadmin

commit sha 036d693f89c8f9ce0b59dc07e29c5777f598c0cb

Add benchmarks for fmt u128 This tests both when there is the max amount of work(all characters used) And least amount of work(1 character used)

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha beb5fef493de1c8c9e226ca927a8c7d61482eb7e

Add benchmarks for fmt u128 This tests both when there is the max amount of work(all characters used) And least amount of work(1 character used)

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha fc0946d078276c60e120c3ca4697a0dd45fc15d6

Add zero padding

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha 9e24f8b75d7db5f1290c230b300b1b530afce54a

Add zero padding

view details

push time in a month

push eventJulianKnodt/rust

kadmin

commit sha 1657951f1e75bdd2f78f7756eb061190f0bf0232

Add zero padding

view details

push time in a month

Pull request review commentrust-lang/rust

Use less divisions in display u128/i128

 mod imp {     impl_Exp!(i64, u64 as u64 via to_u64 named exp_u64); } -impl_Display!(i128, u128 as u128 via to_u128 named fmt_u128);+// impl_Display!(i128, u128 as u128 via to_u128 named fmt_u128); impl_Exp!(i128, u128 as u128 via to_u128 named exp_u128);++fn fmt_u64_2<const N: usize>(+    mut rem: u64,+    buf: &mut [MaybeUninit<u8>; N],+    curr: &mut isize,+) {+    let buf_ptr = MaybeUninit::first_ptr_mut(buf);+    let lut_ptr = DEC_DIGITS_LUT.as_ptr();++    // SAFETY:+    // FIXME(fill this in after reviews)+    unsafe {+        if rem >= 1e16 as u64 {+            let to_parse = rem % 1e16 as u64;+            rem /= 1e16 as u64;++            // Some of these are nops but it looks more elegant this way.+            let d1 = ((to_parse / 1e14 as u64) % 100) << 1;+            let d2 = ((to_parse / 1e12 as u64) % 100) << 1;+            let d3 = ((to_parse / 1e10 as u64) % 100) << 1;+            let d4 = ((to_parse / 1e8 as u64) % 100) << 1;+            let d5 = ((to_parse / 1e6 as u64) % 100) << 1;+            let d6 = ((to_parse / 1e4 as u64) % 100) << 1;+            let d7 = ((to_parse / 1e2 as u64) % 100) << 1;+            let d8 = ((to_parse / 1e0 as u64) % 100) << 1;++            *curr -= 16;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d3 as isize), buf_ptr.offset(*curr + 4), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d4 as isize), buf_ptr.offset(*curr + 6), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d5 as isize), buf_ptr.offset(*curr + 8), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d6 as isize), buf_ptr.offset(*curr + 10), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d7 as isize), buf_ptr.offset(*curr + 12), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d8 as isize), buf_ptr.offset(*curr + 14), 2);+        }+        if rem >= 1e8 as u64 {+            let to_parse = rem % 1e8 as u64;+            rem /= 1e8 as u64;++            // Some of these are nops but it looks more elegant this way.+            let d1 = ((to_parse / 1e6 as u64) % 100) << 1;+            let d2 = ((to_parse / 1e4 as u64) % 100) << 1;+            let d3 = ((to_parse / 1e2 as u64) % 100) << 1;+            let d4 = ((to_parse / 1e0 as u64) % 100) << 1;+            *curr -= 8;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d3 as isize), buf_ptr.offset(*curr + 4), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d4 as isize), buf_ptr.offset(*curr + 6), 2);+        }+        // `rem` < 1e8 < (1 << 32)+        let mut rem = rem as u32;+        if rem >= 1e4 as u32 {+            let to_parse = rem % 1e4 as u32;+            rem /= 1e4 as u32;++            let d1 = (to_parse / 100) << 1;+            let d2 = (to_parse % 100) << 1;+            *curr -= 4;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+        }++        // `rem` < 1e4 < (1 << 16)+        let mut rem = rem as u16;+        if rem >= 100 {+            let d1 = (rem % 100) << 1;+            rem /= 100;+            *curr -= 2;+            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr), 2);+        }++        // decode last 1 or 2 chars+        if rem < 10 {+            *curr -= 1;+            *buf_ptr.offset(*curr) = (rem as u8) + b'0';+        } else {+            let d1 = rem << 1;+            *curr -= 2;+            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr), 2);+        }+    }+}++#[stable(feature = "rust1", since = "1.0.0")]+impl fmt::Display for u128 {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        fmt_u128_2(*self, true, f)+    }+}++#[stable(feature = "rust1", since = "1.0.0")]+impl fmt::Display for i128 {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        let is_nonnegative = *self >= 0;+        let n = if is_nonnegative {+            self.to_u128()+        } else {+            // convert the negative num to positive by summing 1 to it's 2 complement+            (!self.to_u128()).wrapping_add(1)+        };+        fmt_u128_2(n, is_nonnegative, f)+    }+}++#[allow(dead_code)]+fn fmt_u128_2(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::Result {+    // 2^128 is about 3*10^38, so 39 gives an extra byte of space+    let mut buf = [MaybeUninit::<u8>::uninit(); 39];+    let mut curr = buf.len() as isize;+    let buf_ptr = MaybeUninit::first_ptr_mut(&mut buf);++    // SAFETY: Since `d1` and `d2` are always less than or equal to `198`, we+    // can copy from `lut_ptr[d1..d1 + 1]` and `lut_ptr[d2..d2 + 1]`. To show+    // that it's OK to copy into `buf_ptr`, notice that at the beginning+    // `curr == buf.len() == 39 > log(n)` since `n < 2^128 < 10^39`, and at+    // each step this is kept the same as `n` is divided. Since `n` is always+    // non-negative, this means that `curr > 0` so `buf_ptr[curr..curr + 1]`+    // is safe to access.+    unsafe {+        let (n, rem) = udiv_1e9(n);+        fmt_u64_2(rem, &mut buf, &mut curr);++        if n != 0 {+            let (n, rem) = udiv_1e9(n);+            fmt_u64_2(rem, &mut buf, &mut curr);+            // Should this following branch be annotated with unlikely?+            if n != 0 {+                curr -= 1;+                *buf_ptr.offset(curr) = (n as u8) + b'0';+            }+        }+    }++    // SAFETY: `curr` > 0 (since we made `buf` large enough), and all the chars are valid+    // UTF-8 since `DEC_DIGITS_LUT` is+    let buf_slice = unsafe {+        str::from_utf8_unchecked(slice::from_raw_parts(+            buf_ptr.offset(curr),+            buf.len() - curr as usize,+        ))+    };+    f.pad_integral(is_nonnegative, "", buf_slice)+}++fn udiv_1e9(n: u128) -> (u128, u64) {+    const DIV: u64 = 1e19 as u64;

In what case can these casts cause unexpected behaviour? In this case the constant is definitely in the u64 range.

If it's defined as const VAR: u64 = { expr }, then there is definitely no runtime cost. Inlining it elsewhere might incur some runtime cost.

JulianKnodt

comment created time in a month

PullRequestReviewEvent

pull request commentrust-lang/project-safe-transmute

Safe Transmute RFC

Just curious, why is the versioning baked into the type system? Is this not solved by Cargo and version locking? I think this was one of the largest complexities I found while reading the proposal

jswrenn

comment created time in a month

push eventJulianKnodt/rust

kadmin

commit sha 770523c5a8a47474692b06ae13b8aa1ffa0da5c2

Use more efficient scheme for display u128/i128

view details

push time in a month

Pull request review commentrust-lang/rust

Use less divisions in display u128/i128

 mod imp {     impl_Exp!(i64, u64 as u64 via to_u64 named exp_u64); } -impl_Display!(i128, u128 as u128 via to_u128 named fmt_u128);+// impl_Display!(i128, u128 as u128 via to_u128 named fmt_u128); impl_Exp!(i128, u128 as u128 via to_u128 named exp_u128);++fn fmt_u64_2<const N: usize>(+    mut rem: u64,+    buf: &mut [MaybeUninit<u8>; N],+    curr: &mut isize,+) {+    let buf_ptr = MaybeUninit::first_ptr_mut(buf);+    let lut_ptr = DEC_DIGITS_LUT.as_ptr();++    // SAFETY:+    // FIXME(fill this in after reviews)+    unsafe {+        if rem >= 1e16 as u64 {+            let to_parse = rem % 1e16 as u64;+            rem /= 1e16 as u64;++            // Some of these are nops but it looks more elegant this way.+            let d1 = ((to_parse / 1e14 as u64) % 100) << 1;+            let d2 = ((to_parse / 1e12 as u64) % 100) << 1;+            let d3 = ((to_parse / 1e10 as u64) % 100) << 1;+            let d4 = ((to_parse / 1e8 as u64) % 100) << 1;+            let d5 = ((to_parse / 1e6 as u64) % 100) << 1;+            let d6 = ((to_parse / 1e4 as u64) % 100) << 1;+            let d7 = ((to_parse / 1e2 as u64) % 100) << 1;+            let d8 = ((to_parse / 1e0 as u64) % 100) << 1;++            *curr -= 16;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d3 as isize), buf_ptr.offset(*curr + 4), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d4 as isize), buf_ptr.offset(*curr + 6), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d5 as isize), buf_ptr.offset(*curr + 8), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d6 as isize), buf_ptr.offset(*curr + 10), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d7 as isize), buf_ptr.offset(*curr + 12), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d8 as isize), buf_ptr.offset(*curr + 14), 2);+        }+        if rem >= 1e8 as u64 {+            let to_parse = rem % 1e8 as u64;+            rem /= 1e8 as u64;++            // Some of these are nops but it looks more elegant this way.+            let d1 = ((to_parse / 1e6 as u64) % 100) << 1;+            let d2 = ((to_parse / 1e4 as u64) % 100) << 1;+            let d3 = ((to_parse / 1e2 as u64) % 100) << 1;+            let d4 = ((to_parse / 1e0 as u64) % 100) << 1;+            *curr -= 8;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d3 as isize), buf_ptr.offset(*curr + 4), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d4 as isize), buf_ptr.offset(*curr + 6), 2);+        }+        // `rem` < 1e8 < (1 << 32)+        let mut rem = rem as u32;+        if rem >= 1e4 as u32 {+            let to_parse = rem % 1e4 as u32;+            rem /= 1e4 as u32;++            let d1 = (to_parse / 100) << 1;+            let d2 = (to_parse % 100) << 1;+            *curr -= 4;++            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr + 0), 2);+            ptr::copy_nonoverlapping(lut_ptr.offset(d2 as isize), buf_ptr.offset(*curr + 2), 2);+        }++        // `rem` < 1e4 < (1 << 16)+        let mut rem = rem as u16;+        if rem >= 100 {+            let d1 = (rem % 100) << 1;+            rem /= 100;+            *curr -= 2;+            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr), 2);+        }++        // decode last 1 or 2 chars+        if rem < 10 {+            *curr -= 1;+            *buf_ptr.offset(*curr) = (rem as u8) + b'0';+        } else {+            let d1 = rem << 1;+            *curr -= 2;+            ptr::copy_nonoverlapping(lut_ptr.offset(d1 as isize), buf_ptr.offset(*curr), 2);+        }+    }+}++#[stable(feature = "rust1", since = "1.0.0")]+impl fmt::Display for u128 {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        fmt_u128_2(*self, true, f)+    }+}++#[stable(feature = "rust1", since = "1.0.0")]+impl fmt::Display for i128 {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        let is_nonnegative = *self >= 0;+        let n = if is_nonnegative {+            self.to_u128()+        } else {+            // convert the negative num to positive by summing 1 to it's 2 complement+            (!self.to_u128()).wrapping_add(1)+        };+        fmt_u128_2(n, is_nonnegative, f)+    }+}++#[allow(dead_code)]+fn fmt_u128_2(n: u128, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::Result {+    // 2^128 is about 3*10^38, so 39 gives an extra byte of space+    let mut buf = [MaybeUninit::<u8>::uninit(); 39];+    let mut curr = buf.len() as isize;+    let buf_ptr = MaybeUninit::first_ptr_mut(&mut buf);++    // SAFETY: Since `d1` and `d2` are always less than or equal to `198`, we+    // can copy from `lut_ptr[d1..d1 + 1]` and `lut_ptr[d2..d2 + 1]`. To show+    // that it's OK to copy into `buf_ptr`, notice that at the beginning+    // `curr == buf.len() == 39 > log(n)` since `n < 2^128 < 10^39`, and at+    // each step this is kept the same as `n` is divided. Since `n` is always+    // non-negative, this means that `curr > 0` so `buf_ptr[curr..curr + 1]`+    // is safe to access.+    unsafe {+        let (n, rem) = udiv_1e9(n);+        fmt_u64_2(rem, &mut buf, &mut curr);++        if n != 0 {+            let (n, rem) = udiv_1e9(n);+            fmt_u64_2(rem, &mut buf, &mut curr);+            // Should this following branch be annotated with unlikely?+            if n != 0 {+                curr -= 1;+                *buf_ptr.offset(curr) = (n as u8) + b'0';+            }+        }+    }++    // SAFETY: `curr` > 0 (since we made `buf` large enough), and all the chars are valid+    // UTF-8 since `DEC_DIGITS_LUT` is+    let buf_slice = unsafe {+        str::from_utf8_unchecked(slice::from_raw_parts(+            buf_ptr.offset(curr),+            buf.len() - curr as usize,+        ))+    };+    f.pad_integral(is_nonnegative, "", buf_slice)+}++fn udiv_1e9(n: u128) -> (u128, u64) {+    const DIV: u64 = 1e19 as u64;

Do you mean this specific one or all the ascasts? In the other cases, I inlined the others, and while technically it should be const-propagated, the cast to me should always occur at compile time, more so than doing .pow(..).

JulianKnodt

comment created time in a month

more