-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #69748 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] another round of backports for 1.42 This backports the following pull requests: * Fix a leak in `DiagnosticBuilder::into_diagnostic`. #69628 * stash API: remove panic to fix ICE. #69623 * Do not ICE on invalid type node after parse recovery #69583 * Backport only: avoid ICE on bad placeholder type #69324 * add regression test for issue #68794 #69168 * Update compiler-builtins to 0.1.25 #69086 * Update RELEASES.md for 1.42.0 #68989
- Loading branch information
Showing
19 changed files
with
257 additions
and
772 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
17 changes: 17 additions & 0 deletions
17
src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile
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,17 @@ | ||
# Regression test for issue #68794 | ||
# | ||
# Verify that no text relocations are accidentally introduced by linking a | ||
# minimal rust staticlib. | ||
# | ||
# The test links a rust static library into a shared library, and checks that | ||
# the linker doesn't have to flag the resulting file as containing TEXTRELs. | ||
|
||
-include ../tools.mk | ||
|
||
# only-linux | ||
|
||
all: | ||
$(RUSTC) foo.rs | ||
$(CC) bar.c $(call STATICLIB,foo) -fPIC -shared -o $(call DYLIB,bar) \ | ||
$(EXTRACFLAGS) $(EXTRACXXFLAGS) | ||
readelf -d $(call DYLIB,bar) | grep TEXTREL; test $$? -eq 1 |
6 changes: 6 additions & 0 deletions
6
src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/bar.c
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,6 @@ | ||
void foo(); | ||
|
||
int main() { | ||
foo(); | ||
return 0; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/foo.rs
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,8 @@ | ||
#![crate_type = "staticlib"] | ||
|
||
#[no_mangle] | ||
pub extern "C" fn foo(x: u32) { | ||
// using the println! makes it so that enough code from the standard | ||
// library is included (see issue #68794) | ||
println!("foo: {}", x); | ||
} |
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,17 @@ | ||
macro_rules! suite { | ||
( $( $fn:ident; )* ) => { | ||
$( | ||
const A = "A".$fn(); | ||
//~^ ERROR the name `A` is defined multiple times | ||
//~| ERROR missing type for `const` item | ||
//~| ERROR the type placeholder `_` is not allowed within types | ||
)* | ||
} | ||
} | ||
|
||
suite! { | ||
len; | ||
is_empty; | ||
} | ||
|
||
fn main() {} |
48 changes: 48 additions & 0 deletions
48
src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr
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,48 @@ | ||
error[E0428]: the name `A` is defined multiple times | ||
--> $DIR/issue-69396-const-no-type-in-macro.rs:4:13 | ||
| | ||
LL | const A = "A".$fn(); | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| `A` redefined here | ||
| previous definition of the value `A` here | ||
... | ||
LL | / suite! { | ||
LL | | len; | ||
LL | | is_empty; | ||
LL | | } | ||
| |_- in this macro invocation | ||
| | ||
= note: `A` must be defined only once in the value namespace of this module | ||
|
||
error: missing type for `const` item | ||
--> $DIR/issue-69396-const-no-type-in-macro.rs:4:19 | ||
| | ||
LL | const A = "A".$fn(); | ||
| ^ help: provide a type for the item: `A: usize` | ||
... | ||
LL | / suite! { | ||
LL | | len; | ||
LL | | is_empty; | ||
LL | | } | ||
| |_- in this macro invocation | ||
|
||
error[E0121]: the type placeholder `_` is not allowed within types on item signatures | ||
--> $DIR/issue-69396-const-no-type-in-macro.rs:4:19 | ||
| | ||
LL | const A = "A".$fn(); | ||
| ^ | ||
| | | ||
| not allowed in type signatures | ||
| help: replace `_` with the correct type: `bool` | ||
... | ||
LL | / suite! { | ||
LL | | len; | ||
LL | | is_empty; | ||
LL | | } | ||
| |_- in this macro invocation | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0121, E0428. | ||
For more information about an error, try `rustc --explain E0121`. |
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
Oops, something went wrong.