profile
viewpoint
lcnr lcnr Germany NaCl (they/them)

lcnr/crow 94

A simple pixel perfect 2D rendering engine

lcnr/akari 35

A showcase game for the crow rendering engine

distransient/gmtk2019 5

"Only One"

lcnr/computer 3

A simple computer made from scratch

lcnr/binary 1

Efficient type based integers

lcnr/amethyst 0

Data-oriented and data-driven game engine written in Rust

lcnr/arewegameyet 0

The repository for arewegameyet.rs

lcnr/awesome-rust-mentors 0

A list of rust lang mentors tagged by topics of interest

push eventlcnr/awesome-rust-mentors

lcnr

commit sha d3082dc9e9aac4b5a41a310abe05a3a42ccd64b4

update mentors

view details

push time in an hour

PR opened rust-lang/rust

change name in .mailmap
+1 -1

0 comment

1 changed file

pr created time in an hour

pull request commentrust-lang/rust

feat: Update hashbrown to instantiate less llvm IR

@bors try @rust-timer queue

Marwes

comment created time in an hour

create barnchlcnr/rust

branch : namesNstuff

created branch time in an hour

issue commentrust-lang/rust

`rustfmt` no longer builds after rust-lang/rust#77306

yes, so we do not want to use tcx.normalize_erasing_regions in codegen_fulfill_obligations as that can be a bit costly but instead normalize eagerly before then.

To detect cases where we are still using unnormalized values #77306 added a debug assert there. If we look at the backtrace we can find out where the trait_ref is coming from and normalize it there

rust-highfive

comment created time in an hour

issue commentrust-lang/rust

`rustfmt` no longer builds after rust-lang/rust#77306

won't be able to get to this myself in the next few days. To fix this we probably have to compile it with RUST_BACKTRACE=1, find the place where we call Instance::resolve and put a tcx.normalize_erasing_regions before that

rust-highfive

comment created time in 2 hours

Pull request review commentrust-lang/rust

[WIP] Refactor `Binder` to track bound vars

 impl<'tcx> PredicateVisitor<'tcx> for HasEscapingVarsVisitor {     } } +crate struct CountBoundVars<'tcx> {+    crate outer_index: ty::DebruijnIndex,+    crate bound_tys: SsoHashSet<ty::BoundTy>,+    crate bound_regions: SsoHashSet<ty::BoundRegion>,+    crate bound_consts: SsoHashSet<ty::BoundVar>,+    crate visited: SsoHashSet<Ty<'tcx>>,+}++impl<'tcx> CountBoundVars<'tcx> {+    crate fn new() -> Self {+        CountBoundVars {+            outer_index: ty::INNERMOST,+            bound_tys: SsoHashSet::default(),+            bound_regions: SsoHashSet::default(),+            bound_consts: SsoHashSet::default(),+            visited: SsoHashSet::default(),+        }+    }+}++impl<'tcx> TypeVisitor<'tcx> for CountBoundVars<'tcx> {+    fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &Binder<T>) -> bool {+        self.outer_index.shift_in(1);+        let result = t.super_visit_with(self);+        self.outer_index.shift_out(1);+        result+    }++    fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {+        if t.outer_exclusive_binder >= self.outer_index || !self.visited.insert(t) {

isn't this incorrect?

Don't you instead want to exit early if t.outer_exclusive_binder <= self.outer_index?

jackh726

comment created time in 5 hours

PullRequestReviewEvent

pull request commentrust-lang/rust

Fix issue with specifying generic arguments for primitive types

:+1:

@bors r+ rollup

varkor

comment created time in 5 hours

pull request commentrust-lang/rust

Calculate visibilities once in resolve

https://github.com/rust-lang/compiler-team/blob/master/content/experts/map.toml mentions @davidtwco but feel free to reassign

r? @davidtwco for now

petrochenkov

comment created time in 21 hours

Pull request review commentrust-lang/rust

