profile
viewpoint

ecstatic-morse/ksuid 5

A small utility for dealing with Segment.io KSUIDs

ecstatic-morse/enum-utils 4

A set of useful proc macros for enums

ecstatic-morse/atdf 1

A parser for AVR's system description files (.atdf).

ecstatic-morse/fixed-bitset 1

A bitset whose size is fixed at compile-time

ecstatic-morse/anglistic-sched 0

A scheduler for matching students to presentation time slots by preference

ecstatic-morse/blog.rust-lang.org 0

The Rust Programming Language Blog

ecstatic-morse/competitive-coding-demo 0

An example of a solution to a coding problem

ecstatic-morse/compiler-team 0

A home for compiler team planning documents, meeting minutes, and other such things.

ecstatic-morse/const-eval 0

home for proposals in and around compile-time function evaluation

ecstatic-morse/const-phf 0

An experimental perfect hash function generator that runs entirely in const-eval

pull request commentrust-lang/rust

perf: Buffer stderr when writing json errors/warnings

@Marwes In a single-threaded context, what happens if I emit then call warn! then call emit again? I want to see the following:

ERROR 1
warning
ERROR 2

Are we flushing the emitter buffer so that the relative order is preserved?

Marwes

comment created time in 14 hours

pull request commentrust-lang/rust

perf: Buffer stderr when writing json errors/warnings

I don't think we should merge this as-is. I believe this would decouple error messages from other output such as RUSTC_LOG, making debugging harder. Instead, we should wrap io::Stderr in a global BufWriter when writing to a file.

Marwes

comment created time in 14 hours

pull request commentrust-lang/rust

Stabilize const for integer {to,from}_{be,le,ne}_bytes methods

AFAIK we don't have official guidelines about when allow_internal_unstable is acceptable, so here's my personal philosophy.

Before I would be comfortable making something stably const with allow_internal_unstable, I would want some assurances regarding what would happen if the unstable feature needed to be removed (this is not outside the realm of possibility for const_transmute). Namely:

  • [ ] The function in question can be implemented without the unstable feature.
  • [ ] The implementation without the unstable feature is not so complex as to be unmaintainable.
  • [ ] The implementation without the unstable feature is no slower than the current one in release mode.
  • [ ] The implementation without the unstable feature is not unreasonably slow in debug mode (e.g. for cargo test).

I think the first and second points are trivially satisfied by the bitshifting approach, though the macro that defines the byte conversions will not be terribly fun to write. I think the third is probably satisfied, although I would like to see a playground example which proves that the generated assembly is identical. Larger primitive types will require a lot of bit operations that may put them above LLVM's inlining threshold, but there are ways around this. Whether the fourth point is satisfied depends on your definition of "unreasonable". I don't know if debug mode performance is important to others, but I would at least like to see some numbers.

tspiteri

comment created time in 15 hours

issue commentrust-lang/rust

#[allow_internal_unstable] does not allow unstable library features

@eddyb This was changed as part of #63770.

kennytm

comment created time in 2 days

issue commentrust-lang/rust

Tracking issue for conflicting `repr(...)` hints future compatibility

enum-utils has a test case with multiple reprs. Feel free to ignore that crate.

Centril

comment created time in 2 days

push eventecstatic-morse/rust

Michael Bradshaw

commit sha 348278a7fd5fd459f555dd763e71e12c23c1661a

Stabilize Once::is_completed

view details

Dylan MacKenzie

commit sha c981d67b509f1ba16c97683ad6dc430429899e49

[!] Use `rustc_inherit_overflow_checks` in `next_power_of_two` I believe the previous code was calling `ops::Add::add` instead of the `+` operator to get this behavior.

view details

Dylan MacKenzie

commit sha 2afa99379d9623e50efd290e609447bdc5059af8

Use bespoke macro instead of `?` inside const fns

view details

Dylan MacKenzie

commit sha 269bf89865536964546242589bb186a8a7e3c566

Make integer power methods const

view details

Dylan MacKenzie

commit sha 7fe5eaf7d8cb23ceb71d8e509be13d20ef836114

Test integer exponentiation in a const context

view details

Dylan MacKenzie

commit sha f6d4720f26c92e9905c98b4ee2db832927e30a8a

Make `u8::is_ascii` a stable `const fn` `char::is_ascii` is already a stable `const fn`, so there is no reason for `u8::is_ascii` to be unstable.

view details

Dylan MacKenzie

commit sha bf732a11ecc319e0c0a840196bde1b5daccbdc85

Test `u8::is_ascii` alongside `char::is_ascii`

view details

Pyry Kontio

commit sha 86bf96291d8222dbec9e07461404ecb189be0a98

Implement split_inclusive for slice and str, an splitting iterator that includes the matched part in the iterated substrings as a terminator.

view details

Pyry Kontio

commit sha 5c9dc57cb587761561e85574c821a6f9c0c7cc67

Don't return empty slice on last iteration with matched terminator. Test reverse iteration.

view details

Esteban Küber

commit sha 683ebc2dec0a5b88eb3eaf146e6855ea299d17b8

On mismatched argument count point at arguments

view details

Eric Huss

commit sha 4810c4712f9edc4c378142ace1b868fc2fd1eeea

Add shared script for linkchecking books.

view details

Matthew Jasper

commit sha cd9f5ff2a1c50a5af94ad1dd1c976f631b9f19a6

Check `Copy` lifetimes bounds when copying from a projection

view details

Matthew Jasper

commit sha ddc25456c5945457ba86cb60994ce9872bd98edd

Check types of statics in MIR typeck

view details

Ralf Jung

commit sha ad4b3f3e175a1b5d9e532ed35a917cd47196e75b

const-prop: use one helper method for all lints; consistently lint overflow on BinOps and not on Assert

view details

Vadim Petrochenkov

commit sha bcd7e2b38b3eb26004bf94a63814341329233491

rustc_lint: Move `unused_doc_comments` from pre-expansion to early lints

view details

Ralf Jung

commit sha bd485223149e35c1c4e6b3ecf58653e38de4b6c9

fix tests, and use variants to test debug and release builds together

view details

Ralf Jung

commit sha 9c7639492ff4b3f6b812f355d4b8fe08cc81571d

more revisions and use them for another test

view details

Ralf Jung

commit sha 4b8c78496815e22652fdf0da216659fe06936b50

add test for issue 69020

view details

Ralf Jung

commit sha 2107e73d2f0605e916d7b17b1cc0dbb5a1353765

fix exceeding_bitshift lint and test

view details

Ralf Jung

commit sha 415218fc8d590063a8c5cd403ff890fb91c0bd2c

expand assoc-const test a bit, just to be sure

view details

push time in 2 days

pull request commentrust-lang/rust

no more codegen for miri_start_panic

@bors r+ rollup=always

RalfJung

comment created time in 2 days

push eventecstatic-morse/packed_simd

Dylan MacKenzie

commit sha 9b7f2933504f9d81e7e366644412101c3c388130

Add feature `rustc_attrs`

view details

push time in 3 days

pull request commentrust-lang/rust

perf: Buffer stderr when writing json errors/warnings

@marwes. syscall only counts as one instruction. Have a look at the task-clock benchmarks.

Marwes

comment created time in 5 days

pull request commentrust-lang/rust

Emit 1-based column numbers in debuginfo

cc #65437 #65676

tmiasko

comment created time in 5 days

pull request commentrust-lang/rust

perf: Buffer stderr when writing json errors/warnings

Awesome! cc #69227

Marwes

comment created time in 5 days

pull request commentrust-lang/rust

Revert #69280

@pnkfelix simd-intrinsics-generic-elements will ICE in the same way as that issue.

I knew there could be breakage due to #69280. This breakage is allowed since defining simd_shuffle requires platform_intrinsics. However, I missed that this was done in packed_simd as well as stdarch, and it seemed impolite to break everyone using packed_simd with zero notice.

