Rollup merge of #139341 - nnethercote:fix-137874, r=petrochenkov
Apply `Recovery::Forbidden` when reparsing pasted macro fragments. Fixes #137874. The changes to the output of `tests/ui/associated-consts/issue-93835.rs` partly undo the changes seen when `NtTy` was removed in #133436, which is good. r? ``@petrochenkov``
This commit is contained in:
commit
66ccc4fe28
7 changed files with 48 additions and 33 deletions
|
@ -676,12 +676,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
let ty =
|
||||
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::StaticTy));
|
||||
let safety = self.lower_safety(*safety, hir::Safety::Unsafe);
|
||||
|
||||
// njn: where for this?
|
||||
if define_opaque.is_some() {
|
||||
self.dcx().span_err(i.span, "foreign statics cannot define opaque types");
|
||||
}
|
||||
|
||||
(ident, hir::ForeignItemKind::Static(ty, *mutability, safety))
|
||||
}
|
||||
ForeignItemKind::TyAlias(box TyAlias { ident, .. }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue