-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Record
expansion_that_defined
into crate metadata
Fixes #77523 Now that hygiene serialization is implemented, we also need to record `expansion_that_defined` so that we properly handle a foreign `SyntaxContext`.
- Loading branch information
Showing
9 changed files
with
66 additions
and
2 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
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,7 @@ | ||
// edition:2018 | ||
|
||
extern crate opaque_hygiene; | ||
|
||
pub async fn serve() { | ||
opaque_hygiene::make_it!(); | ||
} |
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,21 @@ | ||
// force-host | ||
// no-prefer-dynamic | ||
|
||
#![feature(proc_macro_quote)] | ||
#![crate_type = "proc-macro"] | ||
|
||
extern crate proc_macro; | ||
use proc_macro::{TokenStream, quote}; | ||
|
||
#[proc_macro] | ||
pub fn make_it(input: TokenStream) -> TokenStream { | ||
// `quote!` applies def-site hygiene | ||
quote! { | ||
trait Foo { | ||
fn my_fn(&self) {} | ||
} | ||
|
||
impl<T> Foo for T {} | ||
"a".my_fn(); | ||
} | ||
} |
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,19 @@ | ||
// build-pass | ||
// aux-build:opaque-hygiene.rs | ||
// aux-build:def-site-async-await.rs | ||
|
||
// Regression test for issue #77523 | ||
// Tests that we don't ICE when an unusual combination | ||
// of def-site hygiene and cross-crate monomorphization occurs. | ||
|
||
extern crate def_site_async_await; | ||
|
||
use std::future::Future; | ||
|
||
fn mk_ctxt() -> std::task::Context<'static> { | ||
panic!() | ||
} | ||
|
||
fn main() { | ||
Box::pin(def_site_async_await::serve()).as_mut().poll(&mut mk_ctxt()); | ||
} |