Add track_env_var to the proc macro server

This commit is contained in:
Laurențiu Nicola 2020-08-03 13:57:04 +03:00
parent e5f252ade7
commit 3d169bd3f4
6 changed files with 40 additions and 1 deletions

View file

@ -242,6 +242,8 @@ impl TokenStreamBuilder {
}
}
pub struct FreeFunctions;
#[derive(Clone)]
pub struct TokenStreamIter {
trees: IntoIter<TokenTree>,
@ -254,6 +256,7 @@ pub struct Rustc {
}
impl server::Types for Rustc {
type FreeFunctions = FreeFunctions;
type TokenStream = TokenStream;
type TokenStreamBuilder = TokenStreamBuilder;
type TokenStreamIter = TokenStreamIter;
@ -267,6 +270,13 @@ impl server::Types for Rustc {
type MultiSpan = Vec<Span>;
}
impl server::FreeFunctions for Rustc {
fn track_env_var(&mut self, _var: &str, _value: Option<&str>) {
// FIXME: track env var accesses
// https://github.com/rust-lang/rust/pull/71858
}
}
impl server::TokenStream for Rustc {
fn new(&mut self) -> Self::TokenStream {
Self::TokenStream::new()