File: suggest-convert-ptr-to-ref.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (72 lines) | stat: -rw-r--r-- 3,654 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
error[E0599]: `*const u8` doesn't implement `std::fmt::Display`
  --> $DIR/suggest-convert-ptr-to-ref.rs:5:22
   |
LL |     println!("{}", z.to_string());
   |                      ^^^^^^^^^ `*const u8` cannot be formatted with the default formatter
   |
note: the method `to_string` exists on the type `&u8`
  --> $SRC_DIR/alloc/src/string.rs:LL:COL
   = note: you might want to use the unsafe method `<*const T>::as_ref` to get an optional reference to the value behind the pointer
   = note: read the documentation for `<*const T>::as_ref` and ensure you satisfy its safety preconditions before calling it to avoid undefined behavior: https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref
   = note: the following trait bounds were not satisfied:
           `*const u8: std::fmt::Display`
           which is required by `*const u8: ToString`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead

error[E0599]: `*mut u8` doesn't implement `std::fmt::Display`
  --> $DIR/suggest-convert-ptr-to-ref.rs:8:22
   |
LL |     println!("{}", t.to_string());
   |                      ^^^^^^^^^ `*mut u8` cannot be formatted with the default formatter
   |
note: the method `to_string` exists on the type `&&mut u8`
  --> $SRC_DIR/alloc/src/string.rs:LL:COL
   = note: you might want to use the unsafe method `<*mut T>::as_ref` to get an optional reference to the value behind the pointer
   = note: read the documentation for `<*mut T>::as_ref` and ensure you satisfy its safety preconditions before calling it to avoid undefined behavior: https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref-1
   = note: the following trait bounds were not satisfied:
           `*mut u8: std::fmt::Display`
           which is required by `*mut u8: ToString`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead

error[E0599]: no method named `make_ascii_lowercase` found for raw pointer `*mut u8` in the current scope
  --> $DIR/suggest-convert-ptr-to-ref.rs:9:7
   |
LL |     t.make_ascii_lowercase();
   |       ^^^^^^^^^^^^^^^^^^^^ method not found in `*mut u8`
   |
note: the method `make_ascii_lowercase` exists on the type `&mut u8`
  --> $SRC_DIR/core/src/num/mod.rs:LL:COL
   = note: you might want to use the unsafe method `<*mut T>::as_mut` to get an optional reference to the value behind the pointer
   = note: read the documentation for `<*mut T>::as_mut` and ensure you satisfy its safety preconditions before calling it to avoid undefined behavior: https://doc.rust-lang.org/std/primitive.pointer.html#method.as_mut

error[E0599]: no method named `as_mut_ref` found for raw pointer `*mut u8` in the current scope
  --> $DIR/suggest-convert-ptr-to-ref.rs:12:15
   |
LL |     let _ = t.as_mut_ref();
   |               ^^^^^^^^^^
   |
help: there is a method `as_mut` with a similar name
   |
LL |     let _ = t.as_mut();
   |               ~~~~~~

error[E0599]: no method named `as_ref_mut` found for raw pointer `*mut u8` in the current scope
  --> $DIR/suggest-convert-ptr-to-ref.rs:13:15
   |
LL |     let _ = t.as_ref_mut();
   |               ^^^^^^^^^^
   |
help: there is a method `as_mut` with a similar name
   |
LL |     let _ = t.as_mut();
   |               ~~~~~~

error[E0599]: no method named `make_ascii_lowercase` found for raw pointer `*const u8` in the current scope
  --> $DIR/suggest-convert-ptr-to-ref.rs:16:7
   |
LL |     z.make_ascii_lowercase();
   |       ^^^^^^^^^^^^^^^^^^^^ method not found in `*const u8`

error: aborting due to 6 previous errors

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