Move #[track_caller] behind feature gate

This commit is contained in:
ConnorSkees 2020-01-20 13:39:20 -05:00
parent 25b4bebdf8
commit 75f38ba416
3 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,7 @@ name = "grass"
version = "0.1.0" version = "0.1.0"
description = "An SCSS compiler in Rust" description = "An SCSS compiler in Rust"
readme = "README.md" readme = "README.md"
license = "MIT OR Apache-2.0" license = "MIT"
categories = ["command-line-utilities", "web-programming"] categories = ["command-line-utilities", "web-programming"]
keywords = ["scss", "sass", "css"] keywords = ["scss", "sass", "css"]
repository = "https://github.com/connorskees/grass" repository = "https://github.com/connorskees/grass"
@ -26,6 +26,7 @@ clap = { version = "2.33.0", optional = true }
[features] [features]
default = ["commandline"] default = ["commandline"]
commandline = ["clap"] commandline = ["clap"]
nightly = []
[dev-dependencies] [dev-dependencies]
# test imports # test imports

View File

@ -39,7 +39,7 @@
// than they should // than they should
clippy::module_name_repetitions clippy::module_name_repetitions
)] )]
#![feature(track_caller)] #![cfg_attr(feature = "nightly", feature(track_caller))]
// todo! handle erroring on styles at the toplevel // todo! handle erroring on styles at the toplevel
use std::fmt::{self, Display}; use std::fmt::{self, Display};
use std::fs; use std::fs;

View File

@ -18,7 +18,7 @@ pub(crate) fn devour_whitespace<I: Iterator<Item = W>, W: IsWhitespace>(s: &mut
found_whitespace found_whitespace
} }
#[track_caller] #[cfg_attr(feature = "nightly", track_caller)]
pub(crate) fn deref_variable(name: &str, scope: &Scope) -> Vec<Token> { pub(crate) fn deref_variable(name: &str, scope: &Scope) -> Vec<Token> {
let mut toks = scope let mut toks = scope
.vars .vars