Rollup of 3 pull requests#153729
Closed
JonathanBrouwer wants to merge 6 commits intorust-lang:mainfrom
Closed
Conversation
When a delegation path like `reuse Trait::<> as bar4` has a child segment that resolves to a trait instead of a function, the compiler would ICE because `lower_generic_args_of_path` asserts that `self_ty` is `Some` when `has_self` is true and `parent` is `None`. Fix this by filtering out non-function child segments early using `.filter()` in the method chain, so that when the child segment resolves to a trait (error recovery for E0423), we skip generic args computation entirely and return an empty list via `unwrap_or_default()`. Also make `get_segment` return `Option` by using `opt_def_id()` instead of `def_id()` to gracefully handle unresolved segments.
…range_end_end, r=davidtwco Stop using rustc_layout_scalar_valid_range_* in rustc *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152569)* Another step towards rust-lang#135996 Required some manual impls, but we already do many manual impls for the newtype_index types, so it's not really a new maintenance burden.
…petrochenkov Fix ICE in fn_delegation when child segment resolves to a trait Fixes rust-lang#153420 When a delegation path like `reuse Trait::<> as bar4` has only one segment resolving to a trait (not a function), the child args processing in `get_delegation_user_specified_args` called `lower_generic_args_of_path` with `self_ty = None`. Since the trait's generics have `has_self = true`, this triggered `assert!(self_ty.is_some())`. Fix by computing and providing `self_ty` when the child segment's `def_id` has `has_self`. In valid delegation code the child segment always resolves to a function, so this only affects error recovery.
miri-test-libstd: use --tests and update some comments rust-lang#153143 added `./x test --tests` matching `cargo --tests`, which is exactly what Miri wants when testing the standard library. So let's use it for that. We can then also remove a hack in `library/alloctests/benches/vec_deque_append.rs`. Also update the comment for why the other benchmarks still need to be disabled in Miri, and remove some `cfg_attr` that seem unnecessary since the entire crate that contains them is already disabled in Miri. Those were copied over in rust-lang@b8fa843 -- they used to be needed since benches and tests were in the same crate, but they aren't any more.
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
Contributor
|
This pull request was unapproved due to being closed. |
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.
Successful merges:
r? @ghost
Create a similar rollup