Michael Goulet
8a830cf182
Rollup merge of #106935 - TaKO8Ki:fix-104440, r=cjgillot
...
Fix `SingleUseLifetime` ICE
Fixes #104440
cc: ``@matthiaskrgr``
2023-01-21 23:21:00 -05:00
bors
94a300b9b8
Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
...
Check ADT fields for copy implementations considering regions
Fixes #88901
r? `@ghost`
2023-01-20 21:29:52 +00:00
Scott McMurray
925dc37313
Stop using BREAK
& CONTINUE
in compiler
...
Switching them to `Break(())` and `Continue(())` instead.
libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-17 23:17:51 -08:00
Matthias Krüger
68f12338af
Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726
...
Remove double spaces after dots in comments
Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17 20:21:25 +01:00
Dylan DPC
f91f369949
Rollup merge of #106148 - chenyukang:yukang/fix-105061-unused, r=lcnr
...
Fix unused_parens issue for higher ranked function pointers
fixes #105061
r? `@lcnr`
2023-01-17 20:33:03 +05:30
Maybe Waffle
6a28fb42a8
Remove double spaces after dots in comments
2023-01-17 08:09:33 +00:00
yukang
9d74bb832f
comments feedback
2023-01-16 20:44:14 +08:00
Takayuki Maeda
fe96c11aba
fix #104440
2023-01-16 21:06:34 +09:00
Matthias Krüger
8bd67dd12d
Rollup merge of #106906 - matthiaskrgr:clone, r=Nilstrieb
...
remove redundant clones
2023-01-15 21:17:35 +01:00
Matthias Krüger
665d4ea98d
remove redundant clones
2023-01-15 15:02:02 +01:00
clubby789
295f5483fe
Fix regression in unused_braces
with macros
2023-01-15 05:08:30 +00:00
clubby789
4f64de83bc
Fix unused_braces
on generic const expr macro call
2023-01-14 15:49:08 +00:00
yukang
c67903ef21
fix issues in unused lint
2023-01-14 17:11:04 +08:00
yukang
7d99866bfc
fix #105061 , Fix unused_parens issue for higher ranked function pointers
2023-01-14 17:11:04 +08:00
Michael Goulet
8cf7f40a89
Check ADT fields for copy implementations considering regions
2023-01-13 23:06:29 +00:00
bors
0b90256ada
Auto merge of #106776 - oli-obk:om_nom_nom_nom_nom, r=cjgillot
...
Feed a bunch of queries instead of tracking fields on TyCtxt
r? `@cjgillot`
pulled out of https://github.com/rust-lang/rust/pull/105462
2023-01-13 13:57:21 +00:00
bors
bfffe406fb
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
...
Migrate `rustc_lint` lint diagnostics
Part 2 of [Migrate `rustc_lint` errors to `SessionDiagnostic`](https://github.com/rust-lang/rust/pull/100776 )
r? `@davidtwco`
# TODO
- [x] Refactor some lints manually implementing `DecorateLint` to use `Option<Subdiagnostic>`.
- [x] Add `#[rustc_lint_diagnostics]` to lint functions in `context.rs`.
- [x] Migrate `hidden_unicode_codepoints.rs`.
- [x] Migrate `UnsafeCode` in `builtin.rs`.
- [x] Migrate the rest of `builtin.rs`.
2023-01-13 02:13:00 +00:00
Oli Scherer
d36db0d2a0
Feed the features_query
instead of grabbing it from the session lazily
2023-01-12 17:14:17 +00:00
Arthur Carcano
797f247997
Mark ZST as FFI-safe if all its fields are PhantomData
...
Modify the linting behavior and add the corresponding
regression test
2023-01-12 12:21:35 +01:00
bors
8ecaad85f6
Auto merge of #105919 - uweigand:s390x-stack-overflow, r=Nilstrieb
...
Fix stack overflow in recursive AST walk in early lint
The src/test/ui/issues/issue-74564-if-expr-stack-overflow.rs test case added to verify https://github.com/rust-lang/rust/issues/74564 still crashes with a stack overflow on s390x-ibm-linux.
Symptom is a very deep recursion in compiler/rustc_lint/src/early.rs:
fn visit_expr(&mut self, e: &'a ast::Expr) {
self.with_lint_attrs(e.id, &e.attrs, |cx| {
lint_callback!(cx, check_expr, e);
ast_visit::walk_expr(cx, e);
})
}
(where walk_expr recursively calls back into visit_expr). The crash happens at a nesting depth of over 17000 stack frames when using the default 8 MB stack size on s390x.
This patch fixes the problem by adding a ensure_sufficient_stack call to the with_lint_attrs routine (which also should take care of all the other mutually recursive visitors here).
Fixes part of https://github.com/rust-lang/rust/issues/105383 .
2023-01-11 08:50:38 +00:00
Rejyr
88e5dd2530
refactor: cleanup
2023-01-09 18:57:02 -05:00
Rejyr
fe09291036
migrate: deref_into_dyn_supertrait.rs
2023-01-09 18:57:02 -05:00
Rejyr
f38db48dbd
add: allow lints in lints.rs
2023-01-09 18:57:02 -05:00
Rejyr
758140e196
migrate: rest of builtin.rs
without builtin_asm_labels
2023-01-09 18:56:59 -05:00
Rejyr
587d49766b
migrate: UnsafeCode
in builtin.rs
2023-01-09 17:07:25 -05:00
Rejyr
c06a2426b2
migrate: hidden_unicode_codepoints.rs
2023-01-09 17:07:25 -05:00
Rejyr
ce72f942d7
add: #[rustc_lint_diagnostics]
for more context.rs
functions.
2023-01-09 17:07:25 -05:00
Rejyr
78fce795d8
refactor: refactor to derive for some lints.
2023-01-09 17:07:25 -05:00
Rejyr
ca7df9a2a9
migrate: for_loops_over_fallibles.rs
2023-01-09 17:07:25 -05:00
Rejyr
3c1a1f3643
migrate: expect.rs
2023-01-09 17:07:25 -05:00
Rejyr
6ffecd2059
migrate(wip): builtin.rs
2023-01-09 17:07:25 -05:00
Rejyr
0b19227524
migrate: internal.rs
2023-01-09 17:07:25 -05:00
Rejyr
5ffaae758e
migrate: ImproperCTypes
2023-01-09 17:07:25 -05:00
Rejyr
e610047940
migrate: let_underscore.rs
...
fix: NonBindingLetSub
2023-01-09 17:07:25 -05:00
Rejyr
80df25e160
migrate: levels.rs
2023-01-09 17:07:25 -05:00
Rejyr
ab66ea61cf
add: emit{,_spanned}_lint
for LintLevelsBuilder
...
add: `emit_spanned_lint` and `emit_lint` for `LintLevelsBuilder`
migrate: `DeprecatedLintName`
2023-01-09 17:07:25 -05:00
Rejyr
f9289c35fb
refactor: comment about lint location
2023-01-09 17:07:25 -05:00
Rejyr
a0614ec2c3
fix: merge conflict
2023-01-09 17:07:25 -05:00
Rejyr
dc00aa3114
update: lints.rs
for renamed traits
...
update: `lints.rs` for renamed `SessionSubdiagnostic` and `AddSubdiagnostic`
fix: NonSnakeCaseDiagSub
fix: OverflowingBinHexSign
2023-01-09 17:07:25 -05:00
Rejyr
e3bb2ebfbf
add: lints
for errors.rs
2023-01-09 17:07:25 -05:00
Rejyr
8b897bbce6
migrate: early.rs
and enum_intrinsics_non_enums.rs
2023-01-09 17:07:25 -05:00
Rejyr
c63ba52562
migrate: array_into_iter.rs
2023-01-09 17:07:25 -05:00
Rejyr
95d3e0cb78
migrate: methods.rs
2023-01-09 17:07:25 -05:00
Rejyr
3f69c1b523
migrate: non_ascii_idents.rs
2023-01-09 17:07:25 -05:00
Rejyr
384010b9f4
migrate: non_fmt_panic.rs
2023-01-09 17:07:25 -05:00
Rejyr
a9bbe31519
migrate: nonstandard_style.rs
2023-01-09 17:07:25 -05:00
Rejyr
56fc66d196
migrate: noop_method_call.rs
2023-01-09 17:07:25 -05:00
Rejyr
6fb3a38f9b
migrate: pass_by_value.rs
2023-01-09 17:07:25 -05:00
Rejyr
c3a6801f8e
migrate: redundant_semicolon.rs
2023-01-09 17:07:25 -05:00
Rejyr
a42afa0444
migrate: traits.rs
2023-01-09 17:07:25 -05:00