Git Product home page Git Product logo

Comments (4)

matthiaskrgr avatar matthiaskrgr commented on July 19, 2024

Regression in nightly-2023-02-18

looking for regression commit between 2023-02-17 and 2023-02-18
fetching (via remote github) commits from max(9a7cc6c, 2023-02-15) to 9aa5c24
ending github query because we found starting sha: 9a7cc6c
get_commits_between returning commits, len: 8
commit[0] 2023-02-16: Auto merge of #108127 - matthiaskrgr:rollup-kpzfc6j, r=matthiaskrgr
commit[1] 2023-02-16: Auto merge of #107833 - Zoxc:arena-query-clean, r=cjgillot
commit[2] 2023-02-17: Auto merge of #108145 - matthiaskrgr:rollup-bgadak1, r=matthiaskrgr
commit[3] 2023-02-17: Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU
commit[4] 2023-02-17: Auto merge of #108058 - Zoxc:query-ctxtx-byval, r=cjgillot
commit[5] 2023-02-17: Auto merge of #107965 - BoxyUwU:add_const_arg_has_type_predicate, r=compiler-errors
commit[6] 2023-02-17: Auto merge of #108159 - matthiaskrgr:rollup-5k2j7cx, r=matthiaskrgr
commit[7] 2023-02-17: Auto merge of #108075 - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstrieb
ERROR: no CI builds available between 9a7cc6c and 9aa5c24 within last 167 days

from rust.

fmease avatar fmease commented on July 19, 2024

Oh, I see. I forgot about tcx.types.trait_object_dummy_self (FreshTy(0)) in #121258. Ofc, my PR doesn't regress anything here but still I forgot about this case. Very likely we need to reject trait_object_dummy_self manually and can't rely on registering a <Ty as core::marker::ConstParamTy> obligation1 (which I plan to do to fix #119783 but the location is still unclear to me2) because we just shouldn't be feeding the fake FreshTy(0) to type_of as can be seen by the ICE, the trait solver & the inference engine obviously can't handle such malformed obligations.

Footnotes

  1. Trait object types never impl ConstParamTy.

  2. HIR wf-checking isn't an option because we lack too much information at this stage, during normalization isn't an option since we shouldn't rely on normalization for ensuring well-formedness, leaving us with constructing an ObligationCtxt ad hoc during HIR ty lowering which isn't super great.

from rust.

fmease avatar fmease commented on July 19, 2024

Wait, I don't think we should deny trait_object_dummy_self in the code path that rejects early-bound and escaping late-bound vars, that's not the right thing to do. They are semi-legitimate types that get discarded by helpers like ExistentialTraitRef::erase_self_ty and ExistentialProjection::erase_self_ty, e.g. inside lower_trait_object_ty (which also introduces these dummy_self types).

Oh, okay, so inside lower_trait_object_ty we discard const projections if their args contain a dummy self type but in our case, the projected type (the type_of(proj)) contains a dummy self type.

As the comment over there says such a (const) projection would expand to an infinitely-long type. We also need to check the projected type for dummy self types and drop the existential const projection in case we find any. Edit: Tho, no I'm confused since the projection_ty and the term.ct().ty() should be same in this case due to the anon const feeding, so why isn't it detecting anything? 🤔 Update: We don't even reach the aforementioned branch inside lower_trait_object_ty for some reason. Update: Oh, that's not the code path we're interested in, that's only for super trait elab.

from rust.

fmease avatar fmease commented on July 19, 2024

Stopping my investigations for now but overwriting the args (incl. the self type subst) of such projections with {type error} as well turning the const projection term into {const error} if the args or the type of the projected const contains trait_object_dummy_self didn't help. Note that lower_trait_object_ty does parts of this already.

I haven't dug deeper yet but the cause of this might be the anon const query feeding in lower_assoc_item_binding: We may feed trait_object_dummy_self to type_of(AnonConst) which can't be undone.

from rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.