-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate issue-83112-incr-test-moved-file
, type-mismatch-same-crate-name
and issue-109934-lto-debuginfo
run-make
tests to rmake or ui
#127538
Merged
+78
−68
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
File renamed without changes.
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,27 @@ | ||
// The generated test harness code contains spans with a dummy location, | ||
// but a non-dummy SyntaxContext. Previously, the incremental cache was encoding | ||
// these spans as a full span (with a source file index), instead of skipping | ||
// the encoding of the location information. If the file gest moved, the hash | ||
// of the span will be unchanged (since it has a dummy location), so the incr | ||
// cache would end up try to load a non-existent file using the previously | ||
// enccoded source file id. | ||
// This test reproduces the steps that used to trigger this bug, and checks | ||
// for successful compilation. | ||
// See https://github.com/rust-lang/rust/issues/83112 | ||
|
||
//@ ignore-none | ||
// Reason: no-std is not supported | ||
//@ ignore-nvptx64-nvidia-cuda | ||
// FIXME: can't find crate for 'std' | ||
|
||
use run_make_support::{fs_wrapper, rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
fs_wrapper::create_dir("incr"); | ||
fs_wrapper::create_dir("src"); | ||
fs_wrapper::create_dir("src/mydir"); | ||
fs_wrapper::copy("main.rs", "src/main.rs"); | ||
rustc().input("src/main.rs").incremental("incr").arg("--test").run(); | ||
fs_wrapper::rename("src/main.rs", "src/mydir/main.rs"); | ||
rustc().input("src/mydir/main.rs").incremental("incr").arg("--test").run(); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
// When a compilation failure deals with seemingly identical types, some helpful | ||
// errors should be printed. | ||
// The main use case of this error is when there are two crates | ||
// (generally different versions of the same crate) with the same name | ||
// causing a type mismatch. In this test, one of the crates | ||
// is only introduced as an indirect dependency and the type is accessed via a reexport. | ||
// See https://github.com/rust-lang/rust/pull/42826 | ||
|
||
use run_make_support::{rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().crate_type("rlib").input("crateA.rs").metadata("-1").extra_filename("-1").run(); | ||
rustc().crate_type("rlib").input("crateA.rs").metadata("-2").extra_filename("-2").run(); | ||
rustc() | ||
.crate_type("rlib") | ||
.input("crateB.rs") | ||
.extern_("crateA", rust_lib_name("crateA-1")) | ||
.run(); | ||
rustc() | ||
.input("crateC.rs") | ||
.extern_("crateA", rust_lib_name("crateA-2")) | ||
.run_fail() | ||
.assert_stderr_contains("mismatched types") | ||
.assert_stderr_contains("crateB::try_foo(foo2);") | ||
.assert_stderr_contains("different versions of crate `crateA`") | ||
.assert_stderr_contains("crateB::try_bar(bar2);") | ||
.assert_stderr_contains("expected trait `crateA::bar::Bar`, found trait `Bar`") | ||
.assert_stderr_contains("different versions of crate `crateA`"); | ||
} |
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,22 @@ | ||
// With the upgrade to LLVM 16, the following error appeared when using | ||
// link-time-optimization (LTO) alloc and debug compilation mode simultaneously: | ||
// | ||
// error: Cannot represent a difference across sections | ||
// | ||
// The error stemmed from DI function definitions under type scopes, fixed by | ||
// only declaring in type scope and defining the subprogram elsewhere. | ||
// This test reproduces the circumstances that caused the error to appear, and checks | ||
// that compilation is successful. | ||
|
||
//@ check-pass | ||
//@ compile-flags: --test -C debuginfo=2 -C lto=fat -C incremental=inc-fat | ||
|
||
extern crate alloc; | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn something_alloc() { | ||
assert_eq!(Vec::<u32>::new(), Vec::<u32>::new()); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the case, let's keep it as a rmake.rs test for now, can you please leave a remark about your finding in case someone tries to port it to ui tests? (We could try to fix ui tests not cleaning this up in another PR, but I'm also fine with leaving it as a rmake.rs test if it does something that's "more special" than ui tests, i.e. I don't want to shoehorn it into ui tests if rmake.rs is less friction).