forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#78742 - vn-ki:fix-issue-78655, r=oli-obk
make intern_const_alloc_recursive return error fix rust-lang#78655 r? `@oli-obk`
- Loading branch information
Showing
11 changed files
with
66 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const FOO: *const u32 = { //~ ERROR encountered dangling pointer in final constant | ||
let x; | ||
&x //~ ERROR borrow of possibly-uninitialized variable: `x` | ||
}; | ||
|
||
fn main() { | ||
let FOO = FOO; | ||
//~^ ERROR could not evaluate constant pattern | ||
//~| ERROR could not evaluate constant pattern | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error[E0381]: borrow of possibly-uninitialized variable: `x` | ||
--> $DIR/issue-78655.rs:3:5 | ||
| | ||
LL | &x | ||
| ^^ use of possibly-uninitialized `x` | ||
|
||
error: encountered dangling pointer in final constant | ||
--> $DIR/issue-78655.rs:1:1 | ||
| | ||
LL | / const FOO: *const u32 = { | ||
LL | | let x; | ||
LL | | &x | ||
LL | | }; | ||
| |__^ | ||
|
||
error: could not evaluate constant pattern | ||
--> $DIR/issue-78655.rs:7:9 | ||
| | ||
LL | let FOO = FOO; | ||
| ^^^ | ||
|
||
error: could not evaluate constant pattern | ||
--> $DIR/issue-78655.rs:7:9 | ||
| | ||
LL | let FOO = FOO; | ||
| ^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0381`. |