Calculate visibilities once in resolve

 impl<'a, 'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'a, 'tcx>  pub fn provide(providers: &mut Providers) {     *providers = Providers {+        visibility,         privacy_access_levels,         check_private_in_public,         check_mod_privacy,         ..*providers     }; } +fn visibility(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Visibility {+    let def_id = def_id.expect_local();+    match tcx.visibilities.get(&def_id) {+        Some(vis) => *vis,+        None => {+            let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);+            match tcx.hir().get(hir_id) {+                // Unique types created for closures participate in type privacy checking.+                // They have visibilities inherited from the module they are defined in.+                Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(..), .. }) => {+                    ty::Visibility::Restricted(tcx.parent_module(hir_id).to_def_id())+                }+                // - AST lowering may clone `use` items and the clones don't+                //   get their entries in the resolver's visibility table.+                // - AST lowering also creates opaque type items with inherited visibilies.+                //   Visibility on them should have no effect, but to avoid the visibility+                //   query failing on some items, we provide it for opaque types as well.+                Node::Item(hir::Item {+                    vis,+                    kind: hir::ItemKind::Use(..) | hir::ItemKind::OpaqueTy(..),+                    ..+                }) => ty::Visibility::from_hir(vis, hir_id, tcx),+                // Visibilities of trait impl items are inherited from their traits+                // and are not filled in resolve.+                Node::ImplItem(impl_item) => {+                    match tcx.hir().get(tcx.hir().get_parent_item(hir_id)) {+                        Node::Item(hir::Item {+                            kind: hir::ItemKind::Impl { of_trait: Some(trait_ref), .. },+                            ..+                        }) => trait_ref+                            .path+                            .res+                            .opt_def_id()+                            .map_or(ty::Visibility::Public, |def_id| tcx.visibility(def_id)),

is opt_def_id only None here if we already emitted an error?

Can we use a delay_span_bug here?

petrochenkov

comment created time in 21 hours

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentrust-lang/rust

Lift: take self by value

 impl<'cx, 'tcx> dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tc                 // "Lift" into the tcx -- once regions are erased, this type should be in the                 // global arenas; this "lift" operation basically just asserts that is true, but                 // that is useful later.-                tcx.lift(&drop_place_ty).unwrap();+                tcx.lift(drop_place_ty).unwrap();

Isn't this function call fairly useless now that we only have one global context?

lcnr

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

[WIP] Refactor `Binder` to track bound vars

 impl<'tcx> PredicateVisitor<'tcx> for HasEscapingVarsVisitor {     } } +crate struct CountBoundVars {+    crate outer_index: ty::DebruijnIndex,+    crate bound_tys: FxHashSet<ty::BoundTy>,+    crate bound_regions: FxHashSet<ty::BoundRegion>,+    crate bound_consts: FxHashSet<ty::BoundVar>,+}

it probably makes sense to use MiniSet instead of FxHashSet here as these sets should mostly be nearly empty

jackh726

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

[WIP] Refactor `Binder` to track bound vars

 impl<'tcx> PredicateVisitor<'tcx> for HasEscapingVarsVisitor {     } } +crate struct CountBoundVars {+    crate outer_index: ty::DebruijnIndex,+    crate bound_tys: FxHashSet<ty::BoundTy>,+    crate bound_regions: FxHashSet<ty::BoundRegion>,+    crate bound_consts: FxHashSet<ty::BoundVar>,+}++impl<'tcx> TypeVisitor<'tcx> for CountBoundVars {+    fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &Binder<T>) -> bool {+        self.outer_index.shift_in(1);+        let result = t.super_visit_with(self);+        self.outer_index.shift_out(1);+        result+    }++    fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {+        match t.kind {

you can also implement PredicateVisitor here to do the same for ty::Predicate

jackh726

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

[WIP] Refactor `Binder` to track bound vars

 impl<'tcx> PredicateVisitor<'tcx> for HasEscapingVarsVisitor {     } } +crate struct CountBoundVars {+    crate outer_index: ty::DebruijnIndex,+    crate bound_tys: FxHashSet<ty::BoundTy>,+    crate bound_regions: FxHashSet<ty::BoundRegion>,+    crate bound_consts: FxHashSet<ty::BoundVar>,+}++impl<'tcx> TypeVisitor<'tcx> for CountBoundVars {+    fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &Binder<T>) -> bool {+        self.outer_index.shift_in(1);+        let result = t.super_visit_with(self);+        self.outer_index.shift_out(1);+        result+    }++    fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {+        match t.kind {

can you exit early with ty.has_vars_bound_at_or_above(self.outer_index) here? Should greatly reduce the perf impact I think

jackh726

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

[WIP] Refactor `Binder` to track bound vars

 impl<'tcx> PredicateVisitor<'tcx> for HasEscapingVarsVisitor {     } } +crate struct CountBoundVars {+    crate outer_index: ty::DebruijnIndex,+    crate bound_tys: FxHashSet<ty::BoundTy>,+    crate bound_regions: FxHashSet<ty::BoundRegion>,+    crate bound_consts: FxHashSet<ty::BoundVar>,+}++impl<'tcx> TypeVisitor<'tcx> for CountBoundVars {+    fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &Binder<T>) -> bool {+        self.outer_index.shift_in(1);+        let result = t.super_visit_with(self);+        self.outer_index.shift_out(1);+        result+    }++    fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {+        match t.kind {+            ty::Bound(debruijn, ty) if debruijn >= self.outer_index => {

Why do we consider for for<T> for<U> Struct<T, U> that the inner binder (for<U>) binds T and U while for for<'a> for<'b> Struct<'a, 'b> the inner binder only binds b afaict?

In case I am misunderstanding something here: why do we use debruijn >= self.outer_index for types and debruijn == self.outer_index for regions?

jackh726

comment created time in a day

PullRequestReviewEvent

pull request commentrust-lang/rust

Make sure arenas don't allocate bigger than HUGE_PAGE

well, then

@bors r+ rollup

bugadani

comment created time in a day

pull request commentrust-lang/rust

Make sure arenas don't allocate bigger than HUGE_PAGE

this code is really hot, so it's better to be safe here

@bors try @rust-timer queue

bugadani

comment created time in 2 days

Pull request review commentrust-lang/rust

Make sure arenas don't allocate bigger than HUGE_PAGE

 impl<T> TypedArena<T> {                 // If the previous chunk's len is less than HUGE_PAGE                 // bytes, then this chunk will be least double the previous                 // chunk's size.-                new_cap = last_chunk.storage.len();-                if new_cap < HUGE_PAGE / elem_size {-                    new_cap = new_cap.checked_mul(2).unwrap();-                }+                new_cap = last_chunk.storage.len().min(HUGE_PAGE / 2);

you now use HUGE_PAGE instead of HUGE_PAGE / elem_size here, is that intentional?

bugadani

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentrust-lang/rust

always try inlining functions which do not call other functions

what the heck happened to deeply-nested here? :scream:

Ignoring that one, it does look like both incremental and full builds profit from this change :thinking: I personally would love to land this, potentially after disabling it for check builds. iirc there are still some blocking issues though regarding the source info of the inlined function. cc @oli-obk

lcnr

comment created time in 2 days

pull request commentrust-lang/rust

Suggest correct place to add `self` parameter when inside closure

cc @estebank

@bors r+ rollup

blyxxyz

comment created time in 2 days

PullRequestReviewEvent

pull request commentrust-lang/rust

Fix grammar in note for orphan-rule error [E0210]

thanks!

@bors r+ rollup

willcrozi

comment created time in 2 days

pull request commentrust-lang/rust

Lift: take self by value

yeah, I guess that's about as expected. Mostly think that taking self by value here is cleaner

lcnr

comment created time in 2 days

issue openedrust-lang/compiler-team

Change type folding to take self by value

Proposal

Try changing both fold_with and super_fold_with to take self by value instead of by reference. This removes a lot of unnecessary borrows and clones. It will have an influence on perf, which if negative will result in this MCP being discarded.

https://github.com/rust-lang/rust/pull/78027 implements the same change for Lift.

Mentors or Reviewers

:shrug:

Process

The main points of the Major Change Process is as follows:

  • [x] File an issue describing the proposal.
  • [ ] A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • [ ] Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

created time in 2 days

pull request commentrust-lang/rust

always try inlining functions which do not call other functions

Let's try another perf run, caching is_trivial_mir on disk should hopefully fix most of the incremental cost.

@bors try @rust-timer queue

lcnr

comment created time in 2 days

Pull request review commentrust-lang/rust

always try inlining functions which do not call other functions

 define_tables! {     super_predicates: Table<DefIndex, Lazy!(ty::GenericPredicates<'tcx>)>,     // As an optimization, a missing entry indicates an empty `&[]`.     explicit_item_bounds: Table<DefIndex, Lazy!([(ty::Predicate<'tcx>, Span)])>,+    is_trivial_mir: Table<DefIndex, Lazy<bool>>,

I am using Lazy<bool> here because I don't know how any of this works :sweat_smile: using Table<DefIndex, ()> seems interesting. Will look into this

lcnr

comment created time in 2 days

PullRequestReviewEvent

push eventlcnr/rust

Dylan DPC

commit sha f23559451b0dc5181d73ddd89657266d4e150b6a

Rollup merge of #77303 - lcnr:const-evaluatable-TooGeneric, r=oli-obk,varkor const evaluatable: improve `TooGeneric` handling Instead of emitting an error in `fulfill`, we now correctly stall on inference variables. As `const_eval_resolve` returns `ErrorHandled::TooGeneric` when encountering generic parameters on which we actually do want to error, we check for inference variables and eagerly emit an error if they don't exist, returning `ErrorHandled::Reported` instead. Also contains a small bugfix for `ConstEquate` where we previously only stalled on type variables. This is probably a leftover from when we did not yet support stalling on const inference variables. r? @oli-obk cc @varkor @eddyb

view details

Dylan DPC

commit sha 6d3cfd9d51e9c25452a28d18af130ad7e1fc2c90

Rollup merge of #77305 - lcnr:candidate_from_obligation, r=davidtwco move candidate_from_obligation_no_cache It's only called from `candidate_from_obligation` which is already in this file.

view details

Dylan DPC

commit sha 70740b1b82be274c63a4f7c3795db8a5d2b15d3b

Rollup merge of #77315 - exrook:rename-allocerror, r=joshtriplett Rename AllocErr to AllocError Implements rust-lang/wg-allocators#57

view details

Dylan DPC

commit sha 0044a9c08478d54047abc812a86220cd33f5f120

Rollup merge of #77319 - tgnottingham:siphasher_endianness, r=nnethercote Stable hashing: add comments and tests concerning platform-independence SipHasher128 implements short_write in an endian-independent way, yet its write_xxx Hasher trait methods undo this endian-independence by byte swapping the integer inputs on big-endian hardware. StableHasher then adds endian-independence back by also byte-swapping on big-endian hardware prior to invoking SipHasher128. This double swap may have the appearance of being a no-op, but is in fact by design. In particular, we really do want SipHasher128 to be platform-dependent, in order to be consistent with the libstd SipHasher. Try to clarify this intent. Also, add and update a couple of unit tests. --- Previous commit text: ~SipHasher128: fix platform-independence confusion~ ~StableHasher is supposed to ensure platform independence by converting integers to little-endian and extending isize and usize to 64 bits as necessary, but in fact, much of that work is already handled by SipHasher128.~ ~In particular, SipHasher128 implements short_write in an endian-independent way, yet both StableHasher and SipHasher128 additionally attempt to achieve endian-independence by byte swapping on BE hardware before invoking short writes. This double swap has no effect, so let's remove it.~ ~Because short_write is endian-independent, SipHasher128 is already handling part of the platform-independence, and it would be somewhat difficult to make it *not* handle that part with the current implementation. As splitting platform-independence responsibilities between StableHasher and SipHasher128 would be confusing, let's make SipHasher128 handle all of it.~ ~Finally, update some incorrect comments and increase test coverage. Unit tests pass on both LE and BE systems.~

view details

Dylan DPC

commit sha 73258f87eaacd0b0b9dfbda5603119d425866801

Rollup merge of #77324 - Aaron1011:fix/const-item-mutation-ptr, r=petrochenkov Don't fire `const_item_mutation` lint on writes through a pointer Fixes #77321

view details

Dylan DPC

commit sha 849e5636ea91a09a7e7a34a0cb3183978bed9887

Rollup merge of #77343 - varkor:rustc_args_required_const-validation, r=lcnr Validate `rustc_args_required_const` Fixes https://github.com/rust-lang/rust/issues/74608.

view details

Dylan DPC

commit sha ffb771bc7988ffb5ba862d2d794246ab0ede747d

Rollup merge of #77349 - ehuss:update-cargo, r=ehuss Update cargo 8 commits in 05c611ae3c4255b7a2bcf4fcfa65b20286a07839..75615f8e69f748d7ef0df7bc0b064a9b1f5c78b2 2020-09-23 23:10:38 +0000 to 2020-09-29 18:42:19 +0000 - Correct mistake about supporting sub-makes and document CARGO_MAKEFLAGS (rust-lang/cargo#8741) - Properly set for_host for proc-macro tests. (rust-lang/cargo#8742) - Add Zsh completion for target triples (rust-lang/cargo#8740) - Reinitialize index on "Object not found" error. (rust-lang/cargo#8735) - Normalize raw string indentation. (rust-lang/cargo#8739) - Update links to rustup docs. (rust-lang/cargo#8738) - Add contributor guide. (rust-lang/cargo#8715) - Fix minor error in `cargo update` docs. (rust-lang/cargo#8737)

view details

Dylan DPC

commit sha cc1513b860900f87a1077193f0a1dd4e1beeb577

Rollup merge of #77360 - oli-obk:zst_const_pat_regression, r=RalfJung References to ZSTs may be at arbitrary aligned addresses fixes #77320 r? @RalfJung

view details

Dylan DPC

commit sha 85e77edc82f8052b865cf35f9aaade2d668ea4f1

Rollup merge of #77371 - camelid:remove-extra-space-in-diagnostic, r=varkor Remove trailing space in error message - Add test for error message - Remove trailing space in error message

view details

bors

commit sha b218b952f800c1160b8b5e764ca651b02d678565

Auto merge of #77381 - Dylan-DPC:rollup-0sr6p5p, r=Dylan-DPC Rollup of 12 pull requests Successful merges: - #76909 (Add Iterator::advance_by and DoubleEndedIterator::advance_back_by) - #77153 (Fix recursive nonterminal expansion during pretty-print/reparse check) - #77202 (Defer Apple SDKROOT detection to link time.) - #77303 (const evaluatable: improve `TooGeneric` handling) - #77305 (move candidate_from_obligation_no_cache) - #77315 (Rename AllocErr to AllocError) - #77319 (Stable hashing: add comments and tests concerning platform-independence) - #77324 (Don't fire `const_item_mutation` lint on writes through a pointer) - #77343 (Validate `rustc_args_required_const`) - #77349 (Update cargo) - #77360 (References to ZSTs may be at arbitrary aligned addresses) - #77371 (Remove trailing space in error message) Failed merges: r? `@ghost`

view details

Carol (Nichols || Goulding)

commit sha 2033eb1495b4a0386a0ab08815769477baf20c89

Write manifest for MAJOR.MINOR channel to enable rustup convenience This connects to https://github.com/rust-lang/rustup/issues/794. It's hard to remember if there have been patch releases for old versions when you'd like to install the latest in a MAJOR.MINOR series. When we're doing a stable release, we write duplicate manifests to `stable`. With this change, only when we're doing a stable release, also write duplicate manifests to `MAJOR.MINOR` to eventually enable rustup (and any other tooling that builds Rust release URLs) to request, say, `1.45` and get `1.45.2` (assuming `1.45.2` is the latest available `1.45` and assuming that we never publish patch releases out of order).

view details

Ivan Tham

commit sha 86e30b605c585f2841dfd4bddb5afb696ab03cb5

Fix typo in vec doc "tries to reserves"

view details

Scott McMurray

commit sha 20202da09e86bd15ffcd0ce22b5ebe8a27ef17a0

Improve the example for ptr::copy Fixes #77220

view details

bors

commit sha 3bbc443cc6657b5df623101f74688ec92e35f35d

Auto merge of #77379 - camelid:improve-wording-crate-resolution-error, r=davidtwco Improve wording for external crate resolution error I think it reads better this way.

view details

David Tolnay

commit sha 17db1cb5d5a864d611e17d6e2466731c3b50a794

Bypass const_item_mutation if const's type has Drop impl

view details

David Tolnay

commit sha 0dfe7b6434f6aabbe9673a891ba74c7c7922661d

Add justification of the destructor filter

view details

David Tolnay

commit sha bb760b53bf7f9593c09a03e5dea28ef5f31065d7

Simplify defid destructor check

view details

David Tolnay

commit sha 0f6284c88d521904bb0ada34325a0372a1ea26f1

Add test of const item mutation with Drop impl

view details

David Tolnay

commit sha 352ce8b29990d62465675b46b42a695a4206d5be

Test a type with drop glue but no Drop impl

view details

David Tolnay

commit sha 41baa090ad1c40a7fc96f96664543ce4c26746c2

Skip dropck::check_drop_impl in is_const_item_without_destructor adt_destructor by default also validates the Drop impl using dropck::check_drop_impl, which contains an expect_local(). This leads to ICE in check_const_item_mutation if the const's type is not a local type. thread 'rustc' panicked at 'DefId::expect_local: `DefId(5:4805 ~ alloc[d7e9]::vec::{impl#50})` isn't local', compiler/rustc_span/src/def_id.rs:174:43 stack backtrace: 0: rust_begin_unwind 1: rustc_span::def_id::DefId::expect_local::{{closure}} 2: rustc_typeck::check::dropck::check_drop_impl 3: rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::calculate_dtor::{{closure}} 4: rustc_middle::ty::trait_def::<impl rustc_middle::ty::context::TyCtxt>::for_each_relevant_impl 5: rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::calculate_dtor 6: rustc_typeck::check::adt_destructor 7: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::adt_destructor>::compute 8: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl 9: rustc_query_system::query::plumbing::get_query_impl 10: rustc_mir::transform::check_const_item_mutation::ConstMutationChecker::is_const_item_without_destructor

view details

push time in 2 days

push eventlcnr/rust

Bastian Kauschke

commit sha 18080f9b434339fe6f4f1454b8ebad98fd2c311c

cache me on disk

view details

Bastian Kauschke

commit sha 54fcb47ce840b88f5acb398f3878cd0241d37734

allow intrinsics

view details

push time in 2 days

pull request commentrust-lang/rust

Don't run `resolve_vars_if_possible` in `normalize_erasing_regions`

I believe that resolve_vars_if_possible should always be a noop after normalize in a fresh InferCtxt as I expect all infer variables created during normalization to be still unknown after it.

So I do think it is valuable to remove that afaict unnecessary step here.

jyn514

comment created time in 2 days

pull request commentrust-lang/rust

Use rebind instead of Binder::bind when possible

looking fairly neutral to me

@bors r+

jackh726

comment created time in 2 days

pull request commentrust-lang/rust

Lift: take self by value

@bors try @rust-timer queue

lcnr

comment created time in 3 days

PR opened rust-lang/rust

Lift: take self by value

seems small enough to not warrant an MCP :shrug:

+138 -151

0 comment

15 changed files

pr created time in 3 days

create barnchlcnr/rust

branch : lift-by-value

created branch time in 3 days

pull request commentrust-lang/rust

Use map_bound(_ref) instead of Binder::bind when possible

we have been bitten by perf in the past here, so better safe than sorry

@bors try @rust-timer queue

if perf is clean r=me

jackh726

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Eliminate some temporary vectors

 dependencies = [  "rustc_ast",  "rustc_span",  "rustc_target",+ "smallvec 1.4.2",

specifying a version number here works :O

bugadani

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Use map_bound(_ref) instead of Binder::bind when possible

 impl<'tcx> Predicate<'tcx> {         }     } +    /// Converts this to a `Binder<PredicateAtom<'tcx>>`. If the value was an+    /// `Atom`, then it is not allowed to contain escaping bound vars.+    pub fn bound_atom(self, _tcx: TyCtxt<'tcx>) -> Binder<PredicateAtom<'tcx>> {+        match self.kind() {+            &PredicateKind::ForAll(binder) => binder,+            &PredicateKind::Atom(atom) => {+                assert!(!atom.has_escaping_bound_vars());

also, is there a reason you did not remove the _tcx argument here? Do you expect us to need it in the future?

jackh726

comment created time in 3 days

Pull request review commentrust-lang/rust

Use map_bound(_ref) instead of Binder::bind when possible

 impl<'a, 'tcx> ProbeContext<'a, 'tcx> {         // FIXME: do we want to commit to this behavior for param bounds?         debug!("assemble_inherent_candidates_from_param(param_ty={:?})", param_ty); -        let bounds =-            self.param_env.caller_bounds().iter().map(ty::Predicate::skip_binders).filter_map(-                |predicate| match predicate {-                    ty::PredicateAtom::Trait(trait_predicate, _) => {-                        match trait_predicate.trait_ref.self_ty().kind() {-                            ty::Param(ref p) if *p == param_ty => {-                                Some(ty::Binder::bind(trait_predicate.trait_ref))-                            }-                            _ => None,+        let tcx = self.tcx;+        let bounds = self.param_env.caller_bounds().iter().filter_map(|predicate| {+            let bound_predicate = predicate.bound_atom(tcx);+            match bound_predicate.skip_binder() {+                ty::PredicateAtom::Trait(trait_predicate, _) => {+                    match trait_predicate.trait_ref.self_ty().kind() {+                        ty::Param(ref p) if *p == param_ty => {
                    match *trait_predicate.trait_ref.self_ty().kind() {
                        ty::Param(p) if p == param_ty => {
jackh726

comment created time in 3 days

Pull request review commentrust-lang/rust

Use map_bound(_ref) instead of Binder::bind when possible

 fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(         // could be extended easily also to the other `Predicate`.         let predicate_matches_closure = |p: Predicate<'tcx>| {             let mut relator: SimpleEqRelation<'tcx> = SimpleEqRelation::new(tcx, self_param_env);+            let bound_predicate = predicate.bound_atom(tcx);+            let bound_p = p.bound_atom(tcx);             match (predicate.skip_binders(), p.skip_binders()) {

nit: style

maybe instead shadow p and predicate here and match on (predicate.skip_binder(), p.skip_binder())

jackh726

comment created time in 3 days

Pull request review commentrust-lang/rust

Use map_bound(_ref) instead of Binder::bind when possible

 impl<'tcx> Predicate<'tcx> {         }     } +    /// Converts this to a `Binder<PredicateAtom<'tcx>>`. If the value was an+    /// `Atom`, then it is not allowed to contain escaping bound vars.+    pub fn bound_atom(self, _tcx: TyCtxt<'tcx>) -> Binder<PredicateAtom<'tcx>> {+        match self.kind() {+            &PredicateKind::ForAll(binder) => binder,+            &PredicateKind::Atom(atom) => {+                assert!(!atom.has_escaping_bound_vars());
                debug_assert!(!atom.has_escaping_bound_vars());

i expect this method to be faily hot, so it might also make sense to mark this #[inline]

jackh726

comment created time in 3 days

Pull request review commentrust-lang/rust

Use map_bound(_ref) instead of Binder::bind when possible

 impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {         }          let result = ensure_sufficient_stack(|| {-            match obligation.predicate.skip_binders() {+            let bound_predicate =+                obligation.predicate.bound_atom_with_opt_escaping(self.infcx().tcx);

why do you use ...with_opt_escaping here? We previously used skip_binders which failed on unbound vars

jackh726

comment created time in 3 days

Pull request review commentrust-lang/rust

Use map_bound(_ref) instead of Binder::bind when possible

 impl<T> Binder<T> {         Binder(f(self.0))     } +    /// Wraps a `value` in a binder, using the same bound variables as the+    /// current `Binder`. This should not be used if the new value *changes*+    /// the bound variables. Note: the (old or new) value itself does not+    /// necessarily need to *name* all the bound variables.+    pub fn rebind<U>(&self, value: U) -> Binder<U> {

It might make sense to add a comment here which says that we do not yet track bound variables.

I am also kind of suprised that none of the methods on ty::Binder are marked as inline even though they are very frequently used and really simple. Might be interesting to check if that has a perf impact.

jackh726

comment created time in 3 days

Pull request review commentrust-lang/rust

Use map_bound(_ref) instead of Binder::bind when possible

 impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {              ty::Array(element_ty, _) => {                 // (*) binder moved here-                Where(ty::Binder::bind(vec![element_ty]))+                Where(obligation.predicate.rebind(vec![*element_ty]))

can you instead of using *element_ty here change the match statement to

match *self_ty.kind() {
jackh726

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentrust-lang/rust

Check for frequent types in type folding

@bors try @rust-timer queue

JulianKnodt

comment created time in 3 days

issue commentrust-lang/rust

ICE: type_of.rs:115:26: unexpected anon const res PrimTy(Uint(Usize)) in path

Will look into this in a few weeks so I am claiming this for now so I don't forget.

@rustbot claim

If anyone else wants to work on this before that feel free to do so, don't have much time rn

chengniansun

comment created time in 3 days

pull request commentrust-lang/rust

Check for primitive types in type folding

@bors try @rust-timer queue

JulianKnodt

comment created time in 5 days

pull request commentrust-lang/rust

WIP: Change built-in kernel targets to be os = none throughout

maybe r? @Mark-Simulacrum

Ericson2314

comment created time in 5 days

issue commentrust-lang/rust

Lint elided lifetimes when the argument that triggered the elision is not used

hmm, I am not sure how easy such a lint will be to implement :thinking:

I personally think that the second case would be really valuable though

fn test(s: &i32, v: *const u32) -> &u32 {
    unsafe { &* v }
}

Linting on lifetime elision if it's applied and there are pointers in the function arguments should be able to prevent some unsound code.

camelid

comment created time in 6 days

issue commentrust-lang/rust

Taking an argument hides lifetime error

example a is desugared to

fn foo<'a>(s: &'a i32) -> &'a i32 {
    &0
}

While we currently do not apply any desugarings in the second example. While we may want to change this behavior in the future, as of now the compiler agrees with the language specification here

camelid

comment created time in 6 days

issue commentrust-lang/rust

Taking an argument hides lifetime error

I also think this behavior is expected, so I don't feel like there is any bug here

camelid

comment created time in 6 days

issue commentrust-lang/rust

Tracking issue for `any::type_name_of_val`

getting the type name at runtime isn't really possible without having a non zero cost even for programs never using type_name_of_val

type_name_of_generic is even more verbose than type_name_of_val so I personally do not prefer it. Don't really care about this though

lcnr

comment created time in 6 days

pull request commentrust-lang/rust

Replace absolute paths with relative ones

@bors r+ rollup

Thanks

est31

comment created time in 6 days

pull request commentrust-lang/rust

Check for primitive types in type folding

I do think there are some gains to be made here, but it looks like that wasn't quite it

JulianKnodt

comment created time in 6 days

Pull request review commentrust-lang/rust

Replace absolute paths with relative ones

 impl<'a> serialize::Decoder for Decoder<'a> {     #[inline]     fn read_char(&mut self) -> Result<char, Self::Error> {         let bits = self.read_u32()?;-        Ok(::std::char::from_u32(bits).unwrap())+        Ok(std::char::from_u32(bits).unwrap())     }      #[inline]     fn read_str(&mut self) -> Result<Cow<'_, str>, Self::Error> {         let len = self.read_usize()?;-        let s = ::std::str::from_utf8(&self.data[self.position..self.position + len]).unwrap();+        let s = std::str::from_utf8(&self.data[self.position..][..len]).unwrap();

doesn't really matter, but yeah... doing [start..start + len] is preferable over [start..][..len] to me.

est31

comment created time in 6 days

PullRequestReviewEvent

pull request commentrust-lang/rust

`min_const_generics` diagnostics improvements

lgtm

@bors r+

ethanboxx

comment created time in 6 days

pull request commentrust-lang/rust

Check for primitive types in type folding

@bors try @rust-timer queue

JulianKnodt

comment created time in 6 days

issue commentrust-lang/rust

There's currently no way to specify bounds requiring constants in types to be well-formed

@DrMeepster this is a bug, and one of the most difficult ones we will have to face for this feature.

fixing that one will be a quite invasive change so we probably don't even want to fix it until we fixed most of the remaining issues here.

varkor

comment created time in 6 days

pull request commentrust-lang/rust

Replace absolute paths with relative ones

@bors r+

est31

comment created time in 6 days

Pull request review commentrust-lang/rust

Replace absolute paths with relative ones

 impl<'a> serialize::Decoder for Decoder<'a> {     #[inline]     fn read_char(&mut self) -> Result<char, Self::Error> {         let bits = self.read_u32()?;-        Ok(::std::char::from_u32(bits).unwrap())+        Ok(std::char::from_u32(bits).unwrap())     }      #[inline]     fn read_str(&mut self) -> Result<Cow<'_, str>, Self::Error> {         let len = self.read_usize()?;-        let s = ::std::str::from_utf8(&self.data[self.position..self.position + len]).unwrap();+        let s = std::str::from_utf8(&self.data[self.position..][..len]).unwrap();

I personally prefer the previous version here

est31

comment created time in 6 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentrust-lang/rust

Remove `canonicalize_hr_query_hack`

iirc we still can't remove that as the leak check still exists and we still deal with 'static a bit differently.

r? @matthewjasper

bugadani

comment created time in 6 days

Pull request review commentrust-lang/rust

`min_const_generics` diagnostics improvements

 impl<'a> Resolver<'a> {             ResolutionError::ParamInNonTrivialAnonConst { name, is_type } => {                 let mut err = self.session.struct_span_err(                     span,-                    "generic parameters must not be used inside of non-trivial constant values",-                );-                err.span_label(-                    span,-                    &format!(-                        "non-trivial anonymous constants must not depend on the parameter `{}`",-                        name-                    ),+                    "generic parameters must not be used inside const evaluations",                 );+                err.span_label(span, &format!("cannot perform const operation using `{}`", name));                  if is_type {-                    err.note("type parameters are currently not permitted in anonymous constants");+                    err.note("type parameters may not be used in anonymous constants");

hmm, I guess that's also fine with me :+1: If we go and slowly push for const wf bounds in the future simply using "const expression" for all constants looks good to me, even if it is currently somewhat incorrect for associated constants

ethanboxx

comment created time in 7 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

`min_const_generics` diagnostics improvements

 impl<'a> Resolver<'a> {             ResolutionError::ParamInNonTrivialAnonConst { name, is_type } => {                 let mut err = self.session.struct_span_err(                     span,-                    "generic parameters must not be used inside of non-trivial constant values",-                );-                err.span_label(-                    span,-                    &format!(-                        "non-trivial anonymous constants must not depend on the parameter `{}`",-                        name-                    ),+                    "generic parameters must not be used inside const evaluations",                 );+                err.span_label(span, &format!("cannot perform const operation using `{}`", name));                  if is_type {-                    err.note("type parameters are currently not permitted in anonymous constants");+                    err.note("type parameters may not be used in anonymous constants");

yeah, I guess this is where most of the issue lies - at least for me. What do we call the different constants?

So it seems to me like we settled on const operations for everything which is not a param. Do you want to use const expression for all constants - or at least for all constants used in types and repeat expressions? One issue for me is that type parameters can be used in associated constants which are not anonymous but might also be expressions.

ethanboxx

comment created time in 7 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

`min_const_generics` diagnostics improvements

 impl<'a> Resolver<'a> {             ResolutionError::ParamInNonTrivialAnonConst { name, is_type } => {                 let mut err = self.session.struct_span_err(                     span,-                    "generic parameters must not be used inside of non-trivial constant values",-                );-                err.span_label(-                    span,-                    &format!(-                        "non-trivial anonymous constants must not depend on the parameter `{}`",-                        name-                    ),+                    "generic parameters must not be used inside const evaluations",                 );+                err.span_label(span, &format!("cannot perform const operation using `{}`", name));                  if is_type {-                    err.note("type parameters are currently not permitted in anonymous constants");+                    err.note("type parameters may not be used in anonymous constants");

I think it helps to explicitly mention that type params are not supported at all, so I would personally keep that note

ethanboxx

comment created time in 7 days

PullRequestReviewEvent

pull request commentrust-lang/rust

add shims for WithOptConstParam query calls

@bors rollup

lcnr

comment created time in 7 days

pull request commentrust-lang/rust

add shims for WithOptConstParam query calls

I guess

@bors r=ecstatic-morse

lcnr

comment created time in 7 days

issue closedrust-lang/rust

ICE: src/librustc_middle/ty/subst.rs:568:17: const parameter `N/#0` (Const { ty: usize, val: Param(N/#0) }/0) out of range when substituting substs=[]

Code

fn foo<const N: usize>() -> [(); N + 1] {
    unimplemented!()
}

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a2ca1d2ba3c49f2540baebfb8ac167a0

Similar to #75913 this ICE goes away when adding #![feature(const_generics)].

Meta

Same error on beta and nightly.

rustc --version --verbose:

rustc 1.46.0 (04488afe3 2020-08-24)
binary: rustc
commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9
commit-date: 2020-08-24
host: x86_64-unknown-linux-gnu
release: 1.46.0
LLVM version: 10.0

Error output

error[E0658]: const generics are unstable
 --> src/lib.rs:1:14
  |
1 | fn foo<const N: usize>() -> [(); N + 1] {
  |              ^
  |
  = note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information
  = help: add `#![feature(min_const_generics)]` to the crate attributes to enable

error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:568:17: const parameter `N/#0` (Const { ty: usize, val: Param(N/#0) }/0) out of range when substituting substs=[]

thread 'rustc' panicked at 'Box<Any>', /rustc/c71248b70870960af9993de4f31d3cba9bbce7e8/compiler/rustc_errors/src/lib.rs:891:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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

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

note: rustc 1.49.0-nightly (c71248b70 2020-10-11) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `playground`

To learn more, run the command again with --verbose.

<!-- Include a backtrace in the code block by setting RUST_BACKTRACE=1 in your environment. E.g. RUST_BACKTRACE=1 cargo build. --> <details><summary><strong>Backtrace</strong></summary> <p>

❯ RUST_BACKTRACE=1 rustc next2.rs                                                     Mon 12 Oct 2020 10:44:30 BST
error[E0658]: const generics are unstable
 --> next2.rs:1:14
  |
1 | fn foo<const N: usize>() -> [(); N + 1] {
  |              ^
  |
  = note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information
  = help: add `#![feature(min_const_generics)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `next2`
 --> next2.rs:1:1
  |
1 | / fn foo<const N: usize>() -> [(); N + 1] {
2 | |     unimplemented!()
3 | | }
  | |_^ consider adding a `main` function to `next2.rs`

error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:568:17: const parameter `N/#0` (Const { ty: usize, val: Param(N/#0) }/0) out of range when substituting substs=[]

thread 'rustc' panicked at 'Box<Any>', /rustc/8b4085359ae798dedb05c95ad42520557bd25320/compiler/rustc_errors/src/lib.rs:891:9
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::span_bug
   2: rustc_errors::Handler::span_bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::span_bug_fmt
   8: <rustc_middle::ty::subst::SubstFolder as rustc_middle::ty::fold::TypeFolder>::fold_const
   9: rustc_middle::ty::normalize_erasing_regions::<impl rustc_middle::ty::context::TyCtxt>::subst_and_normalize_erasing_regions
  10: rustc_mir::interpret::operand::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::eval_operand
  11: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::eval_rvalue_into_place
  12: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::run
  13: rustc_mir::const_eval::eval_queries::eval_to_allocation_raw_provider
  14: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_allocation_raw>::compute
  15: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  16: rustc_data_structures::stack::ensure_sufficient_stack
  17: rustc_query_system::query::plumbing::get_query_impl
  18: rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider
  19: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_const_value_raw>::compute
  20: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  21: rustc_data_structures::stack::ensure_sufficient_stack
  22: rustc_query_system::query::plumbing::get_query_impl
  23: rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider
  24: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::eval_to_const_value_raw>::compute
  25: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  26: rustc_data_structures::stack::ensure_sufficient_stack
  27: rustc_query_system::query::plumbing::get_query_impl
  28: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  29: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  30: <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_const
  31: rustc_middle::ty::structural_impls::<impl rustc_middle::ty::fold::TypeFoldable for &rustc_middle::ty::TyS>::super_fold_with
  32: <rustc_trait_selection::traits::project::AssocTypeNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_ty
  33: rustc_middle::ty::structural_impls::fold_list
  34: rustc_trait_selection::traits::project::AssocTypeNormalizer::fold
  35: rustc_trait_selection::traits::project::normalize
  36: <rustc_infer::infer::InferCtxt as rustc_trait_selection::infer::InferCtxtExt>::partially_normalize_associated_types_in
  37: rustc_typeck::check::inherited::Inherited::normalize_associated_types_in
  38: rustc_infer::infer::InferCtxtBuilder::enter
  39: rustc_typeck::check::wfcheck::check_item_fn
  40: rustc_typeck::check::wfcheck::check_item_well_formed
  41: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_item_well_formed>::compute
  42: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  43: rustc_data_structures::stack::ensure_sufficient_stack
  44: rustc_query_system::query::plumbing::get_query_impl
  45: rustc_query_system::query::plumbing::ensure_query_impl
  46: rustc_data_structures::sync::par_for_each_in
  47: rustc_hir::hir::Crate::par_visit_all_item_likes
  48: rustc_typeck::check_crate
  49: rustc_interface::passes::analysis
  50: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  51: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  52: rustc_data_structures::stack::ensure_sufficient_stack
  53: rustc_query_system::query::plumbing::get_query_impl
  54: rustc_interface::passes::QueryContext::enter
  55: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  56: rustc_span::with_source_map
  57: rustc_interface::interface::create_compiler_and_run
  58: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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

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

note: rustc 1.48.0-nightly (8b4085359 2020-09-23) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `foo::{{constant}}#0`
#1 [eval_to_const_value_raw] simplifying constant for the type system `foo::{{constant}}#0`
#2 [eval_to_const_value_raw] simplifying constant for the type system `foo::{{constant}}#0`
#3 [check_item_well_formed] checking that `foo` is well-formed
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.

</p> </details>

closed time in 7 days

ethanboxx

pull request commentrust-lang/rust

Check for primitive types in type folding

@bors try @rust-timer queue

we probably don't want to do this in fold_with, but it does seem interesting to try and see if this influences perf

JulianKnodt

comment created time in 7 days

Pull request review commentrust-lang/rust

Moved the main `impl` for FnCtxt to its own file.

+use super::coercion::CoerceMany;

would it make more sense to instead move this into fn_ctxt/checks.rs? This seems a bit cleaner to me

Nicholas-Baron

comment created time in 7 days

PullRequestReviewEvent

pull request commentrust-lang/rust

`min_const_generics` diagnostics improvements

Nice, good job :+1:

@bors r+ rollup

ethanboxx

comment created time in 7 days

pull request commentrust-lang/rust

Update crossbeam-channel to avoid UB

Why are you updating Cargo.lock instead of Cargo.toml?

mati865

comment created time in 8 days

pull request commentrust-lang/rust

require `Reveal::All` in `normalize_erasing_regions`

doesn't normalize_erasing_regions ICE if it fails to normalize?

Will have to look into this a bit more deeply then

lcnr

comment created time in 8 days

issue commentrust-lang/rust

ICE on unused generic in struct

It is expected to ICE without const generics, so we may want to keep this issue open until min_const_generics gets stabilized.

I do however feel like that won't be that useful as we won't work on fixing this until then.

DutchGhost

comment created time in 10 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Rename ty::TyKind to ty::TyData, Ty::kind to Ty::data

 impl BoundRegion { /// AST structure in `librustc_ast/ast.rs` as well. #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, TyDecodable, Debug)] #[derive(HashStable)]-#[rustc_diagnostic_item = "TyKind"]-pub enum TyKind<'tcx> {+#[rustc_diagnostic_item = "TyData"]

This causes the CI failure, I recommend grepping for sym::TyKind

vandenheuvel

comment created time in 10 days

PR opened rust-lang/rust

require `Reveal::All` in `normalize_erasing_regions`

would have caught a bug in mir inlining, see https://github.com/rust-lang/rust/pull/77568#discussion_r500325317

+1 -0

0 comment

1 changed file

pr created time in 10 days

create barnchlcnr/rust

branch : normalize-assert

created branch time in 10 days

push eventlcnr/rust

push time in 10 days

more