diff --git a/Cargo.lock b/Cargo.lock index 642f1452c37..dc810f97d59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -847,6 +847,15 @@ dependencies = [ "regex", ] +[[package]] +name = "hashbrown" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" +dependencies = [ + "autocfg", +] + [[package]] name = "heck" version = "0.3.1" @@ -964,11 +973,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.3.2" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" +checksum = "4e47a3566dd4fd4eec714ae6ceabdee0caec795be835c223d92c2d40f1e8cf1c" dependencies = [ "autocfg", + "hashbrown", ] [[package]] @@ -1388,15 +1398,6 @@ dependencies = [ "libc", ] -[[package]] -name = "once_cell" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" -dependencies = [ - "parking_lot 0.10.2", -] - [[package]] name = "opaque-debug" version = "0.2.3" @@ -1630,9 +1631,9 @@ dependencies = [ [[package]] name = "racer" -version = "2.1.37" +version = "2.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db975752fc2c2430b4159d262585f7e45eb9aa43d733bf02c5f2fde512b00bfb" +checksum = "51dd5fd4247115b28f3e038eb8cda76a0c6f9cb473f769f41f930af8adff22d0" dependencies = [ "bitflags", "clap", @@ -1904,9 +1905,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_arena" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3941333c39ffa778611a34692244052fc9ba0f6b02dcf019c8d24925707dd6" +checksum = "2958af0d6e0458434a25cd3a96f6e19f24f71bf50b900add520dec52e212866b" dependencies = [ "rustc-ap-rustc_data_structures", "smallvec 1.4.0", @@ -1914,30 +1915,28 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_ast" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c579f7d89e6fc971b433e92bb2b8c65b716d7c797b21de8685945be9455610" +checksum = "0c82c2510460f2133548e62399e5acd30c25ae6ece30245baab3d1e00c2fefac" dependencies = [ "bitflags", - "log", "rustc-ap-rustc_data_structures", "rustc-ap-rustc_index", "rustc-ap-rustc_lexer", "rustc-ap-rustc_macros", "rustc-ap-rustc_serialize", "rustc-ap-rustc_span", - "scoped-tls", "smallvec 1.4.0", + "tracing", ] [[package]] name = "rustc-ap-rustc_ast_passes" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9914fadee461568d19ca2ebaec8699ff898f8ffec9928154659a57ee018e5fd" +checksum = "83977da57f81c6edd89bad47e49136680eaa33288de4abb702e95358c2a0fc6c" dependencies = [ "itertools 0.8.2", - "log", "rustc-ap-rustc_ast", "rustc-ap-rustc_ast_pretty", "rustc-ap-rustc_attr", @@ -1947,31 +1946,33 @@ dependencies = [ "rustc-ap-rustc_parse", "rustc-ap-rustc_session", "rustc-ap-rustc_span", + "tracing", ] [[package]] name = "rustc-ap-rustc_ast_pretty" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a78c5cc50a2f294d3c4e9131a15676724c9f136d3ed54e9ba419850b6025cb3" +checksum = "becf4ca1638b214694c71a8752192683048ab8bd47947cc481f57bd48157eeb9" dependencies = [ - "log", "rustc-ap-rustc_ast", "rustc-ap-rustc_span", "rustc-ap-rustc_target", + "tracing", ] [[package]] name = "rustc-ap-rustc_attr" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78ce08227d146949755175c0cf710280a4b5bf6ee504c0e3f7ccc30d66fbfd9" +checksum = "0f21ca5dadce8a40d75a2756b77eab75b4c2d827f645c622dd93ee2285599640" dependencies = [ "rustc-ap-rustc_ast", "rustc-ap-rustc_ast_pretty", "rustc-ap-rustc_data_structures", "rustc-ap-rustc_errors", "rustc-ap-rustc_feature", + "rustc-ap-rustc_lexer", "rustc-ap-rustc_macros", "rustc-ap-rustc_serialize", "rustc-ap-rustc_session", @@ -1981,9 +1982,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_data_structures" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5ac3735c38d2d0e95991ebcd7eb1618b60e784194a738e0ce2e8d39c39b809" +checksum = "a4cd204764727fde9abf75333eb661f058bfc7242062d91019440fe1b240688b" dependencies = [ "bitflags", "cfg-if", @@ -1993,12 +1994,11 @@ dependencies = [ "jobserver", "lazy_static", "libc", - "log", "measureme", - "once_cell", "parking_lot 0.10.2", "rustc-ap-rustc_graphviz", "rustc-ap-rustc_index", + "rustc-ap-rustc_macros", "rustc-ap-rustc_serialize", "rustc-hash", "rustc-rayon", @@ -2006,34 +2006,36 @@ dependencies = [ "smallvec 1.4.0", "stable_deref_trait", "stacker", + "tempfile", + "tracing", "winapi 0.3.8", ] [[package]] name = "rustc-ap-rustc_errors" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5166a95afa6e3b78ccbece4c2f1e163634854297f1147c6fd90e2712ed3fede5" +checksum = "58116f119e37f14c029f99077b347069621118e048a69df74695b98204e7c136" dependencies = [ "annotate-snippets 0.8.0", "atty", - "log", "rustc-ap-rustc_data_structures", + "rustc-ap-rustc_macros", "rustc-ap-rustc_serialize", "rustc-ap-rustc_span", "termcolor", "termize", + "tracing", "unicode-width", "winapi 0.3.8", ] [[package]] name = "rustc-ap-rustc_expand" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a0586e83bdfe70eda8393429a8a38ecb529525dd252d787e479af075d3cab08" +checksum = "48e3c4bda9b64b92805bebe7431fdb8e24fd112b35a8c6d2174827441f10a6b2" dependencies = [ - "log", "rustc-ap-rustc_ast", "rustc-ap-rustc_ast_passes", "rustc-ap-rustc_ast_pretty", @@ -2042,18 +2044,20 @@ dependencies = [ "rustc-ap-rustc_errors", "rustc-ap-rustc_feature", "rustc-ap-rustc_lexer", + "rustc-ap-rustc_macros", "rustc-ap-rustc_parse", "rustc-ap-rustc_serialize", "rustc-ap-rustc_session", "rustc-ap-rustc_span", "smallvec 1.4.0", + "tracing", ] [[package]] name = "rustc-ap-rustc_feature" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fc3aa8de0737a8c5a4353e6948548f469150d2b5d3eac391843de32c6c6ca2" +checksum = "4b612bb67d3fc49f395b03fc4ea4384a0145b05afbadab725803074ec827632b" dependencies = [ "lazy_static", "rustc-ap-rustc_data_structures", @@ -2062,40 +2066,41 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_fs_util" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fd3380f4029020b693bbfd5a14ec8c893ec33c5c0063ad2e68e46d3fbd6a1f" +checksum = "7630ad1a73a8434ee920676148cb5440ac57509bd20e94ec41087fb0b1d11c28" [[package]] name = "rustc-ap-rustc_graphviz" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b54bd98f70e04291bf611151d1fcd4d7770b35f7ec603d301c4aee0d1979cca4" +checksum = "a603fca4817062eb4fb23ff129d475bd66a69fb32f34ed4362ae950cf814b49d" [[package]] name = "rustc-ap-rustc_index" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335bfb187a2489a59ee8c67fcf5d1760e9dcdbe0f02025c199a74caa05096b15" +checksum = "9850c4a5d7c341513e10802bca9588bf8f452ceea2d5cfa87b934246a52622bc" dependencies = [ "arrayvec", + "rustc-ap-rustc_macros", "rustc-ap-rustc_serialize", ] [[package]] name = "rustc-ap-rustc_lexer" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1221f3bfa2943c942cf8da319ab2346887f8757778c29c7f1822cd27b521f" +checksum = "6d86722e5a1a615b198327d0d794cd9cbc8b9db4542276fc51fe078924de68ea" dependencies = [ "unicode-xid", ] [[package]] name = "rustc-ap-rustc_macros" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b774df26c4ef513555b3a303cb209f44cf68a9e6a5481b41ac832301c6487cb" +checksum = "b3fc8482e44cabdda7ac9a8e224aef62ebdf95274d629dac8db3b42321025fea" dependencies = [ "proc-macro2", "quote", @@ -2105,12 +2110,11 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_parse" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065e632101bdd57a271f38ee7a4d72b5a3d0467ec845104346c284b2c6c69960" +checksum = "3716cdcd978a91dbd4a2788400e90e809527f841426fbeb92f882f9b8582f3ab" dependencies = [ "bitflags", - "log", "rustc-ap-rustc_ast", "rustc-ap-rustc_ast_pretty", "rustc-ap-rustc_data_structures", @@ -2119,14 +2123,16 @@ dependencies = [ "rustc-ap-rustc_lexer", "rustc-ap-rustc_session", "rustc-ap-rustc_span", + "smallvec 1.4.0", + "tracing", "unicode-normalization", ] [[package]] name = "rustc-ap-rustc_serialize" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e8c0b704e3dedb97cbb1ac566bbc0ab397ec4a4743098326a8f2230463fd9f9" +checksum = "c68046d07988b349b2e1c8bc1c9664a1d06519354aa677b9df358c5c5c058da0" dependencies = [ "indexmap", "smallvec 1.4.0", @@ -2134,32 +2140,32 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_session" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda99ede4e6e260712754f8548b0a175b615686ad393653a3bd11f6c5e41a04e" +checksum = "85735553501a4de0c8904e37b7ccef79cc1c585a7d7f2cfa02cc38e0d149f982" dependencies = [ "bitflags", "getopts", - "log", "num_cpus", "rustc-ap-rustc_ast", "rustc-ap-rustc_data_structures", "rustc-ap-rustc_errors", "rustc-ap-rustc_feature", "rustc-ap-rustc_fs_util", + "rustc-ap-rustc_macros", "rustc-ap-rustc_serialize", "rustc-ap-rustc_span", "rustc-ap-rustc_target", + "tracing", ] [[package]] name = "rustc-ap-rustc_span" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53453791c2c0b501a921927ce8e305a801eef130920873f8da92d83dad595236" +checksum = "1c49ae8a0d3b9e27c6ffe8febeaa30f899294fff012de70625f9ee81c54fda85" dependencies = [ "cfg-if", - "log", "md-5", "rustc-ap-rustc_arena", "rustc-ap-rustc_data_structures", @@ -2168,22 +2174,23 @@ dependencies = [ "rustc-ap-rustc_serialize", "scoped-tls", "sha-1", + "tracing", "unicode-width", ] [[package]] name = "rustc-ap-rustc_target" -version = "671.0.0" +version = "677.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac82006fdb31ef44e24e1623f8b72ac2b404ef15ba20b7ebec0df35e5d20bbef" +checksum = "1765f447594740c501c7b666b87639aa7c1dae2bf8c3166d5d2dca16646fd034" dependencies = [ "bitflags", - "log", "rustc-ap-rustc_data_structures", "rustc-ap-rustc_index", "rustc-ap-rustc_macros", "rustc-ap-rustc_serialize", "rustc-ap-rustc_span", + "tracing", ] [[package]] @@ -2258,7 +2265,7 @@ dependencies = [ [[package]] name = "rustfmt-config_proc_macro" version = "0.2.0" -source = "git+https://github.com/rust-lang/rustfmt?branch=rustfmt-1.4.20#48f6c32ec1dd370f3157a27b48a000fd8c1185af" +source = "git+https://github.com/rust-lang/rustfmt?branch=rustfmt-1.4.21#01f2eadccc74cf70eb11e6300ffa7e02b18b0027" dependencies = [ "proc-macro2", "quote", @@ -2267,8 +2274,8 @@ dependencies = [ [[package]] name = "rustfmt-nightly" -version = "1.4.20" -source = "git+https://github.com/rust-lang/rustfmt?branch=rustfmt-1.4.20#48f6c32ec1dd370f3157a27b48a000fd8c1185af" +version = "1.4.21" +source = "git+https://github.com/rust-lang/rustfmt?branch=rustfmt-1.4.21#01f2eadccc74cf70eb11e6300ffa7e02b18b0027" dependencies = [ "annotate-snippets 0.6.1", "anyhow", @@ -2499,9 +2506,9 @@ checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" [[package]] name = "stacker" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72dd941b456e1c006d6b9f27c526d5b69281288aeea8cba82c19d3843d8ccdd2" +checksum = "a92bc346006ae78c539d6ab2cf1a1532bc657b8339c464877a990ec82073c66f" dependencies = [ "cc", "cfg-if", @@ -2924,6 +2931,37 @@ dependencies = [ "serde", ] +[[package]] +name = "tracing" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c" +dependencies = [ + "cfg-if", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f0e00789804e99b20f12bc7003ca416309d28a6f495d6af58d1e2c2842461b5" +dependencies = [ + "lazy_static", +] + [[package]] name = "typenum" version = "1.12.0" diff --git a/Cargo.toml b/Cargo.toml index ad15d69ca85..fac5b7c9da9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,11 +42,11 @@ lsp-types = { version = "0.60", features = ["proposed"] } lazy_static = "1" log = "0.4" num_cpus = "1" -racer = { version = "2.1.37", default-features = false } +racer = { version = "2.1.38", default-features = false } rand = "0.7" rayon = "1" rustc_tools_util = "0.2" -rustfmt-nightly = { version = "1.4.20", git = "https://github.com/rust-lang/rustfmt", branch = "rustfmt-1.4.20" } +rustfmt-nightly = { version = "1.4.21", git = "https://github.com/rust-lang/rustfmt", branch = "rustfmt-1.4.21" } serde = "1.0" serde_json = "1.0" serde_derive = "1.0" diff --git a/ci/azure-install-rust.yml b/ci/azure-install-rust.yml index 02176592a6f..3939ba37747 100644 --- a/ci/azure-install-rust.yml +++ b/ci/azure-install-rust.yml @@ -4,7 +4,7 @@ steps: set -e curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none export PATH=$PATH:$HOME/.cargo/bin - rustup toolchain install $RUSTUP_TOOLCHAIN + rustup toolchain install $RUSTUP_TOOLCHAIN --force rustup default $RUSTUP_TOOLCHAIN echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" env: @@ -17,7 +17,7 @@ steps: curl -sSf -o rustup-init.exe https://win.rustup.rs rustup-init.exe -y --default-toolchain none set PATH=%PATH%;%USERPROFILE%\.cargo\bin - rustup toolchain install %RUSTUP_TOOLCHAIN% + rustup toolchain install %RUSTUP_TOOLCHAIN% --force rustup default %RUSTUP_TOOLCHAIN% echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" env: diff --git a/tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0004_012.json b/tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0004_012.json index ece90b14303..653e5fabf51 100644 --- a/tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0004_012.json +++ b/tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0004_012.json @@ -7,9 +7,9 @@ "data": { "Ok": [{ "language": "rust", - "value": "libstd/sync/mod.rs" + "value": "std/src/sync/mod.rs" }, - "Useful synchronization primitives.\n\n## The need for synchronization\n\nConceptually, a Rust program is a series of operations which will\nbe executed on a computer. The timeline of events happening in the\nprogram is consistent with the order of the operations in the code." + "Useful synchronization primitives.\n\n## The need for synchronization\n\nConceptually, a Rust program is a series of operations which will\nbe executed on a computer. The timeline of events happening in the\nprogram is consistent with the order of the operations in the code.\n\nConsider the following code, operating on some global static variables:\n\n```rust\nstatic mut A: u32 = 0;" ] } } diff --git a/tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0005_012.json b/tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0005_012.json index 8269d9637b6..6d5971bd94e 100644 --- a/tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0005_012.json +++ b/tests/fixtures/hover/save_data/test_tooltip_mod_use_external.rs.0005_012.json @@ -7,9 +7,9 @@ "data": { "Ok": [{ "language": "rust", - "value": "libstd/sync/mod.rs" + "value": "std/src/sync/mod.rs" }, - "Useful synchronization primitives.\n\n## The need for synchronization\n\nConceptually, a Rust program is a series of operations which will\nbe executed on a computer. The timeline of events happening in the\nprogram is consistent with the order of the operations in the code." + "Useful synchronization primitives.\n\n## The need for synchronization\n\nConceptually, a Rust program is a series of operations which will\nbe executed on a computer. The timeline of events happening in the\nprogram is consistent with the order of the operations in the code.\n\nConsider the following code, operating on some global static variables:\n\n```rust\nstatic mut A: u32 = 0;" ] } } diff --git a/tests/fixtures/hover/save_data/test_tooltip_std.rs.0009_012.json b/tests/fixtures/hover/save_data/test_tooltip_std.rs.0009_012.json index 2a2e4033b39..bb805b69b37 100644 --- a/tests/fixtures/hover/save_data/test_tooltip_std.rs.0009_012.json +++ b/tests/fixtures/hover/save_data/test_tooltip_std.rs.0009_012.json @@ -10,7 +10,7 @@ "language": "rust", "value": "pub fn push(&mut self, value: T)" }, - "Appends an element to the back of a collection.\n\n# Panics\n\nPanics if the number of elements in the vector overflows a `usize`.\n\n# Examples\n\n```rust\nlet mut vec = vec![1, 2];\nvec.push(3);\nassert_eq!(vec, [1, 2, 3]);\n```" + "Appends an element to the back of a collection.\n\n# Panics\n\nPanics if the new capacity exceeds `isize::MAX` bytes.\n\n# Examples\n\n```rust\nlet mut vec = vec![1, 2];\nvec.push(3);\nassert_eq!(vec, [1, 2, 3]);\n```" ] } } \ No newline at end of file diff --git a/tests/fixtures/hover/save_data/test_tooltip_std.rs.0015_017.json b/tests/fixtures/hover/save_data/test_tooltip_std.rs.0015_017.json index b786296489d..5fd627d906d 100644 --- a/tests/fixtures/hover/save_data/test_tooltip_std.rs.0015_017.json +++ b/tests/fixtures/hover/save_data/test_tooltip_std.rs.0015_017.json @@ -8,10 +8,10 @@ "Ok": [ { "language": "rust", - "value": "src/liballoc/string.rs" + "value": "library/alloc/src/string.rs" }, "https://doc.rust-lang.org/nightly/alloc/string/", - "A UTF-8 encoded, growable string.\n\nThis module contains the [`String`] type, a trait for converting\n[`ToString`]s, and several error types that may result from working with\n[`String`]s.\n\n[`ToString`]: trait.ToString.html\n\n# Examples\n\nThere are multiple ways to create a new [`String`] from a string literal:\n\n```rust\nlet s = \"Hello\".to_string();\n\nlet s = String::from(\"world\");\nlet s: String = \"also this\".into();\n```\n\nYou can create a new [`String`] from an existing one by concatenating with\n`+`:\n\n[`String`]: struct.String.html\n\n```rust\nlet s = \"Hello\".to_string();\n\nlet message = s + \" world!\";\n```\n\nIf you have a vector of valid UTF-8 bytes, you can make a [`String`] out of\nit. You can do the reverse too.\n\n```rust\nlet sparkle_heart = vec![240, 159, 146, 150];\n\n// We know these bytes are valid, so we'll use `unwrap()`.\nlet sparkle_heart = String::from_utf8(sparkle_heart).unwrap();\n\nassert_eq!(\"💖\", sparkle_heart);\n\nlet bytes = sparkle_heart.into_bytes();\n\nassert_eq!(bytes, [240, 159, 146, 150]);\n```" + "A UTF-8 encoded, growable string.\n\nThis module contains the [`String`] type, a trait for converting\n[`ToString`]s, and several error types that may result from working with\n[`String`]s.\n\n# Examples\n\nThere are multiple ways to create a new [`String`] from a string literal:\n\n```rust\nlet s = \"Hello\".to_string();\n\nlet s = String::from(\"world\");\nlet s: String = \"also this\".into();\n```\n\nYou can create a new [`String`] from an existing one by concatenating with\n`+`:\n\n```rust\nlet s = \"Hello\".to_string();\n\nlet message = s + \" world!\";\n```\n\nIf you have a vector of valid UTF-8 bytes, you can make a [`String`] out of\nit. You can do the reverse too.\n\n```rust\nlet sparkle_heart = vec![240, 159, 146, 150];\n\n// We know these bytes are valid, so we'll use `unwrap()`.\nlet sparkle_heart = String::from_utf8(sparkle_heart).unwrap();\n\nassert_eq!(\"💖\", sparkle_heart);\n\nlet bytes = sparkle_heart.into_bytes();\n\nassert_eq!(bytes, [240, 159, 146, 150]);\n```" ] } } \ No newline at end of file diff --git a/tests/fixtures/hover/save_data/test_tooltip_std.rs.0015_025.json b/tests/fixtures/hover/save_data/test_tooltip_std.rs.0015_025.json index c77b8a6811c..d535ad9099b 100644 --- a/tests/fixtures/hover/save_data/test_tooltip_std.rs.0015_025.json +++ b/tests/fixtures/hover/save_data/test_tooltip_std.rs.0015_025.json @@ -11,7 +11,7 @@ "value": "pub trait ToString" }, "https://doc.rust-lang.org/nightly/alloc/string/ToString.t.html", - "A trait for converting a value to a `String`.\n\nThis trait is automatically implemented for any type which implements the\n[`Display`] trait. As such, `ToString` shouldn't be implemented directly:\n[`Display`] should be implemented instead, and you get the `ToString`\nimplementation for free.\n\n[`Display`]: ../../std/fmt/trait.Display.html" + "A trait for converting a value to a `String`.\n\nThis trait is automatically implemented for any type which implements the\n[`Display`] trait. As such, `ToString` shouldn't be implemented directly:\n[`Display`] should be implemented instead, and you get the `ToString`\nimplementation for free.\n\n[`Display`]: fmt::Display" ] } } \ No newline at end of file