ecstatic-morse

comment created time in 5 days

Pull request review commentrust-lang/rust-clippy

Rustup to rust-lang/rust#69072

 fn check_trait_method_impl_decl<'a, 'tcx>(     let trait_method = cx         .tcx         .associated_items(impl_trait_ref.def_id)-        .iter()+        .in_definition_order()         .find(|assoc_item| {

this should become find_by_name_and_kind(impl_item.ident, ty::AssocKind::Method, impl_trait_ref.def_id)

krishna-veerareddy

comment created time in 5 days

PR opened rust-lang/rust

Revert "Rollup merge of #69280"

Resolves #69313 by reverting #69280.

#69280 began to require #[rustc_args_required_const] be on the declaration of simd_shuffle intrinsics. This is allowed breakage, since you can't define platform intrinsics on stable. However, the latest release of the widely used packed_simd crate defines these intrinsics without the requisite attribute. Since there's no urgency to merge #69280, let's revert it. We can reconsider when rust-lang/packed_simd#278 is included in a point release.

r? @petrochenkov

+41 -39

0 comment

9 changed files

pr created time in 5 days

create barnchecstatic-morse/rust

branch : revert-simd-shuffle

created branch time in 6 days

pull request commentrust-lang/rust

perf: Buffer stderr when writing json errors/warnings

Is this ready for a perf run @Marwes?

Marwes

comment created time in 6 days

PR opened rust-lang/packed_simd

Mark `simd_shuffle` intrinsics as `rustc_args_required_const`

This change was made in stdarch but not packed_simd. See rust-lang/rust#69280 for background.

+6 -0

0 comment

1 changed file

pr created time in 6 days

push eventecstatic-morse/packed_simd

ecstatic-morse

commit sha f760867e42e6b91e04fa7c8b26bfd7c78414d061

Mark `simd_shuffle` intrinsics as `rustc_args_required_const` This change was made in `stdarch` but not `packed_simd`. See rust-lang/rust#69280 for background.

view details

push time in 6 days

issue commentrust-lang/rust

ICE with rustc claiming non-constant shuffle indices when they are constant (block.rs:622)

Likely fallout from #69280.

Ultimately, these intrinsics need to be annotated with #[rustc_args_required_const]. I'll submit a fix over there. Since #69280 is just a cleanup PR, we should revert it until at least the next packed_simd release.

hsivonen

comment created time in 6 days

pull request commentrust-lang/rust

prepare_relocation_copy: check for integer overflow in the multiplica…

@saaramar I think we should close this particular PR, since if the result of that multiplication overflows, there will be much worse performance issues than reallocating a vector a few times.

Adding some debug_asserts for the size/alignment preconditions you mention above may be a good idea though. WDYT?

saaramar

comment created time in 6 days

pull request commentrust-lang/rust

Allow trait methods to be called on concrete types in a const context

@bors r=oli-obk

ecstatic-morse

comment created time in 7 days

pull request commentrust-lang-nursery/rustc-perf

Add benchmark with many associated items

cc @Mark-Simulacrum

ecstatic-morse

comment created time in 7 days

PR opened rust-lang-nursery/rustc-perf

Add benchmark with many associated items

rust-lang/rust#68957 demonstrated an increase in compile times that was quadratic in the number of associated items. rust-lang/rust#68837 sped this up a lot, and rust-lang/rust#69072 hopes to speed it up even more by making associated item name lookup O(log n).

This benchmark has been reduced in size from the original to run in ~2 seconds locally.

+10012 -0

0 comment

4 changed files

pr created time in 7 days

create barnchecstatic-morse/rustc-perf

branch : many-assoc-items

created branch time in 7 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha a0212ba40fdeb07626449b5790537aca542b51d2

Construct `AssociatedItems` from an iterator instead of a `Vec`

view details

push time in 7 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha fc5c2956b11e29f931cec010e3f38461ec4ac309

Impl `GenKill` for old dataflow framework's `GenKillSet` This impl is temporary and will be removed along with the old dataflow framework. It allows us to reuse the transfer function of new dataflow analyses when defining old ones

view details

Dylan MacKenzie

commit sha 7d9dadcccca9efc63f30fa1c9adee00effb860d4

Implement `Maybe{Mut,}BorrowedLocals` analyses

view details

Dylan MacKenzie

commit sha 34783b73bd891a66fb2af613fef7492376fc7c8a

Remove outdated `IndirectlyMutableLocals` `MaybeMutBorrowedLocals` serves the same purpose and has a better name.

view details

Dylan MacKenzie

commit sha 9972502bafab062b06ef04c02c653f1b868937bd

Reenable peek test for indirect mutation analysis This uses the new `MaybeMutBorrowedLocals` pass but we keep the `rustc_peek_indirectly_mutable` since the two are interchangable except when inspecting a local after it has been marked `StorageDead`.

view details

Dylan MacKenzie

commit sha 1d737fb032b762e69e8d809c0e042d45e08b457d

Use `MaybeBorrowedLocals` for generator analyses It should have the same semantics as `HaveBeenBorrowedLocals`

view details

Dylan MacKenzie

commit sha d045a17c4b032a858323f6c9bea698ee2e5920b7

Use `MaybeMutBorrowedLocals` for const-checking

view details

Dylan MacKenzie

commit sha 6f167e9c5f421613ff3de37771b1352cd98dd4f7

Remove ignore and add explanation of indirect mutation peek test

view details

Dylan MacKenzie

commit sha 15a5382ef1115ff11c1357fd21ab4aa12626efee

Rename `MaybeBorrowedLocals` constructors

view details

Dylan MacKenzie

commit sha 0984639348c2fc98389746f6815e576cfcaacda8

Ignore mut borrow from drop terminator in const-eval

view details

Dylan MacKenzie

commit sha 668d2fe807068073647f9c92d81ff0e7b9ab8486

Update line # in test output

view details

Dylan MacKenzie

commit sha 9d423950cc141e110242ff1973f2d7b84c719a86

Use doc comment for explanation of `shared_borrow_allows_mutation`

view details

Dylan MacKenzie

commit sha 077a93c6a9b1c8ee0e541ea484f7e13c207d50d0

Fix typo in comment

view details

Eric Huss

commit sha 597b4f743e55a8c4653af7db1796fb3eb4b11d00

Update cargo

view details

Sebastian Hahn

commit sha 3e17d191fa47b9ab262d0efa3a39e500e9fb1667

Revert "Remove `checked_add` in `Layout::repeat`" This fixes a a segfault in safe code, a stable regression. Reported in \#69225. This reverts commit a983e0590a43ed8b0f60417828efd4e79b51f494. Also adds a test for the expected behaviour.

view details

bors

commit sha a2fb0c28be794f28028884650db70c17fea8e35b

Auto merge of #69241 - shahn:checked_add_revert, r=Mark-Simulacrum,lqd Revert "Remove `checked_add` in `Layout::repeat`" This fixes a a segfault in safe code, a stable regression. Reported in #69225. This reverts commit a983e0590a43ed8b0f60417828efd4e79b51f494.

view details

Matthias Krüger

commit sha 076cd9eabdfbbd68b00d1fb5ccc35c9a2f8c0d51

submodules: update clippy from b91ae16e to 2855b214 Changes: ```` Rustup to rust-lang/rust#69194 Rustup to rust-lang/rust#69181 Add `LOG2_10` and `LOG10_2` to `approx_const` lint Clean up imports Use `Vec::with_capacity()` as possible needless_doctest_main: False positive for async fn Remove use of `TyKind`. Use `if_chain`. Fix ICE. Add tests and improve checks. Add `Future` detection for `missing_errors_doc`. ```` Fixes #69269

view details

bors

commit sha 3a8108d8e52e13f3f1a151a93addfcf4a86b97f5

Auto merge of #69113 - ecstatic-morse:unified-dataflow-borrowed, r=wesleywiser Combine `HaveBeenBorrowedLocals` and `IndirectlyMutableLocals` into one dataflow analysis This PR began as an attempt to port `HaveBeenBorrowedLocals` to the new dataflow framework (see #68241 for prior art). Along the way, I noticed that it could share most of its code with `IndirectlyMutableLocals` and then found a few bugs in the two analyses: - Neither one marked locals as borrowed after an `Rvalue::AddressOf`. - `IndirectlyMutableLocals` was missing a minor fix that `HaveBeenBorrowedLocals` got in #61069. This is not a problem today since it is only used during const-checking, where custom drop glue is forbidden. However, this may change some day. I decided to combine the two analyses so that they wouldn't diverge in the future while ensuring that they remain distinct types (called `MaybeBorrowedLocals` and `MaybeMutBorrowedLocals` to be consistent with the `Maybe{Un,}InitializedPlaces` naming scheme). I fixed the bugs and switched to exhaustive matching where possible to make them less likely in the future. Finally, I added comments explaining some of the finer points of the transfer function for these analyses (see #61069 and #65006).

view details

bors

commit sha ae5467826d1e677aff4662fc0481ace33761fc90

Auto merge of #69265 - ehuss:update-cargo, r=Dylan-DPC Update cargo 9 commits in 3c53211c3d7fee4f430f170115af5baad17a3da9..e02974078a692d7484f510eaec0e88d1b6cc0203 2020-02-07 15:35:03 +0000 to 2020-02-18 15:24:43 +0000 - Set an environment variable for tests to find executables. (rust-lang/cargo#7697) - Rework internal errors. (rust-lang/cargo#7896) - Improvements to StringList config handling. (rust-lang/cargo#7891) - Add new/old rustflags to fingerprint log. (rust-lang/cargo#7890) - Fix inaccurate doc comment on `env_args`. (rust-lang/cargo#7889) - Add some extra fingerprint debug information. (rust-lang/cargo#7888) - Link the licenses into crates/cargo-platform (rust-lang/cargo#7886) - Modify test to make `rustc` PR mergeable (rust-lang/cargo#7883) - Keep environment variables in a BTreeMap to preserve sort order (rust-lang/cargo#7877)

view details

bors

commit sha 7710ae0e2653e0fa14ff9b7797ed29340e0284a8

Auto merge of #69278 - matthiaskrgr:submodule_upd, r=Dylan-DPC submodules: update clippy from b91ae16e to 2855b214 Changes: ```` Rustup to rust-lang/rust#69194 Rustup to rust-lang/rust#69181 Add `LOG2_10` and `LOG10_2` to `approx_const` lint Clean up imports Use `Vec::with_capacity()` as possible needless_doctest_main: False positive for async fn Remove use of `TyKind`. Use `if_chain`. Fix ICE. Add tests and improve checks. Add `Future` detection for `missing_errors_doc`. ```` Fixes #69269

view details

Dylan MacKenzie

commit sha ea3c9d27cffceb9d4c8dcfda1c96b138d7f01f3d

Implement an insertion-order preserving, efficient multi-map

view details

push time in 7 days

PR opened rust-lang/rust

Use new dataflow framework for generators

#65672 introduced a new dataflow framework that can handle arbitrarily complex transfer functions as well as ones that can be expressed with gen/kill. This PR ports the analyses used during generator transforms to the new framework so that we can remove the old one. See #68241 for a prior example of this. The new framework has some superficial API changes, but this shouldn't alter the generator transformations in any way.

r? @tmandry

+150 -153

0 comment

5 changed files

pr created time in 7 days

create barnchecstatic-morse/rust

branch : unified-dataflow-generators

created branch time in 7 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 19801b12c950f727a4e6938a87b0b2fdece73c07

Update tests

view details

push time in 7 days

pull request commentrust-lang/rust

Remove special case for `simd_shuffle` arg promotion

Some tests declare their own simd_shuffle platform intrinsic, which now needs the attribute. I assume this is okay (cc @petrochenkov).

@bors r=petrochenkov

ecstatic-morse

comment created time in 7 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha b43dc806ae3d5fd11ff0bdea288cf16f4b1e4c13

Add `#[rustc_args_required_const]` to `simd_shuffle` tests

view details

push time in 7 days

pull request commentrust-lang/rust

Remove special case for `simd_shuffle` arg promotion

@bors r-

ecstatic-morse

comment created time in 7 days

Pull request review commentrust-lang/rust

const limit for CTFE

 declare_features! (     /// Allows using `&mut` in constant functions.     (active, const_mut_refs, "1.41.0", Some(57349), None), +    // Allows limiting the evaluation steps of const expressions+    (active, const_eval_limit, "1.41.0", Some(67217), None),

He means that you should remove the "closes" line from your PR description.

TheSamsa

comment created time in 7 days

issue openedrust-lang/rust

Replace `#[rustc_args_required_const(n)]` with per-argument attr

RFC 2565, which was recently stabilized, allows individual function parameters to have attributes. One of the motivating examples for that RFC was the ugliness of #[rustc_args_required_const], which specifies the const argument(s) by index. Since that RFC has been stabilized, we should transition away from #[rustc_args_required_const] to a per-argument attribute.

@petrochenkov has proposed #[rustc_required_const]. These attributes are perma-unstable so there are no backwards compatibility concerns.

created time in 7 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 063186fd592da86700d5e8228fa2b2bec5853164

Add `#[rustc_args_required_const]` to `simd_shuffle` test

view details

push time in 7 days

pull request commentrust-lang/rust

O(log n) lookup of associated items by name

@petrochenkov I switched to a map, but it's not quite ready for review, just running the tests while I context switch.

ecstatic-morse

comment created time in 7 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha fb4ee66177644a3eccef36ea5d6a38e3778fda55

Implement an insertion-order preserving, efficient multi-map

view details

Dylan MacKenzie

commit sha 3c931a3fbcc6f0d276b93d770f1c4bb7ce205230

Replace `rustc_typeck::Namespace` with `rustc_hir::def::Namespace`

view details

Dylan MacKenzie

commit sha ffa3fecd7523245c602ecdf028d5e03b4fa350f1

Make lookup of associated item by name O(log n)

view details

Dylan MacKenzie

commit sha 7a73fd3d652c657261f9e3bb32547f2ae4a0aba6

Replace FIXME with explanation

view details

push time in 7 days

push eventecstatic-morse/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

Ben Lewis

commit sha c423a8649c0bac16fd4d1b9cbea657e4245bb5ac

Change const eval to return `ConstValue`, instead of `Const` as the type inside it shouldn't be used.

view details

Ben Lewis

commit sha c7aadcfa567f363e302ac797a4805668eb7bc77c

Change `const_field` and `const_caller_location` to return `ConstValue` instead of `Const` as the type in the returned const isn't needed.

view details

Ben Lewis

commit sha 99a864be39d551362bc29bb76ac06d639afedb42

Fix emulate intrinsics return type.

view details

Ben Lewis

commit sha 821f4a9dfb38dab30df861d3c19788b2e7ed0d95

Monomorphize const type during codegen.

view details

Matthew Jasper

commit sha 0663f253757ab0d360f540e9d7bc7882db1dc8bd

Always qualify literals by type

view details

Matthew Jasper

commit sha f2980e71d936be7a39b9a472664363d93f2c7fd8

Add fast path for is_freeze

view details

Mazdak Farrokhzad

commit sha 2fd15442f2f1c798718242eaa9817531a53c2134

ast: move Generics into AssocItemKinds

view details

Mazdak Farrokhzad

commit sha f06df1629e1144be6a217754303a6585699e0728

ast: colocate AssocItem with ForeignItem

view details

Mazdak Farrokhzad

commit sha e2ae717265c4597d605cf5981a6e557516ccb0c8

ast: tweak comments of Foreign/AssocItemKind

view details

Mazdak Farrokhzad

commit sha 95dc9b9a73353a786e3c934c5074fb793ff7a735

ast: normalize `ForeignItemKind::Ty` & `AssocItemKind::TyAlias`.

view details

Yuki Okushi

commit sha 6351bfd182267133409c5174decdff2071f90454

Add test for issue-39618

view details

Yuki Okushi

commit sha f32447d54138e9f42ba5a729550603573913397f

Add test for issue-51798

view details

Yuki Okushi

commit sha ecb8bf069e0a32d8c76884786a5a0b1ea7ccf8d9

Add test for issue-62894

view details

Yuki Okushi

commit sha 426dcf0da03b4287991e378c50ddb0718960941b

Add test for issue-63952

view details

Yuki Okushi

commit sha 9478503315795401ce037fbca87bf1dbf82f8d31

Add test for issue-68653

view details

Yuki Okushi

commit sha 2f39ec24b20bc1ef09c7810f8210ea48bb5a3d29

Add FIXME note

view details

Mazdak Farrokhzad

commit sha f3e9763543e5828fe9eee7f5e78c88193f5b8ba5

ast: make `= <expr>;` optional in free statics/consts.

view details

Mazdak Farrokhzad

commit sha 1c2906ead3825c013ac022249f1e1ee3a3b97c75

ast/parser: fuse `static` & `const` grammars in all contexts.

view details

Mazdak Farrokhzad

commit sha f8d2264463162291f5cb3391c98d7bc95ec17d87

parse associated statics.

view details

push time in 7 days

pull request commentrust-lang/rust

Remove special case for `simd_shuffle` arg promotion

FWIW, we have function parameter attributes now, so #[rustc_args_required_const(N)] on functions could become #[rustc_required_const] on function parameters. Perhaps we need to open an issue for this.

Ooh, this would be much better. I can open the issue if you like?

ecstatic-morse

comment created time in 7 days

pull request commentrust-lang/rust

O(log n) lookup of associated items by name

The second part of #69072 (comment) still holds, we have a single canonical iteration order now, so in_(definition,arbitrary)_order could be removed in favor of associated_items.iter() thus simplifying the interface.

I prefer in_definition_order. It's self-documenting. in_arbitrary_order can go away since I won't be changing the vtable order anytime soon.

ecstatic-morse

comment created time in 7 days

Pull request review commentrust-lang/rust

O(log n) lookup of associated items by name

 impl AssocItem {     } } +/// A list of `ty::AssocItem`s in definition order that allows for efficient lookup by name.+///+/// When doing lookup by name, we try to postpone hygienic comparison for as long as possible since+/// it is relatively expensive. Instead, items are indexed by `Symbol` and hygienic comparison is+/// done only on items with the same name.+#[derive(Debug, Clone, PartialEq, HashStable)]+pub struct AssociatedItems {+    items_in_def_order: Vec<ty::AssocItem>,+    item_idx_in_name_order: Vec<usize>,

Whoops. My bad.

ecstatic-morse

comment created time in 7 days

Pull request review commentrust-lang/rust

O(log n) lookup of associated items by name

 impl AssocItem {     } } +#[repr(transparent)]+#[derive(Debug, Clone, Copy, HashStable)]+struct AssocItemByNameUnhygienic(ty::AssocItem);

How will in_definition_order return a slice then?

ecstatic-morse

comment created time in 7 days

PR opened rust-lang/rust

Remove special case for `simd_shuffle` arg promotion

After rust-lang/stdarch#825, these intrinsics are now defined with #[rustc_args_required_const(2)], so the special-case is no longer necessary.

+7 -21

0 comment

2 changed files

pr created time in 7 days

create barnchecstatic-morse/rust

branch : promote-shuffle-no-special-case

created branch time in 7 days

push eventecstatic-morse/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

Ben Lewis

commit sha c423a8649c0bac16fd4d1b9cbea657e4245bb5ac

Change const eval to return `ConstValue`, instead of `Const` as the type inside it shouldn't be used.

view details

Ben Lewis

commit sha c7aadcfa567f363e302ac797a4805668eb7bc77c

Change `const_field` and `const_caller_location` to return `ConstValue` instead of `Const` as the type in the returned const isn't needed.

view details

Ben Lewis

commit sha 99a864be39d551362bc29bb76ac06d639afedb42

Fix emulate intrinsics return type.

view details

Ben Lewis

commit sha 821f4a9dfb38dab30df861d3c19788b2e7ed0d95

Monomorphize const type during codegen.

view details

Matthew Jasper

commit sha 0663f253757ab0d360f540e9d7bc7882db1dc8bd

Always qualify literals by type

view details

Matthew Jasper

commit sha f2980e71d936be7a39b9a472664363d93f2c7fd8

Add fast path for is_freeze

view details

Mazdak Farrokhzad

commit sha 2fd15442f2f1c798718242eaa9817531a53c2134

ast: move Generics into AssocItemKinds

view details

Mazdak Farrokhzad

commit sha f06df1629e1144be6a217754303a6585699e0728

ast: colocate AssocItem with ForeignItem

view details

Mazdak Farrokhzad

commit sha e2ae717265c4597d605cf5981a6e557516ccb0c8

ast: tweak comments of Foreign/AssocItemKind

view details

Mazdak Farrokhzad

commit sha 95dc9b9a73353a786e3c934c5074fb793ff7a735

ast: normalize `ForeignItemKind::Ty` & `AssocItemKind::TyAlias`.

view details

Yuki Okushi

commit sha 6351bfd182267133409c5174decdff2071f90454

Add test for issue-39618

view details

Yuki Okushi

commit sha f32447d54138e9f42ba5a729550603573913397f

Add test for issue-51798

view details

Yuki Okushi

commit sha ecb8bf069e0a32d8c76884786a5a0b1ea7ccf8d9

Add test for issue-62894

view details

Yuki Okushi

commit sha 426dcf0da03b4287991e378c50ddb0718960941b

Add test for issue-63952

view details

Yuki Okushi

commit sha 9478503315795401ce037fbca87bf1dbf82f8d31

Add test for issue-68653

view details

Yuki Okushi

commit sha 2f39ec24b20bc1ef09c7810f8210ea48bb5a3d29

Add FIXME note

view details

Mazdak Farrokhzad

commit sha f3e9763543e5828fe9eee7f5e78c88193f5b8ba5

ast: make `= <expr>;` optional in free statics/consts.

view details

Mazdak Farrokhzad

commit sha 1c2906ead3825c013ac022249f1e1ee3a3b97c75

ast/parser: fuse `static` & `const` grammars in all contexts.

view details

Mazdak Farrokhzad

commit sha f8d2264463162291f5cb3391c98d7bc95ec17d87

parse associated statics.

view details

push time in 7 days

push eventecstatic-morse/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

Erin Power

commit sha 49d78fcd901700c5a14e19a6679db1646b5ca901

Add GitHub issue templates

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

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

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

push time in 8 days

PR opened rust-lang/rustc-guide

[WIP] Give overview of MIR dataflow framework

Resolves #564.

I'm a few PRs away from transitioning all existing dataflow analyses in the compiler to the new framework, which can handle gen-kill problems as well as more general ones. When this is finished, we'll want to have an overview of the new framework in the guide.

This is a rough draft, and most of the links don't work since the module structure will change when the old framework is removed. For now, it exists mostly to prove that I've not forgotten about doing this :smile:.

+160 -0

0 comment

2 changed files

pr created time in 8 days

create barnchecstatic-morse/rustc-guide

branch : dataflow

created branch time in 8 days

fork ecstatic-morse/rustc-guide

A guide to how rustc works and how to contribute to it.

https://rust-lang.github.io/rustc-guide/

fork in 8 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 077a93c6a9b1c8ee0e541ea484f7e13c207d50d0

Fix typo in comment

view details

push time in 9 days

Pull request review commentrust-lang/rust

Combine `HaveBeenBorrowedLocals` and `IndirectlyMutableLocals` into one dataflow analysis

 pub use super::*; -use crate::dataflow::{BitDenotation, GenKillSet};+use crate::dataflow::generic::{AnalysisDomain, GenKill, GenKillAnalysis}; use rustc::mir::visit::Visitor; use rustc::mir::*;+use rustc::ty::{ParamEnv, TyCtxt};+use rustc_span::DUMMY_SP;++pub type MaybeMutBorrowedLocals<'mir, 'tcx> = MaybeBorrowedLocals<MutBorrow<'mir, 'tcx>>;++/// A dataflow analysis that tracks whether a pointer or reference could possibly exist that points+/// to a given local.+///+/// The `K` parameter determines what kind of borrows are tracked. By default,+/// `MaybeBorrowedLocals` looks for *any* borrow of a local. If you are only interested in borrows+/// that might allow mutation, use the `MaybeMutBorrowedLocals` type alias instead.+///+/// At present, this is used as a very limited form of alias analysis. For example,+/// `MaybeBorrowedLocals` is used to compute which locals are live during a yield expression for+/// immovable generators. `MaybeMutBorrowedLocals` is used during const checking to prove that a+/// local has not been mutated via indirect assignment (e.g., `*p = 42`), the side-effects of a+/// function call or inline assembly.+pub struct MaybeBorrowedLocals<K = AnyBorrow> {+    kind: K,+} -/// This calculates if any part of a MIR local could have previously been borrowed.-/// This means that once a local has been borrowed, its bit will be set-/// from that point and onwards, until we see a StorageDead statement for the local,-/// at which points there is no memory associated with the local, so it cannot be borrowed.-/// This is used to compute which locals are live during a yield expression for-/// immovable generators.-#[derive(Copy, Clone)]-pub struct HaveBeenBorrowedLocals<'a, 'tcx> {-    body: &'a Body<'tcx>,+impl MaybeBorrowedLocals {+    /// A dataflow analysis that records whether a pointer or reference exists that may alias the+    /// given local.+    pub fn new() -> Self {+        MaybeBorrowedLocals { kind: AnyBorrow }+    } } -impl<'a, 'tcx> HaveBeenBorrowedLocals<'a, 'tcx> {-    pub fn new(body: &'a Body<'tcx>) -> Self {-        HaveBeenBorrowedLocals { body }+impl MaybeMutBorrowedLocals<'mir, 'tcx> {+    /// A dataflow analysis that records whether a pointer or reference exists that may *mutably*+    /// alias the given local.+    pub fn new_mut_only(+        tcx: TyCtxt<'tcx>,+        body: &'mir mir::Body<'tcx>,+        param_env: ParamEnv<'tcx>,+    ) -> Self {+        MaybeBorrowedLocals { kind: MutBorrow { body, tcx, param_env } }     }+} -    pub fn body(&self) -> &Body<'tcx> {-        self.body+impl<K> MaybeBorrowedLocals<K> {+    fn transfer_function<'a, T>(&'a self, trans: &'a mut T) -> TransferFunction<'a, T, K> {+        TransferFunction { kind: &self.kind, trans }     } } -impl<'a, 'tcx> BitDenotation<'tcx> for HaveBeenBorrowedLocals<'a, 'tcx> {+impl<K> AnalysisDomain<'tcx> for MaybeBorrowedLocals<K>+where+    K: BorrowAnalysisKind<'tcx>,+{     type Idx = Local;-    fn name() -> &'static str {-        "has_been_borrowed_locals"++    const NAME: &'static str = K::ANALYSIS_NAME;++    fn bits_per_block(&self, body: &mir::Body<'tcx>) -> usize {+        body.local_decls().len()+    }++    fn initialize_start_block(&self, _: &mir::Body<'tcx>, _: &mut BitSet<Self::Idx>) {+        // No locals are aliased on function entry+    }+}++impl<K> GenKillAnalysis<'tcx> for MaybeBorrowedLocals<K>+where+    K: BorrowAnalysisKind<'tcx>,+{+    fn statement_effect(+        &self,+        trans: &mut impl GenKill<Self::Idx>,+        statement: &mir::Statement<'tcx>,+        location: Location,+    ) {+        self.transfer_function(trans).visit_statement(statement, location);     }-    fn bits_per_block(&self) -> usize {-        self.body.local_decls.len()++    fn terminator_effect(+        &self,+        trans: &mut impl GenKill<Self::Idx>,+        terminator: &mir::Terminator<'tcx>,+        location: Location,+    ) {+        self.transfer_function(trans).visit_terminator(terminator, location);     } -    fn start_block_effect(&self, _on_entry: &mut BitSet<Local>) {-        // Nothing is borrowed on function entry+    fn call_return_effect(+        &self,+        _trans: &mut impl GenKill<Self::Idx>,+        _block: mir::BasicBlock,+        _func: &mir::Operand<'tcx>,+        _args: &[mir::Operand<'tcx>],+        _dest_place: &mir::Place<'tcx>,+    ) {     }+} -    fn statement_effect(&self, trans: &mut GenKillSet<Local>, loc: Location) {-        let stmt = &self.body[loc.block].statements[loc.statement_index];+impl<K> BottomValue for MaybeBorrowedLocals<K> {+    // bottom = unborrowed+    const BOTTOM_VALUE: bool = false;+} -        BorrowedLocalsVisitor { trans }.visit_statement(stmt, loc);+/// A `Visitor` that defines the transfer function for `MaybeBorrowedLocals`.+struct TransferFunction<'a, T, K> {+    trans: &'a mut T,+    kind: &'a K,+} -        // StorageDead invalidates all borrows and raw pointers to a local-        match stmt.kind {-            StatementKind::StorageDead(l) => trans.kill(l),-            _ => (),+impl<T, K> Visitor<'tcx> for TransferFunction<'a, T, K>+where+    T: GenKill<Local>,+    K: BorrowAnalysisKind<'tcx>,+{+    fn visit_statement(&mut self, stmt: &Statement<'tcx>, location: Location) {+        self.super_statement(stmt, location);++        // When we reach a `StorageDead` statement, we can assume that any pointers to this memory+        // are now invalid.+        if let StatementKind::StorageDead(local) = stmt.kind {+            self.trans.kill(local);         }     } -    fn terminator_effect(&self, trans: &mut GenKillSet<Local>, loc: Location) {-        let terminator = self.body[loc.block].terminator();-        BorrowedLocalsVisitor { trans }.visit_terminator(terminator, loc);-        match &terminator.kind {-            // Drop terminators borrows the location-            TerminatorKind::Drop { location, .. }-            | TerminatorKind::DropAndReplace { location, .. } => {-                if let Some(local) = find_local(location) {-                    trans.gen(local);+    fn visit_rvalue(&mut self, rvalue: &mir::Rvalue<'tcx>, location: Location) {+        self.super_rvalue(rvalue, location);++        match rvalue {+            mir::Rvalue::AddressOf(mt, borrowed_place) => {+                if !borrowed_place.is_indirect() && self.kind.in_address_of(*mt, borrowed_place) {+                    self.trans.gen(borrowed_place.local);                 }             }-            _ => (),++            mir::Rvalue::Ref(_, kind, borrowed_place) => {+                if !borrowed_place.is_indirect() && self.kind.in_ref(*kind, borrowed_place) {+                    self.trans.gen(borrowed_place.local);+                }+            }++            mir::Rvalue::Cast(..)+            | mir::Rvalue::Use(..)+            | mir::Rvalue::Repeat(..)+            | mir::Rvalue::Len(..)+            | mir::Rvalue::BinaryOp(..)+            | mir::Rvalue::CheckedBinaryOp(..)+            | mir::Rvalue::NullaryOp(..)+            | mir::Rvalue::UnaryOp(..)+            | mir::Rvalue::Discriminant(..)+            | mir::Rvalue::Aggregate(..) => {}         }     } -    fn propagate_call_return(-        &self,-        _in_out: &mut BitSet<Local>,-        _call_bb: mir::BasicBlock,-        _dest_bb: mir::BasicBlock,-        _dest_place: &mir::Place<'tcx>,-    ) {-        // Nothing to do when a call returns successfully+    fn visit_terminator(&mut self, terminator: &mir::Terminator<'tcx>, location: Location) {+        self.super_terminator(terminator, location);++        match terminator.kind {+            // Drop terminators may call custom drop glue (`Drop::drop`), which takes `&mut self`+            // as a parameter. Hypothetically, a drop impl could launder that reference into the+            // surrounding environment through a raw pointer, thus creating a valid `*mut` pointing+            // to the dropped local. We are not yet willing to declare this particular case UB, so+            // we must treat all dropped locals as mutably borrowed for now. See discussion on+            // [#61069].+            //+            // [#61069]: https://github.com/rust-lang/rust/pull/61069

This is now a doc comment on unsound_ignore_borrow_on_drop

ecstatic-morse

comment created time in 9 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 9d423950cc141e110242ff1973f2d7b84c719a86

Use doc comment for explanation of `shared_borrow_allows_mutation`

view details

push time in 9 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 558683bb468c1828a3463ae758fbb8f10c7de0f8

Make lookup of associated item by name O(log n)

view details

Dylan MacKenzie

commit sha 7f0f333c66acb4693965541305777bad5d670d9c

Add `in_arbitrary_order` method and use it when possible

view details

Dylan MacKenzie

commit sha fede408f140ce1dcf71961f947f70ffbcd63f291

Replace FIXME with explanation

view details

push time in 9 days

push eventecstatic-morse/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

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

Mazdak Farrokhzad

commit sha cec2a9fad057f71fc640392ba3fa47602aea12f6

macro_legacy_warnings -> error

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

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

push time in 9 days

push eventecstatic-morse/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

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

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

Mazdak Farrokhzad

commit sha 6509db844315882db7ec0b624ca1e7b04d72568d

or_patterns: harden bindings test

view details

Mazdak Farrokhzad

commit sha 29437e55a56c1c1251ae5f7276f3e95dac4b609a

or_patterns: rename previous test

view details

push time in 9 days

issue commentrust-lang/rust

Significant performance regression on the `encoding` benchmark

Some perf builds around the regression were stuck in the queue when I posted this, so it may not be #69144.

ecstatic-morse

comment created time in 9 days

pull request commentrust-lang/rust

Combine `HaveBeenBorrowedLocals` and `IndirectlyMutableLocals` into one dataflow analysis

@wesleywiser It is unlikely. Switching from the old to the new framework for the InitializedPlaces analyses yielded very small gains, and these analyses are used only for const-checking and generators respectively. The perf queue is a bit full right now, otherwise I would do one just in case. Perhaps rollup=never is sufficient?

ecstatic-morse

comment created time in 9 days

pull request commentrust-lang/rust

Don't print block exit state in dataflow graphviz if unchanged

@bors rollup=always

ecstatic-morse

comment created time in 10 days

issue commentrust-lang/rust

Using const fn constructor instead of struct expression with large number of constants causes compilation to fail because of large memory allocation.

@CDirkx if the issue has been resolved to your satisfaction, feel free to close it. There's no rush however.

I have another fix in mind in addition to #69072 to make compile-time linear/linearithmic in the number of associated items, so your compile times should continue to improve regardless of the status of this issue. I'm also looking to add a variation of your MCVE to the rustc-perf benchmarks so we don't regress this in the future.

Thank you for posting this in the first place. It made finding these rough spots very easy!

CDirkx

comment created time in 10 days

pull request commentrust-lang/rust

O(log n) lookup of associated items by name

Ideally, this would be implemented using an insertion-order preserving, hash-based multi-map, but one is not readily available.

No. I would be happy to turn this into a general purpose data structure. Not sure if anyone else will use it though XD.

ecstatic-morse

comment created time in 10 days

pull request commentrust-lang/rust

O(log n) lookup of associated items by name

Using an IndexMap in this way will change the order of vtables when there is a raw ident collision. Is this really preferable to binary search?

ecstatic-morse

comment created time in 10 days

delete branch ecstatic-morse/rust

delete branch : revert-69108

delete time in 10 days

PR closed rust-lang/rust

Revert #69108 S-waiting-on-review

...to see if it caused the regression in #69197.

+18 -29

7 comments

7 changed files

ecstatic-morse

pr closed time in 10 days

pull request commentrust-lang/rust

Revert #69108

#69197 did not cause the regression.

ecstatic-morse

comment created time in 10 days

issue commentrust-lang/rust

Significant performance regression on the `encoding` benchmark

Ruled out #69108 via perf results from #69199, so it's likely the big one (#68728) cc @Centril @petrochenkov.

ecstatic-morse

comment created time in 10 days

pull request commentrust-lang/rust

Revert #69108

@bors try @rust-timer queue

ecstatic-morse

comment created time in 11 days

PR opened rust-lang/rust

Revert #69108

... to see if it caused the regression in #69197.

@bors try @rust-timer queue

+18 -29

0 comment

7 changed files

pr created time in 11 days

create barnchecstatic-morse/rust

branch : revert-69108

created branch time in 11 days

pull request commentrust-lang/rust

Allow trait methods to be called on concrete types in a const context

#69036 will change the effects of this, so I'll hold off until that is merged. cc @eddyb who will probably not be happy with Instance::resolve being used in this way.

ecstatic-morse

comment created time in 11 days

issue openedrust-lang/rust

Significant performance regression on the `encoding` benchmark

#69144 (a rollup) slowed down check builds of the encoding benchmark considerably, see the task-clock measurements. This degradation has been consistent over the last half-dozen perf runs, so it is not spurious. The following candidates have non-trivial changes to the parts of the compiler that are run during a check build.

  • #68728 (parse: merge fn syntax + cleanup item parsing)
  • #68938 (fix lifetime shadowing check in GATs)
  • #69057 (expand: misc cleanups and simplifications)
  • #69108 (Use HirId in TraitCandidate.)
  • #69126 (miri: fix exact_div)

I doubt it is #68938 so cc @Centril @cjgillot @RalfJung

created time in 11 days

pull request commentrust-lang/rust

O(log n) lookup of associated items by name

If this is blocked on implementation complexity, I'd like to get a better idea of what people would sign off on before working on it more. Iteration in definition order makes error messages better (it also defines the layout of vtables, but we can change that). Assuming that constraint, I see only two options: using a IndexMap<SmallVec<[AssocItemByName; 1]>> or keep a sorted index as this PR does. @petrochenkov if you have something else in mind, could you expound on it?

ecstatic-morse

comment created time in 11 days

pull request commentrust-lang/rust

Select an appropriate unused lifetime name in suggestion

This seems good other than a small typo in the new comment.

r=me unless you want nagisa to take a look.

estebank

comment created time in 12 days

Pull request review commentrust-lang/rust

Select an appropriate unused lifetime name in suggestion

 impl AstConv<'tcx> for ItemCtxt<'tcx> {     } } +/// Synthesize a new lifetime name that doesn't clash with any of the lifetimes already present.+fn get_new_lifetime_name<'tcx>(+    tcx: TyCtxt<'tcx>,+    poly_trait_ref: ty::PolyTraitRef<'tcx>,+    generics: &hir::Generics<'tcx>,+) -> String {+    let existing_lifetimes = tcx+        .collect_referenced_late_bound_regions(&poly_trait_ref)+        .into_iter()+        .filter_map(|lt| {+            if let ty::BoundRegion::BrNamed(_, name) = lt {+                Some(name.as_str().to_string())+            } else {+                None+            }+        })+        .chain(generics.params.iter().filter_map(|param| {+            if let hir::GenericParamKind::Lifetime { .. } = &param.kind {+                Some(param.name.ident().as_str().to_string())+            } else {+                None+            }+        }))+        .collect::<FxHashSet<String>>();++    let a_to_z_repeat_n = |n| {+        (b'a'..=b'z').map(move |c| {+            let mut s = format!("'");+            s.extend(std::iter::repeat(char::from(c)).take(n));+            s+        })+    };++    // If we all single char lifetime names are present, we wrap around and double the chars.
    // If all single char lifetime names are present, we wrap around and double the chars.
estebank

comment created time in 12 days

pull request commentrust-lang/rust

O(log n) lookup of associated items by name

Some unrelated changes have dramatically sped up the pathological case in #68957 on recent nightlies. A local build only takes 30 seconds, down from several minutes on 1.41.0. This PR is now just a 2x speedup instead of a 10x one.

ecstatic-morse

comment created time in 12 days

issue commentrust-lang/rust

Using const fn constructor instead of struct expression with large number of constants causes compilation to fail because of large memory allocation.

@CDirkx compile time has improved a lot in the current nightly. const_constructor now takes ~30s with a local, non-LTO master build compared to ~15s for struct_literal. #69072 will improve this further: const_constructor takes about the same amount of time as struct_literal with that PR applied.

CDirkx

comment created time in 12 days

Pull request review commentrust-lang/rust

Select an appropriate unused lifetime name in suggestion

 impl AstConv<'tcx> for ItemCtxt<'tcx> {     } } +/// Synthesize a new lifetime name that doesn't clash with any of the lifetimes already present.+/// It will pick a single `char` lifetime name that is available, or some `lt_{number}` that is+/// not already in use.+fn get_new_lifetime_name<'tcx>(+    tcx: TyCtxt<'tcx>,+    poly_trait_ref: ty::PolyTraitRef<'tcx>,+    generics: &hir::Generics<'tcx>,+) -> String {+    let mut lt_char = 'a';+    let mut lt_name = format!("'{}", lt_char);+    let mut existing_lifetimes = tcx+        .collect_referenced_late_bound_regions(&poly_trait_ref)+        .into_iter()+        .filter_map(|lt| {+            if let ty::BoundRegion::BrNamed(_, name) = lt {+                Some(name.as_str().to_string())+            } else {+                None+            }+        })+        .chain(generics.params.iter().filter_map(|param| {+            if let hir::GenericParamKind::Lifetime { .. } = &param.kind {+                Some(param.name.ident().as_str().to_string())+            } else {+                None+            }+        }))+        .collect::<Vec<String>>();+    existing_lifetimes.sort();+    while existing_lifetimes.contains(&lt_name) {+        let prev = lt_char;+        lt_char = std::char::from_u32(lt_char as u32 + 1).unwrap_or(lt_char);

What about using repeated characters instead of numbers? Something like:

let a_to_z_repeat_n = |n| {
    (b'a'..=b'z').map(move |c| {
        let mut ret = format!("'");
        ret.extend(iter::repeat(char::from(c)).take(n));
        ret
    })
};

let lt_name = (1..)
    .flat_map(a_to_z_repeat_n)
    .find(|lt| !existing_lifetimes.contains(lt))
    .unwrap();
estebank

comment created time in 12 days

Pull request review commentrust-lang/rust

Select an appropriate unused lifetime name in suggestion

 impl AstConv<'tcx> for ItemCtxt<'tcx> {     } } +/// Synthesize a new lifetime name that doesn't clash with any of the lifetimes already present.+/// It will pick a single `char` lifetime name that is available, or some `lt_{number}` that is+/// not already in use.+fn get_new_lifetime_name<'tcx>(+    tcx: TyCtxt<'tcx>,+    poly_trait_ref: ty::PolyTraitRef<'tcx>,+    generics: &hir::Generics<'tcx>,+) -> String {+    let mut lt_char = 'a';+    let mut lt_name = format!("'{}", lt_char);+    let mut existing_lifetimes = tcx+        .collect_referenced_late_bound_regions(&poly_trait_ref)+        .into_iter()+        .filter_map(|lt| {+            if let ty::BoundRegion::BrNamed(_, name) = lt {+                Some(name.as_str().to_string())+            } else {+                None+            }+        })+        .chain(generics.params.iter().filter_map(|param| {+            if let hir::GenericParamKind::Lifetime { .. } = &param.kind {+                Some(param.name.ident().as_str().to_string())+            } else {+                None+            }+        }))+        .collect::<Vec<String>>();+    existing_lifetimes.sort();

