about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-11-16 19:50:48 +0000
committerbors <bors@rust-lang.org>2019-11-16 19:50:48 +0000
commit5c5b8afd80e6fa1d24632153cb2257c686041d41 (patch)
treeb63c656633b43294948a19c761bb5bde38b53b18 /src/libstd/sys/unix/stack_overflow.rs
parent5f00849dc495f97ea9eeef07b958664bfb755ae3 (diff)
parent8668c1a19015148821c37255922f9a9b603dd148 (diff)
downloadrust-5c5b8afd80e6fa1d24632153cb2257c686041d41.tar.gz
rust-5c5b8afd80e6fa1d24632153cb2257c686041d41.zip
Auto merge of #64694 - petrochenkov:reshelp, r=matthewjasper
Fully integrate derive helpers into name resolution

```rust
#[derive(Foo)]
#[foo_helper] // already goes through name resolution
struct S {
    #[foo_helper] // goes through name resolution after this PR
    field: u8
}
```
How name resolution normally works:
- We have an identifier we need to resolve, take its location (in some sense) and look what names are in scope in that location.

How derive helper attributes are "resolved" (before this PR):
- After resolving the derive `Foo` we visit the derive's input (`struct S { ... } `) as a piece of AST and mark attributes textually matching one of the derive's helper attributes (`foo_helper`) as "known", so they never go through name resolution.

This PR changes the rules for derive helpers, so they are not proactively marked as known (which is a big hack ignoring any ambiguities or hygiene), but go through regular name resolution instead.
This change was previously blocked by attributes not being resolved in some positions at all (fixed in https://github.com/rust-lang/rust/pull/63468).

"Where exactly are derive helpers in scope?" is an interesting question, and I need some feedback from proc macro authors to answer it, see the post below (https://github.com/rust-lang/rust/pull/64694#issuecomment-533925160).
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions