Skip to content

De and fn - #10563

Closed
pcwalton wants to merge 7 commits into
rust-lang:masterfrom
pcwalton:de-and-fn
Closed

De and fn#10563
pcwalton wants to merge 7 commits into
rust-lang:masterfrom
pcwalton:de-and-fn

Conversation

@pcwalton

Copy link
Copy Markdown
Contributor

@emberian

Copy link
Copy Markdown
Contributor

This 1. overlaps with #10561, 2. needs a rebase

@pcwalton
pcwalton deleted the de-and-fn branch November 19, 2013 20:44
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 6, 2023
Partial no-op refactoring of rust-lang#9948
This contains some prep work for rust-lang#9948 to keep that change to the minimum, and make it easier to review it.
This should be a noop, but it has some tests from that PR discussion, and should help in the future with the corner case format handling.
cc: `@Alexendoo` `@llogiq` `@xFrednet` as the 3 people who reviewed the parent PR
----
changelog: none
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
10563: feat: Make "Generate getter" assist use semantic info r=agluszak a=agluszak
This PR makes "Generate getter" assist use semantic info instead of dealing with types encoded as strings.
Getters for types which are:
- `Copy` no longer return references
- `AsRef<str>` (i.e. `String`) return `&str` (instead of `&String`)
- `AsRef<[T]>` (i.e. `Vec<T>`) return `&[T]` (instead of `&Vec<T>`)
- `AsRef<T>` (i.e. `Box<T>`) return `&T` (instead of `&Box<T>`)
- `Option<T>` return `Option<&T>` (instead of `&Option<T>`)
- `Result<T, E>` return `Result<&T, &E>` (instead of `&Result<T, E>`)
String, Vec, Box and Option were previously handled as special cases.
Closesrust-lang#10295
Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@pcwalton@emberian@alexcrichton@bors