diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-11-22 00:01:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-22 00:01:10 +0100 |
| commit | 9cefd9dd29a918e26f10df08eaef401cd5d651e4 (patch) | |
| tree | 923133215087329acc06f6c49a7f94fcbf8383e9 /src | |
| parent | 89be53d596210cf487d73507ef682af7d3f72944 (diff) | |
| parent | fec6ffc8164692c9acc64078126275a2c2b99bcb (diff) | |
| download | rust-9cefd9dd29a918e26f10df08eaef401cd5d651e4.tar.gz rust-9cefd9dd29a918e26f10df08eaef401cd5d651e4.zip | |
Rollup merge of #104657 - hi-rustin:rustin-patch-check-transmute, r=compiler-errors
Do not check transmute if has non region infer close https://github.com/rust-lang/rust/issues/104609 See: https://github.com/rust-lang/rust/issues/104609#issuecomment-1320956351 r? `@compiler-errors`
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/consts/issue-104609.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/consts/issue-104609.stderr | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/consts/issue-104609.rs b/src/test/ui/consts/issue-104609.rs new file mode 100644 index 00000000000..01fd1c48cf8 --- /dev/null +++ b/src/test/ui/consts/issue-104609.rs @@ -0,0 +1,10 @@ +fn foo() { + oops; + //~^ ERROR: cannot find value `oops` in this scope +} + +unsafe fn bar() { + std::mem::transmute::<_, *mut _>(1_u8); +} + +fn main() {} diff --git a/src/test/ui/consts/issue-104609.stderr b/src/test/ui/consts/issue-104609.stderr new file mode 100644 index 00000000000..00360c44d61 --- /dev/null +++ b/src/test/ui/consts/issue-104609.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `oops` in this scope + --> $DIR/issue-104609.rs:2:5 + | +LL | oops; + | ^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. |
