Skip to content

Commit

Permalink
Implement *inlined* refined syntax for structs (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilehmann authored Nov 15, 2023
1 parent 97bb10c commit 6f00769
Show file tree
Hide file tree
Showing 2 changed files with 297 additions and 11 deletions.
5 changes: 3 additions & 2 deletions crates/flux-driver/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rustc_hir::{
EnumDef, ImplItemKind, Item, ItemKind, OwnerId, VariantData,
};
use rustc_middle::ty::{ScalarInt, TyCtxt};
use rustc_span::{Span, Symbol};
use rustc_span::{Span, Symbol, SyntaxContext};

pub(crate) struct SpecCollector<'tcx, 'a> {
tcx: TyCtxt<'tcx>,
Expand Down Expand Up @@ -490,7 +490,8 @@ impl<'tcx, 'a> SpecCollector<'tcx, 'a> {
parser: impl FnOnce(&mut ParseSess, &TokenStream, Span) -> ParseResult<T>,
ctor: impl FnOnce(T) -> FluxAttrKind,
) -> Result<FluxAttrKind, ErrorGuaranteed> {
parser(&mut self.parse_sess, &dargs.tokens, dargs.dspan.entire())
let entire = dargs.dspan.entire().with_ctxt(SyntaxContext::root());
parser(&mut self.parse_sess, &dargs.tokens, entire)
.map(ctor)
.map_err(|err| self.emit_err(errors::SyntaxErr::from(err)))
}
Expand Down
Loading

0 comments on commit 6f00769

Please sign in to comment.