Avoid rustdoc auto-trait ICEs with the global next solver#158346
Open
Jamesbarford wants to merge 1 commit into
Open
Avoid rustdoc auto-trait ICEs with the global next solver#158346Jamesbarford wants to merge 1 commit into
Jamesbarford wants to merge 1 commit into
Conversation
8806252 to
52e368f
Compare
lcnr
reviewed
Jun 25, 2026
|
|
||
| let (infcx, orig_env) = tcx.infer_ctxt().build_with_typing_env(typing_env); | ||
| let mut selcx = SelectionContext::new(&infcx); | ||
| for polarity in [ty::PredicatePolarity::Positive, ty::PredicatePolarity::Negative] { |
Contributor
There was a problem hiding this comment.
can you instead copy the behavior of
here.rn this doesn't consider there to be an explicit impl for MyType<T> if there's just impl Send for MyType<u32>
lcnr
reviewed
Jun 25, 2026
| let field_clauses = adt_def | ||
| .all_fields() | ||
| .map(|field| field.ty(tcx, args).skip_norm_wip()) | ||
| .filter(|field_ty| field_ty.has_non_region_param()) |
Contributor
There was a problem hiding this comment.
why this?
lcnr
reviewed
Jun 25, 2026
Comment on lines
+240
to
+242
| let full_user_env = ty::ParamEnv::new( | ||
| tcx.mk_clauses_from_iter(orig_env.caller_bounds().iter().chain(field_clauses)), | ||
| ); |
Contributor
There was a problem hiding this comment.
hmm? 🤔 what are you trying to do/please provide a comment
Contributor
There was a problem hiding this comment.
generally, can you describe the algorithm you're trying to implement in words?
This is currently somewhat wrong and I would like to know what it is that you are trying to do. Might also be useful to show the intended behavior on one or two examples
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…t-bounds, r=fmease Fix: auto trait, const trait bound Split from rust-lang#158346. I was fiddling about with the code to understand the behaviour of the snippet below, got confused, and somehow fixed something 🤷 ```rust #![feature(const_trait_impl)] pub struct Outer<T>(Inner<T>); struct Inner<T>(T); impl<T> Unpin for Inner<T> where T: const std::default::Default, {} ``` Fixes rust-lang#149281
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…t-bounds, r=fmease Fix: auto trait, const trait bound Split from rust-lang#158346. I was fiddling about with the code to understand the behaviour of the snippet below, got confused, and somehow fixed something 🤷 ```rust #![feature(const_trait_impl)] pub struct Outer<T>(Inner<T>); struct Inner<T>(T); impl<T> Unpin for Inner<T> where T: const std::default::Default, {} ``` Fixes rust-lang#149281
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…t-bounds, r=fmease Fix: auto trait, const trait bound Split from rust-lang#158346. I was fiddling about with the code to understand the behaviour of the snippet below, got confused, and somehow fixed something 🤷 ```rust #![feature(const_trait_impl)] pub struct Outer<T>(Inner<T>); struct Inner<T>(T); impl<T> Unpin for Inner<T> where T: const std::default::Default, {} ``` Fixes rust-lang#149281
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 25, 2026
…t-bounds, r=fmease Fix: auto trait, const trait bound Split from rust-lang#158346. I was fiddling about with the code to understand the behaviour of the snippet below, got confused, and somehow fixed something 🤷 ```rust #![feature(const_trait_impl)] pub struct Outer<T>(Inner<T>); struct Inner<T>(T); impl<T> Unpin for Inner<T> where T: const std::default::Default, {} ``` Fixes rust-lang#149281
rust-timer
added a commit
that referenced
this pull request
Jun 25, 2026
Rollup merge of #158390 - Jamesbarford:fix/trait-solver-const-bounds, r=fmease Fix: auto trait, const trait bound Split from #158346. I was fiddling about with the code to understand the behaviour of the snippet below, got confused, and somehow fixed something 🤷 ```rust #![feature(const_trait_impl)] pub struct Outer<T>(Inner<T>); struct Inner<T>(T); impl<T> Unpin for Inner<T> where T: const std::default::Default, {} ``` Fixes #149281
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-Znext-solver=globallydoes not ICE.r? @lcnr