Uh oh!
There was an error while loading. Please reload this page.
Add constants for trait object fields, and replace "magic numbers" in GEPi() calls with them - #6172
Closed
Sodel-the-Vociferous wants to merge 1 commit into
Closed
Add constants for trait object fields, and replace "magic numbers" in GEPi() calls with them#6172Sodel-the-Vociferous wants to merge 1 commit into
Sodel-the-Vociferous wants to merge 1 commit into
Conversation
I've added trt_field_vtable, trt_field_box, and trt_field_tydesc, and inserted them in place of the "magic numbers" used to access trait object fields through GEPi().
bors added a commit
that referenced
this pull request
May 2, 2013
…, r=catamorphism,graydon I don't know how one would write a separate test for this sort of thing. Building the compiler, and `make check` worked, which should mean I didn't screw anything.
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 24, 2020
Rustup changelog: none r? `@ghost`
U007D pushed a commit
to U007D/rust-mos
that referenced
this pull request
Aug 21, 2026
6172: Add qualify path assist r=matklad a=Veykril
This implements a `qualify_path` assist which works quite similar to the `auto_import` assist but instead of adding imports to the file it well, qualifies the path. This PR also moves out the `AutoImportAssets` struct and functions from `auto_import` into a utils submodule as most of this is now shared between `auto_import` and `qualify_path`.
Changes made to `AutoImportAssets` are solely in its `search_for_imports` function which now takes a prefixed parameter to discern between using `find_use_path_prefixed` and `find_use_path` as the former is the required behavior by `auto_import` and the latter by this assist.
For missing imported traits instead of importing this will qualify the path with a trait cast as in:
```rust
test_mod::TestStruct::TEST_CONST<|>
```
becomes
```rust
<test_mod::TestStruct as test_mod::TestTrait>::TEST_CONST
```
and for trait methods ideally it would do the following:
```rust
let test_struct = test_mod::TestStruct {};
test_struct.test_meth<|>od()
```
becomes
```rust
let test_struct = test_mod::TestStruct {};
test_mod::TestTrait::test_method(&test_struct)
```
Fixesrust-lang#4124.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
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 freeto 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.
I don't know how one would write a separate test for this sort of thing. Building the compiler, and
make checkworked, which should mean I didn't screw anything.