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

Rollup of 8 pull requests #101733

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
315d12d
Fix ReErased leaking into typeck due to typeof recovery
compiler-errors Aug 5, 2022
890e759
Move `Spacing` out of `AttrAnnotatedTokenStream`.
nnethercote Sep 9, 2022
a56d345
Rename `AttrAnnotatedToken{Stream,Tree}`.
nnethercote Sep 9, 2022
208ca93
Change return type of `Attribute::tokens`.
nnethercote Sep 9, 2022
81eaf87
Tweak some formatting.
nnethercote Sep 9, 2022
f6c9e1d
Inline and remove `TokenStream::opt_from_ast`.
nnethercote Sep 9, 2022
d2df07c
Rename `{Create,Lazy}TokenStream` as `{To,Lazy}AttrTokenStream`.
nnethercote Sep 9, 2022
2126622
Add test for #101211
winxpqq955 Sep 11, 2022
bd54846
A SubstitutionPart is not a deletion if it replaces nothing with nothing
compiler-errors Sep 11, 2022
3bf33c3
Don't trim substitution if it's only whitespace
compiler-errors Sep 11, 2022
cb02b64
constify `CStr` methods
WaffleLapkin Aug 8, 2022
2b7fb8d
Impove diagnostic for .await-ing non-futures
Sep 12, 2022
9139891
Allow unauthenticated users to add the `const-hack` label
fee1-dead Sep 12, 2022
84ca399
rustdoc: improve rustdoc HTML suggestions handling of nested generics
notriddle Sep 12, 2022
81ea7fe
Rollup merge of #100185 - compiler-errors:issue-100183, r=wesleywiser
GuillaumeGomez Sep 12, 2022
003efd1
Rollup merge of #100291 - WaffleLapkin:cstr_const_methods, r=oli-obk
GuillaumeGomez Sep 12, 2022
84fa199
Rollup merge of #101602 - nnethercote:AttrTokenStream, r=petrochenkov
GuillaumeGomez Sep 12, 2022
ba287f8
Rollup merge of #101677 - winxpqq955:issue-101211, r=fee1-dead
GuillaumeGomez Sep 12, 2022
091e699
Rollup merge of #101700 - compiler-errors:deletion-span, r=davidtwco
GuillaumeGomez Sep 12, 2022
5233f68
Rollup merge of #101723 - lukas-code:await-diag, r=compiler-errors
GuillaumeGomez Sep 12, 2022
c75f513
Rollup merge of #101724 - fee1-dead-contrib:triage-const-hack, r=oli-obk
GuillaumeGomez Sep 12, 2022
c8d5541
Rollup merge of #101731 - notriddle:notriddle/more-improved-html-chec…
GuillaumeGomez Sep 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix ReErased leaking into typeck due to typeof recovery
compiler-errors committed Aug 5, 2022
commit 315d12d73d511efb277426c813e5d40157a0d70a
5 changes: 4 additions & 1 deletion compiler/rustc_typeck/src/astconv/mod.rs
Original file line number Diff line number Diff line change
@@ -2667,7 +2667,10 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
self.normalize_ty(ast_ty.span, array_ty)
}
hir::TyKind::Typeof(ref e) => {
let ty = tcx.type_of(tcx.hir().local_def_id(e.hir_id));
let ty_erased = tcx.type_of(tcx.hir().local_def_id(e.hir_id));
let ty = tcx.fold_regions(ty_erased, |r, _| {
if r.is_erased() { tcx.lifetimes.re_static } else { r }
});
let span = ast_ty.span;
tcx.sess.emit_err(TypeofReservedKeywordUsed {
span,
6 changes: 6 additions & 0 deletions src/test/ui/typeof/issue-100183.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
struct Struct {
y: (typeof("hey"),),
//~^ ERROR `typeof` is a reserved keyword but unimplemented
}

fn main() {}
14 changes: 14 additions & 0 deletions src/test/ui/typeof/issue-100183.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0516]: `typeof` is a reserved keyword but unimplemented
--> $DIR/issue-100183.rs:2:9
|
LL | y: (typeof("hey"),),
| ^^^^^^^^^^^^^ reserved keyword
|
help: consider replacing `typeof(...)` with an actual type
|
LL | y: (&'static str,),
| ~~~~~~~~~~~~

error: aborting due to previous error

For more information about this error, try `rustc --explain E0516`.