From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile | 8 ++++++++ .../save-analysis-rfc2126/extern_absolute_paths.rs | 6 ++++++ src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs | 5 +++++ src/test/run-make-fulldeps/save-analysis-rfc2126/validate_json.py | 7 +++++++ 4 files changed, 26 insertions(+) create mode 100644 src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile create mode 100644 src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs create mode 100644 src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs create mode 100644 src/test/run-make-fulldeps/save-analysis-rfc2126/validate_json.py (limited to 'src/test/run-make-fulldeps/save-analysis-rfc2126') diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile new file mode 100644 index 000000000..36288c4b8 --- /dev/null +++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile @@ -0,0 +1,8 @@ +-include ../tools.mk + +all: extern_absolute_paths.rs krate2 + $(RUSTC) extern_absolute_paths.rs -Zsave-analysis --edition=2018 --extern krate2 + cat $(TMPDIR)/save-analysis/extern_absolute_paths.json | "$(PYTHON)" validate_json.py + +krate2: krate2.rs + $(RUSTC) $< diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs b/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs new file mode 100644 index 000000000..7a8e3fff0 --- /dev/null +++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs @@ -0,0 +1,6 @@ +use krate2::hello; + +fn main() { + hello(); + ::krate2::hello(); +} diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs b/src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs new file mode 100644 index 000000000..d24c68862 --- /dev/null +++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs @@ -0,0 +1,5 @@ +#![crate_name = "krate2"] +#![crate_type = "lib"] + +pub fn hello() { +} diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/validate_json.py b/src/test/run-make-fulldeps/save-analysis-rfc2126/validate_json.py new file mode 100644 index 000000000..882d29a8b --- /dev/null +++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/validate_json.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +import sys +import json + +crates = json.loads(sys.stdin.readline().strip())["prelude"]["external_crates"] +assert any(map(lambda c: c["id"]["name"] == "krate2", crates)) -- cgit v1.2.3