From 416caa10ed055e8f059bb2fe3d3dd67c063dfe6c Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 4 Aug 2019 20:20:12 +0900 Subject: [PATCH 1/3] Add test for issue-29265 --- src/test/ui/issues/auxiliary/issue-29265.rs | 9 +++++++++ src/test/ui/issues/issue-29265.rs | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/test/ui/issues/auxiliary/issue-29265.rs create mode 100644 src/test/ui/issues/issue-29265.rs diff --git a/src/test/ui/issues/auxiliary/issue-29265.rs b/src/test/ui/issues/auxiliary/issue-29265.rs new file mode 100644 index 0000000000000..6d26002a2e707 --- /dev/null +++ b/src/test/ui/issues/auxiliary/issue-29265.rs @@ -0,0 +1,9 @@ +#![crate_type = "lib"] + +pub struct SomeType { + pub some_member: usize, +} + +pub static SOME_VALUE: SomeType = SomeType { + some_member: 1, +}; diff --git a/src/test/ui/issues/issue-29265.rs b/src/test/ui/issues/issue-29265.rs new file mode 100644 index 0000000000000..f554c4d16c7d1 --- /dev/null +++ b/src/test/ui/issues/issue-29265.rs @@ -0,0 +1,10 @@ +// aux-build:issue-29265.rs +// check-pass + +extern crate issue_29265 as lib; + +static _UNUSED: &'static lib::SomeType = &lib::SOME_VALUE; + +fn main() { + vec![0u8; lib::SOME_VALUE.some_member]; +} From 620567d87ed578587cbbc6bad851576507283544 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 4 Aug 2019 20:20:40 +0900 Subject: [PATCH 2/3] Add test for issue-49544 --- src/test/ui/issues/auxiliary/issue-49544.rs | 7 +++++++ src/test/ui/issues/issue-49544.rs | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/test/ui/issues/auxiliary/issue-49544.rs create mode 100644 src/test/ui/issues/issue-49544.rs diff --git a/src/test/ui/issues/auxiliary/issue-49544.rs b/src/test/ui/issues/auxiliary/issue-49544.rs new file mode 100644 index 0000000000000..f8b3a3fba1e4a --- /dev/null +++ b/src/test/ui/issues/auxiliary/issue-49544.rs @@ -0,0 +1,7 @@ +#![crate_type = "lib"] + +pub fn foo() -> Vec { + std::env::args() + .skip(1) + .collect() +} diff --git a/src/test/ui/issues/issue-49544.rs b/src/test/ui/issues/issue-49544.rs new file mode 100644 index 0000000000000..ed356275fc135 --- /dev/null +++ b/src/test/ui/issues/issue-49544.rs @@ -0,0 +1,9 @@ +// aux-build:issue-49544.rs +// check-pass + +extern crate issue_49544; +use issue_49544::foo; + +fn main() { + let _ = foo(); +} From 92e4e8e7836e5a505dc466039135b75252e5b1f6 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 4 Aug 2019 21:22:42 +0900 Subject: [PATCH 3/3] Add test for issue-37433 --- src/test/ui/issues/issue-37433.rs | 8 ++++++++ src/test/ui/issues/issue-37433.stderr | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/test/ui/issues/issue-37433.rs create mode 100644 src/test/ui/issues/issue-37433.stderr diff --git a/src/test/ui/issues/issue-37433.rs b/src/test/ui/issues/issue-37433.rs new file mode 100644 index 0000000000000..784e6ccdac089 --- /dev/null +++ b/src/test/ui/issues/issue-37433.rs @@ -0,0 +1,8 @@ +#![feature(asm)] + +fn main() { + unsafe { + asm!("" :: "r"("")); + //~^ ERROR: invalid value for constraint in inline assembly + } +} diff --git a/src/test/ui/issues/issue-37433.stderr b/src/test/ui/issues/issue-37433.stderr new file mode 100644 index 0000000000000..af64193330198 --- /dev/null +++ b/src/test/ui/issues/issue-37433.stderr @@ -0,0 +1,8 @@ +error[E0669]: invalid value for constraint in inline assembly + --> $DIR/issue-37433.rs:5:24 + | +LL | asm!("" :: "r"("")); + | ^^ + +error: aborting due to previous error +