Is this sort doing anything?

estebank

comment created time in 12 days

PR opened rust-lang/rust

Don't print block exit state in dataflow graphviz if unchanged

A small quality-of-life improvement I was using while working on #68528. It's pretty common to have a lot of zero-statement basic blocks, especially before a SimplifyCfg pass is run. When the dataflow state is dense, these blocks could take up a lot of vertical space since the full flow state was printed on both entry and exit. After this PR, we only print a block's exit state if it differs from that block's entry state. Take a look at the two basic blocks on the left.

Before:

image

After: image

+35 -20

0 comment

1 changed file

pr created time in 12 days

create barnchecstatic-morse/rust

branch : graphviz-diff

created branch time in 12 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 26451d007e7482f0c4cdae152a972f4e7c8bf970

Print flow state in debug messages for `find_dead_unwinds`

view details

push time in 12 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 2aa39350d3dde13f5e82f24d42a51cbfe92f723e

Use more descriptive name to get `InitializationData` state

view details

push time in 12 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha f0260ae196b62f27c64738d52519efb424724915

Use `seek_before` instead of `seek_after`

view details

push time in 12 days

PR opened rust-lang/rust

Use `ResultsCursor` for `elaborate_drops`

Some cleanup after #68241. The old code was using a custom cursor-like struct called InitializationData.

+33 -81

0 comment

1 changed file

pr created time in 12 days

create barnchecstatic-morse/rust

branch : unified-dataflow-impls2

created branch time in 12 days

Pull request review commentrust-lang/rust

Migrate borrowck dataflow impls to new framework

 impl<'tcx> MirPass<'tcx> for SanityCheck {         if has_rustc_mir_with(&attributes, sym::rustc_peek_definite_init).is_some() {             sanity_check_via_rustc_peek(tcx, body, def_id, &attributes, &flow_def_inits);         }+        // FIXME: Uncomment these as analyses are migrated to the new framework+        /*         if has_rustc_mir_with(&attributes, sym::rustc_peek_indirectly_mutable).is_some() {

See #69113.

ecstatic-morse

comment created time in 12 days

pull request commentrust-lang/rust

Combine `HaveBeenBorrowedLocals` and `IndirectlyMutableLocals` into one dataflow analysis

cc @pnkfelix. This is the follow-up to #68241 and re-enables the peek test for IndirectlyMutableLocals (now called MaybeMutBorrowedLocals).

ecstatic-morse

comment created time in 12 days

pull request commentrust-lang/rust

[WIP] Mark other variants as uninitialized after switch on discriminant

This is still kind of hacky because it needs to look for SwitchInts on the result of an Rvalue::Discriminant and map the integer values back to their corresponding variant. A SwitchDiscriminant terminator would make this easier. Additionally, since apply_discriminant_switch_effect only takes a single variant, it doesn't run on the "otherwise" edge, and we don't assume anything about variants that aren't handled on that edge.

ecstatic-morse

comment created time in 12 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha a64cd592247b0029352b57a7caf038e6d2ba6a05

Add `Place` getter to `Operand`

view details

Dylan MacKenzie

commit sha ce56f622b4cea033ef339461db46a2ab61d29d13

Use an `Iterator` for `MovePath` traversal

view details

Dylan MacKenzie

commit sha 99b96199a6f47a8ff97c0df8dda849b5f6f58abf

Support effects for particular edges of `SwitchInt`

view details

Dylan MacKenzie

commit sha e2c80477532b54271cbb7249d0bb36d7b257fca2

Kill move paths of dead variants

view details

push time in 12 days

push eventecstatic-morse/rust

Charles Gleason

commit sha 293cdf7ac5d14811debdec3408afde104935caef

Make RangeMut::next_unchecked() output a mutable key reference

view details

Charles Gleason

commit sha f547978392872684085c96a3d5c1d00bad24b724

Implement clone_from for BTree collections

view details

Charles Gleason

commit sha 8651aa066fdbbcfaa082531969469c3fa289de9e

Add test for BTreeMap::clone_from

view details

Erin Power

commit sha 49d78fcd901700c5a14e19a6679db1646b5ca901

Add GitHub issue templates

view details

Linus Färnstrand

commit sha b5ff8064a4fe5b2bc70ee209b19d129b8ffc3ebc

Add MIN/MAX associated constants to the integer types

view details

Linus Färnstrand

commit sha 22dcfa1d8d18687d7ca0b91974bce4202d3383e9

Add relevant associated constants to the float types

view details

Linus Färnstrand

commit sha 9d257579fcaa44f69c8f7d5f668b05ae89e4507b

Fix some float operations to work together with the assoc consts

view details

Linus Färnstrand

commit sha 6ce16cfa42dcb1acd2c823a1d45269132d372409

Remove no longer valid test

view details

Linus Färnstrand

commit sha 9fcbaa4158948324f395ff2eb8061abdf6dbc21f

Fix broken show-const-contents test

view details

Linus Färnstrand

commit sha 4d9e90d2a5146e3f8639b53f29e210be94b30933

Unlock assoc_int_consts in core+std

view details

Linus Färnstrand

commit sha 002c7897a6c92397f6682bf7e9e86c9b4efd5c51

Unlock assoc_int_consts in documentation examples using it

view details

Linus Färnstrand

commit sha 61fecfb82fe088af6d3a7832b72f298064398aff

Add test accessing the module level int/float consts

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

Guillaume Gomez

commit sha 85079f8b1fa8291593735b9b577e8e0dc22ad3b6

Fix run button positionning in case of scrolling

view details

Andreas Molzer

commit sha 47ae565ed4f1b2a7cc754d4cf0af520b5e6841b9

Add a method to query the capacity of a BufWriter

view details

Oliver Middleton

commit sha bbc2ae7590ad53fca02fda187e7f9c2470c9e949

rustdoc: Fix re-exporting primitive types * Generate links to the primitive type docs for re-exports. * Don't ICE on cross crate primitive type re-exports. * Make primitive type re-exports show up cross crate.

view details

Tomasz Miąsko

commit sha a6137fb730d59141ff2f5744b6cf36e29ef74e94

compiletest: Remove unnecessary memory allocation in iter_header Replace `BufRead::lines` with `BuRead::read_line` to reduce memory allocations.

view details

push time in 12 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 668d2fe807068073647f9c92d81ff0e7b9ab8486

Update line # in test output

view details

push time in 13 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 15a5382ef1115ff11c1357fd21ab4aa12626efee

Rename `MaybeBorrowedLocals` constructors

view details

Dylan MacKenzie

commit sha 0984639348c2fc98389746f6815e576cfcaacda8

Ignore mut borrow from drop terminator in const-eval

view details

push time in 13 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 61b83737db21dc1f4eb537394ed132b66d445e9f

Rename `MaybeBorrowedLocals` constructors

view details

Dylan MacKenzie

commit sha e7d839d2b87181e24adf4af945c76be380a9f979

Ignore mut borrow from drop terminator in const-eval

view details

push time in 13 days

pull request commentrust-lang/rust

`O(log n)` lookup of associated items by name

So I added an in_arbitrary_order method but only use it in a few places, since preserving error message order is important. I would like for in_arbitrary_order to return things in a different order than in_definition_order while testing, but in the same order in release builds. That way, code that relies on the definition order only for emitting error messages in the right order could use in_arbitrary_order and in_definition_order would indicate places where the definition order is relied upon for correctness.

Most places that would actually break if the definition order changed are looking up associated items on lang items. IMO, these associated items should themselves be lang items, but AFAICT we don't support that yet.

ecstatic-morse

comment created time in 13 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha d83c696da677fd8a7b3c2b5af9998cd60a6dbf95

Add `in_arbitrary_order` method and use it when possible

view details

push time in 13 days

issue commentrust-lang/rust

Static lifetimes checking regression in rustc 1.41.0

Regressed in a449535bbc7912c4adc1bbf2ab2738d0442f212c, likely #66587 cc @matthewjasper.

ilyavenner

comment created time in 14 days

PR opened rust-lang/rust

Combine `HaveBeenBorrowedLocals` and `IndirectlyMutableLocals` into one dataflow analysis

This PR began as an attempt to port HaveBeenBorrowedLocals to the new dataflow framework (see #68241 for prior art). Along the way, I noticed that it could share most of its code with IndirectlyMutableLocals and then found a few bugs in the two analyses:

  • Neither one marked locals as borrowed after an Rvalue::AddressOf.
  • IndirectlyMutableLocals was missing a minor fix that HaveBeenBorrowedLocals got in #61069.

I decided to combine the two analyses so that they wouldn't diverge in the future while ensuring that they remain distinct types (called MaybeBorrowedLocals and MaybeMutBorrowedLocals to remain consistent with the Maybe{Un,}InitializedPlaces naming scheme). In doing so, I fixed the bugs and switched to exhaustive matching where possible to make them less likely in the future. Finally, I added comments explaining some of the finer points of the transfer function for these analyses (see #61069 and #65006).

+273 -279

0 comment

11 changed files

pr created time in 14 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha 7d9dadcccca9efc63f30fa1c9adee00effb860d4

Implement `Maybe{Mut,}BorrowedLocals` analyses

view details

Dylan MacKenzie

commit sha 34783b73bd891a66fb2af613fef7492376fc7c8a

Remove outdated `IndirectlyMutableLocals` `MaybeMutBorrowedLocals` serves the same purpose and has a better name.

view details

Dylan MacKenzie

commit sha 9972502bafab062b06ef04c02c653f1b868937bd

Reenable peek test for indirect mutation analysis This uses the new `MaybeMutBorrowedLocals` pass but we keep the `rustc_peek_indirectly_mutable` since the two are interchangable except when inspecting a local after it has been marked `StorageDead`.

view details

Dylan MacKenzie

commit sha 1d737fb032b762e69e8d809c0e042d45e08b457d

Use `MaybeBorrowedLocals` for generator analyses It should have the same semantics as `HaveBeenBorrowedLocals`

view details

Dylan MacKenzie

commit sha d045a17c4b032a858323f6c9bea698ee2e5920b7

Use `MaybeMutBorrowedLocals` for const-checking

view details

Dylan MacKenzie

commit sha 6f167e9c5f421613ff3de37771b1352cd98dd4f7

Remove ignore and add explanation of indirect mutation peek test

view details

push time in 14 days

push eventecstatic-morse/rust

Dylan MacKenzie

commit sha c0360e66b4bbf923dd2fea2b885290583ad2406e

Add docs to `MaybeBorrowedLocals`

view details

push time in 14 days

more