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

Add warning if a resolution failed #49542

Merged
merged 6 commits into from
Apr 17, 2018

Conversation

GuillaumeGomez
Copy link
Member

@oli-obk
Copy link
Contributor

oli-obk commented Mar 31, 2018

Can you add a ui test showing the new warnings?

@GuillaumeGomez
Copy link
Member Author

Good idea!

@GuillaumeGomez GuillaumeGomez force-pushed the intra-link-resolution-error branch 2 times, most recently from e507a56 to dc4a9ea Compare April 1, 2018 19:11

fn make_run(run: RunConfig) {
let compiler = run.builder.compiler(run.builder.top_stage, run.host);
run.builder.ensure(tool::Rustdoc {
Copy link
Member

Choose a reason for hiding this comment

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

No need for this as builder.rustdoc below will take care of it for you.

Copy link
Member Author

Choose a reason for hiding this comment

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

Where?

Copy link
Member

Choose a reason for hiding this comment

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

cmd.arg("--rustdoc-path").arg(builder.rustdoc(compiler.host)); on what might be 898 -- that call to rustdoc will auto-ensure it for you, so you shouldn't need this.

@GuillaumeGomez
Copy link
Member Author

Updated (I also added some useful options to rustdoc).

@@ -0,0 +1,6 @@
warning: [src] cannot be resolved, ignoring it...
Copy link
Contributor

Choose a reason for hiding this comment

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

What's with this src thing?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's actually a good question... Looking where it's coming from.

@@ -514,6 +514,44 @@ impl Step for RustdocJS {
}
}

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct RustdocUi {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a lot of code for very few tests. I was hoping we could somehow express this in the regular ui tests by inserting some flags via comments in the test?

Copy link
Member

Choose a reason for hiding this comment

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

As would i, but (as far as i know) there's no facility in compiletest to swap out which binary is called for a specific test - only which arguments are passed. In addition, we would have to tell bootstrap to have rustdoc ready for the UI tests, even if someone is trying to run a specific non-rustdoc test.

Plus, we wanted to introduce UI tests for rustdoc at some point anyway. >_> Having them in a separate test directory will help us when we add more over time.

Copy link
Member Author

Choose a reason for hiding this comment

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

We need to have a struct directly to bind the test folder path.

@@ -1160,6 +1160,10 @@ enum PathKind {
Type,
}

fn resolution_failure(cx: &DocContext, path_str: &str) {
cx.sess().warn(&format!("[{}] cannot be resolved, ignoring it...", path_str));
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there spans available that we can use to report the warnings?

Copy link
Member Author

Choose a reason for hiding this comment

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

It'll be part of another pr. I think this one is already big enough.

..config::basic_options().clone()
};

let codemap = Lrc::new(codemap::CodeMap::new(sessopts.file_path_mapping()));
let diagnostic_handler = errors::Handler::with_tty_emitter(ColorConfig::Auto,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of these changes?

Copy link
Member Author

Choose a reason for hiding this comment

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

Allow rustdoc output to be checked through UI test suite.

@GuillaumeGomez
Copy link
Member Author

Fixed a few comments.

@pietroalbini pietroalbini added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 2, 2018
@@ -47,7 +47,7 @@
//! development you may want to press the **[-]** button near the top of the
//! page to collapse it into a more skimmable view.
//!
//! While you are looking at that **[-]** button also notice the **[src]**
//! While you are looking at that **[-]** button also notice the `[src]`
Copy link
Member

Choose a reason for hiding this comment

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

It's probably worth changing the [-] references to also use backticks, just so they're all using the same style.

@QuietMisdreavus
Copy link
Member

The rustdoc changes look good to me, but i'm less certain about the changes to bootstrap and compiletest. I'd like some extra eyes to look at those bits.

@GuillaumeGomez
Copy link
Member Author

cc @oli-obk

@@ -514,6 +514,41 @@ impl Step for RustdocJS {
}
}

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct RustdocUi {
Copy link
Member

Choose a reason for hiding this comment

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

This struct should be replaceable with a host_test! macro invocation I believe.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to at first to avoid writing code by hand, but failed... I can't only rely on UI or rustdoc test suite, I need a mix of the two.

@@ -276,6 +276,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
),
};

let src_base = opt_path(matches, "src-base");
let run_ignored = matches.opt_present("ignored");
Copy link
Member

Choose a reason for hiding this comment

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

Avoiding these changes seems good for consistency's sake.

Copy link
Member Author

Choose a reason for hiding this comment

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

How would you do it?

Copy link
Member

Choose a reason for hiding this comment

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

Er, this file should be possible to leave as-is: both changes were simply extracted from struct's definition AFAICT.

rustc.args(&["-Z", "incremental-verify-ich"]);
rustc.args(&["-Z", "incremental-queries"]);
}
println!("{:?}", is_rustdoc);
Copy link
Member

Choose a reason for hiding this comment

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

Leftover debugging code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops indeed!

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

ups, forgot to submit this review...

// except according to those terms.

#![deny(warnings)]

Copy link
Contributor

Choose a reason for hiding this comment

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

Why isn't this deny warnings failing the test?

Copy link
Member Author

Choose a reason for hiding this comment

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

It hasn't been implemented in rustdoc (yet?). I'll remove this line.

} else {
vec!["-Crpath".to_string()]
};
if !is_rustdoc_ui {
Copy link
Contributor

Choose a reason for hiding this comment

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

Merge the if below into this one

}

fn make_run(run: RunConfig) {
let compiler = run.builder.compiler(run.builder.top_stage, run.host);
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to make this depend on rustdoc. Otherwise rustdoc might not be available when running the tests. A call to ensure should suffice

Copy link
Member Author

Choose a reason for hiding this comment

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

Apparently it's done correctly (or at least that's what I understood from @Mark-Simulacrum's comment).

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this is fine as is, we depend on rustdoc below when we pass it's path.

@GuillaumeGomez
Copy link
Member Author

Updated.

@GuillaumeGomez
Copy link
Member Author

Anyone? cc @oli-obk @Mark-Simulacrum @QuietMisdreavus

@Mark-Simulacrum
Copy link
Member

r=me on bootstrap changes

@GuillaumeGomez
Copy link
Member Author

@bors: r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Apr 14, 2018

📌 Commit ae4c6d0 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 14, 2018
@bors
Copy link
Contributor

bors commented Apr 14, 2018

🔒 Merge conflict

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 14, 2018
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 15, 2018
@bors
Copy link
Contributor

bors commented Apr 15, 2018

⌛ Testing commit 4b7f4cc with merge f6d0bfd...

bors added a commit that referenced this pull request Apr 15, 2018
…Mark-Simulacrum

Add warning if a resolution failed

r? @QuietMisdreavus
@bors
Copy link
Contributor

bors commented Apr 15, 2018

💔 Test failed - status-appveyor

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 15, 2018
@GuillaumeGomez
Copy link
Member Author

The appveyor tests output just end on running 692 tests. So I have no idea if it's a "normal" failure or not...

@bors
Copy link
Contributor

bors commented Apr 16, 2018

☔ The latest upstream changes (presumably #49956) made this pull request unmergeable. Please resolve the merge conflicts.

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2018
@kennytm
Copy link
Member

kennytm commented Apr 16, 2018

@GuillaumeGomez That looks like just a spurious 3-hour timeout. But now you need to rebase anyway...

@GuillaumeGomez
Copy link
Member Author

Rebased, let's go again!

@bors: r+ p=11

@bors
Copy link
Contributor

bors commented Apr 17, 2018

📌 Commit 05275da has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 17, 2018
@bors
Copy link
Contributor

bors commented Apr 17, 2018

⌛ Testing commit 05275da with merge 8728c7a...

bors added a commit that referenced this pull request Apr 17, 2018
…GuillaumeGomez

Add warning if a resolution failed

r? @QuietMisdreavus
@bors
Copy link
Contributor

bors commented Apr 17, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: GuillaumeGomez
Pushing 8728c7a to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants