-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Avoid ICE when include! is used by stdin crate #65603
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
src/libsyntax_expand/base.rs
Outdated
@@ -1072,7 +1072,8 @@ impl<'a> ExtCtxt<'a> { | |||
/// This unifies the logic used for resolving `include_X!`, and `#[doc(include)]` file paths. | |||
/// | |||
/// Returns an absolute path to the file that `path` refers to. | |||
pub fn resolve_path(&self, path: impl Into<PathBuf>, span: Span) -> PathBuf { | |||
pub fn resolve_path(&self, path: impl Into<PathBuf>, span: Span) | |||
-> Result<PathBuf, DiagnosticBuilder<'a>> { |
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.
Please use the same formatting as the method below.
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.
OK. Wasn't sure what style to use, so copied from this method: https://github.com/rust-lang/rust/blob/0b97ef8d5f78ea7144dbc2afb0ff3e055fb5056a/src/libsyntax_expand/base.rs#L1126-L1127
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
a2aee5f
to
0b97ef8
Compare
This should also eliminate the ICE when using `include_bytes!`, `include_str!` and `#[doc(include = "...")]`. Fixes rust-lang#63900
0b97ef8
to
9be0bd8
Compare
@bors r+ |
📌 Commit 9be0bd8 has been approved by |
…nkov Avoid ICE when include! is used by stdin crate This should hopefully also eliminate the ICE when using `include_bytes!`, `include_str!` and `#[doc(include = "...")]` with a stdio input. I couldn't see a clear way to write a compile-fail test using compiletest with a stdio input, so I haven't written any tests for this change. Fixes rust-lang#63900
Rollup of 8 pull requests Successful merges: - #65314 (rustdoc: forward -Z options to rustc) - #65592 (clarify const_prop ICE protection comment) - #65603 (Avoid ICE when include! is used by stdin crate) - #65614 (Improve error message for APIT with explicit generic arguments) - #65629 (Remove `borrowck_graphviz_postflow` from test) - #65633 (Remove leading :: from paths in doc examples) - #65638 (Rename the default argument 'def' to 'default') - #65639 (Fix parameter name in documentation) Failed merges: r? @ghost
This should hopefully also eliminate the ICE when using
include_bytes!
,include_str!
and#[doc(include = "...")]
with a stdio input.I couldn't see a clear way to write a compile-fail test using compiletest with a stdio input, so I haven't written any tests for this change.
Fixes #63900