]> git.lizzy.rs Git - rust.git/commitdiff
fix some typos
authorKaDiWa <kalle.wachsmuth@gmail.com>
Sat, 24 Dec 2022 23:43:50 +0000 (00:43 +0100)
committerKaDiWa <kalle.wachsmuth@gmail.com>
Sat, 24 Dec 2022 23:43:50 +0000 (00:43 +0100)
12 files changed:
compiler/rustc_data_structures/src/stable_hasher.rs
compiler/rustc_hir_analysis/src/astconv/mod.rs
compiler/rustc_hir_typeck/src/pat.rs
compiler/rustc_lint_defs/src/builtin.rs
compiler/rustc_metadata/src/rmeta/encoder.rs
compiler/rustc_target/src/spec/mod.rs
src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.fixed [deleted file]
src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.rs [deleted file]
src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.stderr [deleted file]
src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed [new file with mode: 0644]
src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.rs [new file with mode: 0644]
src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.stderr [new file with mode: 0644]

index 1a728f82f006fa33a92597defccda7ac8e441431..ae4836645fa41311215aaa39166c4c439766709e 100644 (file)
@@ -223,7 +223,7 @@ pub trait ToStableHashKey<HCX> {
 /// stable across compilation session boundaries. More formally:
 ///
 /// ```txt
-/// Ord::cmp(a1, b1) == Ord:cmp(a2, b2)
+/// Ord::cmp(a1, b1) == Ord::cmp(a2, b2)
 ///    where a2 = decode(encode(a1, context1), context2)
 ///          b2 = decode(encode(b1, context1), context2)
 /// ```
index c29a3afd7fba876896d006e2b0fb45407d1a3f8c..6f0c5d36a5f539c63e6365e493d51c846c5171c2 100644 (file)
@@ -2626,7 +2626,7 @@ pub fn res_to_ty(
                 let e = self
                     .tcx()
                     .sess
-                    .delay_span_bug(path.span, "path with `Res:Err` but no error emitted");
+                    .delay_span_bug(path.span, "path with `Res::Err` but no error emitted");
                 self.set_tainted_by_errors(e);
                 self.tcx().ty_error_with_guaranteed(e)
             }
index d3e88b1b80ae29a30aec1856320059b54bdbf793..0021fdd7f61a9f9200aa7e8cb29a536b97a16f2e 100644 (file)
@@ -1013,7 +1013,7 @@ fn check_pat_tuple_struct(
         let (res, opt_ty, segments) =
             self.resolve_ty_and_res_fully_qualified_call(qpath, pat.hir_id, pat.span);
         if res == Res::Err {
-            let e = tcx.sess.delay_span_bug(pat.span, "`Res:Err` but no error emitted");
+            let e = tcx.sess.delay_span_bug(pat.span, "`Res::Err` but no error emitted");
             self.set_tainted_by_errors(e);
             on_error(e);
             return tcx.ty_error_with_guaranteed(e);
index 67868ded0b86b5b4c9de2442bfc2a75515fee6a0..28317d6cea02a599a0a0cddf1a164911eba33332 100644 (file)
     /// fn main() {
     ///     let x: String = "3".try_into().unwrap();
     ///     //                  ^^^^^^^^
-    ///     // This call to try_into matches both Foo:try_into and TryInto::try_into as
+    ///     // This call to try_into matches both Foo::try_into and TryInto::try_into as
     ///     // `TryInto` has been added to the Rust prelude in 2021 edition.
     ///     println!("{x}");
     /// }
index d5d31bc3edc97af6572079812df5d2a68ad14f1b..be4a0c9bb34d2a22b5c92247574c1908845bb012 100644 (file)
@@ -76,7 +76,7 @@ pub(super) struct EncodeContext<'a, 'tcx> {
     symbol_table: FxHashMap<Symbol, usize>,
 }
 
-/// If the current crate is a proc-macro, returns early with `Lazy:empty()`.
+/// If the current crate is a proc-macro, returns early with `LazyArray::empty()`.
 /// This is useful for skipping the encoding of things that aren't needed
 /// for proc-macro crates.
 macro_rules! empty_proc_macro {
index 988cd401f406bff9f66d02a6d55895afde9a5e21..4512db49403d73602628c40dd6469c99cc58ae25 100644 (file)
@@ -2291,7 +2291,7 @@ macro_rules! key {
                     } else {
                         return Some(Err(format!(
                             "'{}' is not a valid value for lld-flavor. \
-                             Use 'darwin', 'gnu', 'link' or 'wasm.",
+                             Use 'darwin', 'gnu', 'link' or 'wasm'.",
                             s)))
                     }
                     Some(Ok(()))
diff --git a/src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.fixed b/src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.fixed
deleted file mode 100644 (file)
index 63b65ab..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// run-rustfix
-
-macro_rules! my_wrapper {
-    ($expr:expr) => { MyWrapper($expr) }
-}
-
-pub struct MyWrapper(u32);
-
-fn main() {
-    let value = MyWrapper(123);
-    some_fn(value); //~ ERROR mismatched types
-    some_fn(my_wrapper!(123)); //~ ERROR mismatched types
-}
-
-fn some_fn(wrapped: MyWrapper) {
-    drop(wrapped);
-}
diff --git a/src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.rs b/src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.rs
deleted file mode 100644 (file)
index 2ab4e39..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// run-rustfix
-
-macro_rules! my_wrapper {
-    ($expr:expr) => { MyWrapper($expr) }
-}
-
-pub struct MyWrapper(u32);
-
-fn main() {
-    let value = MyWrapper(123);
-    some_fn(value.0); //~ ERROR mismatched types
-    some_fn(my_wrapper!(123).0); //~ ERROR mismatched types
-}
-
-fn some_fn(wrapped: MyWrapper) {
-    drop(wrapped);
-}
diff --git a/src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.stderr b/src/test/ui/mismatched_types/suggest-removing-tulpe-struct-field.stderr
deleted file mode 100644 (file)
index 82a7f27..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/suggest-removing-tulpe-struct-field.rs:11:13
-   |
-LL |     some_fn(value.0);
-   |     ------- ^^^^^^^ expected struct `MyWrapper`, found `u32`
-   |     |
-   |     arguments to this function are incorrect
-   |
-note: function defined here
-  --> $DIR/suggest-removing-tulpe-struct-field.rs:15:4
-   |
-LL | fn some_fn(wrapped: MyWrapper) {
-   |    ^^^^^^^ ------------------
-help: consider removing the tuple struct field `0`
-   |
-LL -     some_fn(value.0);
-LL +     some_fn(value);
-   |
-
-error[E0308]: mismatched types
-  --> $DIR/suggest-removing-tulpe-struct-field.rs:12:13
-   |
-LL |     some_fn(my_wrapper!(123).0);
-   |     ------- ^^^^^^^^^^^^^^^^^^ expected struct `MyWrapper`, found `u32`
-   |     |
-   |     arguments to this function are incorrect
-   |
-note: function defined here
-  --> $DIR/suggest-removing-tulpe-struct-field.rs:15:4
-   |
-LL | fn some_fn(wrapped: MyWrapper) {
-   |    ^^^^^^^ ------------------
-help: consider removing the tuple struct field `0`
-   |
-LL -     some_fn(my_wrapper!(123).0);
-LL +     some_fn(my_wrapper!(123));
-   |
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed b/src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed
new file mode 100644 (file)
index 0000000..63b65ab
--- /dev/null
@@ -0,0 +1,17 @@
+// run-rustfix
+
+macro_rules! my_wrapper {
+    ($expr:expr) => { MyWrapper($expr) }
+}
+
+pub struct MyWrapper(u32);
+
+fn main() {
+    let value = MyWrapper(123);
+    some_fn(value); //~ ERROR mismatched types
+    some_fn(my_wrapper!(123)); //~ ERROR mismatched types
+}
+
+fn some_fn(wrapped: MyWrapper) {
+    drop(wrapped);
+}
diff --git a/src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.rs b/src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.rs
new file mode 100644 (file)
index 0000000..2ab4e39
--- /dev/null
@@ -0,0 +1,17 @@
+// run-rustfix
+
+macro_rules! my_wrapper {
+    ($expr:expr) => { MyWrapper($expr) }
+}
+
+pub struct MyWrapper(u32);
+
+fn main() {
+    let value = MyWrapper(123);
+    some_fn(value.0); //~ ERROR mismatched types
+    some_fn(my_wrapper!(123).0); //~ ERROR mismatched types
+}
+
+fn some_fn(wrapped: MyWrapper) {
+    drop(wrapped);
+}
diff --git a/src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.stderr b/src/test/ui/mismatched_types/suggest-removing-tuple-struct-field.stderr
new file mode 100644 (file)
index 0000000..35871af
--- /dev/null
@@ -0,0 +1,41 @@
+error[E0308]: mismatched types
+  --> $DIR/suggest-removing-tuple-struct-field.rs:11:13
+   |
+LL |     some_fn(value.0);
+   |     ------- ^^^^^^^ expected struct `MyWrapper`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/suggest-removing-tuple-struct-field.rs:15:4
+   |
+LL | fn some_fn(wrapped: MyWrapper) {
+   |    ^^^^^^^ ------------------
+help: consider removing the tuple struct field `0`
+   |
+LL -     some_fn(value.0);
+LL +     some_fn(value);
+   |
+
+error[E0308]: mismatched types
+  --> $DIR/suggest-removing-tuple-struct-field.rs:12:13
+   |
+LL |     some_fn(my_wrapper!(123).0);
+   |     ------- ^^^^^^^^^^^^^^^^^^ expected struct `MyWrapper`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/suggest-removing-tuple-struct-field.rs:15:4
+   |
+LL | fn some_fn(wrapped: MyWrapper) {
+   |    ^^^^^^^ ------------------
+help: consider removing the tuple struct field `0`
+   |
+LL -     some_fn(my_wrapper!(123).0);
+LL +     some_fn(my_wrapper!(123));
+   |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.