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 10 pull requests #126979

Merged
merged 24 commits into from
Jun 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2a6a423
Change E0369 diagnostic give note information for foreign items.
surechen Jun 25, 2024
d9a3423
miri: make sure we can find link_section statics even for the local c…
RalfJung Jun 25, 2024
b6074ff
resolve: Tweak some naming around import ambiguities
petrochenkov Jun 25, 2024
6ba0a84
rewrite lto-empty to rmake
Oneirical Jun 25, 2024
fe2406b
rewrite invalid-so to rmake
Oneirical Jun 25, 2024
ee529b7
rewrite and rename issue-20626 to rmake
Oneirical Jun 25, 2024
6402909
delay bug in RPITIT refinement checking with resolution errors
lqd Jun 25, 2024
133e7b1
fix Drop items getting leaked in Filter::next_chunk
the8472 Jun 23, 2024
2be2d77
add comments explaining optimizations for Filter::next_chunk
the8472 Jun 24, 2024
0d7aef9
regression test for leaks in the the Filter::next_chunk implementation
the8472 Jun 25, 2024
275d922
Rename tcx to cx
compiler-errors Jun 21, 2024
efa48bf
Bump black, ruff and platformdirs
DianQK Jun 20, 2024
cf0251d
Fix a span in `parse_ty_bare_fn`.
nnethercote Jun 17, 2024
0addda6
Fix bad replacement for unsafe extern block suggestion
chenyukang Jun 26, 2024
dd6b046
Rollup merge of #126724 - nnethercote:fix-parse_ty_bare_fn-span, r=co…
matthiaskrgr Jun 26, 2024
dc22ffc
Rollup merge of #126812 - compiler-errors:tcx-cx, r=lcnr
matthiaskrgr Jun 26, 2024
cf22be1
Rollup merge of #126879 - the8472:next-chunk-filter-drop, r=cuviper
matthiaskrgr Jun 26, 2024
95332b8
Rollup merge of #126925 - surechen:fix_125631, r=compiler-errors
matthiaskrgr Jun 26, 2024
5c4ede8
Rollup merge of #126938 - RalfJung:link_section, r=compiler-errors
matthiaskrgr Jun 26, 2024
8b3bbee
Rollup merge of #126954 - petrochenkov:globamb, r=compiler-errors
matthiaskrgr Jun 26, 2024
bf8da39
Rollup merge of #126964 - Oneirical:total-catestrophe, r=Kobzol
matthiaskrgr Jun 26, 2024
8c6c6a7
Rollup merge of #126968 - lqd:issue-126670, r=compiler-errors
matthiaskrgr Jun 26, 2024
ee07d90
Rollup merge of #126971 - DianQK:bump, r=Kobzol
matthiaskrgr Jun 26, 2024
b272086
Rollup merge of #126973 - chenyukang:yukang-fix-126756-unsafe-suggest…
matthiaskrgr Jun 26, 2024
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
Prev Previous commit
Next Next commit
Fix a span in parse_ty_bare_fn.
It currently goes one token too far.

Example: line 259 of `tests/ui/abi/compatibility.rs`:
```
test_abi_compatible!(fn_fn, fn(), fn(i32) -> i32);
```
This commit changes the span for the second element from `fn(),` to
`fn()`, i.e. removes the extraneous comma.
nnethercote committed Jun 25, 2024
commit cf0251d92ced77d926a2292df96cb9ad3ce14f97
3 changes: 2 additions & 1 deletion compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
@@ -2126,7 +2126,8 @@ pub struct BareFnTy {
pub ext: Extern,
pub generic_params: ThinVec<GenericParam>,
pub decl: P<FnDecl>,
/// Span of the `fn(...) -> ...` part.
/// Span of the `[unsafe] [extern] fn(...) -> ...` part, i.e. everything
/// after the generic params (if there are any, e.g. `for<'a>`).
pub decl_span: Span,
}

2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/parser/ty.rs
Original file line number Diff line number Diff line change
@@ -608,7 +608,7 @@ impl<'a> Parser<'a> {
self.dcx().emit_err(FnPointerCannotBeAsync { span: whole_span, qualifier: span });
}
// FIXME(gen_blocks): emit a similar error for `gen fn()`
let decl_span = span_start.to(self.token.span);
let decl_span = span_start.to(self.prev_token.span);
Ok(TyKind::BareFn(P(BareFnTy { ext, safety, generic_params: params, decl, decl_span })))
}

2 changes: 1 addition & 1 deletion tests/ui/rust-2024/safe-outside-extern.gated.stderr
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ error: function pointers cannot be declared with `safe` safety qualifier
--> $DIR/safe-outside-extern.rs:24:14
|
LL | type FnPtr = safe fn(i32, i32) -> i32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 5 previous errors

2 changes: 1 addition & 1 deletion tests/ui/rust-2024/safe-outside-extern.ungated.stderr
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ error: function pointers cannot be declared with `safe` safety qualifier
--> $DIR/safe-outside-extern.rs:24:14
|
LL | type FnPtr = safe fn(i32, i32) -> i32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
--> $DIR/safe-outside-extern.rs:4:1