Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite compile loop regression from recursive Lazy reference #1242

Merged
merged 1 commit into from
May 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sqlx-macros/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct Metadata {
static METADATA: Lazy<Metadata> = Lazy::new(|| {
use std::env;

let manifest_dir = env::var("CARGO_MANIFEST_DIR")
let manifest_dir: PathBuf = env::var("CARGO_MANIFEST_DIR")
.expect("`CARGO_MANIFEST_DIR` must be set")
.into();

Expand All @@ -47,7 +47,7 @@ static METADATA: Lazy<Metadata> = Lazy::new(|| {

// If a .env file exists at CARGO_MANIFEST_DIR, load environment variables from this,
// otherwise fallback to default dotenv behaviour.
let env_path = METADATA.manifest_dir.join(".env");
let env_path = manifest_dir.join(".env");
if env_path.exists() {
let res = dotenv::from_path(&env_path);
if let Err(e) = res {
Expand Down