profile
viewpoint

AveryOS/avery 29

x86-64 kernel in Rust

Zoxc/AntiSpam 3

A RedVex anti-spam plugin.

Zoxc/Avery 3

something resembling an microkernel

Zoxc/JassCraft 3

A JASS2 editor

Zoxc/JassParser 3

A parser and typechecker for the JASS2 scripting language.

Zoxc/legion 3

A Galaxy targeting compiler

Zoxc/game 2

Some game.

AveryOS/rust-elfloader 1

Library to load and relocate ELF files.

push eventZoxc/rust

Mark Rousskov

commit sha 3b92689f3d0c3b90fa01d9873cdf01543d51c000

Relax bounds on HashMap to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to no trait bounds: K: Hash + Eq * new * with_capacity K: Eq + Hash, S: BuildHasher * with_hasher * with_capacity_and_hasher * hasher K: Eq + Hash + Debug -> K: Debug S: BuildHasher -> S <HashMap as Debug> K: Eq + Hash -> K S: BuildHasher + Default -> S: Default <HashMap as Default>

view details

Mark Rousskov

commit sha 48859db151b839518bdd9d44a2387c0f6b65d141

Relax bounds on HashSet to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to the new bound: T: Hash + Eq -> T * new * with_capacity T: Eq + Hash, S: BuildHasher -> T * with_hasher * with_capacity_and_hasher * hasher T: Eq + Hash + Debug -> T: Debug S: BuildHasher -> S <HashSet as Debug> T: Eq + Hash -> T S: BuildHasher + Default -> S: Default <HashSet as Default>

view details

Tobias Thiel

commit sha 51021b1d421a7d055ff44f9b6afe11377b825c5c

rustc_session: allow overriding lint level of individual lints from a group

view details

Tobias Thiel

commit sha 34417792deed6f0e570e9c7b01a24f1d05b70519

tools/compiletest: fix argument ordering for allowing unused in ui & compile-fail tests

view details

Tobias Thiel

commit sha 21edd2ae2cc4c06d8ea98051c47d24dc3c4e2238

convert match statement to if let

view details

Tobias Thiel

commit sha 3fc9253a5a27771c72429a738d5379c34e1cd924

rustc: add lint level cli ordering into the documentation

view details

Aaron Hill

commit sha 90afc0765e5e536af6307b63e1655a38df06e235

Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest` Previously, we used a plain `Predicate` to cache results (e.g. successes and failures) in ObligationForest. However, fulfillment depends on the precise `ParamEnv` used, so this is unsound in general. This commit changes the impl of `ForestObligation` for `PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of `Predicate` for the associated type. The associated type and method are renamed from 'predicate' to 'cache_key' to reflect the fact that type is no longer just a predicate.

view details

Steven Degutis

commit sha ac19dffd1eaea34c3861324c2588f9cb1f1489f5

Updating str.chars docs to mention crates.io. This might spare someone else a little time searching the stdlib for unicode/grapheme support.

view details

Oliver Middleton

commit sha 84f3356e0dffc36f57d9be7902822db5d362e24f

Simplify `Skip::nth` and `Skip::last` implementations The main improvement is to make `last` no longer recursive.

view details

John Kåre Alsaker

commit sha bfba6ef328bbba327cae8918e795c11b89217672

Add an option to use LLD to link the compiler on Windows platforms

view details

John Kåre Alsaker

commit sha 95318f8d859dc55cc5e06722c96f6e492529d6ca

Link a linking issue

view details

John Kåre Alsaker

commit sha 2124a85260fdf0851bb4de369d311bcfc05b205f

Don't use a whitelist for use_lld

view details

Tom Jakubowski

commit sha b60f08bd6d3fbe784eb47a57e0c41954454af3dd

rustdoc: NodeId is now DefId

view details

Tom Jakubowski

commit sha 05c6f329e785c9b53a50217de0f21df906ae7ba0

rustdoc: emit JS paths for struct-like variants On the backend, rustdoc now emits `paths` entries to a crate's search index for struct-like enum variants, and index items of type structfield which belong to such variants point to their variant parents in the `paths` table, rather than their enum grandparents. The path entry for a variant is the fully qualified module path plus the enum name. On the frontend, the search code recognizes structfields belonging to structlike variants in the `paths` table and re-constructs the URL to the field's anchor on the enum documentation page. closes #16017

view details

kennytm

commit sha 847d5b4d1387a30f1798a5c3c59c3e0c31e00319

Derive Clone + PartialEq + Eq for std::string::FromUtf8Error

view details

Trevor Spiteri

commit sha fd2282388140ea0f370ee25c82f00be81c2f822c

implement AsMut<str> for String

view details

Guillaume Gomez

commit sha 8ee30dbc1b07ad7fc842ceee6d6729a1377f7a36

Add tests for struct variant field in search

view details

Matthew Jasper

commit sha 91cf0e741186a9fa3bf31b07a65dc89324c10296

Don't requery the param_env of a union Union fields have the ParamEnv of the union.

view details

Matthew Jasper

commit sha 570c1613c1225d5777af5603dcf526da9cf57e19

Remove unnecessary features in rustc_ty

view details

Matthew Jasper

commit sha 39733223fc817efba52a4204dd697192bf5da185

Add IS_MANUALLY_DROP to AdtFlags

view details

push time in 23 minutes

pull request commentrust-lang/rust

Querify object_safety_violations.

@bors try @rust-timer queue

cjgillot

comment created time in an hour

pull request commentrust-lang/rust

[WIP] Add an abstraction for custom query caches

@bors try @rust-timer queue

Zoxc

comment created time in 2 hours

push eventZoxc/rust

Oliver Middleton

commit sha 84f3356e0dffc36f57d9be7902822db5d362e24f

Simplify `Skip::nth` and `Skip::last` implementations The main improvement is to make `last` no longer recursive.

view details

Hiroki Noda

commit sha 67068f35dd41409c8e79710f1335cc9dc64f1860

macOS: avoid calling pthread_self() twice

view details

LeSeulArtichaut

commit sha 2ae493a767536b0a5180c788d9ecf2b7ea8bf749

Stabilize {f32, f64}::{LOG2_10, LOG10_2}

view details

spunit262

commit sha a9b5c692d9319a993ca5dfa6e853a3f5d3f68079

Ignore GDB versions with broken str printing. https://sourceware.org/bugzilla/show_bug.cgi?id=22236

view details

Fisher Darling

commit sha c53693d34d83e6221dc8b93a2c4e17e66fa6f0e2

Handle recursion_limit parsing errors

view details

Esteban Küber

commit sha e5b2c66dea8e2d721612089ebfa00e0799cd5e50

Do not ICE when encountering `yield` inside `async` block

view details

Josh Stone

commit sha 3a55e8875e1c5f4b12954fc939efa76bc9da0a8c

configure: set LLVM flags with a value Rather than a boolean `--enable-cflags` etc., these options should reflect that they are for LLVM, and that they need a value. You would now use `./configure --llvm-cflags="..."`.

view details

Mark Rousskov

commit sha c992ab23fa14a38c5565889d52ba3a3fb6e1e831

Clean out some default-installed directories This helps us have enough disk space for our builders to be able to complete successfully. For now, the choices are ad-hoc and 'definitely not needed'. This should never fail the build, as everything our build needs should be inside Docker.

view details

Yuki Okushi

commit sha 6c4f8598b916087e2758d8c14c249ee5fa4fa0d5

Rollup merge of #67272 - fisherdarling:master, r=varkor,hellow554 recursion_limit parsing handles overflows This PR adds overflow handling to `#![recursion_limit]` attribute parsing. If parsing the given value results in an `IntErrorKind::Overflow`, then the recursion_limit is set to `usize::max_value()`. closes #67265

view details

Yuki Okushi

commit sha ae81241eae061ee9fb2af798b109508c27f208f1

Rollup merge of #68597 - ollie27:skip_nth_last, r=Amanieu Simplify `Skip::nth` and `Skip::last` implementations The main improvement is to make `last` no longer recursive.

view details

Yuki Okushi

commit sha 284acafe61fa76eb56ca2dddd479a2b5f9a262cd

Rollup merge of #68767 - kubo39:patch-macos, r=shepmaster macOS: avoid calling pthread_self() twice

view details

Yuki Okushi

commit sha 35e7c783a26a33375b765c7b5fbb18a11cab3aff

Rollup merge of #69175 - estebank:shall-not-ice, r=petrochenkov Do not ICE when encountering `yield` inside `async` block Fix #67158.

view details

Yuki Okushi

commit sha 8b34f72b4f1a13947c1f066ccd63479da53d3e3d

Rollup merge of #69223 - spunit262:empty-string-gdb-version, r=Dylan-DPC Ignore GDB versions with broken str printing. https://sourceware.org/bugzilla/show_bug.cgi?id=22236

view details

Yuki Okushi

commit sha 6528b9f88799d0a4a2a09c32494b7d207880ddb8

Rollup merge of #69244 - cuviper:llvm-flags, r=Mark-Simulacrum configure: set LLVM flags with a value Rather than a boolean `--enable-cflags` etc., these options should reflect that they are for LLVM, and that they need a value. You would now use `./configure --llvm-cflags="..."`.

view details

Yuki Okushi

commit sha 20c483506a8e1c904f57d8775252f0f74d6de1f2

Rollup merge of #69249 - LeSeulArtichaut:stabilize-logs-consts, r=sfackler Stabilize {f32, f64}::{LOG2_10, LOG10_2} Following the decision to stabilize `LOG2_10` and `LOG10_2` in https://github.com/rust-lang/rust/issues/50540#issuecomment-536627588. Closes #50540. r? @sfackler

view details

Yuki Okushi

commit sha c1a05fbf00f4cf23e43036b2764a835ed4c3c96f

Rollup merge of #69252 - Mark-Simulacrum:disk-try, r=pietroalbini Clean out unused directories for extra disk space This cleans out some of the unused (but large) directories on our linux builders to hopefully allow them to complete without running out of disk space.

view details

bors

commit sha 6317721cd951030f1f28801c34931c3c2322bc06

Auto merge of #69258 - JohnTitor:rollup-n2hljai, r=JohnTitor Rollup of 8 pull requests Successful merges: - #67272 (recursion_limit parsing handles overflows) - #68597 (Simplify `Skip::nth` and `Skip::last` implementations) - #68767 (macOS: avoid calling pthread_self() twice) - #69175 (Do not ICE when encountering `yield` inside `async` block) - #69223 (Ignore GDB versions with broken str printing.) - #69244 (configure: set LLVM flags with a value) - #69249 (Stabilize {f32, f64}::{LOG2_10, LOG10_2}) - #69252 (Clean out unused directories for extra disk space) Failed merges: r? @ghost

view details

John Kåre Alsaker

commit sha f78b0c89f53f225d372f19201730887eca59f4ca

Split query execution into hot and cold paths

view details

John Kåre Alsaker

commit sha 4c42beead4afd6a6eb611c2b7019fd507a2e68c6

Make `try_get_cached` take closures

view details

John Kåre Alsaker

commit sha 7bdb8aa458bec1fe9be07b0f205f25498508e037

Add an abstraction for custom query caches

view details

push time in 2 hours

pull request commentrust-lang/rust

Querify object_safety_violations.

@bors try @rust-timer queue

cjgillot

comment created time in 21 hours

pull request commentrust-lang/rust

[WIP] Add an abstraction for custom query caches

@bors try @rust-timer queue

Zoxc

comment created time in a day

push eventZoxc/rust

Tobias Thiel

commit sha 51021b1d421a7d055ff44f9b6afe11377b825c5c

rustc_session: allow overriding lint level of individual lints from a group

view details

Tobias Thiel

commit sha 34417792deed6f0e570e9c7b01a24f1d05b70519

tools/compiletest: fix argument ordering for allowing unused in ui & compile-fail tests

view details

Tobias Thiel

commit sha 21edd2ae2cc4c06d8ea98051c47d24dc3c4e2238

convert match statement to if let

view details

Tobias Thiel

commit sha 3fc9253a5a27771c72429a738d5379c34e1cd924

rustc: add lint level cli ordering into the documentation

view details

Steven Degutis

commit sha ac19dffd1eaea34c3861324c2588f9cb1f1489f5

Updating str.chars docs to mention crates.io. This might spare someone else a little time searching the stdlib for unicode/grapheme support.

view details

Mazdak Farrokhzad

commit sha cec2a9fad057f71fc640392ba3fa47602aea12f6

macro_legacy_warnings -> error

view details

Dylan MacKenzie

commit sha 5c473a059e26614b65414cfb8cf75c283cda5a87

Don't print block exit state if unchanged

view details

Vadim Petrochenkov

commit sha dcad07af8aa831344fd3be353c71379854637c21

parser: `macro_rules` is a weak keyword

view details

Amos Onn

commit sha 302b9e4b540cc352e75d3de6f803a99147107a50

Improve #Safety in various methods in core::ptr s/for reads and writes/for both ...

view details

Amos Onn

commit sha 351782d30aaa6e15204e17ecdd51ac1e712685cf

Improve #Safety of core::ptr::replace Added missing condition: `dst` must be readable

view details

Amos Onn

commit sha 40ca16794456e9b1520bba6d887a176395f127f0

Improve #Safety in various methods in core::ptr For all methods which read a value of type T, `read`, `read_unaligned`, `read_volatile` and `replace`, added missing constraint: The value they point to must be properly initialized

view details

Guillaume Gomez

commit sha cadf9efad123a62472cad45f22569747cc599256

Clean up E0309 explanation

view details

John Kåre Alsaker

commit sha a7db5051d14994474c641328333884aeba70ca25

Treat NodeIs as pure values for incremental compilation

view details

John Kåre Alsaker

commit sha 8a37811e2c3b89beb135cf96dcb5d887a6262751

Panic when hashing node IDs

view details

Camille GILLOT

commit sha d5691209b6d5fe5e47560b1db7b822dbeb0880fd

Move librustc/{traits,infer} to librustc_infer.

view details

Camille GILLOT

commit sha 187a9741d3cd63dd78571e2a0e08344aef05f51b

Make librustc compile.

view details

Camille GILLOT

commit sha f07e8891458259bb4373bb6aa59d158304f637b1

Make librustc_infer compile.

view details

Camille GILLOT

commit sha 4b57cb3cbed8674aa480bff450affa62ac6b75bf

Make librustc_typeck compile.

view details

Camille GILLOT

commit sha 1637aab15e175b5e0dc14947ffa946804420d414

Make librustc_mir compile.

view details

Camille GILLOT

commit sha 2519f4a0a336993fc2e494a194807c56060256b3

Make librustc_traits compile.

view details

push time in a day

pull request commentrust-lang/rust

Split librustc::{traits,infer} to their respective crates

Could you split Querify object_safety_violations. into a separate PR so we can run perf on it?

cjgillot

comment created time in a day

pull request commentrust-lang/rust

Split librustc::{traits,infer} to a separate crate rustc_infer

This seems to have regressed performance a bit: https://perf.rust-lang.org/compare.html?start=5e7af4669f80e5f682141f050193ab679afdb4b1&end=a643ee8d693b8100e6f54f2a01ff7cde05eb65c5&stat=instructions:u

My guess is that something hot doesn't get inlined in type checking anymore.

cjgillot

comment created time in a day

pull request commentrust-lang/rust

Split librustc::{traits,infer} to their respective crates

Would rustc_trait_selection be a better crate name for rustc_infer::traits?

cc @rust-lang/compiler

cjgillot

comment created time in a day

pull request commentrust-lang/rust

Split librustc::{traits,infer} to a separate crate rustc_infer

This looks good to me besides the dependency mentioned by @matthewjasper, but that can be fixed later in https://github.com/rust-lang/rust/pull/69076.

@bors r+ p=1

cjgillot

comment created time in 2 days

delete branch Zoxc/rust

delete branch : pure-node-id

delete time in 2 days

pull request commentrust-lang/rust

Add an abstraction for custom query caches

Checking to see if removing the storage attributes gives a more neutral performance impact.

@bors try @rust-timer queue

Zoxc

comment created time in 2 days

push eventZoxc/rust

Tom Jakubowski

commit sha b60f08bd6d3fbe784eb47a57e0c41954454af3dd

rustdoc: NodeId is now DefId

view details

Tom Jakubowski

commit sha 05c6f329e785c9b53a50217de0f21df906ae7ba0

rustdoc: emit JS paths for struct-like variants On the backend, rustdoc now emits `paths` entries to a crate's search index for struct-like enum variants, and index items of type structfield which belong to such variants point to their variant parents in the `paths` table, rather than their enum grandparents. The path entry for a variant is the fully qualified module path plus the enum name. On the frontend, the search code recognizes structfields belonging to structlike variants in the `paths` table and re-constructs the URL to the field's anchor on the enum documentation page. closes #16017

view details

Guillaume Gomez

commit sha 8ee30dbc1b07ad7fc842ceee6d6729a1377f7a36

Add tests for struct variant field in search

view details

Daniel Henry-Mantilla

commit sha 60274a95fef57a18113f7c48be68be31ece860eb

Added From<Vec<NonZeroU8>> for CString Updated tracking issue number Added safeguards for transmute_vec potentially being factored out elsewhere Clarified comment about avoiding mem::forget Removed unneeded unstable guard Added back a stability annotation for CI Minor documentation improvements Thanks to @Centril's code review Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com> Improved layout checks, type annotations and removed unaccurate comment Removed unnecessary check on array layout Adapt the stability annotation to the new 1.41 milestone Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com> Simplify the implementation. Use `Vec::into_raw_parts` instead of a manual implementation of `Vec::transmute`. If `Vec::into_raw_parts` uses `NonNull` instead, then the code here will need to be adjusted to take it into account (issue #65816) Reduce the whitespace of safety comments

view details

Ingvar Stepanyan

commit sha 8fb8bb4b3ff25570a7a9b105c1a569bb2307f25f

Fix std::fs::copy on WASI target Previously `std::fs::copy` on wasm32-wasi would reuse code from the `sys_common` module and would successfully copy contents of the file just to fail right before closing it. This was happening because `sys_common::copy` tries to copy permissions of the file, but permissions are not a thing in WASI (at least yet) and `set_permissions` is implemented as an unconditional runtime error. This change instead adds a custom working implementation of `std::fs::copy` (like Rust already has on some other targets) that doesn't try to call `set_permissions` and is essentially a thin wrapper around `std::io::copy`. Fixes #68560.

view details

Dylan MacKenzie

commit sha 95186201724a087bacafc74317722314f203cfdc

Use `ResultsCursor` for `elaborate_drops` The old code hard-coded the transfer function for the initialized places analyses.

view details

Dylan MacKenzie

commit sha f0260ae196b62f27c64738d52519efb424724915

Use `seek_before` instead of `seek_after`

view details

Dylan MacKenzie

commit sha 2aa39350d3dde13f5e82f24d42a51cbfe92f723e

Use more descriptive name to get `InitializationData` state

view details

Dylan MacKenzie

commit sha 26451d007e7482f0c4cdae152a972f4e7c8bf970

Print flow state in debug messages for `find_dead_unwinds`

view details

Yuki Okushi

commit sha be92200af7ac732063500a96890ed0354dcc490b

Check `has_typeck_tables` before calling `typeck_tables_of`

view details

Alberto Piai

commit sha ea2ffda44e0c38854dbe63c786a194dd35559545

add regression test for issue #68794 This is a minimal regression test for the issue #68794: "TEXTREL in i686", which was fixed with e86019c4a0968a1e393cdd0731649168624a88b8. The test links a minimal rust static library into a shared library, and checks that the linker didn't have to add the TEXTREL flag.

view details

Yuki Okushi

commit sha 47aa2b5bfd35d3e094b55a1a2841698f2765e419

Avoid calling `fn_sig` on closures

view details

Max Blachman

commit sha a8fe47d1756df0fb68f6ed2edd2cedfb3cc66d7c

implement LowerExp and UpperExp for integers

view details

Aaron Hill

commit sha 98757f14d0242e6dcae258df8aeb7e17580702ef

Suggest a comma if a struct initializer field fails to parse Currently, we emit a "try adding a comma" suggestion if a comma is missing in a struct definition. However, we emit no such suggestion if a comma is missing in a struct initializer. This commit adds a "try adding a comma" suggestion when we don't find a comma during the parsing of a struct initializer field. The change to `src/test/ui/parser/removed-syntax-with-1.stderr` isn't great, but I don't see a good way of avoiding it.

view details

Dylan DPC

commit sha d28b35812fe6e72c8a499dee73e6687816fe829a

Rollup merge of #64069 - danielhenrymantilla:feature/cstring_from_vec_of_nonzerou8, r=KodrAus Added From<Vec<NonZeroU8>> for CString Added a `From<Vec<NonZeroU8>>` `impl` for `CString` # Rationale - `CString::from_vec_unchecked` is a subtle function, that makes `unsafe` code harder to audit when the generated `Vec`'s creation is non-trivial. This `impl` allows to write safer `unsafe` code thanks to the very explicit semantics of the `Vec<NonZeroU8>` type. - One such situation is when trying to `.read()` a `CString`, see issue #59229. - this lead to a PR: #59314, that was closed for being too specific / narrow (it only targetted being able to `.read()` a `CString`, when this pattern could have been generalized). - the issue suggested another route, based on `From<Vec<NonZeroU8>>`, which is indeed a less general and more concise code pattern. - quoting @shnatsel: - > For me the main thing about making this safe is simplifying auditing - people have spent like an hour looking at just this one unsafe block in libflate because it's not clear what exactly is unchecked, so you have to look it up when auditing anyway. This has distracted us from much more serious memory safety issues the library had. Having this trivial impl in stdlib would turn this into safe code with compiler more or less guaranteeing that it's fine, and save anyone auditing the code a whole lot of time.

view details

Dylan DPC

commit sha afea30dc27b781e4a9843d7b39b0aa32426c1df1

Rollup merge of #66721 - maxbla:exp-format-integers, r=KodrAus implement LowerExp and UpperExp for integers Addresses https://github.com/rust-lang/rust/issues/39479 This implementation is heavily based on the preexisting `macro_rules! impl_Display` in the same file. I don't like the liberal use of unsafe in that macro and would like to modify it so `unsafe` is only present where necessary. What is Rust's policy on doing such modifications? Also, I couldn't figure out where to put tests, can I have some help with that?

view details

Dylan DPC

commit sha 728be34ebc716aa90cc525b42282d6c9f461b67b

Rollup merge of #69106 - RReverser:wasi-fs-copy, r=KodrAus Fix std::fs::copy on WASI target Previously `std::fs::copy` on wasm32-wasi would reuse code from the `sys_common` module and would successfully copy contents of the file just to fail right before closing it. This was happening because `sys_common::copy` tries to copy permissions of the file, but permissions are not a thing in WASI (at least yet) and `set_permissions` is implemented as an unconditional runtime error. This change instead adds a custom working implementation of `std::fs::copy` (like Rust already has on some other targets) that doesn't try to call `set_permissions` and is essentially a thin wrapper around `std::io::copy`. Fixes #68560.

view details

Dylan DPC

commit sha c115ad927a2dc24400de60dc280a9e7029b9bd44

Rollup merge of #69154 - JohnTitor:fix-macro-ices, r=petrochenkov Avoid calling `fn_sig` on closures Fixes #68060 r? @petrochenkov

view details

Dylan DPC

commit sha 09d6a657b1396d8ed9ce052df4a45d4ef47fa608

Rollup merge of #69166 - JohnTitor:ice-const-enum, r=matthewjasper Check `has_typeck_tables` before calling `typeck_tables_of` Fixes #68684 r? @matthewjasper

view details

Dylan DPC

commit sha e9db0613acb2dfdb6a892873d59d0626b20c6cc8

Rollup merge of #69180 - Aaron1011:feature/comma-struct-init, r=petrochenkov Suggest a comma if a struct initializer field fails to parse Currently, we emit a "try adding a comma" suggestion if a comma is missing in a struct definition. However, we emit no such suggestion if a comma is missing in a struct initializer. This commit adds a "try adding a comma" suggestion when we don't find a comma during the parsing of a struct initializer field. The change to `src/test/ui/parser/removed-syntax-with-1.stderr` isn't great, but I don't see a good way of avoiding it.

view details

push time in 2 days

Pull request review commentrust-lang/rust

Fix printing of `Yield` terminator

 impl<'tcx> TerminatorKind<'tcx> {     /// successors, which may be rendered differently between the text and the graphviz format.     pub fn fmt_head<W: Write>(&self, fmt: &mut W) -> fmt::Result {         use self::TerminatorKind::*;-        match *self {+        match self {             Goto { .. } => write!(fmt, "goto"),-            SwitchInt { discr: ref place, .. } => write!(fmt, "switchInt({:?})", place),+            SwitchInt { discr, .. } => write!(fmt, "switchInt({:?})", discr),             Return => write!(fmt, "return"),             GeneratorDrop => write!(fmt, "generator_drop"),             Resume => write!(fmt, "resume"),             Abort => write!(fmt, "abort"),-            Yield { ref value, .. } => write!(fmt, "_1 = suspend({:?})", value),+            Yield { value, resume_arg, .. } => {+                write!(fmt, "{:?} = suspend({:?})", resume_arg, value)

You can probably output yield instead of suspend. I think this was just missed during the Suspend to Yield rename.

jonas-schievink

comment created time in 2 days

pull request commentrust-lang/rust

Panic if NodeIds are used for incremental compilation

I made this panic instead.

r? @petrochenkov

Zoxc

comment created time in 2 days

issue commentrust-lang/rust

Using a String as a generator resume argument causes a segfault

I suspect this is because RequiresStorage doesn't consider Yield terminators as writes.

shepmaster

comment created time in 3 days

issue commentrust-lang/rust

Using a String as a generator resume argument causes a segfault

Well that would explain why the MIR looks wrong.

shepmaster

comment created time in 3 days

push eventZoxc/rust

Mark Rousskov

commit sha 3b92689f3d0c3b90fa01d9873cdf01543d51c000

Relax bounds on HashMap to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to no trait bounds: K: Hash + Eq * new * with_capacity K: Eq + Hash, S: BuildHasher * with_hasher * with_capacity_and_hasher * hasher K: Eq + Hash + Debug -> K: Debug S: BuildHasher -> S <HashMap as Debug> K: Eq + Hash -> K S: BuildHasher + Default -> S: Default <HashMap as Default>

view details

Mark Rousskov

commit sha 48859db151b839518bdd9d44a2387c0f6b65d141

Relax bounds on HashSet to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to the new bound: T: Hash + Eq -> T * new * with_capacity T: Eq + Hash, S: BuildHasher -> T * with_hasher * with_capacity_and_hasher * hasher T: Eq + Hash + Debug -> T: Debug S: BuildHasher -> S <HashSet as Debug> T: Eq + Hash -> T S: BuildHasher + Default -> S: Default <HashSet as Default>

view details

Aaron Hill

commit sha 90afc0765e5e536af6307b63e1655a38df06e235

Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest` Previously, we used a plain `Predicate` to cache results (e.g. successes and failures) in ObligationForest. However, fulfillment depends on the precise `ParamEnv` used, so this is unsound in general. This commit changes the impl of `ForestObligation` for `PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of `Predicate` for the associated type. The associated type and method are renamed from 'predicate' to 'cache_key' to reflect the fact that type is no longer just a predicate.

view details

John Kåre Alsaker

commit sha bfba6ef328bbba327cae8918e795c11b89217672

Add an option to use LLD to link the compiler on Windows platforms

view details

John Kåre Alsaker

commit sha 95318f8d859dc55cc5e06722c96f6e492529d6ca

Link a linking issue

view details

John Kåre Alsaker

commit sha 2124a85260fdf0851bb4de369d311bcfc05b205f

Don't use a whitelist for use_lld

view details

kennytm

commit sha 847d5b4d1387a30f1798a5c3c59c3e0c31e00319

Derive Clone + PartialEq + Eq for std::string::FromUtf8Error

view details

Trevor Spiteri

commit sha fd2282388140ea0f370ee25c82f00be81c2f822c

implement AsMut<str> for String

view details

Matthew Jasper

commit sha 91cf0e741186a9fa3bf31b07a65dc89324c10296

Don't requery the param_env of a union Union fields have the ParamEnv of the union.

view details

Matthew Jasper

commit sha 570c1613c1225d5777af5603dcf526da9cf57e19

Remove unnecessary features in rustc_ty

view details

Matthew Jasper

commit sha 39733223fc817efba52a4204dd697192bf5da185

Add IS_MANUALLY_DROP to AdtFlags

view details

Matthew Jasper

commit sha d1965216a34dc2831cf44d2e15ad9d78403d10cc

Improve needs_drop query * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty

view details

Matthew Jasper

commit sha d20646b2d8033f31423b5bda3e56776df115e144

Address review comments * Handle arrays with const-generic lengths * Use closure for repeated code.

view details

Matthew Jasper

commit sha 465b86253ce828e215d564fde53adf8742f0e3f6

Use correct `ParamEnv` in `Instance::resolve`

view details

Esteban Küber

commit sha 109d5c189f4b5c3405a7d6cfb312e04d866c0c31

Tweak borrow error on `FnMut` when `Fn` is expected

view details

Daniel Henry-Mantilla

commit sha 60274a95fef57a18113f7c48be68be31ece860eb

Added From<Vec<NonZeroU8>> for CString Updated tracking issue number Added safeguards for transmute_vec potentially being factored out elsewhere Clarified comment about avoiding mem::forget Removed unneeded unstable guard Added back a stability annotation for CI Minor documentation improvements Thanks to @Centril's code review Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com> Improved layout checks, type annotations and removed unaccurate comment Removed unnecessary check on array layout Adapt the stability annotation to the new 1.41 milestone Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com> Simplify the implementation. Use `Vec::into_raw_parts` instead of a manual implementation of `Vec::transmute`. If `Vec::into_raw_parts` uses `NonNull` instead, then the code here will need to be adjusted to take it into account (issue #65816) Reduce the whitespace of safety comments

view details

bjorn3

commit sha bdacdf49e532ce869d1eb96e967fd77991566a7f

Remove unused core_intrinsics feature gate from bootstrap

view details

bjorn3

commit sha 095963f91d525951cb0183648c47c427fb69f16d

Remove unused feature gates from librustc

view details

bjorn3

commit sha f9971c5cba0a141d3f00737292a40e3cacf44ac0

Remove unused feature gates from cg_llvm Also turns a few `box` into `Box::new`

view details

bjorn3

commit sha c2da8b3f0d669cb5d6e7d1338aed91fd1c76b8a3

Remove unused feature gates from cg_ssa and cg_utils

view details

push time in 3 days

pull request commentrust-lang/rust

[WIP] Treat NodeIs as pure values for incremental compilation

They exist in macro defs and attributes (in token trees). I'm not sure if they are actually used for anything though.

Zoxc

comment created time in 3 days

pull request commentrust-lang/rust

[WIP] Add an abstraction for custom query caches

@bors try @rust-timer queue

Zoxc

comment created time in 3 days

delete branch Zoxc/rust

delete branch : query-refactor

delete time in 3 days

PR closed rust-lang/rust

[WIP] Split query execution into hot and cold paths S-waiting-on-author
+165 -105

18 comments

3 changed files

Zoxc

pr closed time in 3 days

pull request commentrust-lang/rust

[WIP] Split query execution into hot and cold paths

These changes have been merged into https://github.com/rust-lang/rust/pull/68988.

Zoxc

comment created time in 3 days

push eventZoxc/rust

Aaron Hill

commit sha 90afc0765e5e536af6307b63e1655a38df06e235

Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest` Previously, we used a plain `Predicate` to cache results (e.g. successes and failures) in ObligationForest. However, fulfillment depends on the precise `ParamEnv` used, so this is unsound in general. This commit changes the impl of `ForestObligation` for `PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of `Predicate` for the associated type. The associated type and method are renamed from 'predicate' to 'cache_key' to reflect the fact that type is no longer just a predicate.

view details

Mazdak Farrokhzad

commit sha 6509db844315882db7ec0b624ca1e7b04d72568d

or_patterns: harden bindings test

view details

Mazdak Farrokhzad

commit sha 29437e55a56c1c1251ae5f7276f3e95dac4b609a

or_patterns: rename previous test

view details

Mazdak Farrokhzad

commit sha 17e632d382dfae46e9dfa684db9bddec3e8951a7

or_patterns: test default binding modes

view details

Mazdak Farrokhzad

commit sha b5aca3128d5c0ee2441ec9ca9a9c3ae4f391ef16

typeck: refactor default binding mode logic & improve docs

view details

varkor

commit sha 38060567e89bb142e8a060d91bf53f7e82eaaae6

Correct inference of primitive operand type behind binary operation

view details

varkor

commit sha 0276d7a32e1c83abc3106f7b36b711faf1f74dff

Add more tests

view details

Mazdak Farrokhzad

commit sha ebbaf4611a9605412d2aa31c8ebaf0745557fff0

simplify_try: address some of eddyb's comments

view details

Mazdak Farrokhzad

commit sha f5bd9646be31d865a083193c21c7448d546ce07c

fix extra subslice lowering

view details

Eric Huss

commit sha 1e1b6ad1084783b4d6b21e9c6e79f114991f3dab

Update books.

view details

Camille GILLOT

commit sha 0e652c550711b301086b8f5ead2f6c90418fe7a1

Move resolve_instance to rustc_ty.

view details

Nicholas Nethercote

commit sha dbd8220891d229f9092e623b8a1dcadbddeb12fc

Avoid `base_parser`, it's not needed.

view details

Nicholas Nethercote

commit sha 88b0912d27afa0fa2f9593c3c7545207127ff91c

Fix a typo in a variable name.

view details

Ralf Jung

commit sha cdb4a59633536d8e7f59c0b1ac9a683b196bc4db

update miri

view details

bors

commit sha e168dcd254d0a6a0cbaad5f2c054ce5116a07119

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

view details

bors

commit sha 35071e3e2e74f6f780bc851500b9316e3e82062a

Auto merge of #69100 - cjgillot:resolve_instance, r=Zoxc Move resolve_instance to rustc_ty. r? @Zoxc

view details

bors

commit sha 433aae93e4ef866a1fdfefad136b32ed89acd3e7

Auto merge of #69115 - ehuss:update-books, r=Dylan-DPC Update books. This required some changes in how the books are tested due to some changes in rust-lang/book. It uses new syntax that is not compatible with bare `rustdoc --test`. This changes it so that it uses rustbook to run the tests, which is essentially the same as `mdbook test`. ## reference 7 commits in 11e893fc1357bc688418ddf1087c2b7aa25d154d..64239df6d173562b9deb4f012e4c3e6e960c4754 2020-01-18 21:24:08 +0100 to 2020-02-10 19:05:13 +0100 - Update for nested receivers. (rust-lang-nursery/reference#724) - clarify note re. leading `::` in 2018 (rust-lang-nursery/reference#752) - Update macro-ambiguity.md (rust-lang-nursery/reference#754) - typo fix: add missing `by` (rust-lang-nursery/reference#753) - fix `TypeParamBounds` link on trait objects (rust-lang-nursery/reference#749) - reorganize docs on references (rust-lang-nursery/reference#745) - add MacroRepOp usage for ? (rust-lang-nursery/reference#744) ## book 49 commits in 87dd6843678575f8dda962f239d14ef4be14b352..6fb3705e5230311b096d47f7e2c91f9ce24393d0 2020-01-20 15:20:40 -0500 to 2020-02-12 13:48:57 -0500 - Fix nomicon links. (rust-lang/book#2253) - Update to Rust 1.41.0 (rust-lang/book#2244) - Listing 19-6: use ptr.add instead of ptr.offset (rust-lang/book#2201) - Remove unneeded mutable reference - Clarify deref coercion explanation - Fix typo in link to 1.30 book - Acknowledge Murphy's Law - Clarify that buffer overread is UB in C - Change from "must" to "idiomatic" about comments - Fancy quotes - Make HashMap types match previous example; add fwd ref to ch 13 - Tweak wording to array clarification - Merge remote-tracking branch 'origin/pr/2236' - Update all our crates (rust-lang/book#2235) - Reword git caveat - Merge remote-tracking branch 'origin/pr/2234' - Merge remote-tracking branch 'origin/pr/2230' - println! is a macro (rust-lang/book#2224) - Update a translated version link (rust-lang/book#2221) - move `Macro invocation` from section on tuple to section on mac… (rust-lang/book#2206) - Do not limit `Self` usage in trait implementation (rust-lang/book#2197) - Merge remote-tracking branch 'origin/pr/2191' - Fix wrapping - Merge remote-tracking branch 'origin/pr/2187' - Updated appendix 07 to reflect deprecation of rustup install (rust-lang/book#2181) - Make links to the Nomicon consistent - Merge remote-tracking branch 'origin/pr/2180' - Merge remote-tracking branch 'origin/pr/2175' - Merge remote-tracking branch 'origin/pr/2171' - Merge remote-tracking branch 'origin/pr/2170' - Clarify and make consistent the explanation of unions - Merge remote-tracking branch 'origin/pr/2166' - Handle dev or test in the Finished output line - Link to macros by example rather than macros (rust-lang/book#2164) - Merge remote-tracking branch 'origin/pr/2147' - Fix parens (rust-lang/book#2132) - Clarify type inference with closures requires calling the closures - Update link to French translation (rust-lang/book#2119) - Merge remote-tracking branch 'origin/pr/2108' - Add an explicit cross reference to data type - Merge remote-tracking branch 'origin/pr/2105' - ch15-02-deref: Improve explanation on immut-to-mut (rust-lang/book#2030) - Remove unnecessary quotes - Make markdown link identifier match - Remove extra newline - Merge remote-tracking branch 'origin/pr/2004' - Extract code and output; script formatting and updating them (rust-lang/book#2231) - Switch "Finally" to "Next" to reflect new chapters having been… (rust-lang/book#2098) - ch19-06 added curly braces to macro output (rust-lang/book#2050) ## rust-by-example 2 commits in 1c2bd024d13f8011307e13386cf1fea2180352b5..32facd5522ddbbf37baf01e4e4b6562bc55c071a 2020-01-20 12:18:36 -0300 to 2020-02-11 09:25:06 -0300 - Add missing `dyn` in code sample (rust-lang/rust-by-example#1306) - Improve grammar in a few sections (rust-lang/rust-by-example#1305) ## edition-guide 1 commits in 1a2390247ad6d08160e0dd74f40a01a9578659c2..37f9e6848411188a1062ead1bd8ebe4b8aa16899 2019-12-29 10:40:55 -0800 to 2020-02-10 14:36:14 +0100 - Fixed typo (rust-lang-nursery/edition-guide#196) ## embedded-book 4 commits in 4d78994915af1bde9a95c04a8c27d8dca066232a..b2e1092bf67bd4d7686c4553f186edbb7f5f92db 2020-01-14 08:25:25 +0000 to 2020-01-30 08:45:46 +0000 - Make typestate initialization notes correct (rust-embedded/book#224) - Mention discovery book more prominently (rust-embedded/book#219) - Replace nursery links with rust-lang links (rust-embedded/book#222) - Add a Glossary appendix page (rust-embedded/book#223)

view details

Matthew Jasper

commit sha 033bd8c7af79d362b4e861543b63991e7300948f

Explain a test

view details

Matthew Jasper

commit sha 7f41cf4cef551d887de539842d11945b6bfaa8b6

Check associated opaque types don't use unconstrained lifetimes

view details

Matthew Jasper

commit sha 4af0952961520d44088107d000b78eb3a698edba

Call `is_freeze` less in unsafety-checking This is to avoid cycles when calling `is_freeze` on an opaque type.

view details

push time in 3 days

pull request commentrust-lang/rust

Use queries for the HIR map

@bors try

Zoxc

comment created time in 3 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 14a346765299593704dff6734574b7b35ab3b664

Move `storage` attribute to HIR queries

view details

push time in 3 days

pull request commentrust-lang/rust

Use queries for the HIR map

@bors try @rust-timer queue

Zoxc

comment created time in 3 days

push eventZoxc/rust

Aaron Hill

commit sha 90afc0765e5e536af6307b63e1655a38df06e235

Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest` Previously, we used a plain `Predicate` to cache results (e.g. successes and failures) in ObligationForest. However, fulfillment depends on the precise `ParamEnv` used, so this is unsound in general. This commit changes the impl of `ForestObligation` for `PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of `Predicate` for the associated type. The associated type and method are renamed from 'predicate' to 'cache_key' to reflect the fact that type is no longer just a predicate.

view details

Mazdak Farrokhzad

commit sha 6509db844315882db7ec0b624ca1e7b04d72568d

or_patterns: harden bindings test

view details

Mazdak Farrokhzad

commit sha 29437e55a56c1c1251ae5f7276f3e95dac4b609a

or_patterns: rename previous test

view details

Mazdak Farrokhzad

commit sha 17e632d382dfae46e9dfa684db9bddec3e8951a7

or_patterns: test default binding modes

view details

Mazdak Farrokhzad

commit sha b5aca3128d5c0ee2441ec9ca9a9c3ae4f391ef16

typeck: refactor default binding mode logic & improve docs

view details

varkor

commit sha 38060567e89bb142e8a060d91bf53f7e82eaaae6

Correct inference of primitive operand type behind binary operation

view details

varkor

commit sha 0276d7a32e1c83abc3106f7b36b711faf1f74dff

Add more tests

view details

Mazdak Farrokhzad

commit sha ebbaf4611a9605412d2aa31c8ebaf0745557fff0

simplify_try: address some of eddyb's comments

view details

Mazdak Farrokhzad

commit sha f5bd9646be31d865a083193c21c7448d546ce07c

fix extra subslice lowering

view details

Eric Huss

commit sha 1e1b6ad1084783b4d6b21e9c6e79f114991f3dab

Update books.

view details

Camille GILLOT

commit sha 0e652c550711b301086b8f5ead2f6c90418fe7a1

Move resolve_instance to rustc_ty.

view details

Nicholas Nethercote

commit sha dbd8220891d229f9092e623b8a1dcadbddeb12fc

Avoid `base_parser`, it's not needed.

view details

Nicholas Nethercote

commit sha 88b0912d27afa0fa2f9593c3c7545207127ff91c

Fix a typo in a variable name.

view details

Ralf Jung

commit sha cdb4a59633536d8e7f59c0b1ac9a683b196bc4db

update miri

view details

bors

commit sha e168dcd254d0a6a0cbaad5f2c054ce5116a07119

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

view details

bors

commit sha 35071e3e2e74f6f780bc851500b9316e3e82062a

Auto merge of #69100 - cjgillot:resolve_instance, r=Zoxc Move resolve_instance to rustc_ty. r? @Zoxc

view details

bors

commit sha 433aae93e4ef866a1fdfefad136b32ed89acd3e7

Auto merge of #69115 - ehuss:update-books, r=Dylan-DPC Update books. This required some changes in how the books are tested due to some changes in rust-lang/book. It uses new syntax that is not compatible with bare `rustdoc --test`. This changes it so that it uses rustbook to run the tests, which is essentially the same as `mdbook test`. ## reference 7 commits in 11e893fc1357bc688418ddf1087c2b7aa25d154d..64239df6d173562b9deb4f012e4c3e6e960c4754 2020-01-18 21:24:08 +0100 to 2020-02-10 19:05:13 +0100 - Update for nested receivers. (rust-lang-nursery/reference#724) - clarify note re. leading `::` in 2018 (rust-lang-nursery/reference#752) - Update macro-ambiguity.md (rust-lang-nursery/reference#754) - typo fix: add missing `by` (rust-lang-nursery/reference#753) - fix `TypeParamBounds` link on trait objects (rust-lang-nursery/reference#749) - reorganize docs on references (rust-lang-nursery/reference#745) - add MacroRepOp usage for ? (rust-lang-nursery/reference#744) ## book 49 commits in 87dd6843678575f8dda962f239d14ef4be14b352..6fb3705e5230311b096d47f7e2c91f9ce24393d0 2020-01-20 15:20:40 -0500 to 2020-02-12 13:48:57 -0500 - Fix nomicon links. (rust-lang/book#2253) - Update to Rust 1.41.0 (rust-lang/book#2244) - Listing 19-6: use ptr.add instead of ptr.offset (rust-lang/book#2201) - Remove unneeded mutable reference - Clarify deref coercion explanation - Fix typo in link to 1.30 book - Acknowledge Murphy's Law - Clarify that buffer overread is UB in C - Change from "must" to "idiomatic" about comments - Fancy quotes - Make HashMap types match previous example; add fwd ref to ch 13 - Tweak wording to array clarification - Merge remote-tracking branch 'origin/pr/2236' - Update all our crates (rust-lang/book#2235) - Reword git caveat - Merge remote-tracking branch 'origin/pr/2234' - Merge remote-tracking branch 'origin/pr/2230' - println! is a macro (rust-lang/book#2224) - Update a translated version link (rust-lang/book#2221) - move `Macro invocation` from section on tuple to section on mac… (rust-lang/book#2206) - Do not limit `Self` usage in trait implementation (rust-lang/book#2197) - Merge remote-tracking branch 'origin/pr/2191' - Fix wrapping - Merge remote-tracking branch 'origin/pr/2187' - Updated appendix 07 to reflect deprecation of rustup install (rust-lang/book#2181) - Make links to the Nomicon consistent - Merge remote-tracking branch 'origin/pr/2180' - Merge remote-tracking branch 'origin/pr/2175' - Merge remote-tracking branch 'origin/pr/2171' - Merge remote-tracking branch 'origin/pr/2170' - Clarify and make consistent the explanation of unions - Merge remote-tracking branch 'origin/pr/2166' - Handle dev or test in the Finished output line - Link to macros by example rather than macros (rust-lang/book#2164) - Merge remote-tracking branch 'origin/pr/2147' - Fix parens (rust-lang/book#2132) - Clarify type inference with closures requires calling the closures - Update link to French translation (rust-lang/book#2119) - Merge remote-tracking branch 'origin/pr/2108' - Add an explicit cross reference to data type - Merge remote-tracking branch 'origin/pr/2105' - ch15-02-deref: Improve explanation on immut-to-mut (rust-lang/book#2030) - Remove unnecessary quotes - Make markdown link identifier match - Remove extra newline - Merge remote-tracking branch 'origin/pr/2004' - Extract code and output; script formatting and updating them (rust-lang/book#2231) - Switch "Finally" to "Next" to reflect new chapters having been… (rust-lang/book#2098) - ch19-06 added curly braces to macro output (rust-lang/book#2050) ## rust-by-example 2 commits in 1c2bd024d13f8011307e13386cf1fea2180352b5..32facd5522ddbbf37baf01e4e4b6562bc55c071a 2020-01-20 12:18:36 -0300 to 2020-02-11 09:25:06 -0300 - Add missing `dyn` in code sample (rust-lang/rust-by-example#1306) - Improve grammar in a few sections (rust-lang/rust-by-example#1305) ## edition-guide 1 commits in 1a2390247ad6d08160e0dd74f40a01a9578659c2..37f9e6848411188a1062ead1bd8ebe4b8aa16899 2019-12-29 10:40:55 -0800 to 2020-02-10 14:36:14 +0100 - Fixed typo (rust-lang-nursery/edition-guide#196) ## embedded-book 4 commits in 4d78994915af1bde9a95c04a8c27d8dca066232a..b2e1092bf67bd4d7686c4553f186edbb7f5f92db 2020-01-14 08:25:25 +0000 to 2020-01-30 08:45:46 +0000 - Make typestate initialization notes correct (rust-embedded/book#224) - Mention discovery book more prominently (rust-embedded/book#219) - Replace nursery links with rust-lang links (rust-embedded/book#222) - Add a Glossary appendix page (rust-embedded/book#223)

view details

Matthew Jasper

commit sha 033bd8c7af79d362b4e861543b63991e7300948f

Explain a test

view details

Matthew Jasper

commit sha 7f41cf4cef551d887de539842d11945b6bfaa8b6

Check associated opaque types don't use unconstrained lifetimes

view details

Matthew Jasper

commit sha 4af0952961520d44088107d000b78eb3a698edba

Call `is_freeze` less in unsafety-checking This is to avoid cycles when calling `is_freeze` on an opaque type.

view details

push time in 3 days

pull request commentrust-lang/rust

Use queries for the HIR map

It seems like https://github.com/rust-lang/rust/pull/68693 helped a bit with the performance here.

Zoxc

comment created time in 4 days

pull request commentrust-lang/rust

[WIP] Add an abstraction for custom query caches

@bors try @rust-timer queue

Zoxc

comment created time in 4 days

push eventZoxc/rust

Mark Rousskov

commit sha 3b92689f3d0c3b90fa01d9873cdf01543d51c000

Relax bounds on HashMap to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to no trait bounds: K: Hash + Eq * new * with_capacity K: Eq + Hash, S: BuildHasher * with_hasher * with_capacity_and_hasher * hasher K: Eq + Hash + Debug -> K: Debug S: BuildHasher -> S <HashMap as Debug> K: Eq + Hash -> K S: BuildHasher + Default -> S: Default <HashMap as Default>

view details

Mark Rousskov

commit sha 48859db151b839518bdd9d44a2387c0f6b65d141

Relax bounds on HashSet to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to the new bound: T: Hash + Eq -> T * new * with_capacity T: Eq + Hash, S: BuildHasher -> T * with_hasher * with_capacity_and_hasher * hasher T: Eq + Hash + Debug -> T: Debug S: BuildHasher -> S <HashSet as Debug> T: Eq + Hash -> T S: BuildHasher + Default -> S: Default <HashSet as Default>

view details

John Kåre Alsaker

commit sha bfba6ef328bbba327cae8918e795c11b89217672

Add an option to use LLD to link the compiler on Windows platforms

view details

John Kåre Alsaker

commit sha 95318f8d859dc55cc5e06722c96f6e492529d6ca

Link a linking issue

view details

John Kåre Alsaker

commit sha 2124a85260fdf0851bb4de369d311bcfc05b205f

Don't use a whitelist for use_lld

view details

Matthew Jasper

commit sha a81c59f9b84b6519785a4e0ae9234107d149f454

Remove some unsound specializations

view details

kennytm

commit sha 847d5b4d1387a30f1798a5c3c59c3e0c31e00319

Derive Clone + PartialEq + Eq for std::string::FromUtf8Error

view details

Trevor Spiteri

commit sha fd2282388140ea0f370ee25c82f00be81c2f822c

implement AsMut<str> for String

view details

Mazdak Farrokhzad

commit sha 7af9ff3e699207da7a5220b98ba9831d66697c80

introduce `#![feature(move_ref_pattern)]`

view details

Mazdak Farrokhzad

commit sha d984f127f662f7a1fcf0472230a1b64fcc3325d5

move_ref_patterns: introduce tests bindings_after_at: harden tests

view details

Mazdak Farrokhzad

commit sha 0253f868cab2c5be84d354589b4b833aedbc9987

move_ref_pattern: adjust error index

view details

Mazdak Farrokhzad

commit sha 8d4973f5871fd36b5946b9a06bd1157d4a87bbe0

move_ref_pattern: don't ICE on unreachable 2xby-move conflicts

view details

Mazdak Farrokhzad

commit sha bd318be05dab2e1149595aacbf3d808559fa42dc

move_ref_pattern: change pov in diagnostics & add binding names

view details

Mazdak Farrokhzad

commit sha d2b88b7050b0e21b136022c4cfe8d352c1425588

move_ref_pattern: test captures inside closure

view details

Matthew Jasper

commit sha 91cf0e741186a9fa3bf31b07a65dc89324c10296

Don't requery the param_env of a union Union fields have the ParamEnv of the union.

view details

Matthew Jasper

commit sha 570c1613c1225d5777af5603dcf526da9cf57e19

Remove unnecessary features in rustc_ty

view details

Matthew Jasper

commit sha 39733223fc817efba52a4204dd697192bf5da185

Add IS_MANUALLY_DROP to AdtFlags

view details

Matthew Jasper

commit sha d1965216a34dc2831cf44d2e15ad9d78403d10cc

Improve needs_drop query * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty

view details

Matthew Jasper

commit sha d20646b2d8033f31423b5bda3e56776df115e144

Address review comments * Handle arrays with const-generic lengths * Use closure for repeated code.

view details

Matthew Jasper

commit sha 465b86253ce828e215d564fde53adf8742f0e3f6

Use correct `ParamEnv` in `Instance::resolve`

view details

push time in 4 days

pull request commentrust-lang/rust

Use queries for the HIR map

@rust-timer build 74fce5097f923d83640aaba1861c89fd3ad3d898

Zoxc

comment created time in 4 days

pull request commentrust-lang/rust

Move resolve_instance to rustc_ty.

@bors retry

cjgillot

comment created time in 4 days

push eventZoxc/rust

Mark Rousskov

commit sha 3b92689f3d0c3b90fa01d9873cdf01543d51c000

Relax bounds on HashMap to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to no trait bounds: K: Hash + Eq * new * with_capacity K: Eq + Hash, S: BuildHasher * with_hasher * with_capacity_and_hasher * hasher K: Eq + Hash + Debug -> K: Debug S: BuildHasher -> S <HashMap as Debug> K: Eq + Hash -> K S: BuildHasher + Default -> S: Default <HashMap as Default>

view details

Mark Rousskov

commit sha 48859db151b839518bdd9d44a2387c0f6b65d141

Relax bounds on HashSet to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to the new bound: T: Hash + Eq -> T * new * with_capacity T: Eq + Hash, S: BuildHasher -> T * with_hasher * with_capacity_and_hasher * hasher T: Eq + Hash + Debug -> T: Debug S: BuildHasher -> S <HashSet as Debug> T: Eq + Hash -> T S: BuildHasher + Default -> S: Default <HashSet as Default>

view details

Matthew Jasper

commit sha 91cf0e741186a9fa3bf31b07a65dc89324c10296

Don't requery the param_env of a union Union fields have the ParamEnv of the union.

view details

Matthew Jasper

commit sha 570c1613c1225d5777af5603dcf526da9cf57e19

Remove unnecessary features in rustc_ty

view details

Matthew Jasper

commit sha 39733223fc817efba52a4204dd697192bf5da185

Add IS_MANUALLY_DROP to AdtFlags

view details

Matthew Jasper

commit sha d1965216a34dc2831cf44d2e15ad9d78403d10cc

Improve needs_drop query * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty

view details

Matthew Jasper

commit sha d20646b2d8033f31423b5bda3e56776df115e144

Address review comments * Handle arrays with const-generic lengths * Use closure for repeated code.

view details

Matthew Jasper

commit sha 465b86253ce828e215d564fde53adf8742f0e3f6

Use correct `ParamEnv` in `Instance::resolve`

view details

Nicholas Nethercote

commit sha 6bf2cc2229768faa8e86e0e8a9f5bd8ebfc817a2

Avoid instantiating many `Parser` structs in `generic_extension`. Currently, every iteration of the main loop in `generic_extension` instantiates a `Parser`, which is expensive because `Parser` is a large type. Many of those instantiations are only used immutably, particularly for simple-but-repetitive macros of the sort seen in `html5ever` and PR 68836. This commit initializes a single "base" parser outside the loop, and then uses `Cow` to avoid cloning it except for the mutating iterations. This speeds up `html5ever` runs by up to 15%.

view details

Nicholas Nethercote

commit sha f840a955bd449810e75d8320b4c46482d6dbdec1

Remove the `Cow` from `Directory`. The previous commit wrapped `Parser` within a `Cow` for the hot macro parsing path. As a result, there's no need for the `Cow` within `Directory`, because it lies within `Parser`.

view details

Nicholas Nethercote

commit sha 2a13b24d369b8619f0197993cd5dc60f7217ed72

Change condition ordering in `parse_tt`. This is a small win, because `Failure` is much more common than `Success`.

view details

Mikhail Babenko

commit sha 953f6ecb6adc37b4f8e52102c1e7ca86cc5bc92c

fix lifetime shadowing check in GATs

view details

Esteban Küber

commit sha 97d47a5e7c41274eacbec55a4c08112407c78ff5

Account for type params on method without parens

view details

matthewjasper

commit sha 3eb524188451fcec6cd5ed7e3cba2404021b75eb

Apply suggestions from code review Co-Authored-By: varkor <github@varkor.com>

view details

Matthew Jasper

commit sha 842938a82f673f0483e40328709c3887a2091534

cache adt_drop_tys

view details

Ralf Jung

commit sha 202d401c2504f17133c50505b82fe4278ab2c842

miri: simplify singed operator overflow detection

view details

Ralf Jung

commit sha 28f85c6ffad77554150e7cab4ccac38b26621bdb

bring back extra check for int_min%-1

view details

Ralf Jung

commit sha 7d2f6ae00149e4fdfeb9eedc9cb7433f6e67cf42

miri: equip unary_op with overflow detection

view details

Ralf Jung

commit sha ae23f7020a5cb9a201e83f20f151282368b1f494

const-prop: use overflowing_unary_op for overflowing checking of unary ops

view details

Aaron Hill

commit sha a60669d95cdad0e28cf28790b717bbcf235153f8

Properly use parent generics for opaque types Fixes #67844 Previously, opaque types would only get parent generics if they a return-position-impl-trait (e.g. `fn foo<A>() -> impl MyTrait<A>`). However, it's possible for opaque types to be nested inside one another: ```rust trait WithAssoc { type AssocType; } trait WithParam<A> {} type Return<A> = impl WithAssoc<AssocType = impl WithParam<A>>; ``` When this occurs, we need to ensure that the nested opaque types properly inherit generic parameters from their parent opaque type. This commit fixes the `generics_of` query to take the parent item into account when determining the generics for an opaque type.

view details

push time in 4 days

pull request commentrust-lang/rust

Use queries for the HIR map

@bors try @rust-timer queue

Zoxc

comment created time in 4 days

push eventZoxc/rust

Mikhail Babenko

commit sha 953f6ecb6adc37b4f8e52102c1e7ca86cc5bc92c

fix lifetime shadowing check in GATs

view details

John Kåre Alsaker

commit sha 77ab0d091e32ac9ec4154bba1727fc3937975d64

Construct query job latches on-demand

view details

John Kåre Alsaker

commit sha 19c1012483fe8fb3c793a6ba83f97d896c6a6c98

Use a counter instead of pointers to the stack

view details

John Kåre Alsaker

commit sha 5de82b926486edc54d7183971fde901be9445c6b

Drop the lock guard

view details

John Kåre Alsaker

commit sha 5206827933177ab83e91c38042597b9061c85b96

Address comments

view details

Tomasz Miąsko

commit sha 91b4a24219f33b7ad28b5ba147d50bc160c6f56c

Enable use after scope detection in the new LLVM pass manager Implementation of 08a1c566a792dcf9657d293155f7ada87746bb65 for the new LLVM pass manager, support for which landed in the meantime.

view details

Andreas Jonson

commit sha cec0ed0219c4e4961b9e7a33419d716a5ddf0e5d

add selfprofiling for new llvm passmanager

view details

Jethro Beekman

commit sha 57a62f5335c1e8178802d00dfac94212726ee240

Add comment to SGX entry code

view details

Mazdak Farrokhzad

commit sha e839b2ec849246ec5efe5069c8d874dbef289462

Constness -> enum Const { Yes(Span), No } Same idea for `Unsafety` & use new span for better diagnostics.

view details

Mazdak Farrokhzad

commit sha c30f068dc8b2ef58678b9846ba834dd6dea3fe44

IsAsync -> enum Async { Yes { span: Span, .. }, No } use new span for better diagnostics.

view details

Mazdak Farrokhzad

commit sha 36a17e4067d2e67223cd9a172476ee5503d6b44b

parser_fn_front_matter: allow `const .. extern`

view details

Mazdak Farrokhzad

commit sha a833be21626890de406e12f2561d2ffbda4aadb4

parser: fuse free `fn` parsing together.

view details

Mazdak Farrokhzad

commit sha b05e9d2b4d8692a9f0932e9098727762bfad6efe

parser: solidify `fn` parsing with `parse_fn`.

view details

Mazdak Farrokhzad

commit sha 04253791952d85a4da5d19d228cbac92e37ee2b9

parser: inline `parse_assoc_fn` and friends.

view details

Mazdak Farrokhzad

commit sha cdbbc25cc31080e189a98c010a0b39a9074d0c50

parser: move `ban_async_in_2015` to `fn` parsing & improve it.

view details

Mazdak Farrokhzad

commit sha 05e5530577bf43749186fd56195cffb686f0311e

parser: address review comments

view details

Mazdak Farrokhzad

commit sha 79d139ac7056d0102db605715f354689b0214705

parser: simplify ParamCfg -> ReqName

view details

Mazdak Farrokhzad

commit sha 3341c940068d60ade54ea343301a810c0bb51153

ast_validation: tweak diagnostic output

view details

Mazdak Farrokhzad

commit sha 27f60906aa400aa42bca5346701b7a02fbc1a872

rustc_bulltin_macros: tweak span_labels

view details

Mazdak Farrokhzad

commit sha 4ca3bbf0b21c82d50d14aca9b74a4dd919d9087f

parser: add test for 'extern crate async'

view details

push time in 4 days

push eventZoxc/rust

Mark Rousskov

commit sha 3b92689f3d0c3b90fa01d9873cdf01543d51c000

Relax bounds on HashMap to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to no trait bounds: K: Hash + Eq * new * with_capacity K: Eq + Hash, S: BuildHasher * with_hasher * with_capacity_and_hasher * hasher K: Eq + Hash + Debug -> K: Debug S: BuildHasher -> S <HashMap as Debug> K: Eq + Hash -> K S: BuildHasher + Default -> S: Default <HashMap as Default>

view details

Mark Rousskov

commit sha 48859db151b839518bdd9d44a2387c0f6b65d141

Relax bounds on HashSet to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to the new bound: T: Hash + Eq -> T * new * with_capacity T: Eq + Hash, S: BuildHasher -> T * with_hasher * with_capacity_and_hasher * hasher T: Eq + Hash + Debug -> T: Debug S: BuildHasher -> S <HashSet as Debug> T: Eq + Hash -> T S: BuildHasher + Default -> S: Default <HashSet as Default>

view details

Erin Power

commit sha 49d78fcd901700c5a14e19a6679db1646b5ca901

Add GitHub issue templates

view details

Tomasz Miąsko

commit sha 7e3c51d085d9eaa2204cc18763bc7d98b66435fd

Instrument C / C++ in MemorySanitizer example Modify the example to instrument C / C++ in addition to Rust, since it will be generally required (e.g., when using libbacktrace for symbolication). Additionally use rustc specific flag to track the origins of unitialized memory rather than LLVM one.

view details

Andreas Molzer

commit sha 47ae565ed4f1b2a7cc754d4cf0af520b5e6841b9

Add a method to query the capacity of a BufWriter

view details

Andreas Molzer

commit sha aebd0d733940d62566c66a923c7b9f7078209e98

Add capacity to BufReader with same unstable gate

view details

John Kåre Alsaker

commit sha bfba6ef328bbba327cae8918e795c11b89217672

Add an option to use LLD to link the compiler on Windows platforms

view details

John Kåre Alsaker

commit sha 95318f8d859dc55cc5e06722c96f6e492529d6ca

Link a linking issue

view details

John Kåre Alsaker

commit sha 2124a85260fdf0851bb4de369d311bcfc05b205f

Don't use a whitelist for use_lld

view details

Trevor Spiteri

commit sha aa046da61f8722dfe46204cb303dbc9d2b4cb32e

rustdoc: attempt full build for compile_fail test Some code fails when doing a full build but does not fail when only emitting metadata. This commit makes sure compile_fail tests for such code behave as expected, that is, the test succeeds because the compilation fails.

view details

Trevor Spiteri

commit sha 6d768ddecc13c4acf45730952c0af401a990383a

error code examples: replace some ignore with compile_fail

view details

Rob Pilling

commit sha 3c91bdca1d552055e2b92ecac5275c1ebe9a4ee8

Suggest path separator for single-colon typos This commit adds guidance for when a user means to type a path, but ends up typing a single colon, such as `<<Impl as T>:Ty>`. This change seemed pertinent as the current error message is particularly misleading, emitting `error: unmatched angle bracket`, despite the angle bracket being matched later on, leaving the user to track down the typo'd colon.

view details

Jacob Rothstein

commit sha 2a79ed0b4999bf9e805e0e38cd1faf5f85068368

[docs] remind bug reporters to update nightly

view details

Mark Rousskov

commit sha 39e502744c7db993eb0269285082ac5c7b7d4bdd

Install robots.txt into rust-docs tarballs

view details

Jonas Schievink

commit sha 08e85aa5865dcb8198942a082d892d863367d4d2

Ignore `build` dir formatting

view details

Mark Rousskov

commit sha b613b0cb3641a7a5be74471e8e5963e52adf30ea

Correctly reinstall rustfmt on channel change

view details

Mark Rousskov

commit sha ff95473b5e8fe4a25f59778e6a071abc026e6447

Bump rustfmt and stage0

view details

Mark Rousskov

commit sha 31dcdc9e13c324d33a18db3aed7f4b3208ff3744

Drop cfg(bootstrap) code

view details

hman523

commit sha 346920c3c844e650aff6428c6b5c6e70cbce9954

Fixed issue 68593

view details

Matthew Jasper

commit sha a81c59f9b84b6519785a4e0ae9234107d149f454

Remove some unsound specializations

view details

push time in 4 days

pull request commentrust-lang/rust

Move resolve_instance to rustc_ty.

The performance overhead will be fixed by https://github.com/rust-lang/rust/pull/67797 so I'm just going to approve this.

@bors r+ p=1 rollup=never

cjgillot

comment created time in 4 days

delete branch Zoxc/rust

delete branch : query-no-arc

delete time in 4 days

issue commentrust-lang/rust

Re-evaluate `Hash{Set,Map}` vs `FxHash{Set,Map}` once #69152 lands

You could fork the rustc-hash crate, make it use DefaultHasher and then use [replace] in the workspace Cargo.toml to try it out.

nnethercote

comment created time in 4 days

pull request commentrust-lang/rust

Construct query job latches on-demand

@bors retry

Zoxc

comment created time in 5 days

pull request commentrust-lang/rust

Use HirId in TraitCandidate.

@bors r+

cjgillot

comment created time in 5 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 258c735954bbdb8f6721771d80f1aed3b4d4bcd8

Update tests

view details

push time in 5 days

pull request commentrust-lang/rust

[WIP] Split query execution into hot and cold paths

Oops, didn't mean to do that.

@bors try @rust-timer queue

Zoxc

comment created time in 5 days

push eventZoxc/rust

Mark Rousskov

commit sha 3b92689f3d0c3b90fa01d9873cdf01543d51c000

Relax bounds on HashMap to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to no trait bounds: K: Hash + Eq * new * with_capacity K: Eq + Hash, S: BuildHasher * with_hasher * with_capacity_and_hasher * hasher K: Eq + Hash + Debug -> K: Debug S: BuildHasher -> S <HashMap as Debug> K: Eq + Hash -> K S: BuildHasher + Default -> S: Default <HashMap as Default>

view details

Mark Rousskov

commit sha 48859db151b839518bdd9d44a2387c0f6b65d141

Relax bounds on HashSet to match hashbrown No functional changes are made, and all APIs are moved to strictly less restrictive bounds. These APIs changed from the old bound listed to the new bound: T: Hash + Eq -> T * new * with_capacity T: Eq + Hash, S: BuildHasher -> T * with_hasher * with_capacity_and_hasher * hasher T: Eq + Hash + Debug -> T: Debug S: BuildHasher -> S <HashSet as Debug> T: Eq + Hash -> T S: BuildHasher + Default -> S: Default <HashSet as Default>

view details

Matthew Jasper

commit sha 91cf0e741186a9fa3bf31b07a65dc89324c10296

Don't requery the param_env of a union Union fields have the ParamEnv of the union.

view details

Matthew Jasper

commit sha 570c1613c1225d5777af5603dcf526da9cf57e19

Remove unnecessary features in rustc_ty

view details

Matthew Jasper

commit sha 39733223fc817efba52a4204dd697192bf5da185

Add IS_MANUALLY_DROP to AdtFlags

view details

Matthew Jasper

commit sha d1965216a34dc2831cf44d2e15ad9d78403d10cc

Improve needs_drop query * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty

view details

Matthew Jasper

commit sha d20646b2d8033f31423b5bda3e56776df115e144

Address review comments * Handle arrays with const-generic lengths * Use closure for repeated code.

view details

Matthew Jasper

commit sha 465b86253ce828e215d564fde53adf8742f0e3f6

Use correct `ParamEnv` in `Instance::resolve`

view details

Nicholas Nethercote

commit sha 6bf2cc2229768faa8e86e0e8a9f5bd8ebfc817a2

Avoid instantiating many `Parser` structs in `generic_extension`. Currently, every iteration of the main loop in `generic_extension` instantiates a `Parser`, which is expensive because `Parser` is a large type. Many of those instantiations are only used immutably, particularly for simple-but-repetitive macros of the sort seen in `html5ever` and PR 68836. This commit initializes a single "base" parser outside the loop, and then uses `Cow` to avoid cloning it except for the mutating iterations. This speeds up `html5ever` runs by up to 15%.

view details

Nicholas Nethercote

commit sha f840a955bd449810e75d8320b4c46482d6dbdec1

Remove the `Cow` from `Directory`. The previous commit wrapped `Parser` within a `Cow` for the hot macro parsing path. As a result, there's no need for the `Cow` within `Directory`, because it lies within `Parser`.

view details

Nicholas Nethercote

commit sha 2a13b24d369b8619f0197993cd5dc60f7217ed72

Change condition ordering in `parse_tt`. This is a small win, because `Failure` is much more common than `Success`.

view details

Esteban Küber

commit sha 97d47a5e7c41274eacbec55a4c08112407c78ff5

Account for type params on method without parens

view details

matthewjasper

commit sha 3eb524188451fcec6cd5ed7e3cba2404021b75eb

Apply suggestions from code review Co-Authored-By: varkor <github@varkor.com>

view details

Matthew Jasper

commit sha 842938a82f673f0483e40328709c3887a2091534

cache adt_drop_tys

view details

Ralf Jung

commit sha 202d401c2504f17133c50505b82fe4278ab2c842

miri: simplify singed operator overflow detection

view details

Ralf Jung

commit sha 28f85c6ffad77554150e7cab4ccac38b26621bdb

bring back extra check for int_min%-1

view details

Ralf Jung

commit sha 7d2f6ae00149e4fdfeb9eedc9cb7433f6e67cf42

miri: equip unary_op with overflow detection

view details

Ralf Jung

commit sha ae23f7020a5cb9a201e83f20f151282368b1f494

const-prop: use overflowing_unary_op for overflowing checking of unary ops

view details

Aaron Hill

commit sha a60669d95cdad0e28cf28790b717bbcf235153f8

Properly use parent generics for opaque types Fixes #67844 Previously, opaque types would only get parent generics if they a return-position-impl-trait (e.g. `fn foo<A>() -> impl MyTrait<A>`). However, it's possible for opaque types to be nested inside one another: ```rust trait WithAssoc { type AssocType; } trait WithParam<A> {} type Return<A> = impl WithAssoc<AssocType = impl WithParam<A>>; ``` When this occurs, we need to ensure that the nested opaque types properly inherit generic parameters from their parent opaque type. This commit fixes the `generics_of` query to take the parent item into account when determining the generics for an opaque type.

view details

Nicholas Nethercote

commit sha f8a02864afa2faecc3cb9cb8f81905a61a638ade

Speed up `SipHasher128`. The current code in `SipHasher128::short_write` is inefficient. It uses `u8to64_le` (which is complex and slow) to extract just the right number of bytes of the input into a u64 and pad the result with zeroes. It then left-shifts that value in order to bitwise-OR it with `self.tail`. For example, imagine we have a u32 input 0xIIHH_GGFF and only need three bytes to fill up `self.tail`. The current code uses `u8to64_le` to construct 0x0000_0000_00HH_GGFF, which is just 0xIIHH_GGFF with the 0xII removed and zero-extended to a u64. The code then left-shifts that value by five bytes -- discarding the 0x00 byte that replaced the 0xII byte! -- to give 0xHHGG_FF00_0000_0000. It then then ORs that value with self.tail. There's a much simpler way to do it: zero-extend to u64 first, then left shift. E.g. 0xIIHH_GGFF is zero-extended to 0x0000_0000_IIHH_GGFF, and then left-shifted to 0xHHGG_FF00_0000_0000. We don't have to take time to exclude the unneeded 0xII byte, because it just gets shifted out anyway! It also avoids multiple occurrences of `unsafe`. There's a similar story with the setting of `self.tail` at the method's end. The current code uses `u8to64_le` to extract the remaining part of the input, but the same effect can be achieved more quickly with a right shift on the zero-extended input. All that works on little-endian. It doesn't work for big-endian, but we can just do a `to_le` before calling `short_write` and then it works. This commit changes `SipHasher128` to use the simpler shift-based approach. The code is also smaller, which means that `short_write` is now inlined where previously it wasn't, which makes things faster again. This gives big speed-ups for all incremental builds, especially "baseline" incremental builds.

view details

push time in 5 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 438a6bafafef7045008d20b17541f32517052f01

Split query execution into hot and cold paths

view details

push time in 5 days

Pull request review commentrust-lang/rust

Use HirId in TraitCandidate.

 pub type CaptureModeMap = NodeMap<CaptureBy>; #[derive(Clone, Debug)] pub struct TraitCandidate {

You could make this generic over the id instead of duplicating it.

cjgillot

comment created time in 5 days

Pull request review commentrust-lang/rust

Use HirId in TraitCandidate.

 impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::TraitCandidate {          let import_keys = import_ids

Maybe just leave it like this for now.

cjgillot

comment created time in 5 days

Pull request review commentrust-lang/rust

Use HirId in TraitCandidate.

 impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::TraitCandidate {          let import_keys = import_ids

I think this method can just return the fields of TraitCandidate now.

cjgillot

comment created time in 5 days

pull request commentrust-lang/rust

Fix box_region.rs

@lebensterben The build fails because generators now take an argument, and you removed them in this PR.

lebensterben

comment created time in 5 days

PR closed rust-lang/rust

Fix box_region.rs S-waiting-on-review

As reported in https://github.com/racer-rust/racer/issues/1093, When building racer, compiler throws error E0061, that the method resume() expect 0 parameter, but 1 parameter () is supplied.

This commit removed the wrongly supplied parameter to resume().

+3 -3

5 comments

1 changed file

lebensterben

pr closed time in 5 days

pull request commentrust-lang/rust

Fix box_region.rs

This seems to be the result of trying to install racer with the wrong nightly and is not a bug in rustc.

lebensterben

comment created time in 5 days

pull request commentrust-lang/rust

[WIP] Split query execution into hot and cold paths

@rust-timer build 14e43456b2599ec8d1b7b839ced3ac834312659d

Zoxc

comment created time in 5 days

pull request commentrust-lang/rust

[WIP] Split query execution into hot and cold paths

@bors try @rust-timer queue

Zoxc

comment created time in 6 days

PR opened rust-lang/rust

[WIP] Split query execution into hot and cold paths
+455 -239

0 comment

6 changed files

pr created time in 6 days

push eventZoxc/rust

Guillaume Gomez

commit sha 9746b05da995629780f559e68cde2a3d41b3b2bc

clean up e0200 explanation

view details

bors

commit sha 779f85bac6b304dd4cad5981acf053a2c0601582

Auto merge of #68001 - Marwes:lexical_region_resolve, r=nikomatsakis perf: Only search potentially changed constraints in lexical_region_resolve Gives a big performance increase to the unicode_normalization benchmark in my testing.

view details

Mazdak Farrokhzad

commit sha c41443a2b729054c48cd798e341f75f076b390a7

stabilize slice_patterns

view details

Mazdak Farrokhzad

commit sha 0aebb0811548202b177ab411a7570e1fd3e43bc0

slice_patterns: adjust error codes

view details

Konrad Borowski

commit sha a70b24018936fe59f0a037adfa13f2255d8aa5d2

Make iter::Empty<T> implement Send and Sync for any T

view details

Konrad Borowski

commit sha d7a18f89864a4360230e3cbbdcbf22d9864a86e0

Add a test for iter::empty::<*mut i32> being Sync and Send

view details

Mazdak Farrokhzad

commit sha 3ccb0f9b8f990df7f2149655fb3bf7585ddc8cad

slice_patterns: remove internal uses of gate

view details

Mazdak Farrokhzad

commit sha 3e3cac010b318c6a2aa89ffbbafaea169898ba3d

slice_patterns: remove feature gate test

view details

Mazdak Farrokhzad

commit sha a1eadca88f03de91f5eecd316419d32e2a302c2b

slice_patterns: remove gates in tests

view details

Mazdak Farrokhzad

commit sha e3c2f8fc57e718f4ba1d7f52405eb2c1cb434559

slice_patterns: organize some tests

view details

Mazdak Farrokhzad

commit sha 120e98c3c7d28b1667576d0fa32fa94751968699

slice_patterns: remove from unstable book

view details

Mazdak Farrokhzad

commit sha 57b6843100b247b6065b71e4485572dda4bfccc6

slice_patterns: address review comments

view details

Mazdak Farrokhzad

commit sha 733c7f440e7777f35bb527f8b75cb9351d31c14d

Rollup merge of #67712 - Centril:stabilize-slice_patterns, r=matthewjasper Stabilize `#![feature(slice_patterns)]` in 1.42.0 # Stabilization report The following is the stabilization report for `#![feature(slice_patterns)]`. This report is the collaborative effort of @matthewjasper and @Centril. Tracking issue: https://github.com/rust-lang/rust/issues/62254 [Version target](https://forge.rust-lang.org/#current-release-versions): 1.42 (2020-01-30 => beta, 2020-03-12 => stable). ## Backstory: slice patterns It is already possible to use slice patterns on stable Rust to match on arrays and slices. For example, to match on a slice, you may write: ```rust fn foo(slice: &[&str]) { match slice { [] => { dbg!() } [a] => { dbg!(a); } [a, b] => { dbg!(a, b); } _ => {} // ^ Fallback -- necessary because the length is unknown! } } ``` To match on an array, you may instead write: ```rust fn bar([a, b, c]: [u8; 3]) {} // --------- Length is known, so pattern is irrefutable. ``` However, on stable Rust, it is not yet possible to match on a subslice or subarray. ## A quick user guide: Subslice patterns The ability to match on a subslice or subarray is gated under `#![feature(slice_patterns)]` and is what is proposed for stabilization here. ### The syntax of subslice patterns Subslice / subarray patterns come in two flavors syntactically. Common to both flavors is they use the token `..`, referred as a *"rest pattern"* in a pattern context. This rest pattern functions as a variable-length pattern, matching whatever amount of elements that haven't been matched already before and after. When `..` is used syntactically as an element of a slice-pattern, either directly (1), or as part of a binding pattern (2), it becomes a subslice pattern. On stable Rust, a rest pattern `..` can also be used in a tuple or tuple-struct pattern with `let (x, ..) = (1, 2, 3);` and `let TS(x, ..) = TS(1, 2, 3);` respectively. ### (1) Matching on a subslice without binding it ```rust fn base(string: &str) -> u8 { match string.as_bytes() { [b'0', b'x', ..] => 16, [b'0', b'o', ..] => 8, [b'0', b'b', ..] => 2, _ => 10, } } fn main() { assert_eq!(base("0xFF"), 16); assert_eq!(base("0x"), 16); } ``` In the function `base`, the pattern `[b'0', b'x', ..]` will match on any byte-string slice with the *prefix* `0x`. Note that `..` may match on nothing, so `0x` is a valid match. ### (2) Binding a subslice: ```rust fn main() { #[derive(PartialEq, Debug)] struct X(u8); let xs: Vec<X> = vec![X(0), X(1), X(2)]; if let [start @ .., end] = &*xs { // --- bind on last element, assuming there is one. // ---------- bind the initial elements, if there are any. assert_eq!(start, &[X(0), X(1)] as &[X]); assert_eq!(end, &X(2)); let _: &[X] = start; let _: &X = end; } } ``` In this case, `[start @ .., end]` will match any non-empty slice, binding the last element to `end` and any elements before that to `start`. Note in particular that, as above, `start` may match on the empty slice. ### Only one `..` per slice pattern In today's stable Rust, a tuple (struct) pattern `(a, b, c)` can only have one subtuple pattern (e.g., `(a, .., c)`). That is, if there is a rest pattern, it may only occur once. Any `..` that follow, as in e.g., `(a, .., b, ..)` will cause an error, as there is no way for the compiler to know what `b` applies to. This rule also applies to slice patterns. That is, you may also not write `[a, .., b, ..]`. ## Motivation [PR #67569]: https://github.com/rust-lang/rust/pull/67569/files Slice patterns provide a natural and efficient way to pattern match on slices and arrays. This is particularly useful as slices and arrays are quite a common occurence in modern software targeting modern hardware. However, as aforementioned, it's not yet possible to perform incomplete matches, which is seen in `fn base`, an example taken from the `rustc` codebase itself. This is where subslice patterns come in and extend slice patterns with the natural syntax `xs @ ..` and `..`, where the latter is already used for tuples and tuple structs. As an example of how subslice patterns can be used to clean up code, we have [PR #67569]. In this PR, slice patterns enabled us to improve readability and reduce unsafety, at no loss to performance. ## Technical specification ### Grammar The following specification is a *sub-set* of the grammar necessary to explain what interests us here. Note that stabilizing subslice patterns does not alter the stable grammar. The stabilization contains purely semantic changes. ```rust Binding = reference:"ref"? mutable:"mut"? name:IDENT; Pat = | ... // elided | Rest: ".." | Binding:{ binding:Binding { "@" subpat:Pat }? } | Slice:{ "[" elems:Pat* %% "," "]" } | Paren:{ "(" pat:Pat ")" } | Tuple:{ path:Path? "(" elems:Pat* &% "," ")" } ; ``` Notes: 1. `(..)` is interpreted as a `Tuple`, not a `Paren`. This means that `[a, (..)]` is interpreted as `Slice[Binding(a), Tuple[Rest]]` and not `Slice[Binding(a), Paren(Rest)]`. ### Name resolution [resolve_pattern_inner]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/struct.LateResolutionVisitor.html#method.resolve_pattern_inner [product context]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_resolve/late/enum.PatBoundCtx.html#variant.Product A slice pattern is [resolved][resolve_pattern_inner] as a [product context] and `..` is given no special treatment. ### Abstract syntax of slice patterns The abstract syntax (HIR level) is defined like so: ```rust enum PatKind { ... // Other unimportant stuff. Wild, Binding { binding: Binding, subpat: Option<Pat>, }, Slice { before: List<Pat>, slice: Option<Pat>, after: List<Pat>, }, } ``` [`hir::PatKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/hir/enum.PatKind.html The executable definition is found in [`hir::PatKind`]. ### Lowering to abstract syntax Lowering a slice pattern to its abstract syntax proceeds by: 1. Lowering each element pattern of the slice pattern, where: 1. `..` is lowered to `_`, recording that it was a subslice pattern, 2. `binding @ ..` is lowered to `binding @ _`, recording that it was a subslice pattern, 3. and all other patterns are lowered as normal, recording that it was not a subslice pattern. 2. Taking all lowered elements until the first subslice pattern. 3. Take all following elements. If there are any, 1. The head is the sub-`slice` pattern. 2. The tail (`after`) must not contain a subslice pattern, or an error occurs. [`LoweringContext::lower_pat_slice`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/hir/lowering/struct.LoweringContext.html#method.lower_pat_slice The full executable definition can be found in [`LoweringContext::lower_pat_slice`]. ### Type checking slice patterns #### Default binding modes [non-reference pattern]: https://doc.rust-lang.org/nightly/reference/patterns.html#binding-modes [`is_non_ref_pat`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html#method.is_non_ref_pat [peel_off_references]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html#method.peel_off_references A slice pattern is a [non-reference pattern] as defined in [`is_non_ref_pat`]. This means that when type checking a slice pattern, as many immediate reference types are [peeled off][peel_off_references] from the `expected` type as possible and the default binding mode is adjusted to by-reference before checking the slice pattern. See https://github.com/rust-lang/rust/pull/63118/#issuecomment-524161584 for an algorithmic description. [RFC 2359]: https://github.com/rust-lang/rfcs/blob/master/text/2359-subslice-pattern-syntax.md [rfc-2359-gle]: https://github.com/rust-lang/rfcs/blob/master/text/2359-subslice-pattern-syntax.md#guide-level-explanation See [RFC 2359]'s [guide-level explanation][rfc-2359-gle] and the tests listed below for examples of what effect this has. #### Checking the pattern Type checking a slice pattern proceeds as follows: 1. Resolve any type variables by a single level. If the result still is a type variable, error. 2. Determine the expected type for any subslice pattern (`slice_ty`) and for elements (`inner_ty`) depending on the expected type. 1. If the expected type is an array (`[E; N]`): 1. Evaluate the length of the array. If the length couldn't be evaluated, error. This may occur when we have e.g., `const N: usize`. Now `N` is known. 2. If there is no sub-`slice` pattern, check `len(before) == N`, and otherwise error. 3. Otherwise, set `S = N - len(before) - len(after)`, and check `N >= 0` and otherwise error. Set `slice_ty = [E; S]`. Set `inner_ty = E`. 2. If the expected type is a slice (`[E]`), set `inner_ty = E` and `slice_ty = [E]`. 3. Otherwise, error. 3. Check each element in `before` and `after` against `inner_ty`. 4. If it exists, check `slice` against `slice_ty`. [`check_pat_slice`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html#method.check_pat_slice For an executable definition, see [`check_pat_slice`]. ### Typed abstract syntax of slice and array patterns The typed abstract syntax (HAIR level) is defined like so: ```rust enum PatKind { ... // Other unimportant stuff. Wild, Binding { ... // Elided. } Slice { prefix: List<Pat>, slice: Option<Pat>, suffix: List<Pat>, }, Array { prefix: List<Pat>, slice: Option<Pat>, suffix: List<Pat>, }, } ``` [`hair::pattern::PatKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/hair/pattern/enum.PatKind.html The executable definition is found in [`hair::pattern::PatKind`]. ### Lowering to typed abstract syntax Lowering a slice pattern to its typed abstract syntax proceeds by: 1. Lowering each pattern in `before` into `prefix`. 2. Lowering the `slice`, if it exists, into `slice`. 1. A `Wild` pattern in abstract syntax is lowered to `Wild`. 2. A `Binding` pattern in abstract syntax is lowered to `Binding { .. }`. 3. Lowering each pattern in `after` into `after`. 4. If the type is `[E; N]`, construct `PatKind::Array { prefix, slice, after }`, otherwise `PatKind::Slice { prefix, slice, after }`. [`PatCtxt::slice_or_array_pattern`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/hair/pattern/struct.PatCtxt.html#method.slice_or_array_pattern The executable definition is found in [`PatCtxt::slice_or_array_pattern`]. ### Exhaustiveness checking Let `E` be the element type of a slice or array. - For array types, `[E; N]` with a known length `N`, the full set of constructors required for an exahustive match is the sequence `ctors(E)^N` where `ctors` denotes the constructors required for an exhaustive match of `E`. - Otherwise, for slice types `[E]`, or for an array type with an unknown length `[E; ?L]`, the full set of constructors is the infinite sequence `⋃_i=0^∞ ctors(E)^i`. This entails that an exhaustive match without a cover-all pattern (e.g. `_` or `binding`) or a subslice pattern (e.g., `[..]` or `[_, _, ..]`) is impossible. - `PatKind::{Slice, Array}(prefix, None, suffix @ [])` cover a sequence of of `len(prefix)` covered by `patterns`. Note that `suffix.len() > 0` with `slice == None` is unrepresentable. - `PatKind::{Slice, Array}(prefix, Some(s), suffix)` cover a `sequence` with `prefix` as the start and `suffix` as the end and where `len(prefix) + len(suffix) <= len(sequence)`. The `..` in the middle is interpreted as an unbounded number of `_`s in terms of exhaustiveness checking. ### MIR representation The relevant MIR representation for the lowering into MIR, which is discussed in the next section, includes: ```rust enum Rvalue { // ... /// The length of a `[X]` or `[X; N]` value. Len(Place), } struct Place { base: PlaceBase, projection: List<PlaceElem>, } enum ProjectionElem { // ... ConstantIndex { offset: Nat, min_length: Nat, from_end: bool, }, Subslice { from: Nat, to: Nat, from_end: bool, }, } ``` ### Lowering to MIR * For a slice pattern matching a slice, where the pattern has `N` elements specified, there is a check that the `Rvalue::Len` of the slice is at least `N` to decide if the pattern can match. * There are two kinds of `ProjectionElem` used for slice patterns: 1. `ProjectionElem::ConstantIndex` is an array or slice element with a known index. As a shorthand it's written `base[offset of min_length]` if `from_end` is false and `base[-offset of min_length]` if `from_end` is true. `base[-offset of min_length]` is the `len(base) - offset`th element of `base`. 2. `ProjectionElem::Subslice` is a subslice of an array or slice with known bounds. As a shorthand it's written `base[from..to]` if `from_end` is false and `base[from:-to]` if `from_end` is true. `base[from:-to]` is the subslice `base[from..len(base) - to]`. * Note that `ProjectionElem::Index` is used for indexing expressions, but not for slice patterns. It's written `base[idx]`. * When binding an array pattern, any individual element binding is lowered to an assignment or borrow of `base[offset of len]` where `offset` is the element's index in the array and `len` is the array's length. * When binding a slice pattern, let `N` be the number of elements that have patterns. Elements before the subslice pattern (`prefix`) are lowered to `base[offset of N]` where `offset` is the element's index from the start. Elements after the subslice pattern (`suffix`) are lowered to `base[-offset of N]` where `offset` is the element's index from the end, plus 1. * Subslices of arrays are lowered to `base[from..to]` where `from` is the number of elements before the subslice pattern and `to = len(array) - len(suffix)` is the length of the array minus the number of elements after the subslice pattern. * Subslices of slices are lowered to `base[from:-to]` where `from` is the number of elements before the subslice pattern (`len(prefix)`) and `to` is the number of elements after the subslice pattern (`len(suffix)`). ### Safety and const checking * Subslice patterns do not introduce any new unsafe operations. * As subslice patterns for arrays are irrefutable, they are allowed in const contexts. As are `[..]` and `[ref y @ ..]` patterns for slices. However, `ref mut` bindings are only allowed with `feature(const_mut_refs)` for now. * As other subslice patterns for slices require a `match`, `if let`, or `while let`, they are only allowed with `feature(const_if_match, const_fn)` for now. * Subslice patterns may occur in promoted constants. ### Borrow and move checking * A subslice pattern can be moved from if it has an array type `[E; N]` and the parent array can be moved from. * Moving from an array subslice pattern moves from all of the elements of the array within the subslice. * If the subslice contains at least one element, this means that dynamic indexing (`arr[idx]`) is no longer allowed on the array. * The array can be reinitialized and can still be matched with another slice pattern that uses a disjoint set of elements. * A subslice pattern can be mutably borrowed if the parent array/slice can be mutably borrowed. * When determining whether an access conflicts with a borrow and at least one is a slice pattern: * `x[from..to]` always conflicts with `x` and `x[idx]` (where `idx` is a variable). * `x[from..to]` conflicts with `x[idx of len]` if `from <= idx` and `idx < to` (that is, `idx ∈ from..to`). * `x[from..to]` conflicts with `x[from2..to2]` if `from < to2` and `from2 < to` (that is, `(from..to) ∩ (from2..to2) ≠ ∅`). * `x[from:-to]` always conflicts with `x`, `x[idx]`, and `x[from2:-to2]`. * `x[from:-to]` conflicts with `x[idx of len]` if `from <= idx`. * `x[from:-to]` conflicts with `x[-idx of len]` if `to < idx`. * A constant index from the end conflicts with other elements as follows: * `x[-idx of len]` always conflicts with `x` and `x[idx]`. * `x[-idx of len]` conflicts with `x[-idx2 of len2]` if `idx == idx2`. * `x[-idx of len]` conflicts with `x[idx2 of len2]` if `idx + idx2 >= max(len, len2)`. ## Tests The tests can be primarily seen in the PR itself. Here are some of them: ### Parsing (3) * Testing that `..` patterns are syntactically allowed in all pattern contexts (2) * [pattern/rest-pat-syntactic.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/rest-pat-syntactic.rs) * [ignore-all-the-things.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/ignore-allthe-things.rs) * Slice patterns allow a trailing comma, including after `..` (1) * [trailing-comma.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/trailing-comma.rs) ### Lowering (2) * `@ ..` isn't allowed outside of slice patterns and only allowed once in each pattern (1) * [pattern/rest-pat-semantic-disallowed.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/rest-pat-semantic-disallowed.rs) * Mulitple `..` patterns are not allowed (1) * [parser/match-vec-invalid.rs](https://github.com/rust-lang/rust/blob/53712f8637dbe326df569a90814aae1cc5429710/src/test/ui/parser/match-vec-invalid.rs) ### Type checking (5) * Default binding modes apply to slice patterns (2) * [rfc-2005-default-binding-mode/slice.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/rfc-2005-default-binding-mode/slice.rs) * [rfcs/rfc-2005-default-binding-mode/slice.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/rfcs/rfc-2005-default-binding-mode/slice.rs) * Array patterns cannot have more elements in the pattern than in the array (2) * [match/match-vec-mismatch.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/match/match-vec-mismatch.rs) * [error-codes/E0528.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/error-codes/E0528.rs) * Array subslice patterns have array types (1) * [array-slice-vec/subslice-patterns-pass.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/subslice-patterns-pass.rs) ### Exhaustiveness and usefulness checking (20) * Large subslice matches don't stack-overflow the exhaustiveness checker (1) * [pattern/issue-53820-slice-pattern-large-array.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/issue-53820-slice-pattern-large-array.rs) * Array patterns with subslices are irrefutable (1) * [issues/issue-7784.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/issues/issue-7784.rs) * `[xs @ ..]` slice patterns are irrefutable (1) * [binding/irrefutable-slice-patterns.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/binding/irrefutable-slice-patterns.rs) * Subslice patterns can match zero-length slices (2) * [issues/issue-15080.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/issues/issue-15080.rs) * [issues/issue-15104.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/issues/issue-15104.rs) * General tests (13) * [issues/issue-12369.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/issues/issue-12369.rs) * [issues/issue-37598.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/issues/issue-37598.rs) * [pattern/usefulness/match-vec-unreachable.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/match-vec-unreachable.rs) * [pattern/usefulness/non-exhaustive-match.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/non-exhaustive-match.rs) * [pattern/usefulness/non-exhaustive-match-nested.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs) * [pattern/usefulness/non-exhaustive-pattern-witness.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs) * [pattern/usefulness/65413-constants-and-slices-exhaustiveness.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/65413-constants-and-slices-exhaustiveness.rs) * [pattern/usefulness/match-byte-array-patterns.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/match-byte-array-patterns.rs) * [pattern/usefulness/match-slice-patterns.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/match-slice-patterns.rs) * [pattern/usefulness/slice-patterns-exhaustiveness.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs) * [pattern/usefulness/slice-patterns-irrefutable.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/slice-patterns-irrefutable.rs) * [pattern/usefulness/slice-patterns-reachability.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/usefulness/slice-patterns-reachability.rs) * [uninhabited/uninhabited-patterns.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/uninhabited/uninhabited-patterns.rs) * Interactions with or-patterns (2) * [or-patterns/exhaustiveness-pass.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/or-patterns/exhaustiveness-pass.rs) * [or-patterns/exhaustiveness-unreachable-pattern.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs) ### Borrow checking (28) * Slice patterns can only move from owned, fixed-length arrays (4) * [borrowck/borrowck-move-out-of-vec-tail.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.rs) * [moves/move-out-of-slice-2.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/moves/move-out-of-slice-2.rs) * [moves/move-out-of-array-ref.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/moves/move-out-of-array-ref.rs) * [issues/issue-12567.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/issues/issue-12567.rs) * Moves from arrays are tracked by element (2) * [borrowck/borrowck-move-out-from-array-no-overlap.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-move-out-from-array-no-overlap.rs) * [borrowck/borrowck-move-out-from-array-use-no-overlap.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-move-out-from-array-use-no-overlap.rs) * Slice patterns cannot be used on moved-from slices/arrays (2) * [borrowck/borrowck-move-out-from-array.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-move-out-from-array.rs) * [borrowck/borrowck-move-out-from-array-use.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-move-out-from-array-use.rs) * Slice patterns cannot be used with conflicting borrows (3) * [borrowck/borrowck-describe-lvalue.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-describe-lvalue.rs) * [borrowck/borrowck-slice-pattern-element-loan-array.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-array.rs) * [borrowck/borrowck-slice-pattern-element-loan-slice.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.rs) * Borrows from slice patterns are tracked and only conflict when there is possible overlap (6) * [borrowck/borrowck-slice-pattern-element-loan-array-no-overlap.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-array-no-overlap.rs) * [borrowck/borrowck-slice-pattern-element-loan-slice-no-overlap.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice-no-overlap.rs) * [borrowck/borrowck-slice-pattern-element-loan-rpass.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-rpass.rs) * [borrowck/borrowck-vec-pattern-element-loan.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-vec-pattern-element-loan.rs) * [borrowck/borrowck-vec-pattern-loan-from-mut.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.rs) * [borrowck/borrowck-vec-pattern-tail-element-loan.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.rs) * Slice patterns affect indexing expressions (1) * [borrowck/borrowck-vec-pattern-move-tail.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.rs) * Borrow and move interactions with `box` patterns (1) * [borrowck/borrowck-vec-pattern-move-tail.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.rs) * Slice patterns correctly affect inference of closure captures (2) * [borrowck/borrowck-closures-slice-patterns.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-closures-slice-patterns.rs) * [borrowck/borrowck-closures-slice-patterns-ok.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-closures-slice-patterns-ok.rs) * Interactions with `#![feature(bindings_after_at)]` (7) * [pattern/bindings-after-at/borrowck-move-and-move.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs) * [pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs) * [pattern/bindings-after-at/borrowck-pat-at-and-box.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs) * [pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs) * [pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs) * [pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs) * [pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs) * Misc (1) * [issues/issue-26619.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/issues/issue-26619.rs) ### MIR lowering (1) * [uniform_array_move_out.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/mir-opt/uniform_array_move_out.rs) ### Evaluation (19) * Slice patterns don't cause leaks or double drops (2) * [drop/dynamic-drop.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/drop/dynamic-drop.rs) * [drop/dynamic-drop-async.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/drop/dynamic-drop-async.rs) * General run-pass tests (10) * [array-slice-vec/subslice-patterns-pass.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/subslice-patterns-pass.rs) * [array-slice-vec/vec-matching-fixed.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/vec-matching-fixed.rs) * [array-slice-vec/vec-matching-fold.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/vec-matching-fold.rs) * [array-slice-vec/vec-matching-legal-tail-element-borrow.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/vec-matching-legal-tail-element-borrow.rs) * [array-slice-vec/vec-matching.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/vec-matching.rs) * [array-slice-vec/vec-tail-matching.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/vec-tail-matching.rs) * [binding/irrefutable-slice-patterns.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/binding/irrefutable-slice-patterns.rs) * [binding/match-byte-array-patterns.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/binding/match-byte-array-patterns.rs) * [binding/match-vec-alternatives.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/binding/match-vec-alternatives.rs) * [borrowck/borrowck-slice-pattern-element-loan-rpass.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-rpass.rs) * Matching a large by-value array (1) * [issues/issue-17877.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/issues/issue-17877.rs) * Uninhabited elements (1) * [binding/empty-types-in-patterns.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/binding/empty-types-in-patterns.rs) * Zero-sized elements (3) * [binding/zero_sized_subslice_match.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/binding/zero_sized_subslice_match.rs) * [array-slice-vec/subslice-patterns-const-eval.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/subslice-patterns-const-eval.rs) * [array-slice-vec/subslice-patterns-const-eval-match.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/subslice-patterns-const-eval-match.rs) * Evaluation in const contexts (2) * [array-slice-vec/subslice-patterns-const-eval.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/subslice-patterns-const-eval.rs) * [array-slice-vec/subslice-patterns-const-eval-match.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/array-slice-vec/subslice-patterns-const-eval-match.rs) ## Misc (1) * Exercising a case where const-prop cased an ICE (1) * [consts/const_prop_slice_pat_ice.rs](https://github.com/rust-lang/rust/blob/acb6690e1d58fc5f262ada5b5030fe73e601f1e8/src/test/ui/consts/const_prop_slice_pat_ice.rs) ## History - 2012-12-08, commit https://github.com/rust-lang/rust/commit/1968cb315af9d128ee4457738fddd1eba275277f Author: Jakub Wieczorek Reviewers: @graydon This is where slice patterns were first implemented. It is particularly instructive to read the `vec-tail-matching.rs` test. - 2013-08-20, issue https://github.com/rust-lang/rust/issues/8636 Author: @huonw Fixed by @mikhail-m1 in https://github.com/rust-lang/rust/pull/51894 The issue describes a problem wherein the borrow-checker would not consider disjointness when checking mutable references in slice patterns. - 2014-09-03, RFC https://github.com/rust-lang/rfcs/pull/164 Author: @brson Reviewers: The Core Team The RFC decided to feature gate slice patterns due to concerns over lack of oversight and the exhaustiveness checking logic not having seen much love. Since then, the exhaustivenss checking algorithm, in particular for slice patterns, has been substantially refactored and tests have been added. - 2014-09-03, RFC https://github.com/rust-lang/rfcs/pull/202 Author: @krdln Reviewers: The Core Team > Change syntax of subslices matching from `..xs` to `xs..` to be more consistent with the rest of the language and allow future backwards compatible improvements. In 2019, https://github.com/rust-lang/rfcs/pull/2359 changed the syntax again in favor of `..` and `xs @ ..`. - 2014-09-08, PR https://github.com/rust-lang/rust/pull/17052 Author: @pcwalton Reviewers: @alexcrichton and @sfackler This implemented the feature gating as specified in https://github.com/rust-lang/rfcs/pull/164. - 2015-03-06, RFC https://github.com/rust-lang/rfcs/pull/495 Author: @P1start Reviewers: The Core Team The RFC changed array and slice patterns like so: - Made them only match on arrays (`[T; N]`) and slice types (`[T]`), not references to slice types (`& mut? [T]`). - Made subslice matching yield a value of type `[T; N]` or `[T]`, not `& mut? [T]`. - Allowed multiple mutable references to be made to different parts of the same array or slice in array patterns. These changes were made to fit with the introduction of DSTs like `[T]` as well as with e.g. `box [a, b, c]` (`Box<[T]>`) in the future. All points remain true today, in particular with the advent of default binding modes. - 2015-03-22, PR https://github.com/rust-lang/rust/pull/23361 Author: @petrochenkov Reviewers: Unknown The PR adjusted codegen ("trans") such that `let ref a = *"abcdef"` would no longer ICE, paving the way for https://github.com/rust-lang/rfcs/pull/495. - 2015-05-28, PR https://github.com/rust-lang/rust/pull/23794 Author: @brson Reviewers: @nrc The PR feature gated slice patterns in more contexts. - 2016-06-09, PR https://github.com/rust-lang/rust/pull/32202 Author: @arielb1 Reviewers: @eddyb and @nikomatsakis This implemented RFC https://github.com/rust-lang/rfcs/pull/495 via a MIR based implementation fixing some bugs. - 2016-09-16, PR https://github.com/rust-lang/rust/pull/36353 Author: @arielb1 Reviewers: @nagisa, @pnkfelix, and @nikomatsakis The PR made move-checker improvements prohibiting moves out of slices. - 2018-02-17, PR https://github.com/rust-lang/rust/pull/47926 Author: @mikhail-m1 Reviewers: @nikomatsakis This added the `UniformArrayMoveOut` which converted move-out-from-array by `Subslice` and `ConstIndex {.., from_end: true }` to `ConstIndex` move out(s) from the beginning of the array. This fixed some problems with the MIR borrow-checker and drop-elaboration of arrays. Unfortunately, the transformation ultimately proved insufficient for soundness and was removed and replaced in https://github.com/rust-lang/rust/pull/66650. - 2018-02-19, PR https://github.com/rust-lang/rust/pull/48355 Author: @mikhail-m1 Reviewers: @nikomatsakis After https://github.com/rust-lang/rust/pull/47926, this restored some MIR optimizations after drop-elaboration and borrow-checking. - 2018-03-20, PR https://github.com/rust-lang/rust/pull/48516 Author: @petrochenkov Reviewers: @nikomatsakis This stabilized fixed length slice patterns `[a, b, c]` without variable length subslices and moved subslice patterns into `#![feature(slice_patterns)`. See https://github.com/rust-lang/rust/issues/48836 wherein the language team accepted the proposal to stabilize. - 2018-07-06, PR https://github.com/rust-lang/rust/pull/51894 Author: @mikhail-m1 Reviewers: @nikomatsakis https://github.com/rust-lang/rust/issues/8636 was fixed such that the borrow-checker would consider disjointness with respect to mutable references in slice patterns. - 2019-06-30, RFC https://github.com/rust-lang/rfcs/pull/2359 Author: @petrochenkov Reviewers: The Language Team The RFC switched the syntax of subslice patterns to `{$binding @}? ..` as opposed to `.. $pat?` (which was what the RFC originally proposed). This RFC reignited the work towards finishing the implementation and the testing of slice patterns which eventually lead to this stabilization proposal. - 2019-06-30, RFC https://github.com/rust-lang/rfcs/pull/2707 Author: @petrochenkov Reviewers: The Language Team This RFC built upon https://github.com/rust-lang/rfcs/pull/2359 turning `..` into a full-fledged pattern (`Pat |= Rest:".." ;`), as opposed to a special part of slice and tuple patterns, moving previously syntactic restrictions into semantic ones. - 2019-07-03, PR https://github.com/rust-lang/rust/pull/62255 Author: @Centril Reviewers: @varkor This closed the old tracking issue (https://github.com/rust-lang/rust/issues/23121) in favor of the new one (https://github.com/rust-lang/rust/issues/62254) due to the new RFCs having been accepted. - 2019-07-28, PR https://github.com/rust-lang/rust/pull/62550 Author: @Centril Reviewers: @petrochenkov and @eddyb Implemented RFCs https://github.com/rust-lang/rfcs/pull/2707 and https://github.com/rust-lang/rfcs/pull/2359 by introducing the `..` syntactic rest pattern form as well as changing the lowering to subslice and subtuple patterns and the necessary semantic restrictions as per the RFCs. Moreover, the parser was cleaned up to use a more generic framework for parsing sequences of things. This framework was employed in parsing slice patterns. Finally, the PR introduced parser recovery for half-open ranges (e.g., `..X`, `..=X`, and `X..`), demonstrating in practice that the RFCs proposed syntax will enable half-open ranges if we want to add those (which is done in https://github.com/rust-lang/rust/pull/67258). - 2019-07-30, PR https://github.com/rust-lang/rust/pull/63111 Author: @Centril Reviewers: @estebank Added a test which comprehensively exercised the parsing of `..` rest patterns. That is, the PR exercised the specification in https://github.com/rust-lang/rfcs/pull/2707. Moreover, a test was added for the semantic restrictions noted in the RFC. - 2019-07-31, PR https://github.com/rust-lang/rust/pull/63129 Author: @Centril Reviewers: @oli-obk Hardened the test-suite for subslice and subarray patterns with a run-pass tests. This test exercises both type checking and dynamic semantics. - 2019-09-15, PR https://github.com/rust-analyzer/rust-analyzer/pull/1848 Author: @ecstatic-morse Reviewers: @matklad This implemented the syntactic change (rest patterns, `..`) in rust-analyzer. - 2019-11-05, PR https://github.com/rust-lang/rust/pull/65874 Author: @Nadrieril Reviewers: @varkor, @arielb1, and @Centril Usefulness / exhaustiveness checking saw a major refactoring clarifying the analysis by emphasizing that each row of the matrix can be seen as a sort of stack from which we pop constructors. - 2019-11-12, PR https://github.com/rust-lang/rust/pull/66129 Author: @Nadrieril Reviewers: @varkor, @Centril, and @estebank Usefulness / exhaustiveness checking of slice patterns were refactored in favor of clearer code. Before the PR, variable-length slice patterns were eagerly expanded into a union of fixed-length slices. They now have their own special constructor, which allows expanding them more lazily. As a side-effect, this improved diagnostics. Moreover, the test suite for exhaustiveness checking of slice patterns was hardened. - 2019-11-20, PR https://github.com/rust-lang/rust/pull/66497 Author: @Nadrieril Reviewers: @varkor and @Centril Building on the previous PR, this one fixed a bug https://github.com/rust-lang/rust/issues/53820 wherein sufficiently large subarray patterns (`match [0u8; 16*1024] { [..] => {}}`) would result in crashing the compiler with a stack-overflow. The PR did this by treating array patterns in a more first-class way (using a variable-length mechanism also used for slices) rather than like large tuples. This also had the effect of improving diagnostics for non-exhaustive matches. - 2019-11-28, PR https://github.com/rust-lang/rust/pull/66603 Author: @Nadrieril Reviewers: @varkor Fixed a bug https://github.com/rust-lang/rust/issues/65413 wherein constants, slice patterns, and exhaustiveness checking interacted in a suboptimal way conspiring to suggest that a reachable arm was in fact unreachable. - 2019-12-12, PR https://github.com/rust-lang/rust/pull/66650 Author: @matthewjasper Reviewers: @pnkfelix and @Centril Removed the `UniformArrayMoveOut` MIR transformation pass in favor of baking the necessary logic into the borrow-checker, drop elaboration and MIR building itself. This fixed a number of bugs, including a soundness hole https://github.com/rust-lang/rust/issues/66502. Moreover, the PR added a slew of tests for borrow- and move-checking of slice patterns as well as a test for the dynamic semantics of dropping subslice patterns. - 2019-12-16, PR https://github.com/rust-lang/rust/pull/67318 Author: @Centril Reviewers: @matthewjasper Improved documentation for AST->HIR lowering + type checking of slice as well as minor code simplification. - 2019-12-21, PR https://github.com/rust-lang/rust/pull/67467 Author: @matthewjasper Reviewers: @oli-obk, @RalfJung, and @Centril Fixed bugs in the const evaluation of slice patterns and added tests for const evaluation as well as borrow- and move-checking. - 2019-12-22, PR https://github.com/rust-lang/rust/pull/67439 Author: @Centril Reviewers: @matthewjasper Cleaned up HAIR lowering of slice patterns, removing special cased dead code for the unrepresentable `[a, b] @ ..`. The PR also refactored type checking for slice patterns. - 2019-12-23, PR https://github.com/rust-lang/rust/pull/67546 Author: @oli-obk Reviewers: @varkor and @RalfJung Fixed an ICE in the MIR interpretation of slice patterns. - 2019-12-24, PR https://github.com/rust-lang/rust/pull/66296 Author: @Centril Reviewers: @pnkfelix and @matthewjasper This implemented `#![feature(bindings_after_at)]` which allows writing e.g. `a @ Some([_, b @ ..])`. This is not directly linked to slice patterns other than with patterns in general. However, the combination of the feature and `slice_patterns` received some testing in the PR. - 2020-01-09, PR https://github.com/rust-lang/rust/pull/67990 Author: @Centril Reviewers: @matthewjasper This hardened move-checker tests for `match` expressions in relation to https://github.com/rust-lang/rust/issues/53114. - This PR stabilizes `slice_patterns`. ## Related / possible future work There is on-going work to improve pattern matching in other ways (the relevance of some of these are indirect, and only by composition): - OR-patterns, `pat_0 | .. | pat_n` is almost implemented. Tracking issue: https://github.com/rust-lang/rust/issues/54883 - Bindings after `@`, e.g., `x @ Some(y)` is implemented. Tracking issue: https://github.com/rust-lang/rust/issues/65490 - Half-open range patterns, e.g., `X..`, `..X`, and `..=X` as well as exclusive range patterns, e.g., `X..Y`. Tracking issue: https://github.com/rust-lang/rust/issues/67264 and https://github.com/rust-lang/rust/issues/37854 The relevance here is that this work demonstrates, in practice, that there are no syntactic conflicts introduced by the stabilization of subslice patterns. As for more direct improvements to slice patterns, some avenues could be: - Box patterns, e.g., `box [a, b, .., c]` to match on `Box<[T]>`. Tracking issue: https://github.com/rust-lang/rust/issues/29641 This issue currently has no path to stabilization. Note that it is currently possible to match on `Box<[T]>` or `Vec<T>` by first dereferencing them to slices. - `DerefPure`, which would allow e.g., using slice patterns to match on `Vec<T>` (e.g., moving out of it). Another idea which was raised by [RFC 2707](https://github.com/rust-lang/rfcs/blob/master/text/2707-dotdot-patterns.md#future-possibilities) and [RFC 2359](https://github.com/rust-lang/rfcs/blob/master/text/2359-subslice-pattern-syntax.md#pat-vs-pat) was to allow binding a subtuple pattern. That is, we could allow `(a, xs @ .., b)`. However, while we could allow by-value bindings to `..` as in `xs @ ..` at zero cost, the same cannot be said of by-reference bindings, e.g. `(a, ref xs @ .., b)`. The issue here becomes that for a reference to be legal, we have to represent `xs` contiguously in memory. In effect, we are forced into a [`HList`](https://docs.rs/frunk/0.3.1/frunk/hlist/struct.HCons.html) based representation for tuples.

view details

Mazdak Farrokhzad

commit sha 36e58ea6bf7aa104bad78f5e291d53887678c283

Rollup merge of #68224 - GuillaumeGomez:prevent-urls-in-headings, r=ollie27 Prevent urls in headings Fixes #68215. cc @pietroalbini @ollie27 r? @kinnison

view details

Mazdak Farrokhzad

commit sha 2a12ef81341cfbba852cc3145c6398841607c185

Rollup merge of #68340 - GuillaumeGomez:clean-up-e0200, r=Dylan-DPC clean up e0200 explanation r? @Dylan-DPC

view details

Mazdak Farrokhzad

commit sha 6c94ceb691bf334043e3d679a17b0d30d788e43e

Rollup merge of #68341 - fusion-engineering-forks:instant-docs, r=Dylan-DPC Fix syscalls tables in docs of std::time.

view details

Mazdak Farrokhzad

commit sha e8819b62b4c45d380058c5f86c7e9484ae05ddb5

Rollup merge of #68342 - lcnr:type_name_docs, r=Dylan-DPC improve type_name_of_val docs suggested by @Globidev in https://github.com/rust-lang/rust/issues/66359#issuecomment-575016612

view details

bors

commit sha 1ce08f9d631ef767c915270bc63283c6af40dc3f

Auto merge of #68351 - Centril:rollup-0gzuh0p, r=Centril Rollup of 5 pull requests Successful merges: - #67712 (Stabilize `#![feature(slice_patterns)]` in 1.42.0) - #68224 (Prevent urls in headings) - #68340 (clean up e0200 explanation) - #68341 (Fix syscalls tables in docs of std::time.) - #68342 (improve type_name_of_val docs) Failed merges: r? @ghost

view details

Mazdak Farrokhzad

commit sha de6046fa0ff6e57afa50174c001d1668ee7f3cf6

remove rustc_error_codes deps except in rustc_driver

view details

Wesley Wiser

commit sha e1f70f77bf7aae099453d54a1175d8453ce4f5cb

[const-prop] Remove useless typedef It's confusing because it conflicts with ty::Const and just isn't generally useful.

view details

push time in 6 days

issue commentrust-lang/rust

ICE in incr comp after s/trait/struct/: src/librustc/dep_graph/graph.rs:688: DepNode Hir(...) should have been pre-allocated but wasn't.

I see 3 ways we can fix this:

  • use a query for as_local_hir_id to track the dependency
  • encode the HirId into DefPathData so type_of receives this information as an argument instead of discovering it through as_local_hir_id
  • make sure there's a 1:1 correspondence from DefIndex to HIR owners (HirId's with 0 as the local item)
ProgVal

comment created time in 6 days

pull request commentrust-lang/rust

Use queries for the HIR map

@bors try @rust-timer queue

Zoxc

comment created time in 6 days

pull request commentrust-lang/rust

Split lang_items to crates `rustc_hir` and `rustc_passes`.

@jonas-schievink The regressions seem to be in LLVM though, maybe it's the Box PR?

cjgillot

comment created time in 6 days

IssuesEvent

issue commentrust-lang/rust

ICE in incr comp after s/trait/struct/: src/librustc/dep_graph/graph.rs:688: DepNode Hir(...) should have been pre-allocated but wasn't.

The problem seems to be that as_local_hir_id called from type_of is untracked and reveals the HirId without adding a dependency. When Something::foo is changed from a method to a field, this HirId will change without causing type_of to be re-executed.

https://github.com/rust-lang/rust/pull/68289 just added a workaround for this, but doesn't really fix the issue.

ProgVal

comment created time in 6 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 5392a378efb9ccfc3fd6dd018613b637bdcb3d33

Reintroduce workaround for #62649

view details

John Kåre Alsaker

commit sha bf40dadc1c42211af40c197729dc1e8940589c98

Update ich_nested_items.rs

view details

push time in 6 days

pull request commentrust-lang/rust

Move resolve_instance to rustc_resolve.

@bors try @rust-timer queue

cjgillot

comment created time in 6 days

Pull request review commentrust-lang/rust

Move resolve_instance to rustc_resolve.

 fn needs_fn_once_adapter_shim(         (ty::ClosureKind::FnMut, _) | (ty::ClosureKind::FnOnce, _) => Err(()),     } }++fn resolve_instance_default(+    _tcx: TyCtxt<'tcx>,+    _param_env: ty::ParamEnv<'tcx>,+    _def_id: DefId,+    _substs: SubstsRef<'tcx>,+) -> Option<Instance<'tcx>> {+    unimplemented!()+}++pub static RESOLVE_INSTANCE: AtomicRef<+    for<'tcx> fn(+        TyCtxt<'tcx>,+        ty::ParamEnv<'tcx>,+        DefId,+        SubstsRef<'tcx>,+    ) -> Option<Instance<'tcx>>,+> = AtomicRef::new(+    &(resolve_instance_default+        as for<'tcx> fn(

Can you do a as _ cast here?

cjgillot

comment created time in 6 days

pull request commentrust-lang/rust

Move resolve_instance to rustc_resolve.

These don't really belong in rustc_resolve. I'd put them in rustc_ty instead.

cjgillot

comment created time in 6 days

pull request commentrust-lang/rust

[WIP] Treat NodeIs as pure values for incremental compilation

In order to do this, we'd have to track node_to_hir_id as that would reveal the HirId now. There's just 1 call of it left in the compiler proper though (some more in save-analysis).

Zoxc

comment created time in 6 days

pull request commentrust-lang/rust

[WIP] Treat NodeIs as pure values for incremental compilation

This makes the query system treat node ids as pure integers (which is what they are) instead of HIR ids.

cc @rust-lang/compiler Does anyone know of any scenarios this would break?

Zoxc

comment created time in 6 days

pull request commentrust-lang/rust

Use queries for the HIR map

The problem seems to be that as_local_hir_id called from type_of is untracked and reveals the HirId without adding a dependency. When Something::foo is changed from a method to a field, this HirId will change without causing type_of to be re-executed.

Zoxc

comment created time in 6 days

push eventZoxc/rust

Esteban Küber

commit sha 109d5c189f4b5c3405a7d6cfb312e04d866c0c31

Tweak borrow error on `FnMut` when `Fn` is expected

view details

bjorn3

commit sha bdacdf49e532ce869d1eb96e967fd77991566a7f

Remove unused core_intrinsics feature gate from bootstrap

view details

bjorn3

commit sha 095963f91d525951cb0183648c47c427fb69f16d

Remove unused feature gates from librustc

view details

bjorn3

commit sha f9971c5cba0a141d3f00737292a40e3cacf44ac0

Remove unused feature gates from cg_llvm Also turns a few `box` into `Box::new`

view details

bjorn3

commit sha c2da8b3f0d669cb5d6e7d1338aed91fd1c76b8a3

Remove unused feature gates from cg_ssa and cg_utils

view details

bjorn3

commit sha 2a4596abfb4449371982c824c330e30f4ae0d1ee

Remove unused feature gates from librustc_data_structures

view details

bjorn3

commit sha cf862df494438923295ae4ca78b40787c6b89d53

Remove unused feature gates from librustc_driver

view details

bjorn3

commit sha 3e61d52784bd20140a8124d41a9661378b65f40e

Remove unused feature gates from librustc_errors

view details

Josh White

commit sha 82684ad30a0929afba9463b89232730a9c6dadf4

Added long error description & modifed error_codes.rs

view details

Josh White

commit sha 4a1c6ce23547346757fa8b61207aea7eb6997aa3

Added long error description & modifed error_codes.rs

view details

Josh White

commit sha 201a262ac4a9cb61e4e94d8e841a973fee0edc86

Revised error long description

view details

Josh White

commit sha cdf2f30d6a364b49dcd919530c60799e8793a2e6

Merge branch 'E0637' of https://github.com/jwhite927/rust into E0637

view details

Josh White

commit sha 1923586286dea1a0f8ece43056126fc2ecc89337

Edited error description

view details

Josh White

commit sha 78df44655aa8547baa25ee9ca49699ad82c7f76d

Tidied up the long error description

view details

bjorn3

commit sha d252791a93b7ad26c9af63b68d223164a3678e8e

Remove unused feature gate from librustc_incremental

view details

bjorn3

commit sha 6638b867022fb1d2a56b6ed5f899e9fd00183396

Remove unused feature gates from librustc_interface

view details

bjorn3

commit sha 74994af266a83edb9f82f8175de0c5c84bd849a0

Remove unused feature gate from librustc_lint

view details

bjorn3

commit sha 6305c683cb63a3a83641aaf4ec763c290fc52b0c

Remove unused feature gates from librustc_metadata

view details

bjorn3

commit sha 341594e1969795e4d48840ec48f0d6309ea0fa3a

Remove unused feature gates from librustc_mir

view details

bjorn3

commit sha 1bfba4fbce25ac02a8023a817eee2c539c47c37e

Remove unused feature gate from librustc_resolve

view details

push time in 6 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 186e6d6f9a1d5570bed72134c4b06206fd23be59

Replace `HirBody` with `hir_owner_items` in tests

view details

John Kåre Alsaker

commit sha fe6e3450d3e0404f3fd0cf6dd596bc2de326fd5e

Replace `Hir` with `hir_owner` in tests

view details

John Kåre Alsaker

commit sha 0b3c2b64ab93f186307014c107ac46d0f34ee90f

Format function_interfaces.rs

view details

push time in 6 days

pull request commentrust-lang/rust

Use queries for the HIR map

This PR seems to trigger https://github.com/rust-lang/rust/issues/62649 / issue-62649-path-collisions-happen.rs again, which means we probably didn't fix the root cause.

Zoxc

comment created time in 6 days

Pull request review commentrust-lang/rust

Construct query job latches on-demand

 impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {                                 query_blocked_prof_timer = Some(tcx.prof.query_blocked());                             } -                            job.clone()+                            // Create the id of the job we're waiting for+                            let id = QueryJobId {+                                job: job.id,+                                shard: u16::try_from(shard).unwrap(),+                                kind: Q::dep_kind(),+                            };++                            job.latch(id)                         }                         QueryResult::Poisoned => FatalError.raise(),                     }                 }                 Entry::Vacant(entry) => {+                    let jobs = &mut lock.jobs;+                     // No job entry for this query. Return a new one to be started later.                     return tls::with_related_context(tcx, |icx| {-                        // Create the `parent` variable before `info`. This allows LLVM-                        // to elide the move of `info`-                        let parent = icx.query.clone();-                        let info = QueryInfo { span, query: Q::query(key.clone()) };-                        let job = Lrc::new(QueryJob::new(info, parent));-                        let owner = JobOwner { cache, job: job.clone(), key: (*key).clone() };+                        // Generate an id unique within this shard.+                        let id = jobs.checked_add(1).unwrap();+                        *jobs = id;+                        let id = QueryShardJobId(NonZeroU32::new(id).unwrap());++                        let global_id = QueryJobId {+                            job: id,+                            shard: u16::try_from(shard).unwrap(),+                            kind: Q::dep_kind(),+                        };

No, this is was my default way of dealing with this particular borrow error, I've refactored it.

Zoxc

comment created time in 6 days

Pull request review commentrust-lang/rust

Construct query job latches on-demand

 impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {                                 query_blocked_prof_timer = Some(tcx.prof.query_blocked());                             } -                            job.clone()+                            // Create the id of the job we're waiting for+                            let id = QueryJobId {

Done.

Zoxc

comment created time in 6 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 2f41e89f01be6adfbf9c9e72bc2214e4144edd3d

Create the `hir_to_node_id` map before `TyCtxt`

view details

push time in 6 days

Pull request review commentrust-lang/rust

Fix incremental bugs in the HIR map

 impl<'hir> Map<'hir> {         if self.dep_graph.is_fully_enabled() {             let hir_id_owner = hir_id.owner;             let def_path_hash = self.definitions.def_path_hash(hir_id_owner);-            self.dep_graph.read(def_path_hash.to_dep_node(DepKind::HirBody));+            let kind = if hir_id.local_id == ItemLocalId::from_u32_const(0) {+                DepKind::Hir+            } else {+                DepKind::HirBody+            };+            self.dep_graph.read(def_path_hash.to_dep_node(kind));

It is supposed to add a read to the node which reveals the parent of the HirId.

Zoxc

comment created time in 6 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 5206827933177ab83e91c38042597b9061c85b96

Address comments

view details

push time in 6 days

pull request commentrust-lang/rust

Fix incremental bugs in the HIR map

Yeah. I just removed a commit and it's reversion.

Zoxc

comment created time in 6 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 5de82b926486edc54d7183971fde901be9445c6b

Drop the lock guard

view details

push time in 6 days

Pull request review commentrust-lang/rust

Construct query job latches on-demand

 pub struct QueryInfo<'tcx> {     pub query: Query<'tcx>, } -/// Representss an object representing an active query job.-pub struct QueryJob<'tcx> {+type QueryMap<'tcx> = FxHashMap<QueryToken, QueryJobInfo<'tcx>>;++/// A value uniquely identifiying an active query job.+/// This value is created from a stack pointer in `get_query` and `force_query`+/// which is alive while the query executes.+#[derive(Copy, Clone, Eq, PartialEq, Hash)]+pub struct QueryToken(NonZeroUsize);

I used DepKind, u16 (for the shard) and u32 for a job in the shard. We're limited to u32::MAX - 1 due to DepNodeIndex anyway.

Zoxc

comment created time in 6 days

push eventZoxc/rust

Erin Power

commit sha 49d78fcd901700c5a14e19a6679db1646b5ca901

Add GitHub issue templates

view details

varkor

commit sha f4f96e294335de13bc7341c626837affdb2e4a45

Normalise diagnostics with respect to "the X is declared/defined here"

view details

varkor

commit sha 24a2929ed1d3e1760bf89c878352448fb5ee2087

Normalise notes with the/is

view details

varkor

commit sha 45832839087da140eeb2a85a8b98927ec27ba21c

Update new tests

view details

Tomasz Miąsko

commit sha 7e3c51d085d9eaa2204cc18763bc7d98b66435fd

Instrument C / C++ in MemorySanitizer example Modify the example to instrument C / C++ in addition to Rust, since it will be generally required (e.g., when using libbacktrace for symbolication). Additionally use rustc specific flag to track the origins of unitialized memory rather than LLVM one.

view details

Andreas Molzer

commit sha 47ae565ed4f1b2a7cc754d4cf0af520b5e6841b9

Add a method to query the capacity of a BufWriter

view details

Mazdak Farrokhzad

commit sha dc17f38e041e6bde95c6f6c5c6170dbb3917d51e

check_unsafety: more code reuse

view details

Andreas Molzer

commit sha aebd0d733940d62566c66a923c7b9f7078209e98

Add capacity to BufReader with same unstable gate

view details

Andrew Paverd

commit sha c0744e1e0c35b1083733fd5c74fc3fb5a6cd04f7

Add support for Control Flow Guard on Windows. This patch enables rustc to emit the required LLVM module flags to enable Control Flow Guard metadata (cfguard=1) or metadata and checks (cfguard=2). The LLVM module flags are ignored on unsupported targets and operating systems.

view details

Yuki Okushi

commit sha cef7764a7624fabeb151b861f005a9d89da91a09

Avoid ICE in macro's diagnostics

view details

John Kåre Alsaker

commit sha bfba6ef328bbba327cae8918e795c11b89217672

Add an option to use LLD to link the compiler on Windows platforms

view details

John Kåre Alsaker

commit sha 95318f8d859dc55cc5e06722c96f6e492529d6ca

Link a linking issue

view details

John Kåre Alsaker

commit sha 2124a85260fdf0851bb4de369d311bcfc05b205f

Don't use a whitelist for use_lld

view details

Nicholas Nethercote

commit sha 0d69fe8308a76630a104504c14e1d3d74e2a3f15

Use `P` for `NtTraitItem`, `NtImplItem`, and `NtForeignItem`. This commit reduces the size of `Nonterminal` from a whopping 240 bytes to 72 bytes (on x86-64), which gets it below the `memcpy` threshold. It also removes some impedance mismatches with `Annotatable`, which already uses `P` for these variants.

view details

Nicholas Nethercote

commit sha 7d2173ed27c1cddc4d4a7a9755f244b66cf1ec81

Use `P` for `NtMeta`. This commit reduces the size of `Nonterminal` from a 72 bytes to 40 bytes (on x86-64).

view details

Hiroki Noda

commit sha 50ed6cbf9836a48c938e74bb28501ffbbe59585e

Fix typo.

view details

Hiroki Noda

commit sha c870ca6217038e80138b69a88b2340b62859f52b

Update

view details

Alex Crichton

commit sha ad0e4a167d950607430ff95022219671ab7054db

Update jobserver crate to 0.1.21 Brings in a fix for alexcrichton/jobserver-rs#23 which could cause Cargo to unnecessarily hang in some situations.

view details

Yuki Okushi

commit sha b1c91ee1b1a671e1d277763169abd9986195712a

Change Applicability to `HasPlaceholders`

view details

Guillaume Gomez

commit sha 2f575dab3030467525acae204e47f7a9a8311530

Add missing links for cmp traits

view details

push time in 6 days

pull request commentrust-lang/rust

Split lang_items to crates `rustc_hir` and `rustc_passes`.

@bors r+

cjgillot

comment created time in 6 days

pull request commentrust-lang/rust

Remove a few unused objects

I do have a PR open which make use of ParDeepVisitor =P

ljedrz

comment created time in 6 days

pull request commentrust-lang/rust

[do not merge] Fix incremental bugs in the HIR map

I added a parent_module query and that seems to have fixed the large regressions. unused-warnings regresses a bit due to the additional parent_module query.

r? @michaelwoerister

Zoxc

comment created time in 6 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 017472529bdaaf4a98c97931f7e66bb99dea28e0

Fix bugs

view details

John Kåre Alsaker

commit sha bd02f4ad164521c172ef4393e3ec6e155e8b2219

Add a `parent_module` query

view details

John Kåre Alsaker

commit sha 0672ea953645b005a0d4ba8d371abba47d9ec069

Update test

view details

push time in 6 days

issue commentrust-lang/rust

Using a String as a generator resume argument causes a segfault

Looking at the MIR generated for @jonas-schievink's reduced test case we can see that the writes that should have been to name1 is instead done to the generator _1:


fn  my_scenario::{{closure}}#0(_1: [generator@test.rs:12:5: 16:6 {std::string::String, ()}], _2: std::string::String) -> ()
yields ()
 {
    debug _arg => _2;                    // in scope 0 at test.rs:12:6: 12:10
    let mut _0: ();                      // return place in scope 0 at test.rs:12:20: 12:20
    let _3: std::string::String;         // in scope 0 at test.rs:13:13: 13:18
    let mut _4: ();                      // in scope 0 at test.rs:13:21: 13:26
    let mut _6: ();                      // in scope 0 at test.rs:14:21: 14:26
    let _7: std::string::String;         // in scope 0 at test.rs:15:9: 15:26
    let mut _8: &std::string::String;    // in scope 0 at test.rs:15:11: 15:17
    let _9: &std::string::String;        // in scope 0 at test.rs:15:11: 15:17
    let mut _10: &std::string::String;   // in scope 0 at test.rs:15:19: 15:25
    let _11: &std::string::String;       // in scope 0 at test.rs:15:19: 15:25
    scope 1 {
        debug name1 => _3;               // in scope 1 at test.rs:13:13: 13:18
        let _5: std::string::String;     // in scope 1 at test.rs:14:13: 14:18
        scope 2 {
            debug name2 => _5;           // in scope 2 at test.rs:14:13: 14:18
        }
    }

    bb0: {
        StorageLive(_3);                 // bb0[0]: scope 0 at test.rs:13:13: 13:18
        StorageLive(_4);                 // bb0[1]: scope 0 at test.rs:13:21: 13:26
        _4 = ();                         // bb0[2]: scope 0 at test.rs:13:21: 13:26
        _1 = suspend(move _4) -> [resume: bb2, drop: bb7]; // bb0[3]: scope 0 at test.rs:13:21: 13:26
    }
...

So this seems to be a problem in MIR construction.

shepmaster

comment created time in 7 days

Pull request review commentrust-lang/rust

Construct query job latches on-demand

 pub struct QueryInfo<'tcx> {     pub query: Query<'tcx>, } -/// Representss an object representing an active query job.-pub struct QueryJob<'tcx> {+type QueryMap<'tcx> = FxHashMap<QueryToken, QueryJobInfo<'tcx>>;++/// A value uniquely identifiying an active query job.+/// This value is created from a stack pointer in `get_query` and `force_query`+/// which is alive while the query executes.+#[derive(Copy, Clone, Eq, PartialEq, Hash)]+pub struct QueryToken(NonZeroUsize);

We can put a counter into the query cache shard. We'll need to split QueryToken into QueryJobId (which globally identifies a query) and QueryShardJobId (which just identifies a query within the shard), or we could just use u32 for the latter.

Zoxc

comment created time in 7 days

pull request commentrust-lang/rust

[do not merge] Fix incremental bugs in the HIR map

@bors try

Zoxc

comment created time in 7 days

pull request commentrust-lang/rust

[do not merge] Fix incremental bugs in the HIR map

@bors try @rust-timer queue

Zoxc

comment created time in 7 days

push eventZoxc/rust

John Kåre Alsaker

commit sha 12e305a97c8e060ca599213a045cde32d2a74de9

anon tweak

view details

John Kåre Alsaker

commit sha 6e06fdc02b1a19d23798b6c051a1560069d7d190

Fix bugs

view details

John Kåre Alsaker

commit sha e1baea98d7f1f9c8e470b89d3121f5b68e7b44fa

Add a `parent_module` query

view details

John Kåre Alsaker

commit sha e510684e6fbca72455b335482cf6538dd20dc0f2

Revert "anon tweak" This reverts commit 12e305a97c8e060ca599213a045cde32d2a74de9.

view details

push time in 7 days

Pull request review commentrust-lang/rust

Split lang_items to crates `rustc_hir` and `rustc_passes`.

+//! Defines language items.+//!+//! Language items are items that represent concepts intrinsic to the language+//! itself. Examples are:+//!+//! * Traits that specify "kinds"; e.g., `Sync`, `Send`.+//! * Traits that represent operators; e.g., `Add`, `Sub`, `Index`.+//! * Functions called by the compiler itself.++pub use self::LangItem::*;++use crate::def_id::DefId;+use crate::Target;++use rustc_data_structures::fx::FxHashMap;+use rustc_data_structures::stable_hasher::{HashStable, StableHasher};+use rustc_macros::HashStable_Generic;+use rustc_span::symbol::{sym, Symbol};+use rustc_span::Span;+use syntax::ast;++use lazy_static::lazy_static;++// The actual lang items defined come at the end of this file in one handy table.+// So you probably just want to nip down to the end.+macro_rules! language_item_table {+    (+        $( $variant:ident, $name:expr, $method:ident, $target:path; )*+    ) => {++enum_from_u32! {+    /// A representation of all the valid language items in Rust.+    #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]+    pub enum LangItem {+        $($variant,)*+    }+}++impl LangItem {+    /// Returns the `name` in `#[lang = "$name"]`.+    /// For example, `LangItem::EqTraitLangItem`,+    /// that is `#[lang = "eq"]` would result in `"eq"`.+    pub fn name(self) -> &'static str {+        match self {+            $( $variant => $name, )*+        }+    }+}++#[derive(HashStable_Generic)]+pub struct LanguageItems {+    /// Mappings from lang items to their possibly found `DefId`s.+    /// The index corresponds to the order in `LangItem`.+    pub items: Vec<Option<DefId>>,+    /// Lang items that were not found during collection.+    pub missing: Vec<LangItem>,+}++impl LanguageItems {+    /// Construct an empty collection of lang items and no missing ones.+    pub fn new() -> Self {+        fn init_none(_: LangItem) -> Option<DefId> { None }++        Self {+            items: vec![$(init_none($variant)),*],+            missing: Vec::new(),+        }+    }++    /// Returns the mappings to the possibly found `DefId`s for each lang item.+    pub fn items(&self) -> &[Option<DefId>] {+        &*self.items+    }++    /// Requires that a given `LangItem` was bound and returns the corresponding `DefId`.+    /// If it wasn't bound, e.g. due to a missing `#[lang = "<it.name()>"]`,+    /// returns an error message as a string.+    pub fn require(&self, it: LangItem) -> Result<DefId, String> {+        self.items[it as usize].ok_or_else(|| format!("requires `{}` lang_item", it.name()))+    }++    $(+        /// Returns the corresponding `DefId` for the lang item+        #[doc = $name]+        /// if it exists.+        #[allow(dead_code)]+        pub fn $method(&self) -> Option<DefId> {+            self.items[$variant as usize]+        }+    )*+}++lazy_static! {+    /// A mapping from the name of the lang item to its order and the form it must be of.+    pub static ref ITEM_REFS: FxHashMap<&'static str, (usize, Target)> = {+        let mut item_refs = FxHashMap::default();+        $( item_refs.insert($name, ($variant as usize, $target)); )*+        item_refs+    };+}

Maybe fix up the indentation in this macro?

cjgillot

comment created time in 7 days

Pull request review commentrust-lang/rust

Split lang_items to crates `rustc_hir` and `rustc_passes`.

 impl<'tcx> TyCtxt<'tcx> {             }         })     }++    pub fn fn_trait_lang_item(&self, id: DefId) -> Option<ty::ClosureKind> {

This should be named fn_trait_kind_from_lang_item. It currently sounds like it returns a lang item.

cjgillot

comment created time in 7 days

pull request commentrust-lang/rust

Use queries for the HIR map

  • What is IndexedHir? I'd guess the entire HIR after lowering + lookup tables?

It has the crate hash, the lookup tables for hir_owner and hir_owner_items and also hir_to_node_id. It basically store the stuff that was in Map.

  • What is a HirOwner? An "item-like"? The thing corresponding to a DepNode::Hir?

It is an item-like or a macro def. It corresponds to DepNode::Hir.

  • What is a HirItem? A child of an owner, like an expression, params, etc?

Yeah.

  • What HirOwnerItems? A local lookup table for items of a HirOwner?

It's a lookup table for items (without a DefIndex) and bodies. It corresponds to DepNode::HirBody.

Not sure if that is due to bug fixes or just a different configuration of red-green boundaries. Do we decrease dep-node granularity for HIR-related things with this setup?

The dep-node granularity is the same, expect for hir_module_items which is slightly finer.

I looked over the existing HIR map and fixed the bugs I found. That seems to result in similar regressions.

  • Does this get rid of all custom dep-tracking we do for the HIR map? (That would be awesome!)

It does.

  • Does this hash the HIR twice in order to compute the SVH?

It hashed the HIR thrice. I put while_hashing_hir_bodies(false, ... on the wrong type. I fixed that and also made HirOwnerItems store a Fingerprint calculated by the collector. So now this hashes HIR as much as master.

Zoxc

comment created time in 7 days

pull request commentrust-lang/rust

Use queries for the HIR map

@rust-timer build 090412221c6300b5828f61d6f39e2777b94214ab

Zoxc

comment created time in 7 days

pull request commentrust-lang/rust

Reduce the number of `RefCell`s in `InferCtxt`.

Oh, they're just hypothetical data structures which avoid the cost of a RefCell by only exposing operations which do not return references to their interior, like Cell. This makes them mostly useful when doing simple get/set operations with Copy types.

nnethercote

comment created time in 7 days

pull request commentrust-lang/rust

Use queries for the HIR map

@bors try @rust-timer queue

Zoxc

comment created time in 8 days

push eventZoxc/rust

John Kåre Alsaker

commit sha bfba6ef328bbba327cae8918e795c11b89217672

Add an option to use LLD to link the compiler on Windows platforms

view details

John Kåre Alsaker

commit sha 95318f8d859dc55cc5e06722c96f6e492529d6ca

Link a linking issue

view details

John Kåre Alsaker

commit sha 2124a85260fdf0851bb4de369d311bcfc05b205f

Don't use a whitelist for use_lld

view details

kennytm

commit sha 847d5b4d1387a30f1798a5c3c59c3e0c31e00319

Derive Clone + PartialEq + Eq for std::string::FromUtf8Error

view details

Trevor Spiteri

commit sha fd2282388140ea0f370ee25c82f00be81c2f822c

implement AsMut<str> for String

view details

Eduard-Mihai Burtescu

commit sha b82f6c575e53f06c3645f66a9d480b4f025ee39e

rustc_codegen_llvm: always set AlwaysPreserve on all debuginfo variables.

view details

Mikhail Babenko

commit sha 73936ab57ad567802a613157ae9db0cccf31eda3

print generic bounds on associated types

view details

Mikhail Babenko

commit sha ab6ea2bba771836ebbf8759e718fedd2c6d229d2

add regression test

view details

Mikhail Babenko

commit sha bf82582d6f8de744df5c34e80a04ad72f40afed7

add hir printing

view details

Jonas Schievink

commit sha 66fd4e6ed8fbc00feeccfe0fe9d25e1c1346807d

Make `associated_items` query return a slice

view details

Jonas Schievink

commit sha f4165731ad0445dc801b43b6b125c7178d5c70ff

Use `associated_items` query in impl overlap check This reduces the number of `associated_item` queries done here.

view details

Jonas Schievink

commit sha 52f77110d455b6b946ae0ca36a4671bdd9b7e145

Add a fast path to inherent impl overlap check Quickly skip impls that do not define any items with the same name

view details

Jonas Schievink

commit sha e0cb1ae24abb9242263d0bbf40f631bd95512406

Make `provided_trait_methods` use `impl Iterator`

view details

Jonas Schievink

commit sha 58a9284bff045ef81f38b730043b5acb00485d0e

Add missing import

view details

Patryk Wychowaniec

commit sha a8d34c106206553d46e031a3d427edf865225ab6

Improve reporting errors and suggestions for trait bounds

view details

John Kåre Alsaker

commit sha e763ddc6b9025482edd06ab563f8a3783381aae9

Add some comments

view details

John Kåre Alsaker

commit sha d304cd0c5543c701bbfec0bd7b0c8b7c142b3bca

More comments

view details

bors

commit sha 1ad6b5e1e69ad3d3509abd8c041bb9fb2dd86c41

Auto merge of #68623 - Zoxc:lld, r=Mark-Simulacrum Add an option to use LLD to link the compiler on Windows platforms Based on https://github.com/rust-lang/rust/pull/68609. Using LLD is good way to improve compile times on Windows since `link.exe` is quite slow. The time for `x.py build --stage 1 src/libtest` goes from 0:12:00 to 0:08:29. Compile time for `rustc_driver` goes from 226.34s to 18.5s. `rustc_macros` goes from 28.69s to 7.7s. The size of `rustc_driver` is also reduced from 83.3 MB to 78.7 MB. r? @Mark-Simulacrum

view details

Jonas Schievink

commit sha 0b50319af69d52ce9806e91fba777986dec4e417

Rollup merge of #68738 - kennytm:derive-clone-eq-for-fromutf8error, r=sfackler Derive Clone + Eq for std::string::FromUtf8Error Implement `Clone` and `Eq` for `std::string::FromUtf8Error`. Both the inner `Vec<u8>` and `std::str::Utf8Error` are also `Clone + Eq`, so I don't see why we shouldn't derive them on `FromUtf8Error` as well. (impl are insta-stable, requiring FCP from T-libs.)

view details

Jonas Schievink

commit sha 3516df3ecbc97a449221e7a02cf750bf8726b5c1

Rollup merge of #68742 - tspiteri:string-as-mut, r=sfackler implement AsMut<str> for String Closes #68741.

view details

push time in 8 days

pull request commentrust-lang/rust

[do not merge] Fix incremental bugs in the HIR map

@bors try @rust-timer queue

Zoxc

comment created time in 8 days

PR opened rust-lang/rust

[do not merge] Fix incremental bugs in the HIR map
+21 -7

0 comment

2 changed files

pr created time in 8 days

create barnchZoxc/rust

branch : hir-map-audit

created branch time in 8 days

more