Address the new odd backticks tidy lint in compiler/
This commit is contained in:
parent
7a686bf41d
commit
7f4cc178f0
9 changed files with 10 additions and 6 deletions
|
@ -1052,6 +1052,7 @@ impl<'a> MethodDef<'a> {
|
||||||
/// ::core::hash::Hash::hash(&{ self.y }, state)
|
/// ::core::hash::Hash::hash(&{ self.y }, state)
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
|
/// ```
|
||||||
fn expand_struct_method_body<'b>(
|
fn expand_struct_method_body<'b>(
|
||||||
&self,
|
&self,
|
||||||
cx: &mut ExtCtxt<'_>,
|
cx: &mut ExtCtxt<'_>,
|
||||||
|
|
|
@ -438,6 +438,7 @@ fn build_enum_variant_member_di_node<'ll, 'tcx>(
|
||||||
/// DW_TAG_structure_type (type of variant 1)
|
/// DW_TAG_structure_type (type of variant 1)
|
||||||
/// DW_TAG_structure_type (type of variant 2)
|
/// DW_TAG_structure_type (type of variant 2)
|
||||||
/// DW_TAG_structure_type (type of variant 3)
|
/// DW_TAG_structure_type (type of variant 3)
|
||||||
|
/// ```
|
||||||
struct VariantMemberInfo<'a, 'll> {
|
struct VariantMemberInfo<'a, 'll> {
|
||||||
variant_index: VariantIdx,
|
variant_index: VariantIdx,
|
||||||
variant_name: Cow<'a, str>,
|
variant_name: Cow<'a, str>,
|
||||||
|
|
|
@ -41,7 +41,7 @@ impl Add for Foo {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut x: Foo = Foo(5);
|
let mut x: Foo = Foo(5);
|
||||||
x += Foo(7); // error, `+= cannot be applied to the type `Foo`
|
x += Foo(7); // error, `+=` cannot be applied to the type `Foo`
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,14 @@ An unknown tool name was found in a scoped lint.
|
||||||
Erroneous code examples:
|
Erroneous code examples:
|
||||||
|
|
||||||
```compile_fail,E0710
|
```compile_fail,E0710
|
||||||
#[allow(clipp::filter_map)] // error!`
|
#[allow(clipp::filter_map)] // error!
|
||||||
fn main() {
|
fn main() {
|
||||||
// business logic
|
// business logic
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```compile_fail,E0710
|
```compile_fail,E0710
|
||||||
#[warn(clipp::filter_map)] // error!`
|
#[warn(clipp::filter_map)] // error!
|
||||||
fn main() {
|
fn main() {
|
||||||
// business logic
|
// business logic
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
|
||||||
let (mention_influencer, influencer_point) =
|
let (mention_influencer, influencer_point) =
|
||||||
if sup_origin.span().overlaps(param.param_ty_span) {
|
if sup_origin.span().overlaps(param.param_ty_span) {
|
||||||
// Account for `async fn` like in `async-await/issues/issue-62097.rs`.
|
// Account for `async fn` like in `async-await/issues/issue-62097.rs`.
|
||||||
// The desugaring of `async `fn`s causes `sup_origin` and `param` to point at the same
|
// The desugaring of `async fn`s causes `sup_origin` and `param` to point at the same
|
||||||
// place (but with different `ctxt`, hence `overlaps` instead of `==` above).
|
// place (but with different `ctxt`, hence `overlaps` instead of `==` above).
|
||||||
//
|
//
|
||||||
// This avoids the following:
|
// This avoids the following:
|
||||||
|
|
|
@ -123,6 +123,7 @@ fn dump_matched_mir_node<'tcx, F>(
|
||||||
// see notes on #41697 above
|
// see notes on #41697 above
|
||||||
let def_path =
|
let def_path =
|
||||||
ty::print::with_forced_impl_filename_line!(tcx.def_path_str(body.source.def_id()));
|
ty::print::with_forced_impl_filename_line!(tcx.def_path_str(body.source.def_id()));
|
||||||
|
// ignore-tidy-odd-backticks the literal below is fine
|
||||||
write!(file, "// MIR for `{}", def_path)?;
|
write!(file, "// MIR for `{}", def_path)?;
|
||||||
match body.source.promoted {
|
match body.source.promoted {
|
||||||
None => write!(file, "`")?,
|
None => write!(file, "`")?,
|
||||||
|
|
|
@ -1886,6 +1886,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
// let place = Foo::new();
|
// let place = Foo::new();
|
||||||
// match place { Foo { .. } if { let tmp1 = &place; inspect(*tmp1) }
|
// match place { Foo { .. } if { let tmp1 = &place; inspect(*tmp1) }
|
||||||
// => { let tmp2 = place; feed(tmp2) }, ... }
|
// => { let tmp2 = place; feed(tmp2) }, ... }
|
||||||
|
// ```
|
||||||
//
|
//
|
||||||
// And an input like:
|
// And an input like:
|
||||||
//
|
//
|
||||||
|
|
|
@ -2220,7 +2220,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
// - `BuiltinDerivedObligation` with a generator witness (A)
|
// - `BuiltinDerivedObligation` with a generator witness (A)
|
||||||
// - `BuiltinDerivedObligation` with a generator (A)
|
// - `BuiltinDerivedObligation` with a generator (A)
|
||||||
// - `BuiltinDerivedObligation` with `impl std::future::Future` (A)
|
// - `BuiltinDerivedObligation` with `impl std::future::Future` (A)
|
||||||
// - `BindingObligation` with `impl_send (Send requirement)
|
// - `BindingObligation` with `impl_send` (Send requirement)
|
||||||
//
|
//
|
||||||
// The first obligation in the chain is the most useful and has the generator that captured
|
// The first obligation in the chain is the most useful and has the generator that captured
|
||||||
// the type. The last generator (`outer_generator` below) has information about where the
|
// the type. The last generator (`outer_generator` below) has information about where the
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
//! It defines a "skeleton" of how they should be folded.
|
//! It defines a "skeleton" of how they should be folded.
|
||||||
//! - `TypeSuperFoldable`. This is implemented only for each type of interest,
|
//! - `TypeSuperFoldable`. This is implemented only for each type of interest,
|
||||||
//! and defines the folding "skeleton" for these types.
|
//! and defines the folding "skeleton" for these types.
|
||||||
//! - `TypeFolder`/`FallibleTypeFolder. One of these is implemented for each
|
//! - `TypeFolder`/`FallibleTypeFolder`. One of these is implemented for each
|
||||||
//! folder. This defines how types of interest are folded.
|
//! folder. This defines how types of interest are folded.
|
||||||
//!
|
//!
|
||||||
//! This means each fold is a mixture of (a) generic folding operations, and (b)
|
//! This means each fold is a mixture of (a) generic folding operations, and (b)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue