Skip to content
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

Fix error message in test, run tests on AppVeyor #120

Merged
merged 4 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ environment:
CHANNEL: nightly
- TARGET: x86_64-pc-windows-msvc
CHANNEL: nightly
- TARGET: x86_64-pc-windows-gnu
CHANNEL: stable
- TARGET: x86_64-pc-windows-msvc
CHANNEL: stable

install:
- curl -sSf -o rustup-init.exe https://win.rustup.rs
Expand All @@ -20,8 +16,8 @@ build: false

test_script:
- if %CHANNEL%==stable (cargo build --features stable) else (cargo build)
- cd test-project && if %CHANNEL%==stable (cargo test --features stable) else (cargo test)

branches:
only:
- master

4 changes: 2 additions & 2 deletions test-project/tests/compile-fail/trait-bounds-cant-coerce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fn c(x: Box<Foo+Sync+Send>) {
fn d(x: Box<Foo>) {
a(x); //~ ERROR mismatched types
//~| expected trait `Foo + std::marker::Send`, found trait `Foo`
//~| expected type `std::boxed::Box<Foo + std::marker::Send + 'static>`
//~| found type `std::boxed::Box<Foo + 'static>`
//~| expected type `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>`
//~| found type `std::boxed::Box<(dyn Foo + 'static)>`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix seems simple, but I don't really understand why this is the fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just what the latest nighty rustc outputs... they probably changed the text of the message.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting... That means that even if you write Box<Trait> the error message is going to write Box<dyn Trait> (or is it Box<(dyn Trait)>?). I wonder if that's intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks strange, indeed... I assumed that here we are testing that compiletest matches errors correctly, not that rustc produces the correct message.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I just copied some tests from rustc's test suite when developing the test project - it was just to verify that things worked as expected, and for use as a future benchmark.

I think it's a result of the "dyn everywhere" approach: rust-lang/rust@4b18085. In particular: https://github.com/rust-lang/rust/blob/master/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr.

}

fn main() { }
2 changes: 1 addition & 1 deletion test-project/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn run_mode(mode: &'static str) {

config.mode = cfg_mode;
config.src_base = PathBuf::from(format!("tests/{}", mode));
config.link_deps();
config.target_rustcflags = Some("-L target/debug -L target/debug/deps".to_string());
config.clean_rmeta();

compiletest::run_tests(&config);
Expand Down