about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-10-20 21:02:46 +0000
committerGitHub <noreply@github.com>2021-10-20 21:02:46 +0000
commit6877240fdf597533e2d3349454f62fdc40aaae54 (patch)
tree40a9803a4080ea144c35c9b550c7c4cb8211bfe7 /src/test/codegen
parent11326a6847f7fd43afef1806779082f96264d9c6 (diff)
parent88e2f0782693b73d71d7bbf13d584c4aa37fd834 (diff)
downloadrust-6877240fdf597533e2d3349454f62fdc40aaae54.tar.gz
rust-6877240fdf597533e2d3349454f62fdc40aaae54.zip
Merge #10563
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.

Closes #10295


Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
Diffstat (limited to 'src/test/codegen')
0 files changed, 0 insertions, 0 deletions