зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1750646 - Bulk update of rust crates (n, o and p). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136191
This commit is contained in:
Родитель
c3a7880211
Коммит
a340a51fa9
|
@ -3609,9 +3609,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "num_cpus"
|
||||
version = "1.13.0"
|
||||
version = "1.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
|
||||
checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
|
@ -3650,9 +3650,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.8.0"
|
||||
version = "1.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
|
||||
checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
|
||||
|
||||
[[package]]
|
||||
name = "opaque-debug"
|
||||
|
@ -3847,18 +3847,18 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pin-project"
|
||||
version = "0.4.28"
|
||||
version = "0.4.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f"
|
||||
checksum = "9615c18d31137579e9ff063499264ddc1278e7b1982757ebc111028c4d1dc909"
|
||||
dependencies = [
|
||||
"pin-project-internal",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-internal"
|
||||
version = "0.4.28"
|
||||
version = "0.4.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e"
|
||||
checksum = "044964427019eed9d49d9d5bbce6047ef18f37100ea400912a9fa4a3523ab12a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -3895,9 +3895,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.23"
|
||||
version = "0.3.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e"
|
||||
checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
|
||||
|
||||
[[package]]
|
||||
name = "plain"
|
||||
|
@ -3939,9 +3939,9 @@ checksum = "b18befed8bc2b61abc79a457295e7e838417326da1586050b919414073977f19"
|
|||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.15"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
|
||||
checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
|
||||
|
||||
[[package]]
|
||||
name = "precomputed-hash"
|
||||
|
@ -3961,9 +3961,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.33"
|
||||
version = "1.0.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a"
|
||||
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
|
||||
dependencies = [
|
||||
"unicode-xid",
|
||||
]
|
||||
|
@ -4000,9 +4000,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "profiling"
|
||||
version = "1.0.4"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9926767b8b8244d7b6b64546585121d193c3d0b4856ccd656b7bfa9deb91ab6a"
|
||||
checksum = "9145ac0af1d93c638c98c40cf7d25665f427b2a44ad0a99b1dccf3e2f25bb987"
|
||||
|
||||
[[package]]
|
||||
name = "prost"
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"CHANGELOG.md":"648196d9fad2d62618f5778dab9127cf6bb801e3a432d72179f118350d36ff23","CONTRIBUTING.md":"2390961aab1bba026135338da1216b6cc828dfaeed9357d9c155c55a252d3efb","Cargo.lock":"a7cbc6156b3b0ed9e8afdaae9668067e86aaeafc237f99c87e7fda76d8032c24","Cargo.toml":"08fed4ec7fac699f408ef1abdd39b1a6294b2c015cfe859eedbbb4c286bb7912","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0593d22d122d4bfec6407115e3907546312976f75473417aaa4c57ecd2095ae6","README.md":"12451d6905fe9cdac206410de8071b562e5ea936b6e55a19ac97982831a0fcdb","ci/cgroups/Dockerfile":"b018cda01776cabe033af06a22c5ad337c90c07fdb8093e94857f2fc5a0b2bdb","examples/values.rs":"46c833324b7339d359054c4f8e8284259e860df206c552c63b5893ade59c16a6","fixtures/cgroups/cgroups/ceil/cpu.cfs_period_us":"d2ace393dc9388863d75d8de140df516d7ffe4aa7ed2f9a545aa71c9930d6638","fixtures/cgroups/cgroups/ceil/cpu.cfs_quota_us":"7ccd86cde0b22ffc2318f2509726d2a13053f6973e96dc5ca6965a56497e485e","fixtures/cgroups/cgroups/good/cpu.cfs_period_us":"d2ace393dc9388863d75d8de140df516d7ffe4aa7ed2f9a545aa71c9930d6638","fixtures/cgroups/cgroups/good/cpu.cfs_quota_us":"cdc3397c35d915e5fe61f8d2bdedcae00a225d55cc6b090580cde1b71c63463b","fixtures/cgroups/cgroups/zero-period/cpu.cfs_period_us":"74d01a0c051c963d9a9b8ab9dbeab1723f0ad8534ea9fa6a942f358d7fa011b4","fixtures/cgroups/cgroups/zero-period/cpu.cfs_quota_us":"1e6ffd8a95fab538ddd645a767e8cc505722d5c8aaf008969f2ed8ab753ff61e","fixtures/cgroups/proc/cgroups/cgroup":"6812299a4409bfd831ed751fdbbfdd9c5749f69acd7b14c5b0a704271a1f74c6","fixtures/cgroups/proc/cgroups/mountinfo":"3187b0b1c0fa192790abced7d435190e8979059186055688e4c3c2ca013398c6","src/lib.rs":"e1ce45ba3b2655fabb49ea0af50080808fd305c884d79cb4b9527198dab828ac","src/linux.rs":"c10382e85a4b196d6fd9a481d9b3d5978b8bb18eaeb7670716ced7d71b919f5e"},"package":"05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"}
|
||||
{"files":{"CHANGELOG.md":"1b01434272c7e464f187eedc95522d9f5668f7f423459572fd33cd8eb5c4c5cf","CONTRIBUTING.md":"2390961aab1bba026135338da1216b6cc828dfaeed9357d9c155c55a252d3efb","Cargo.lock":"dabfb21d5ed9cefaf28e1fcbcaf253de08807ca3be33d0de4b06bb7a377d7b60","Cargo.toml":"885f8ecc8197bec06e151fde7769dc7c267d2f25a4b573240463e8a40a5be298","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0593d22d122d4bfec6407115e3907546312976f75473417aaa4c57ecd2095ae6","README.md":"7760d315d3efd2306affa4c8e4dcdb3a245ae30b3c9cfb9cffed2f1116c86362","ci/cgroups/Dockerfile":"567f00918a6422b363e2c21e57bd47cef9dcc03d0ab109c9605e052f83af7e89","examples/values.rs":"46c833324b7339d359054c4f8e8284259e860df206c552c63b5893ade59c16a6","fixtures/cgroups/cgroups/ceil/cpu.cfs_period_us":"d2ace393dc9388863d75d8de140df516d7ffe4aa7ed2f9a545aa71c9930d6638","fixtures/cgroups/cgroups/ceil/cpu.cfs_quota_us":"7ccd86cde0b22ffc2318f2509726d2a13053f6973e96dc5ca6965a56497e485e","fixtures/cgroups/cgroups/good/cpu.cfs_period_us":"d2ace393dc9388863d75d8de140df516d7ffe4aa7ed2f9a545aa71c9930d6638","fixtures/cgroups/cgroups/good/cpu.cfs_quota_us":"cdc3397c35d915e5fe61f8d2bdedcae00a225d55cc6b090580cde1b71c63463b","fixtures/cgroups/cgroups/zero-period/cpu.cfs_period_us":"74d01a0c051c963d9a9b8ab9dbeab1723f0ad8534ea9fa6a942f358d7fa011b4","fixtures/cgroups/cgroups/zero-period/cpu.cfs_quota_us":"1e6ffd8a95fab538ddd645a767e8cc505722d5c8aaf008969f2ed8ab753ff61e","fixtures/cgroups/proc/cgroups/cgroup":"6812299a4409bfd831ed751fdbbfdd9c5749f69acd7b14c5b0a704271a1f74c6","fixtures/cgroups/proc/cgroups/mountinfo":"3187b0b1c0fa192790abced7d435190e8979059186055688e4c3c2ca013398c6","fixtures/cgroups/proc/cgroups/mountinfo_multi_opt":"d1e397752bc5c4558a3230ad847e89c6885362eab68a53b08dbf219de2e0138a","fixtures/cgroups/proc/cgroups/mountinfo_zero_opt":"91b03b270c76460bc19225aa4b743f893c7d32173e9609ef77e5a04814ab81ff","src/lib.rs":"81fc237964757a53689db848b1df4fed75bbd6a6e7a9063b6bb008161f8c22af","src/linux.rs":"a453e1056c130beaa7e2338222d04b5d3786f6325f5ca314ce9f4130079add2f"},"package":"19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"}
|
|
@ -1,3 +1,9 @@
|
|||
## v1.13.1
|
||||
|
||||
### Fixes
|
||||
|
||||
- fix parsing zero or multiple optional fields in cgroup mountinfo.
|
||||
|
||||
## v1.13.0
|
||||
|
||||
### Features
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120"
|
||||
dependencies = [
|
||||
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.65"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8"
|
||||
|
||||
[[package]]
|
||||
name = "num_cpus"
|
||||
version = "1.13.0"
|
||||
version = "1.13.1"
|
||||
dependencies = [
|
||||
"hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[metadata]
|
||||
"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120"
|
||||
"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8"
|
||||
|
|
|
@ -3,25 +3,24 @@
|
|||
# When uploading crates to the registry Cargo will automatically
|
||||
# "normalize" Cargo.toml files for maximal compatibility
|
||||
# with all versions of Cargo and also rewrite `path` dependencies
|
||||
# to registry (e.g., crates.io) dependencies
|
||||
# to registry (e.g., crates.io) dependencies.
|
||||
#
|
||||
# If you believe there's an error in this file please file an
|
||||
# issue against the rust-lang/cargo repository. If you're
|
||||
# editing this file be aware that the upstream Cargo.toml
|
||||
# will likely look very different (and much more reasonable)
|
||||
# If you are reading this file be aware that the original Cargo.toml
|
||||
# will likely look very different (and much more reasonable).
|
||||
# See Cargo.toml.orig for the original contents.
|
||||
|
||||
[package]
|
||||
name = "num_cpus"
|
||||
version = "1.13.0"
|
||||
version = "1.13.1"
|
||||
authors = ["Sean McArthur <sean@seanmonstar.com>"]
|
||||
description = "Get the number of CPUs on a machine."
|
||||
documentation = "https://docs.rs/num_cpus"
|
||||
readme = "README.md"
|
||||
keywords = ["cpu", "cpus", "cores"]
|
||||
categories = ["hardware-support"]
|
||||
license = "MIT/Apache-2.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/seanmonstar/num_cpus"
|
||||
[dependencies.libc]
|
||||
version = "0.2.26"
|
||||
[target."cfg(all(any(target_arch = \"x86_64\", target_arch = \"aarch64\"), target_os = \"hermit\"))".dependencies.hermit-abi]
|
||||
version = "0.1.3"
|
||||
[target."cfg(not(windows))".dependencies.libc]
|
||||
version = "0.2.26"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# num_cpus
|
||||
|
||||
[![crates.io](http://meritbadge.herokuapp.com/num_cpus)](https://crates.io/crates/num_cpus)
|
||||
[![crates.io](https://img.shields.io/crates/v/num_cpus.svg)](https://crates.io/crates/num_cpus)
|
||||
[![Travis CI Status](https://travis-ci.org/seanmonstar/num_cpus.svg?branch=master)](https://travis-ci.org/seanmonstar/num_cpus)
|
||||
[![AppVeyor status](https://ci.appveyor.com/api/projects/status/qn8t6grhko5jwno6?svg=true)](https://ci.appveyor.com/project/seanmonstar/num-cpus)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM rust:1.40
|
||||
FROM rust:latest
|
||||
|
||||
WORKDIR /usr/num_cpus
|
||||
|
||||
|
|
8
third_party/rust/num_cpus/fixtures/cgroups/proc/cgroups/mountinfo_multi_opt
поставляемый
Normal file
8
third_party/rust/num_cpus/fixtures/cgroups/proc/cgroups/mountinfo_multi_opt
поставляемый
Normal file
|
@ -0,0 +1,8 @@
|
|||
1 0 8:1 / / rw,noatime shared:1 - ext4 /dev/sda1 rw,errors=remount-ro,data=reordered
|
||||
2 1 0:1 / /dev rw,relatime shared:2 - devtmpfs udev rw,size=10240k,nr_inodes=16487629,mode=755
|
||||
3 1 0:2 / /proc rw,nosuid,nodev,noexec,relatime shared:3 - proc proc rw
|
||||
4 1 0:3 / /sys rw,nosuid,nodev,noexec,relatime shared:4 - sysfs sysfs rw
|
||||
5 4 0:4 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:5 - tmpfs tmpfs ro,mode=755
|
||||
6 5 0:5 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:6 - cgroup cgroup rw,cpuset
|
||||
7 5 0:6 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:7 shared:8 shared:9 - cgroup cgroup rw,cpu,cpuacct
|
||||
8 5 0:7 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:8 - cgroup cgroup rw,memory
|
8
third_party/rust/num_cpus/fixtures/cgroups/proc/cgroups/mountinfo_zero_opt
поставляемый
Normal file
8
third_party/rust/num_cpus/fixtures/cgroups/proc/cgroups/mountinfo_zero_opt
поставляемый
Normal file
|
@ -0,0 +1,8 @@
|
|||
1 0 8:1 / / rw,noatime shared:1 - ext4 /dev/sda1 rw,errors=remount-ro,data=reordered
|
||||
2 1 0:1 / /dev rw,relatime shared:2 - devtmpfs udev rw,size=10240k,nr_inodes=16487629,mode=755
|
||||
3 1 0:2 / /proc rw,nosuid,nodev,noexec,relatime shared:3 - proc proc rw
|
||||
4 1 0:3 / /sys rw,nosuid,nodev,noexec,relatime shared:4 - sysfs sysfs rw
|
||||
5 4 0:4 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:5 - tmpfs tmpfs ro,mode=755
|
||||
6 5 0:5 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:6 - cgroup cgroup rw,cpuset
|
||||
7 5 0:6 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpu,cpuacct
|
||||
8 5 0:7 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:8 - cgroup cgroup rw,memory
|
|
@ -28,7 +28,6 @@
|
|||
//! [`rayon::ThreadPool`]: https://docs.rs/rayon/1.*/rayon/struct.ThreadPool.html
|
||||
#![cfg_attr(test, deny(warnings))]
|
||||
#![deny(missing_docs)]
|
||||
#![doc(html_root_url = "https://docs.rs/num_cpus/1.13.0")]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
#[cfg(not(windows))]
|
||||
|
@ -47,6 +46,8 @@ use linux::{get_num_cpus, get_num_physical_cpus};
|
|||
/// This function will get the number of logical cores. Sometimes this is different from the number
|
||||
/// of physical cores (See [Simultaneous multithreading on Wikipedia][smt]).
|
||||
///
|
||||
/// This will always return at least `1`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
@ -75,6 +76,8 @@ pub fn get() -> usize {
|
|||
|
||||
/// Returns the number of physical cores of the current system.
|
||||
///
|
||||
/// This will always return at least `1`.
|
||||
///
|
||||
/// # Note
|
||||
///
|
||||
/// Physical count is supported only on Linux, mac OS and Windows platforms.
|
||||
|
|
|
@ -18,7 +18,7 @@ macro_rules! debug {
|
|||
}
|
||||
|
||||
macro_rules! some {
|
||||
($e:expr) => ({
|
||||
($e:expr) => {{
|
||||
match $e {
|
||||
Some(v) => v,
|
||||
None => {
|
||||
|
@ -26,7 +26,7 @@ macro_rules! some {
|
|||
return None;
|
||||
}
|
||||
}
|
||||
})
|
||||
}};
|
||||
}
|
||||
|
||||
pub fn get_num_cpus() -> usize {
|
||||
|
@ -126,18 +126,15 @@ fn init_cgroups() {
|
|||
// Should only be called once
|
||||
debug_assert!(CGROUPS_CPUS.load(Ordering::SeqCst) == 0);
|
||||
|
||||
match load_cgroups("/proc/self/cgroup", "/proc/self/mountinfo") {
|
||||
Some(quota) => {
|
||||
if quota == 0 {
|
||||
return;
|
||||
}
|
||||
|
||||
let logical = logical_cpus();
|
||||
let count = ::std::cmp::min(quota, logical);
|
||||
|
||||
CGROUPS_CPUS.store(count, Ordering::SeqCst);
|
||||
if let Some(quota) = load_cgroups("/proc/self/cgroup", "/proc/self/mountinfo") {
|
||||
if quota == 0 {
|
||||
return;
|
||||
}
|
||||
None => return,
|
||||
|
||||
let logical = logical_cpus();
|
||||
let count = ::std::cmp::min(quota, logical);
|
||||
|
||||
CGROUPS_CPUS.store(count, Ordering::SeqCst);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,18 +164,14 @@ struct Subsys {
|
|||
|
||||
impl Cgroup {
|
||||
fn new(dir: PathBuf) -> Cgroup {
|
||||
Cgroup {
|
||||
base: dir,
|
||||
}
|
||||
Cgroup { base: dir }
|
||||
}
|
||||
|
||||
fn translate(mntinfo: MountInfo, subsys: Subsys) -> Option<Cgroup> {
|
||||
// Translate the subsystem directory via the host paths.
|
||||
debug!(
|
||||
"subsys = {:?}; root = {:?}; mount_point = {:?}",
|
||||
subsys.base,
|
||||
mntinfo.root,
|
||||
mntinfo.mount_point
|
||||
subsys.base, mntinfo.root, mntinfo.mount_point
|
||||
);
|
||||
|
||||
let rel_from_root = some!(Path::new(&subsys.base).strip_prefix(&mntinfo.root).ok());
|
||||
|
@ -238,13 +231,27 @@ impl MountInfo {
|
|||
fn parse_line(line: String) -> Option<MountInfo> {
|
||||
let mut fields = line.split(' ');
|
||||
|
||||
// 7 5 0:6 </> /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:7 - cgroup cgroup rw,cpu,cpuacct
|
||||
let mnt_root = some!(fields.nth(3));
|
||||
let mnt_point = some!(fields.nth(0));
|
||||
// 7 5 0:6 / </sys/fs/cgroup/cpu,cpuacct> rw,nosuid,nodev,noexec,relatime shared:7 - cgroup cgroup rw,cpu,cpuacct
|
||||
let mnt_point = some!(fields.next());
|
||||
|
||||
if fields.nth(3) != Some("cgroup") {
|
||||
// Ignore all fields until the separator(-).
|
||||
// Note: there could be zero or more optional fields before hyphen.
|
||||
// See: https://man7.org/linux/man-pages/man5/proc.5.html
|
||||
// 7 5 0:6 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:7 <-> cgroup cgroup rw,cpu,cpuacct
|
||||
// Note: we cannot use `?` here because we need to support Rust 1.13.
|
||||
match fields.find(|&s| s == "-") {
|
||||
Some(_) => {}
|
||||
None => return None,
|
||||
};
|
||||
|
||||
// 7 5 0:6 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:7 - <cgroup> cgroup rw,cpu,cpuacct
|
||||
if fields.next() != Some("cgroup") {
|
||||
return None;
|
||||
}
|
||||
|
||||
// 7 5 0:6 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:7 - cgroup cgroup <rw,cpu,cpuacct>
|
||||
let super_opts = some!(fields.nth(1));
|
||||
|
||||
// We only care about the 'cpu' option
|
||||
|
@ -281,16 +288,18 @@ impl Subsys {
|
|||
return None;
|
||||
}
|
||||
|
||||
fields.next().map(|path| Subsys { base: path.to_owned() })
|
||||
fields.next().map(|path| Subsys {
|
||||
base: path.to_owned(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::path::{Path, PathBuf};
|
||||
use super::{Cgroup, MountInfo, Subsys};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
|
||||
// `static_in_const` feature is not stable in Rust 1.13.
|
||||
static FIXTURES_PROC: &'static str = "fixtures/cgroups/proc/cgroups";
|
||||
|
||||
static FIXTURES_CGROUPS: &'static str = "fixtures/cgroups/cgroups";
|
||||
|
@ -304,12 +313,29 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_load_mountinfo() {
|
||||
// test only one optional fields
|
||||
let path = join!(FIXTURES_PROC, "mountinfo");
|
||||
|
||||
let mnt_info = MountInfo::load_cpu(path).unwrap();
|
||||
|
||||
assert_eq!(mnt_info.root, "/");
|
||||
assert_eq!(mnt_info.mount_point, "/sys/fs/cgroup/cpu,cpuacct");
|
||||
|
||||
// test zero optional field
|
||||
let path = join!(FIXTURES_PROC, "mountinfo_zero_opt");
|
||||
|
||||
let mnt_info = MountInfo::load_cpu(path).unwrap();
|
||||
|
||||
assert_eq!(mnt_info.root, "/");
|
||||
assert_eq!(mnt_info.mount_point, "/sys/fs/cgroup/cpu,cpuacct");
|
||||
|
||||
// test multi optional fields
|
||||
let path = join!(FIXTURES_PROC, "mountinfo_multi_opt");
|
||||
|
||||
let mnt_info = MountInfo::load_cpu(path).unwrap();
|
||||
|
||||
assert_eq!(mnt_info.root, "/");
|
||||
assert_eq!(mnt_info.mount_point, "/sys/fs/cgroup/cpu,cpuacct");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -324,12 +350,7 @@ mod tests {
|
|||
#[test]
|
||||
fn test_cgroup_mount() {
|
||||
let cases = &[
|
||||
(
|
||||
"/",
|
||||
"/sys/fs/cgroup/cpu",
|
||||
"/",
|
||||
Some("/sys/fs/cgroup/cpu"),
|
||||
),
|
||||
("/", "/sys/fs/cgroup/cpu", "/", Some("/sys/fs/cgroup/cpu")),
|
||||
(
|
||||
"/docker/01abcd",
|
||||
"/sys/fs/cgroup/cpu",
|
||||
|
@ -348,27 +369,10 @@ mod tests {
|
|||
"/docker/01abcd/large",
|
||||
Some("/sys/fs/cgroup/cpu/large"),
|
||||
),
|
||||
|
||||
// fails
|
||||
|
||||
(
|
||||
"/docker/01abcd",
|
||||
"/sys/fs/cgroup/cpu",
|
||||
"/",
|
||||
None,
|
||||
),
|
||||
(
|
||||
"/docker/01abcd",
|
||||
"/sys/fs/cgroup/cpu",
|
||||
"/docker",
|
||||
None,
|
||||
),
|
||||
(
|
||||
"/docker/01abcd",
|
||||
"/sys/fs/cgroup/cpu",
|
||||
"/elsewhere",
|
||||
None,
|
||||
),
|
||||
("/docker/01abcd", "/sys/fs/cgroup/cpu", "/", None),
|
||||
("/docker/01abcd", "/sys/fs/cgroup/cpu", "/docker", None),
|
||||
("/docker/01abcd", "/sys/fs/cgroup/cpu", "/elsewhere", None),
|
||||
(
|
||||
"/docker/01abcd",
|
||||
"/sys/fs/cgroup/cpu",
|
||||
|
@ -387,7 +391,7 @@ mod tests {
|
|||
};
|
||||
|
||||
let actual = Cgroup::translate(mnt_info, subsys).map(|c| c.base);
|
||||
let expected = expected.map(|s| PathBuf::from(s));
|
||||
let expected = expected.map(PathBuf::from);
|
||||
assert_eq!(actual, expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"CHANGELOG.md":"abb8c3977a69e288097ac9e6d86c78b95170fabcaa4454ce3250e06f6fc388ab","Cargo.lock":"8904e3dc1908b63c1c81005d34a1e5e498c639a65f05d306b3388bc88a919f3a","Cargo.toml":"0ab421ab8c48cc6410965fd82a82dbaec19bb8b24adb7bf0cab07870fac472e9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"7e93eec9a4c6c38db0eb3851c1e868c55e64ff2bacc86380d601a2ee08a11589","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/bench_vs_lazy_static.rs":"d527294a2e73b53ac5faed8b316dfd1ae2a06adb31384134af21f10ce76333a5","examples/lazy_static.rs":"90541b093ed1d1cbb73f4097ff02cf80657e28264d281d6a31d96a708fdfea90","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_pl.rs":"cac67286119fcfa2b69ffb9ada51d5cb57c89e95a533d95d5d40b0ae4d38a6c2","src/imp_std.rs":"7a9b58444f71ca3025655f060dabc0f33a775d3b27916e9c22fe4182b286265d","src/lib.rs":"80c30678f1583e6abf5105c704650564505556cf97e30ab507acf70d5e90d25a","src/race.rs":"4b19f459ac16605353e4b6559ea3b194f45c3812aa157e2c0e3a82f67ebacfeb","tests/it.rs":"ed9ff44665f29fa138055800d7199405740bce912f9c568c11aa2ff2249c17f8"},"package":"692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"}
|
||||
{"files":{"CHANGELOG.md":"82ab4befbaaa36caf65981a5b404e2694211e73a893d0bb52c9be4b2c4499c24","Cargo.lock":"a59f0983203428f13b7998cacbcb611d87bb097333f24daaddfeb82cf52758d2","Cargo.toml":"6eb98fe8d0db8728b5d327a25290aebdd2c7d69dd0636baf24422a7b70c6be8f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"7e93eec9a4c6c38db0eb3851c1e868c55e64ff2bacc86380d601a2ee08a11589","bors.toml":"ebd69f714a49dceb8fd10ebadfea6e2767be4732fdef49eddf6239151b4bc78c","examples/bench.rs":"1597a52529f75d6c5ad0b86759a775b1d723dfa810e2016317283b13594219da","examples/bench_acquire.rs":"9f4912ca262194cb55e893c33739c85c2f4868d07905b9dd3238552b6ce8a6e4","examples/bench_vs_lazy_static.rs":"d527294a2e73b53ac5faed8b316dfd1ae2a06adb31384134af21f10ce76333a5","examples/lazy_static.rs":"90541b093ed1d1cbb73f4097ff02cf80657e28264d281d6a31d96a708fdfea90","examples/reentrant_init_deadlocks.rs":"ff84929de27a848e5b155549caa96db5db5f030afca975f8ba3f3da640083001","examples/regex.rs":"4a2e0fb093c7f5bbe0fff8689fc0c670c5334344a1bfda376f5faa98a05d459f","examples/test_synchronization.rs":"88abd5c16275bb2f2d77eaecf369d97681404a77b8edd0021f24bfd377c46be3","src/imp_pl.rs":"cac67286119fcfa2b69ffb9ada51d5cb57c89e95a533d95d5d40b0ae4d38a6c2","src/imp_std.rs":"7a9b58444f71ca3025655f060dabc0f33a775d3b27916e9c22fe4182b286265d","src/lib.rs":"b7263ecf5c5e293903c522a8bfee9fc5e61d1379bc53bb656b34dc0ec4b6cc8c","src/race.rs":"2a6613a50df41c1433e692160cba427f3c7a5624960b82bc6f84ea7b383286c2","tests/it.rs":"ed9ff44665f29fa138055800d7199405740bce912f9c568c11aa2ff2249c17f8"},"package":"da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"}
|
|
@ -1,5 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
## 1.9
|
||||
|
||||
- Added an `atomic-polyfill` optional dependency to compile `race` on platforms without atomics
|
||||
|
||||
## 1.8.0
|
||||
|
||||
- Add `try_insert` API -- a version of `set` that returns a reference.
|
||||
|
|
|
@ -8,14 +8,46 @@ dependencies = [
|
|||
"memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atomic-polyfill"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"critical-section 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"riscv-target 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "bare-metal"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bare-metal"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "bit_field"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "bitfield"
|
||||
version = "0.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.2.1"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
|
@ -28,6 +60,28 @@ name = "cfg-if"
|
|||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "cortex-m"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bare-metal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitfield 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"embedded-hal 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"volatile-register 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "critical-section"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bare-metal 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cortex-m 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"riscv 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.7.2"
|
||||
|
@ -38,9 +92,18 @@ dependencies = [
|
|||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "embedded-hal"
|
||||
version = "0.2.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"nb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "instant"
|
||||
version = "0.1.9"
|
||||
version = "0.1.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -53,12 +116,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.97"
|
||||
version = "0.2.112"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.4"
|
||||
version = "0.4.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -70,44 +133,58 @@ version = "2.2.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.8.0"
|
||||
name = "nb"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"nb 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nb"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.9.0"
|
||||
dependencies = [
|
||||
"atomic-polyfill 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.11.1"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"instant 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lock_api 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot_core 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"instant 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lock_api 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot_core 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.8.3"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"instant 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.97 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"instant 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.112 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.2.8"
|
||||
version = "0.2.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -130,14 +207,54 @@ dependencies = [
|
|||
"ucd-util 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "riscv"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bare-metal 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bit_field 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"riscv-target 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "riscv-target"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver-parser"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.6.1"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
|
@ -158,6 +275,24 @@ name = "utf8-ranges"
|
|||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "vcell"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "void"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "volatile-register"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"vcell 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
|
@ -179,26 +314,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[metadata]
|
||||
"checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282"
|
||||
"checksum atomic-polyfill 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e686d748538a32325b28d6411dd8a939e7ad5128e5d0023cc4fd3573db456042"
|
||||
"checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||
"checksum bare-metal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3"
|
||||
"checksum bare-metal 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8fe8f5a8a398345e52358e18ff07cc17a568fbca5c6f73873d3a62056309603"
|
||||
"checksum bit_field 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4"
|
||||
"checksum bitfield 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719"
|
||||
"checksum bitflags 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
|
||||
"checksum cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
"checksum cortex-m 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ac919ef424449ec8c08d515590ce15d9262c0ca5f0da5b0c901e971a3b783b3"
|
||||
"checksum critical-section 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01e191a5a6f6edad9b679777ef6b6c0f2bdd4a333f2ecb8f61c3e28109a03d70"
|
||||
"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
|
||||
"checksum instant 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec"
|
||||
"checksum embedded-hal 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e36cfb62ff156596c892272f3015ef952fe1525e85261fa3a7f327bd6b384ab9"
|
||||
"checksum instant 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
|
||||
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
"checksum libc 0.2.97 (registry+https://github.com/rust-lang/crates.io-index)" = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6"
|
||||
"checksum lock_api 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb"
|
||||
"checksum libc 0.2.112 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
|
||||
"checksum lock_api 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
|
||||
"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
|
||||
"checksum parking_lot 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
|
||||
"checksum parking_lot_core 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
|
||||
"checksum redox_syscall 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc"
|
||||
"checksum nb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f"
|
||||
"checksum nb 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "546c37ac5d9e56f55e73b677106873d9d9f5190605e41a856503623648488cae"
|
||||
"checksum parking_lot 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
||||
"checksum parking_lot_core 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
|
||||
"checksum redox_syscall 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
|
||||
"checksum regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b23da8dfd98a84bd7e08700190a5d9f7d2d38abd4369dd1dae651bc40bfd2cc"
|
||||
"checksum regex-syntax 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bfaca88e749e19dffb60f77b55e5d87a872fac7e9e48598f7cf93b2d8c047b0a"
|
||||
"checksum riscv 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6907ccdd7a31012b70faf2af85cd9e5ba97657cc3987c4f13f8e4d2c2a088aba"
|
||||
"checksum riscv-target 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88aa938cda42a0cf62a20cfe8d139ff1af20c2e681212b5b34adb5a58333f222"
|
||||
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||
"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||
"checksum smallvec 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
|
||||
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||
"checksum smallvec 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
|
||||
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
|
||||
"checksum ucd-util 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f3bf5cdf1df6b578c0947a94d4740bbb2b2afd1b898e33df1ff07b555a335e4"
|
||||
"checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4"
|
||||
"checksum vcell 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002"
|
||||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||
"checksum volatile-register 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee8f19f9d74293faf70901bc20ad067dc1ad390d2cbf1e3f75f721ffee908b6"
|
||||
"checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
||||
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
|
|
@ -3,17 +3,16 @@
|
|||
# When uploading crates to the registry Cargo will automatically
|
||||
# "normalize" Cargo.toml files for maximal compatibility
|
||||
# with all versions of Cargo and also rewrite `path` dependencies
|
||||
# to registry (e.g., crates.io) dependencies
|
||||
# to registry (e.g., crates.io) dependencies.
|
||||
#
|
||||
# If you believe there's an error in this file please file an
|
||||
# issue against the rust-lang/cargo repository. If you're
|
||||
# editing this file be aware that the upstream Cargo.toml
|
||||
# will likely look very different (and much more reasonable)
|
||||
# If you are reading this file be aware that the original Cargo.toml
|
||||
# will likely look very different (and much more reasonable).
|
||||
# See Cargo.toml.orig for the original contents.
|
||||
|
||||
[package]
|
||||
edition = "2018"
|
||||
name = "once_cell"
|
||||
version = "1.8.0"
|
||||
version = "1.9.0"
|
||||
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
|
||||
exclude = ["*.png", "*.svg", "/Cargo.lock.msrv", "/.travis.yml", "/run-miri-tests.sh", "rustfmt.toml"]
|
||||
description = "Single assignment cells and lazy values."
|
||||
|
@ -53,6 +52,10 @@ required-features = ["std"]
|
|||
[[example]]
|
||||
name = "test_synchronization"
|
||||
required-features = ["std"]
|
||||
[dependencies.atomic-polyfill]
|
||||
version = "0.1"
|
||||
optional = true
|
||||
|
||||
[dependencies.parking_lot]
|
||||
version = "0.11"
|
||||
optional = true
|
||||
|
|
|
@ -441,6 +441,18 @@ pub mod unsync {
|
|||
/// Gets a mutable reference to the underlying value.
|
||||
///
|
||||
/// Returns `None` if the cell is empty.
|
||||
///
|
||||
/// This method is allowed to violate the invariant of writing to a `OnceCell`
|
||||
/// at most once because it requires `&mut` access to `self`. As with all
|
||||
/// interior mutability, `&mut` access permits arbitrary modification:
|
||||
///
|
||||
/// ```
|
||||
/// use once_cell::unsync::OnceCell;
|
||||
///
|
||||
/// let mut cell: OnceCell<u32> = OnceCell::new();
|
||||
/// cell.set(92).unwrap();
|
||||
/// cell = OnceCell::new();
|
||||
/// ```
|
||||
pub fn get_mut(&mut self) -> Option<&mut T> {
|
||||
// Safe because we have unique access
|
||||
unsafe { &mut *self.inner.get() }.as_mut()
|
||||
|
@ -590,6 +602,18 @@ pub mod unsync {
|
|||
/// assert_eq!(cell.take(), Some("hello".to_string()));
|
||||
/// assert_eq!(cell.get(), None);
|
||||
/// ```
|
||||
///
|
||||
/// This method is allowed to violate the invariant of writing to a `OnceCell`
|
||||
/// at most once because it requires `&mut` access to `self`. As with all
|
||||
/// interior mutability, `&mut` access permits arbitrary modification:
|
||||
///
|
||||
/// ```
|
||||
/// use once_cell::unsync::OnceCell;
|
||||
///
|
||||
/// let mut cell: OnceCell<u32> = OnceCell::new();
|
||||
/// cell.set(92).unwrap();
|
||||
/// cell = OnceCell::new();
|
||||
/// ```
|
||||
pub fn take(&mut self) -> Option<T> {
|
||||
mem::replace(self, Self::default()).into_inner()
|
||||
}
|
||||
|
@ -737,7 +761,7 @@ pub mod sync {
|
|||
panic::RefUnwindSafe,
|
||||
};
|
||||
|
||||
use crate::imp::OnceCell as Imp;
|
||||
use crate::{imp::OnceCell as Imp, take_unchecked};
|
||||
|
||||
/// A thread-safe cell which can be written to only once.
|
||||
///
|
||||
|
@ -835,6 +859,18 @@ pub mod sync {
|
|||
/// Gets the mutable reference to the underlying value.
|
||||
///
|
||||
/// Returns `None` if the cell is empty.
|
||||
///
|
||||
/// This method is allowed to violate the invariant of writing to a `OnceCell`
|
||||
/// at most once because it requires `&mut` access to `self`. As with all
|
||||
/// interior mutability, `&mut` access permits arbitrary modification:
|
||||
///
|
||||
/// ```
|
||||
/// use once_cell::sync::OnceCell;
|
||||
///
|
||||
/// let mut cell: OnceCell<u32> = OnceCell::new();
|
||||
/// cell.set(92).unwrap();
|
||||
/// cell = OnceCell::new();
|
||||
/// ```
|
||||
pub fn get_mut(&mut self) -> Option<&mut T> {
|
||||
self.0.get_mut()
|
||||
}
|
||||
|
@ -897,7 +933,7 @@ pub mod sync {
|
|||
/// ```
|
||||
pub fn try_insert(&self, value: T) -> Result<&T, (&T, T)> {
|
||||
let mut value = Some(value);
|
||||
let res = self.get_or_init(|| value.take().unwrap());
|
||||
let res = self.get_or_init(|| unsafe { take_unchecked(&mut value) });
|
||||
match value {
|
||||
None => Ok(res),
|
||||
Some(value) => Err((res, value)),
|
||||
|
@ -999,6 +1035,18 @@ pub mod sync {
|
|||
/// assert_eq!(cell.take(), Some("hello".to_string()));
|
||||
/// assert_eq!(cell.get(), None);
|
||||
/// ```
|
||||
///
|
||||
/// This method is allowed to violate the invariant of writing to a `OnceCell`
|
||||
/// at most once because it requires `&mut` access to `self`. As with all
|
||||
/// interior mutability, `&mut` access permits arbitrary modification:
|
||||
///
|
||||
/// ```
|
||||
/// use once_cell::sync::OnceCell;
|
||||
///
|
||||
/// let mut cell: OnceCell<u32> = OnceCell::new();
|
||||
/// cell.set(92).unwrap();
|
||||
/// cell = OnceCell::new();
|
||||
/// ```
|
||||
pub fn take(&mut self) -> Option<T> {
|
||||
mem::replace(self, Self::default()).into_inner()
|
||||
}
|
||||
|
|
|
@ -6,10 +6,13 @@
|
|||
//!
|
||||
//! This module does not require `std` feature.
|
||||
|
||||
use core::{
|
||||
num::NonZeroUsize,
|
||||
sync::atomic::{AtomicUsize, Ordering},
|
||||
};
|
||||
#[cfg(feature = "atomic-polyfill")]
|
||||
use atomic_polyfill as atomic;
|
||||
#[cfg(not(feature = "atomic-polyfill"))]
|
||||
use core::sync::atomic;
|
||||
|
||||
use atomic::{AtomicUsize, Ordering};
|
||||
use core::num::NonZeroUsize;
|
||||
|
||||
/// A thread-safe cell which can be written to only once.
|
||||
#[derive(Default, Debug)]
|
||||
|
@ -160,21 +163,23 @@ pub use self::once_box::OnceBox;
|
|||
|
||||
#[cfg(feature = "alloc")]
|
||||
mod once_box {
|
||||
use core::{
|
||||
marker::PhantomData,
|
||||
ptr,
|
||||
sync::atomic::{AtomicPtr, Ordering},
|
||||
};
|
||||
use super::atomic::{AtomicPtr, Ordering};
|
||||
use core::{marker::PhantomData, ptr};
|
||||
|
||||
use alloc::boxed::Box;
|
||||
|
||||
/// A thread-safe cell which can be written to only once.
|
||||
#[derive(Debug)]
|
||||
pub struct OnceBox<T> {
|
||||
inner: AtomicPtr<T>,
|
||||
ghost: PhantomData<Option<Box<T>>>,
|
||||
}
|
||||
|
||||
impl<T> core::fmt::Debug for OnceBox<T> {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
write!(f, "OnceBox({:?})", self.inner.load(Ordering::Relaxed))
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Default for OnceBox<T> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"Cargo.toml":"6691c704de55962c48e8e34a109ae4948427fdb453836f7bdd62ac9c9fb50992","LICENSE-APACHE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","build.rs":"ff90cd6a515a5eab716f63f3af90db47c411ac3a1629800731fb73de832495aa","src/lib.rs":"57267f77a182d4baf651b3495eb89cb326bebb17c2f2f69a5e351bf1529d775b","src/pin_project/attribute.rs":"6601b126a642b25a4c0a5fbb2bbeb2bdc59ecb28eb678ef40595fc28001e5433","src/pin_project/derive.rs":"f97503dcdd13c15f27bfc24a557701fc9790218041ada1491cfc96b8dce67762","src/pin_project/mod.rs":"149bda261825c80b1043ce1a26f944f69d939d86e5fc37fd1f71969469202b2f","src/pinned_drop.rs":"1feb86175c035c2cbe5e5a0a43d18d2502d764d930644c5456d0ae249b4bbc2c","src/project.rs":"c1fe5164374317ada25ce0a26945c2fd2484d611de60b8ce05adc15013d768b2","src/utils.rs":"120e4c49164a1cbaf5e9f6632f29d88ab9821acb34355758c6b1566233a2fccc"},"package":"3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e"}
|
||||
{"files":{"Cargo.toml":"5258b88a2b398ff9c68a822446c6d524ac475545f38d39140ba17e54277f82e5","LICENSE-APACHE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","build.rs":"ff90cd6a515a5eab716f63f3af90db47c411ac3a1629800731fb73de832495aa","src/lib.rs":"e3e8f00f9c9ada23bb4783ff964b08e24dd2d6e3e159ec2b0b788370b38a50a7","src/pin_project/attribute.rs":"4bf467e46315e87a181ad4ef99c8a9f1936505c4f3d72d57ab737244bf957fd7","src/pin_project/derive.rs":"caae2a40a61e556f75718d80338f550610c21c36876e3e6b42ccfa1b88f28c2d","src/pin_project/mod.rs":"149bda261825c80b1043ce1a26f944f69d939d86e5fc37fd1f71969469202b2f","src/pinned_drop.rs":"cd028eb8f588dbfe3239ef1287a655de17c224cfdc19b9803b795d231e2f10e3","src/project.rs":"bebfed7481d93661d5af28fcadf8919ec90bdfd9e588cbe2955165a2b2e00ce4","src/utils.rs":"637418e3b2df45427c5047caa57e4bb65a632d5d78d03b300d3e4b9e1125df41"},"package":"044964427019eed9d49d9d5bbce6047ef18f37100ea400912a9fa4a3523ab12a"}
|
|
@ -3,20 +3,18 @@
|
|||
# When uploading crates to the registry Cargo will automatically
|
||||
# "normalize" Cargo.toml files for maximal compatibility
|
||||
# with all versions of Cargo and also rewrite `path` dependencies
|
||||
# to registry (e.g., crates.io) dependencies
|
||||
# to registry (e.g., crates.io) dependencies.
|
||||
#
|
||||
# If you believe there's an error in this file please file an
|
||||
# issue against the rust-lang/cargo repository. If you're
|
||||
# editing this file be aware that the upstream Cargo.toml
|
||||
# will likely look very different (and much more reasonable)
|
||||
# If you are reading this file be aware that the original Cargo.toml
|
||||
# will likely look very different (and much more reasonable).
|
||||
# See Cargo.toml.orig for the original contents.
|
||||
|
||||
[package]
|
||||
edition = "2018"
|
||||
rust-version = "1.34"
|
||||
name = "pin-project-internal"
|
||||
version = "0.4.28"
|
||||
authors = ["Taiki Endo <te316e89@gmail.com>"]
|
||||
version = "0.4.29"
|
||||
description = "Implementation detail of the `pin-project` crate.\n"
|
||||
documentation = "https://docs.rs/pin-project-internal"
|
||||
keywords = ["pin", "macros", "attribute"]
|
||||
categories = ["no-std", "rust-patterns"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
))]
|
||||
#![warn(unsafe_code)]
|
||||
#![warn(rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
|
||||
#![warn(clippy::all, clippy::default_trait_access)]
|
||||
#![warn(clippy::default_trait_access, clippy::wildcard_imports)]
|
||||
// mem::take and #[non_exhaustive] requires Rust 1.40
|
||||
#![allow(clippy::mem_replace_with_default, clippy::manual_non_exhaustive)]
|
||||
#![allow(clippy::needless_doctest_main)]
|
||||
|
|
|
@ -2,7 +2,7 @@ use proc_macro2::TokenStream;
|
|||
use quote::quote;
|
||||
use syn::{
|
||||
parse::{Parse, ParseStream},
|
||||
*,
|
||||
Attribute, Result, Token, Visibility,
|
||||
};
|
||||
|
||||
use super::PIN;
|
||||
|
|
|
@ -2,9 +2,13 @@ use proc_macro2::{Delimiter, Group, Span, TokenStream};
|
|||
use quote::{format_ident, quote, quote_spanned, ToTokens};
|
||||
use syn::{
|
||||
parse::{Parse, ParseStream},
|
||||
parse_quote,
|
||||
spanned::Spanned,
|
||||
token,
|
||||
visit_mut::VisitMut,
|
||||
*,
|
||||
Attribute, Data, DataEnum, DataStruct, DeriveInput, Error, Field, Fields, FieldsNamed,
|
||||
FieldsUnnamed, Generics, Ident, Index, Lifetime, LifetimeDef, Meta, MetaList, NestedMeta,
|
||||
Result, Token, Type, Variant, Visibility, WhereClause,
|
||||
};
|
||||
|
||||
use super::PIN;
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
use proc_macro2::TokenStream;
|
||||
use quote::{quote, ToTokens};
|
||||
use syn::{spanned::Spanned, visit_mut::VisitMut, *};
|
||||
use syn::{
|
||||
parse_quote, spanned::Spanned, visit_mut::VisitMut, Error, FnArg, GenericArgument, Ident,
|
||||
ImplItem, ImplItemMethod, ItemImpl, Pat, Path, PathArguments, Result, ReturnType, Token, Type,
|
||||
TypePath, TypeReference,
|
||||
};
|
||||
|
||||
use crate::utils::{parse_as_empty, prepend_underscore_to_self, ReplaceReceiver, SliceExt};
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
use proc_macro2::{Span, TokenStream};
|
||||
use quote::ToTokens;
|
||||
use syn::{
|
||||
parse_quote,
|
||||
visit_mut::{self, VisitMut},
|
||||
*,
|
||||
Expr, ExprLet, ExprMatch, Ident, ImplItem, Item, ItemFn, ItemImpl, ItemUse, Lifetime, Local,
|
||||
Pat, PatBox, PatIdent, PatOr, PatPath, PatReference, PatStruct, PatTupleStruct, PatType, Path,
|
||||
PathArguments, PathSegment, Result, Stmt, Type, TypePath, UseTree,
|
||||
};
|
||||
|
||||
use crate::utils::{
|
||||
|
|
|
@ -4,9 +4,13 @@ use proc_macro2::{Group, Spacing, Span, TokenStream, TokenTree};
|
|||
use quote::{format_ident, quote, quote_spanned, ToTokens};
|
||||
use syn::{
|
||||
parse::{Parse, ParseBuffer, ParseStream},
|
||||
parse_quote,
|
||||
punctuated::Punctuated,
|
||||
token,
|
||||
visit_mut::{self, VisitMut},
|
||||
*,
|
||||
Attribute, ExprPath, ExprStruct, Generics, Ident, Item, Lifetime, LifetimeDef, Macro, PatPath,
|
||||
PatStruct, PatTupleStruct, Path, PathArguments, PredicateType, QSelf, Result, Token, Type,
|
||||
TypeParamBound, TypePath, Variant, Visibility, WherePredicate,
|
||||
};
|
||||
|
||||
pub(crate) type Variants = Punctuated<Variant, Token![,]>;
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -4,13 +4,21 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
This project adheres to [Semantic Versioning](https://semver.org).
|
||||
|
||||
<!--
|
||||
NOTE: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering.
|
||||
-->
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.4.29] - 2021-12-26
|
||||
|
||||
- [Fix compile error with `syn` 1.0.84 and later.](https://github.com/taiki-e/pin-project/pull/335)
|
||||
|
||||
## [0.4.28] - 2021-03-28
|
||||
|
||||
- [Fix `unused_must_use` warning on unused borrows, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/322) See [#322](https://github.com/taiki-e/pin-project/pull/322) for more details.
|
||||
|
||||
(Note: 1.0 does not have this problem.)
|
||||
(NOTE: 1.0 does not have this problem.)
|
||||
|
||||
## [0.4.27] - 2020-10-11
|
||||
|
||||
|
@ -24,13 +32,13 @@ This project adheres to [Semantic Versioning](https://semver.org).
|
|||
|
||||
- [Suppress `drop_bounds` lint, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/273) See [#272](https://github.com/taiki-e/pin-project/issues/272) for more details.
|
||||
|
||||
(Note: 1.0.0-alpha.1 already contains this change.)
|
||||
(NOTE: 1.0.0-alpha.1 already contains this change.)
|
||||
|
||||
## [0.4.24] - 2020-09-26
|
||||
|
||||
- [Fix compatibility of generated code with `forbid(future_incompatible)`.](https://github.com/taiki-e/pin-project/pull/282)
|
||||
|
||||
Note: This does not guarantee compatibility with `forbid(future_incompatible)` in the future.
|
||||
NOTE: This does not guarantee compatibility with `forbid(future_incompatible)` in the future.
|
||||
If rustc adds a new lint, we may not be able to keep this.
|
||||
|
||||
## [0.4.23] - 2020-07-27
|
||||
|
@ -161,7 +169,7 @@ This project adheres to [Semantic Versioning](https://semver.org).
|
|||
}
|
||||
```
|
||||
|
||||
*[Note: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.](https://github.com/taiki-e/pin-project/pull/219#pullrequestreview-408644187)*
|
||||
*[NOTE: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.](https://github.com/taiki-e/pin-project/pull/219#pullrequestreview-408644187)*
|
||||
|
||||
- [Fix an issue where duplicate `#[project]` attributes were ignored.](https://github.com/taiki-e/pin-project/pull/218)
|
||||
|
||||
|
@ -195,7 +203,7 @@ This project adheres to [Semantic Versioning](https://semver.org).
|
|||
|
||||
## [0.4.11] - 2020-05-07
|
||||
|
||||
**Note: This release has been yanked.** See [#206](https://github.com/taiki-e/pin-project/issues/206) for details.
|
||||
**NOTE:** This release has been yanked. See [#206](https://github.com/taiki-e/pin-project/issues/206) for details.
|
||||
|
||||
- [Fix an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197)
|
||||
|
||||
|
@ -249,7 +257,7 @@ This project adheres to [Semantic Versioning](https://semver.org).
|
|||
|
||||
## [0.4.3] - 2019-10-15
|
||||
|
||||
**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
|
||||
**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
|
||||
|
||||
- [`#[pin_project]` can now interoperate with `#[cfg_attr()]`.](https://github.com/taiki-e/pin-project/pull/135)
|
||||
|
||||
|
@ -261,19 +269,19 @@ This project adheres to [Semantic Versioning](https://semver.org).
|
|||
|
||||
## [0.4.2] - 2019-09-29
|
||||
|
||||
**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
|
||||
**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
|
||||
|
||||
- [Fix support for DSTs(Dynamically Sized Types).](https://github.com/taiki-e/pin-project/pull/113)
|
||||
|
||||
## [0.4.1] - 2019-09-26
|
||||
|
||||
**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
|
||||
**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
|
||||
|
||||
- [Fix an issue that caused an error when using `#[pin_project]` on a type that has `#[pin]` + `!Unpin` field with no generics or lifetime.](https://github.com/taiki-e/pin-project/pull/111)
|
||||
|
||||
## [0.4.0] - 2019-09-25
|
||||
|
||||
**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
|
||||
**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details.
|
||||
|
||||
- [**Pin projection has become a safe operation.**](https://github.com/taiki-e/pin-project/pull/18) In the absence of other unsafe code that you write, it is impossible to cause undefined behavior.
|
||||
|
||||
|
@ -402,7 +410,7 @@ Changes since the 0.4.0-beta.1 release:
|
|||
|
||||
- `Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait.
|
||||
|
||||
- Made `#[project]` attribute disabled by default.
|
||||
- Make `#[project]` attribute disabled by default.
|
||||
|
||||
See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project/issues/21).
|
||||
|
||||
|
@ -416,7 +424,7 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project
|
|||
|
||||
## [0.3.3] - 2019-07-15
|
||||
|
||||
**Note: This release has been yanked.** See [#16](https://github.com/taiki-e/pin-project/issues/16) for details.
|
||||
**NOTE:** This release has been yanked. See [#16](https://github.com/taiki-e/pin-project/issues/16) for details.
|
||||
|
||||
- Diagnostic improvements.
|
||||
|
||||
|
@ -490,11 +498,12 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project
|
|||
|
||||
## [0.1.0] - 2019-01-08
|
||||
|
||||
**Note: This release has been yanked.**
|
||||
**NOTE:** This release has been yanked.
|
||||
|
||||
Initial release
|
||||
|
||||
[Unreleased]: https://github.com/taiki-e/pin-project/compare/v0.4.28...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/pin-project/compare/v0.4.29...v0.4
|
||||
[0.4.29]: https://github.com/taiki-e/pin-project/compare/v0.4.28...v0.4.29
|
||||
[0.4.28]: https://github.com/taiki-e/pin-project/compare/v0.4.27...v0.4.28
|
||||
[0.4.27]: https://github.com/taiki-e/pin-project/compare/v0.4.26...v0.4.27
|
||||
[0.4.26]: https://github.com/taiki-e/pin-project/compare/v0.4.25...v0.4.26
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "glob"
|
||||
version = "0.3.0"
|
||||
|
@ -8,9 +10,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
|||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "0.4.7"
|
||||
version = "0.4.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
|
||||
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
|
@ -20,18 +22,20 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||
|
||||
[[package]]
|
||||
name = "pin-project"
|
||||
version = "0.4.28"
|
||||
version = "0.4.29"
|
||||
dependencies = [
|
||||
"pin-project-internal",
|
||||
"rustversion",
|
||||
"ryu",
|
||||
"serde_json",
|
||||
"trybuild",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-internal"
|
||||
version = "0.4.28"
|
||||
version = "0.4.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e"
|
||||
checksum = "044964427019eed9d49d9d5bbce6047ef18f37100ea400912a9fa4a3523ab12a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -40,48 +44,48 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.24"
|
||||
version = "1.0.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
|
||||
checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1"
|
||||
dependencies = [
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.9"
|
||||
version = "1.0.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
|
||||
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.4"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd"
|
||||
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.5"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
|
||||
checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.125"
|
||||
version = "1.0.132"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171"
|
||||
checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.125"
|
||||
version = "1.0.132"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d"
|
||||
checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -90,9 +94,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.64"
|
||||
version = "1.0.72"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79"
|
||||
checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
|
@ -101,9 +105,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.65"
|
||||
version = "1.0.84"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3a1d708c221c5a612956ef9f75b37e454e88d1f7b899fbd3a18d4252012d663"
|
||||
checksum = "ecb2e6da8ee5eb9a61068762a32fa9619cc591ceb055b3687f4cd4051ec2e06b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -130,9 +134,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "trybuild"
|
||||
version = "1.0.41"
|
||||
version = "1.0.53"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "99471a206425fba51842a9186315f32d91c56eadc21ea4c21f847b59cf778f8b"
|
||||
checksum = "9d664de8ea7e531ad4c0f5a834f20b8cb2b8e6dfe88d05796ee7887518ed67b9"
|
||||
dependencies = [
|
||||
"glob",
|
||||
"lazy_static",
|
||||
|
@ -144,9 +148,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
|
|
|
@ -3,21 +3,19 @@
|
|||
# When uploading crates to the registry Cargo will automatically
|
||||
# "normalize" Cargo.toml files for maximal compatibility
|
||||
# with all versions of Cargo and also rewrite `path` dependencies
|
||||
# to registry (e.g., crates.io) dependencies
|
||||
# to registry (e.g., crates.io) dependencies.
|
||||
#
|
||||
# If you believe there's an error in this file please file an
|
||||
# issue against the rust-lang/cargo repository. If you're
|
||||
# editing this file be aware that the upstream Cargo.toml
|
||||
# will likely look very different (and much more reasonable)
|
||||
# If you are reading this file be aware that the original Cargo.toml
|
||||
# will likely look very different (and much more reasonable).
|
||||
# See Cargo.toml.orig for the original contents.
|
||||
|
||||
[package]
|
||||
edition = "2018"
|
||||
rust-version = "1.34"
|
||||
name = "pin-project"
|
||||
version = "0.4.28"
|
||||
authors = ["Taiki Endo <te316e89@gmail.com>"]
|
||||
version = "0.4.29"
|
||||
exclude = ["/.*", "/ci", "/tools"]
|
||||
description = "A crate for safe and ergonomic pin-projection.\n"
|
||||
documentation = "https://docs.rs/pin-project"
|
||||
keywords = ["pin", "macros", "attribute"]
|
||||
categories = ["no-std", "rust-patterns"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
|
@ -25,10 +23,16 @@ repository = "https://github.com/taiki-e/pin-project"
|
|||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
[dependencies.pin-project-internal]
|
||||
version = "=0.4.28"
|
||||
version = "=0.4.29"
|
||||
default-features = false
|
||||
[dev-dependencies.rustversion]
|
||||
version = "1.0"
|
||||
|
||||
[dev-dependencies.ryu]
|
||||
version = "=1.0.6"
|
||||
|
||||
[dev-dependencies.serde_json]
|
||||
version = "=1.0.72"
|
||||
|
||||
[dev-dependencies.trybuild]
|
||||
version = "1.0"
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code))
|
||||
))]
|
||||
#![warn(missing_docs, rust_2018_idioms, single_use_lifetimes, unreachable_pub)]
|
||||
#![warn(clippy::all, clippy::default_trait_access)]
|
||||
#![warn(clippy::default_trait_access, clippy::wildcard_imports)]
|
||||
// mem::take and #[non_exhaustive] requires Rust 1.40
|
||||
#![allow(clippy::mem_replace_with_default, clippy::manual_non_exhaustive)]
|
||||
#![allow(clippy::needless_doctest_main)]
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
single_use_lifetimes,
|
||||
trivial_casts,
|
||||
trivial_numeric_casts,
|
||||
unaligned_references,
|
||||
unreachable_pub,
|
||||
unused_extern_crates,
|
||||
unused_import_braces,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0599]: no method named `project` found for struct `Pin<&mut Foo<u8>>` in the current scope
|
||||
--> $DIR/cfg_attr-resolve.rs:10:31
|
||||
--> tests/ui/cfg/cfg_attr-resolve.rs:10:31
|
||||
|
|
||||
10 | let _x = Pin::new(&mut x).project(); //~ ERROR E0599
|
||||
| ^^^^^^^ method not found in `Pin<&mut Foo<u8>>`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/cfg_attr-type-mismatch.rs:19:27
|
||||
--> tests/ui/cfg/cfg_attr-type-mismatch.rs:19:27
|
||||
|
|
||||
19 | let _: Pin<&mut u8> = x.inner; //~ ERROR E0308
|
||||
| ------------ ^^^^^^^ expected struct `Pin`, found `&mut u8`
|
||||
|
@ -10,7 +10,7 @@ error[E0308]: mismatched types
|
|||
found mutable reference `&mut u8`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/cfg_attr-type-mismatch.rs:23:22
|
||||
--> tests/ui/cfg/cfg_attr-type-mismatch.rs:23:22
|
||||
|
|
||||
23 | let _: &mut u8 = x.inner; //~ ERROR E0308
|
||||
| ------- ^^^^^^^
|
||||
|
|
|
@ -1,22 +1,43 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/cfg_attr-unpin.rs:18:5
|
||||
--> tests/ui/cfg/cfg_attr-unpin.rs:18:5
|
||||
|
|
||||
15 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
18 | is_unpin::<Foo<PhantomPinned>>(); // ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Foo<PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `Foo<PhantomPinned>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/cfg_attr-unpin.rs:20:5
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `Foo<PhantomPinned>`
|
||||
--> tests/ui/cfg/cfg_attr-unpin.rs:5:8
|
||||
|
|
||||
5 | struct Foo<T> {
|
||||
| ^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/cfg/cfg_attr-unpin.rs:15:16
|
||||
|
|
||||
15 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/cfg/cfg_attr-unpin.rs:20:5
|
||||
|
|
||||
20 | is_unpin::<Bar<PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__Bar<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `__Bar<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Bar<PhantomPinned>`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `__Bar<'_, PhantomPinned>`
|
||||
--> tests/ui/cfg/cfg_attr-unpin.rs:10:8
|
||||
|
|
||||
10 | struct Bar<T> {
|
||||
| ^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `Bar<PhantomPinned>`
|
||||
--> tests/ui/cfg/cfg_attr-unpin.rs:9:24
|
||||
|
|
||||
9 | #[cfg_attr(not(any()), pin_project)]
|
||||
| ^^^^^^^^^^^
|
||||
10 | struct Bar<T> {
|
||||
| ^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/cfg/cfg_attr-unpin.rs:15:16
|
||||
|
|
||||
15 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed_sneaky-span-issue-1.rs:8:1
|
||||
--> tests/ui/cfg/packed_sneaky-span-issue-1.rs:8:1
|
||||
|
|
||||
8 | #[hidden_repr(packed)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed_sneaky-span-issue-2.rs:8:1
|
||||
--> tests/ui/cfg/packed_sneaky-span-issue-2.rs:8:1
|
||||
|
|
||||
8 | #[hidden_repr(packed)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed_sneaky.rs:6:1
|
||||
--> tests/ui/cfg/packed_sneaky.rs:6:1
|
||||
|
|
||||
6 | #[hidden_repr_cfg_not_any(packed)] //~ ERROR may not be used on #[repr(packed)] types
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the attribute macro `hidden_repr_cfg_not_any` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,11 +1,25 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/proper_unpin.rs:27:5
|
||||
--> tests/ui/cfg/proper_unpin.rs:27:5
|
||||
|
|
||||
22 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
27 | is_unpin::<Bar<PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__Bar<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `__Bar<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Bar<PhantomPinned>`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `__Bar<'_, PhantomPinned>`
|
||||
--> tests/ui/cfg/proper_unpin.rs:14:8
|
||||
|
|
||||
14 | struct Bar<T> {
|
||||
| ^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `Bar<PhantomPinned>`
|
||||
--> tests/ui/cfg/proper_unpin.rs:13:1
|
||||
|
|
||||
13 | #[pin_project]
|
||||
| ^^^^^^^^^^^^^^
|
||||
14 | struct Bar<T> {
|
||||
| ^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/cfg/proper_unpin.rs:22:16
|
||||
|
|
||||
22 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
error: #[pin_project] attribute may not be used on structs with zero fields
|
||||
--> $DIR/unsupported.rs:7:1
|
||||
--> tests/ui/cfg/unsupported.rs:7:15
|
||||
|
|
||||
7 | / struct Struct {
|
||||
7 | struct Struct {
|
||||
| _______________^
|
||||
8 | | #[cfg(any())]
|
||||
9 | | #[pin]
|
||||
10 | | f: u8,
|
||||
|
|
|
@ -1,83 +1,146 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/assert-not-unpin.rs:31:5
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:31:5
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
31 | is_unpin::<Foo<(), ()>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
= note: required because it appears within the type `Wrapper<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Foo<(), ()>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/assert-not-unpin.rs:32:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `Foo<(), ()>`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:8:15
|
||||
|
|
||||
8 | #[pin_project(!Unpin)]
|
||||
| ^^^^^^
|
||||
9 | struct Foo<T, U> {
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:32:5
|
||||
|
|
||||
32 | is_unpin::<Foo<PhantomPinned, ()>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
= note: required because it appears within the type `Wrapper<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned, ()>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/assert-not-unpin.rs:33:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned, ()>`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:8:15
|
||||
|
|
||||
8 | #[pin_project(!Unpin)]
|
||||
| ^^^^^^
|
||||
9 | struct Foo<T, U> {
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:33:5
|
||||
|
|
||||
33 | is_unpin::<Foo<(), PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
= note: required because it appears within the type `Wrapper<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Foo<(), PhantomPinned>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/assert-not-unpin.rs:34:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `Foo<(), PhantomPinned>`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:8:15
|
||||
|
|
||||
8 | #[pin_project(!Unpin)]
|
||||
| ^^^^^^
|
||||
9 | struct Foo<T, U> {
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:34:5
|
||||
|
|
||||
34 | is_unpin::<Foo<PhantomPinned, PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
= note: required because it appears within the type `Wrapper<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned, PhantomPinned>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/assert-not-unpin.rs:36:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned, PhantomPinned>`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:8:15
|
||||
|
|
||||
8 | #[pin_project(!Unpin)]
|
||||
| ^^^^^^
|
||||
9 | struct Foo<T, U> {
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:36:5
|
||||
|
|
||||
36 | is_unpin::<TrivialBounds>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
= note: required because it appears within the type `Wrapper<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `TrivialBounds`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/assert-not-unpin.rs:38:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `TrivialBounds`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:15:15
|
||||
|
|
||||
15 | #[pin_project(!Unpin)]
|
||||
| ^^^^^^
|
||||
16 | struct TrivialBounds {
|
||||
| ^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:38:5
|
||||
|
|
||||
38 | is_unpin::<Bar<'_, (), ()>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
= note: required because it appears within the type `Wrapper<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Bar<'_, (), ()>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/assert-not-unpin.rs:39:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `Bar<'_, (), ()>`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:21:15
|
||||
|
|
||||
21 | #[pin_project(!Unpin)]
|
||||
| ^^^^^^
|
||||
22 | struct Bar<'a, T, U> {
|
||||
| ^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:39:5
|
||||
|
|
||||
39 | is_unpin::<Bar<'_, PhantomPinned, PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
= note: required because it appears within the type `Wrapper<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Bar<'_, PhantomPinned, PhantomPinned>`
|
||||
note: required because of the requirements on the impl of `Unpin` for `Bar<'_, PhantomPinned, PhantomPinned>`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:21:15
|
||||
|
|
||||
21 | #[pin_project(!Unpin)]
|
||||
| ^^^^^^
|
||||
22 | struct Bar<'a, T, U> {
|
||||
| ^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/not_unpin/assert-not-unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:3:15
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
|
||||
--> tests/ui/not_unpin/conflict-unpin.rs:3:15
|
||||
|
|
||||
3 | #[pin_project(!Unpin)] //~ ERROR E0119
|
||||
| ^^^^^^ conflicting implementation for `Foo<_, _>`
|
||||
|
@ -7,8 +7,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
10 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {}
|
||||
| --------------------------------------------- first implementation here
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:12:15
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`
|
||||
--> tests/ui/not_unpin/conflict-unpin.rs:12:15
|
||||
|
|
||||
12 | #[pin_project(!Unpin)] //~ ERROR E0119
|
||||
| ^^^^^^ conflicting implementation for `Bar<_, _>`
|
||||
|
@ -16,8 +16,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
19 | impl<T, U> Unpin for Bar<T, U> {}
|
||||
| ------------------------------ first implementation here
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:21:15
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`
|
||||
--> tests/ui/not_unpin/conflict-unpin.rs:21:15
|
||||
|
|
||||
21 | #[pin_project(!Unpin)] //~ ERROR E0119
|
||||
| ^^^^^^ conflicting implementation for `Baz<_, _>`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`:
|
||||
--> $DIR/impl-unsafe-unpin.rs:3:1
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`
|
||||
--> tests/ui/not_unpin/impl-unsafe-unpin.rs:3:1
|
||||
|
|
||||
3 | #[pin_project(!Unpin)] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>`
|
||||
|
@ -7,10 +7,10 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
|||
10 | unsafe impl<T, U> UnsafeUnpin for Foo<T, U> where T: Unpin {}
|
||||
| ---------------------------------------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`:
|
||||
--> $DIR/impl-unsafe-unpin.rs:12:1
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`
|
||||
--> tests/ui/not_unpin/impl-unsafe-unpin.rs:12:1
|
||||
|
|
||||
12 | #[pin_project(!Unpin)] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
|
||||
|
@ -18,10 +18,10 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
|||
19 | unsafe impl<T, U> UnsafeUnpin for Bar<T, U> {}
|
||||
| ------------------------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`:
|
||||
--> $DIR/impl-unsafe-unpin.rs:21:1
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`
|
||||
--> tests/ui/not_unpin/impl-unsafe-unpin.rs:21:1
|
||||
|
|
||||
21 | #[pin_project(!Unpin)] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>`
|
||||
|
@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
|||
28 | unsafe impl<T: Unpin, U: Unpin> UnsafeUnpin for Baz<T, U> {}
|
||||
| --------------------------------------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
error: duplicate #[pin] attribute
|
||||
--> $DIR/add-attr-to-struct.rs:6:1
|
||||
--> tests/ui/pin_project/add-attr-to-struct.rs:6:1
|
||||
|
|
||||
6 | #[add_pin_attr(struct)] //~ ERROR duplicate #[pin] attribute
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the attribute macro `add_pin_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: #[pin] attribute may only be used on fields of structs or variants
|
||||
--> $DIR/add-attr-to-struct.rs:12:1
|
||||
--> tests/ui/pin_project/add-attr-to-struct.rs:12:1
|
||||
|
|
||||
12 | #[add_pin_attr(struct)] //~ ERROR #[pin] attribute may only be used on fields of structs or variants
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the attribute macro `add_pin_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,23 +1,52 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/add-pinned-field.rs:21:5
|
||||
--> tests/ui/pin_project/add-pinned-field.rs:21:5
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
21 | is_unpin::<Foo>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^ within `__Foo<'_>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `__Foo<'_>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Foo`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/add-pinned-field.rs:22:5
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `__Foo<'_>`
|
||||
--> tests/ui/pin_project/add-pinned-field.rs:8:8
|
||||
|
|
||||
8 | struct Foo {
|
||||
| ^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `Foo`
|
||||
--> tests/ui/pin_project/add-pinned-field.rs:6:1
|
||||
|
|
||||
6 | #[pin_project]
|
||||
| ^^^^^^^^^^^^^^
|
||||
7 | #[add_pinned_field]
|
||||
8 | struct Foo {
|
||||
| ^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/pin_project/add-pinned-field.rs:4:16
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/pin_project/add-pinned-field.rs:22:5
|
||||
|
|
||||
22 | is_unpin::<Bar>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^ within `__Bar<'_>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `__Bar<'_>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Bar`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `__Bar<'_>`
|
||||
--> tests/ui/pin_project/add-pinned-field.rs:15:8
|
||||
|
|
||||
15 | struct Bar {
|
||||
| ^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `Bar`
|
||||
--> tests/ui/pin_project/add-pinned-field.rs:14:1
|
||||
|
|
||||
14 | #[pin_project]
|
||||
| ^^^^^^^^^^^^^^
|
||||
15 | struct Bar {
|
||||
| ^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/pin_project/add-pinned-field.rs:4:16
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>`:
|
||||
--> $DIR/conflict-drop.rs:4:1
|
||||
error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>`
|
||||
--> tests/ui/pin_project/conflict-drop.rs:4:1
|
||||
|
|
||||
4 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
@ -7,10 +7,10 @@ error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for t
|
|||
| first implementation here
|
||||
| conflicting implementation for `Foo<_, _>`
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>`:
|
||||
--> $DIR/conflict-drop.rs:15:15
|
||||
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>`
|
||||
--> tests/ui/pin_project/conflict-drop.rs:15:15
|
||||
|
|
||||
15 | #[pin_project(PinnedDrop)] //~ ERROR E0119
|
||||
| ^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:5:1
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
|
||||
--> tests/ui/pin_project/conflict-unpin.rs:5:1
|
||||
|
|
||||
5 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>`
|
||||
|
@ -7,10 +7,10 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
13 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl
|
||||
| --------------------------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:17:1
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`
|
||||
--> tests/ui/pin_project/conflict-unpin.rs:17:1
|
||||
|
|
||||
17 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
|
||||
|
@ -18,10 +18,10 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
25 | impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl
|
||||
| ------------------------------ first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:27:1
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`
|
||||
--> tests/ui/pin_project/conflict-unpin.rs:27:1
|
||||
|
|
||||
27 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>`
|
||||
|
@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
35 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl
|
||||
| -------------------------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`:
|
||||
--> $DIR/impl-unsafe-unpin.rs:3:1
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`
|
||||
--> tests/ui/pin_project/impl-unsafe-unpin.rs:3:1
|
||||
|
|
||||
3 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>`
|
||||
|
@ -7,10 +7,10 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
|||
10 | unsafe impl<T, U> UnsafeUnpin for Foo<T, U> where T: Unpin {}
|
||||
| ---------------------------------------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`:
|
||||
--> $DIR/impl-unsafe-unpin.rs:12:1
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`
|
||||
--> tests/ui/pin_project/impl-unsafe-unpin.rs:12:1
|
||||
|
|
||||
12 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
|
||||
|
@ -18,10 +18,10 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
|||
19 | unsafe impl<T, U> UnsafeUnpin for Bar<T, U> {}
|
||||
| ------------------------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`:
|
||||
--> $DIR/impl-unsafe-unpin.rs:21:1
|
||||
error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`
|
||||
--> tests/ui/pin_project/impl-unsafe-unpin.rs:21:1
|
||||
|
|
||||
21 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>`
|
||||
|
@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo
|
|||
28 | unsafe impl<T: Unpin, U: Unpin> UnsafeUnpin for Baz<T, U> {}
|
||||
| --------------------------------------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,317 +1,317 @@
|
|||
error: unexpected token: ()
|
||||
--> $DIR/invalid.rs:6:14
|
||||
--> tests/ui/pin_project/invalid.rs:6:14
|
||||
|
|
||||
6 | #[pin()] //~ ERROR unexpected token
|
||||
| ^^
|
||||
|
||||
error: unexpected token: (foo)
|
||||
--> $DIR/invalid.rs:11:29
|
||||
--> tests/ui/pin_project/invalid.rs:11:29
|
||||
|
|
||||
11 | struct TupleStruct(#[pin(foo)] ()); //~ ERROR unexpected token
|
||||
| ^^^^^
|
||||
|
||||
error: unexpected token: (foo)
|
||||
--> $DIR/invalid.rs:15:16
|
||||
--> tests/ui/pin_project/invalid.rs:15:16
|
||||
|
|
||||
15 | V(#[pin(foo)] ()), //~ ERROR unexpected token
|
||||
| ^^^^^
|
||||
|
||||
error: unexpected token: (foo)
|
||||
--> $DIR/invalid.rs:21:18
|
||||
--> tests/ui/pin_project/invalid.rs:21:18
|
||||
|
|
||||
21 | #[pin(foo)] //~ ERROR unexpected token
|
||||
| ^^^^^
|
||||
|
||||
error: duplicate #[pin] attribute
|
||||
--> $DIR/invalid.rs:33:9
|
||||
--> tests/ui/pin_project/invalid.rs:33:9
|
||||
|
|
||||
33 | #[pin] //~ ERROR duplicate #[pin] attribute
|
||||
| ^^^^^^
|
||||
|
||||
error: duplicate #[pin] attribute
|
||||
--> $DIR/invalid.rs:40:9
|
||||
--> tests/ui/pin_project/invalid.rs:40:9
|
||||
|
|
||||
40 | #[pin]
|
||||
| ^^^^^^
|
||||
|
||||
error: duplicate #[pin] attribute
|
||||
--> $DIR/invalid.rs:49:13
|
||||
--> tests/ui/pin_project/invalid.rs:49:13
|
||||
|
|
||||
49 | #[pin]
|
||||
| ^^^^^^
|
||||
|
||||
error: duplicate #[pin] attribute
|
||||
--> $DIR/invalid.rs:59:13
|
||||
--> tests/ui/pin_project/invalid.rs:59:13
|
||||
|
|
||||
59 | #[pin] //~ ERROR duplicate #[pin] attribute
|
||||
| ^^^^^^
|
||||
|
||||
error: #[pin] attribute may only be used on fields of structs or variants
|
||||
--> $DIR/invalid.rs:69:5
|
||||
--> tests/ui/pin_project/invalid.rs:69:5
|
||||
|
|
||||
69 | #[pin] //~ ERROR may only be used on fields of structs or variants
|
||||
| ^^^^^^
|
||||
|
||||
error: #[pin] attribute may only be used on fields of structs or variants
|
||||
--> $DIR/invalid.rs:77:9
|
||||
--> tests/ui/pin_project/invalid.rs:77:9
|
||||
|
|
||||
77 | #[pin] //~ ERROR may only be used on fields of structs or variants
|
||||
| ^^^^^^
|
||||
|
||||
error: #[pin] attribute may only be used on fields of structs or variants
|
||||
--> $DIR/invalid.rs:82:5
|
||||
--> tests/ui/pin_project/invalid.rs:82:5
|
||||
|
|
||||
82 | #[pin] //~ ERROR may only be used on fields of structs or variants
|
||||
| ^^^^^^
|
||||
|
||||
error: expected identifier
|
||||
--> $DIR/invalid.rs:91:31
|
||||
--> tests/ui/pin_project/invalid.rs:91:31
|
||||
|
|
||||
91 | #[pin_project(UnsafeUnpin,,)] //~ ERROR expected identifier
|
||||
| ^
|
||||
|
||||
error: unexpected argument: Foo
|
||||
--> $DIR/invalid.rs:94:19
|
||||
--> tests/ui/pin_project/invalid.rs:94:19
|
||||
|
|
||||
94 | #[pin_project(Foo)] //~ ERROR unexpected argument
|
||||
| ^^^
|
||||
|
||||
error: expected identifier
|
||||
--> $DIR/invalid.rs:97:19
|
||||
--> tests/ui/pin_project/invalid.rs:97:19
|
||||
|
|
||||
97 | #[pin_project(,UnsafeUnpin)] //~ ERROR expected identifier
|
||||
| ^
|
||||
|
||||
error: expected `,`
|
||||
--> $DIR/invalid.rs:103:30
|
||||
--> tests/ui/pin_project/invalid.rs:103:30
|
||||
|
|
||||
103 | #[pin_project(PinnedDrop PinnedDrop)] //~ ERROR expected `,`
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: duplicate `PinnedDrop` argument
|
||||
--> $DIR/invalid.rs:106:31
|
||||
--> tests/ui/pin_project/invalid.rs:106:31
|
||||
|
|
||||
106 | #[pin_project(PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: duplicate `Replace` argument
|
||||
--> $DIR/invalid.rs:109:28
|
||||
--> tests/ui/pin_project/invalid.rs:109:28
|
||||
|
|
||||
109 | #[pin_project(Replace, Replace)] //~ ERROR duplicate `Replace` argument
|
||||
| ^^^^^^^
|
||||
|
||||
error: duplicate `UnsafeUnpin` argument
|
||||
--> $DIR/invalid.rs:112:32
|
||||
--> tests/ui/pin_project/invalid.rs:112:32
|
||||
|
|
||||
112 | #[pin_project(UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: duplicate `!Unpin` argument
|
||||
--> $DIR/invalid.rs:115:27
|
||||
--> tests/ui/pin_project/invalid.rs:115:27
|
||||
|
|
||||
115 | #[pin_project(!Unpin, !Unpin)] //~ ERROR duplicate `!Unpin` argument
|
||||
| ^^^^^^
|
||||
|
||||
error: duplicate `UnsafeUnpin` argument
|
||||
--> $DIR/invalid.rs:118:44
|
||||
--> tests/ui/pin_project/invalid.rs:118:44
|
||||
|
|
||||
118 | #[pin_project(PinnedDrop, UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: duplicate `PinnedDrop` argument
|
||||
--> $DIR/invalid.rs:121:44
|
||||
--> tests/ui/pin_project/invalid.rs:121:44
|
||||
|
|
||||
121 | #[pin_project(PinnedDrop, UnsafeUnpin, PinnedDrop, UnsafeUnpin)] //~ ERROR duplicate `PinnedDrop` argument
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: duplicate `project` argument
|
||||
--> $DIR/invalid.rs:124:32
|
||||
--> tests/ui/pin_project/invalid.rs:124:32
|
||||
|
|
||||
124 | #[pin_project(project = A, project = B)] //~ ERROR duplicate `project` argument
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: duplicate `project` argument
|
||||
--> $DIR/invalid.rs:127:49
|
||||
--> tests/ui/pin_project/invalid.rs:127:49
|
||||
|
|
||||
127 | #[pin_project(project = A, project_ref = A, project = B)] //~ ERROR duplicate `project` argument
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: duplicate `project_ref` argument
|
||||
--> $DIR/invalid.rs:130:36
|
||||
--> tests/ui/pin_project/invalid.rs:130:36
|
||||
|
|
||||
130 | #[pin_project(project_ref = A, project_ref = B)] //~ ERROR duplicate `project_ref` argument
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate `project_replace` argument
|
||||
--> $DIR/invalid.rs:133:40
|
||||
--> tests/ui/pin_project/invalid.rs:133:40
|
||||
|
|
||||
133 | #[pin_project(project_replace = A, project_replace = B)] //~ ERROR duplicate `project_replace` argument
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate `project_replace` argument
|
||||
--> $DIR/invalid.rs:136:36
|
||||
--> tests/ui/pin_project/invalid.rs:136:36
|
||||
|
|
||||
136 | #[pin_project(project_replace, project_replace = B)] //~ ERROR duplicate `project_replace` argument
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate `project_replace` argument
|
||||
--> $DIR/invalid.rs:139:40
|
||||
--> tests/ui/pin_project/invalid.rs:139:40
|
||||
|
|
||||
139 | #[pin_project(project_replace = A, project_replace)] //~ ERROR duplicate `project_replace` argument
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: arguments `PinnedDrop` and `Replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:145:19
|
||||
--> tests/ui/pin_project/invalid.rs:145:19
|
||||
|
|
||||
145 | #[pin_project(PinnedDrop, Replace)] //~ ERROR arguments `PinnedDrop` and `Replace` are mutually exclusive
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: arguments `PinnedDrop` and `Replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:148:41
|
||||
--> tests/ui/pin_project/invalid.rs:148:41
|
||||
|
|
||||
148 | #[pin_project(Replace, UnsafeUnpin, PinnedDrop)] //~ ERROR arguments `PinnedDrop` and `Replace` are mutually exclusive
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: arguments `PinnedDrop` and `project_replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:151:19
|
||||
--> tests/ui/pin_project/invalid.rs:151:19
|
||||
|
|
||||
151 | #[pin_project(PinnedDrop, project_replace)] //~ ERROR arguments `PinnedDrop` and `project_replace` are mutually exclusive
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: arguments `PinnedDrop` and `project_replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:154:49
|
||||
--> tests/ui/pin_project/invalid.rs:154:49
|
||||
|
|
||||
154 | #[pin_project(project_replace, UnsafeUnpin, PinnedDrop)] //~ ERROR arguments `PinnedDrop` and `project_replace` are mutually exclusive
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive
|
||||
--> $DIR/invalid.rs:163:19
|
||||
--> tests/ui/pin_project/invalid.rs:163:19
|
||||
|
|
||||
163 | #[pin_project(UnsafeUnpin, !Unpin)] //~ ERROR arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive
|
||||
--> $DIR/invalid.rs:166:39
|
||||
--> tests/ui/pin_project/invalid.rs:166:39
|
||||
|
|
||||
166 | #[pin_project(!Unpin, PinnedDrop, UnsafeUnpin)] //~ ERROR arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: expected `!Unpin`, found `!`
|
||||
--> $DIR/invalid.rs:169:19
|
||||
--> tests/ui/pin_project/invalid.rs:169:19
|
||||
|
|
||||
169 | #[pin_project(!)] //~ ERROR expected `!Unpin`, found `!`
|
||||
| ^
|
||||
|
||||
error: unexpected argument: Unpin
|
||||
--> $DIR/invalid.rs:172:19
|
||||
--> tests/ui/pin_project/invalid.rs:172:19
|
||||
|
|
||||
172 | #[pin_project(Unpin)] //~ ERROR unexpected argument
|
||||
| ^^^^^
|
||||
|
||||
error: expected `project = <identifier>`, found `project`
|
||||
--> $DIR/invalid.rs:175:19
|
||||
--> tests/ui/pin_project/invalid.rs:175:19
|
||||
|
|
||||
175 | #[pin_project(project)] //~ ERROR expected `project = <identifier>`, found `project`
|
||||
| ^^^^^^^
|
||||
|
||||
error: expected `project = <identifier>`, found `project =`
|
||||
--> $DIR/invalid.rs:178:19
|
||||
--> tests/ui/pin_project/invalid.rs:178:19
|
||||
|
|
||||
178 | #[pin_project(project = )] //~ ERROR expected `project = <identifier>`, found `project =`
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: expected identifier
|
||||
--> $DIR/invalid.rs:181:29
|
||||
--> tests/ui/pin_project/invalid.rs:181:29
|
||||
|
|
||||
181 | #[pin_project(project = !)] //~ ERROR expected identifier
|
||||
| ^
|
||||
|
||||
error: expected `project_ref = <identifier>`, found `project_ref`
|
||||
--> $DIR/invalid.rs:184:19
|
||||
--> tests/ui/pin_project/invalid.rs:184:19
|
||||
|
|
||||
184 | #[pin_project(project_ref)] //~ ERROR expected `project_ref = <identifier>`, found `project_ref`
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: expected `project_ref = <identifier>`, found `project_ref =`
|
||||
--> $DIR/invalid.rs:187:19
|
||||
--> tests/ui/pin_project/invalid.rs:187:19
|
||||
|
|
||||
187 | #[pin_project(project_ref = )] //~ ERROR expected `project_ref = <identifier>`, found `project_ref =`
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: expected identifier
|
||||
--> $DIR/invalid.rs:190:33
|
||||
--> tests/ui/pin_project/invalid.rs:190:33
|
||||
|
|
||||
190 | #[pin_project(project_ref = !)] //~ ERROR expected identifier
|
||||
| ^
|
||||
|
||||
error: expected `project_replace = <identifier>`, found `project_replace =`
|
||||
--> $DIR/invalid.rs:196:19
|
||||
--> tests/ui/pin_project/invalid.rs:196:19
|
||||
|
|
||||
196 | #[pin_project(project_replace = )] //~ ERROR expected `project_replace = <identifier>`, found `project_replace =`
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: expected identifier
|
||||
--> $DIR/invalid.rs:199:37
|
||||
--> tests/ui/pin_project/invalid.rs:199:37
|
||||
|
|
||||
199 | #[pin_project(project_replace = !)] //~ ERROR expected identifier
|
||||
| ^
|
||||
|
||||
error: name `A` is already specified by `project` argument
|
||||
--> $DIR/invalid.rs:206:46
|
||||
--> tests/ui/pin_project/invalid.rs:206:46
|
||||
|
|
||||
206 | #[pin_project(project = A, project_ref = A)] //~ ERROR name `A` is already specified by `project` argument
|
||||
| ^
|
||||
|
||||
error: name `A` is already specified by `project` argument
|
||||
--> $DIR/invalid.rs:209:50
|
||||
--> tests/ui/pin_project/invalid.rs:209:50
|
||||
|
|
||||
209 | #[pin_project(project = A, project_replace = A)] //~ ERROR name `A` is already specified by `project` argument
|
||||
| ^
|
||||
|
||||
error: name `A` is already specified by `project_ref` argument
|
||||
--> $DIR/invalid.rs:212:54
|
||||
--> tests/ui/pin_project/invalid.rs:212:54
|
||||
|
|
||||
212 | #[pin_project(project_ref = A, project_replace = A)] //~ ERROR name `A` is already specified by `project_ref` argument
|
||||
| ^
|
||||
|
||||
error: duplicate #[pin_project] attribute
|
||||
--> $DIR/invalid.rs:220:5
|
||||
--> tests/ui/pin_project/invalid.rs:220:5
|
||||
|
|
||||
220 | #[pin_project] //~ ERROR duplicate #[pin_project] attribute
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on structs with zero fields
|
||||
--> $DIR/invalid.rs:228:19
|
||||
--> tests/ui/pin_project/invalid.rs:228:19
|
||||
|
|
||||
228 | struct Struct {} //~ ERROR may not be used on structs with zero fields
|
||||
| ^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on structs with zero fields
|
||||
--> $DIR/invalid.rs:231:23
|
||||
--> tests/ui/pin_project/invalid.rs:231:23
|
||||
|
|
||||
231 | struct TupleStruct(); //~ ERROR may not be used on structs with zero fields
|
||||
| ^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on structs with zero fields
|
||||
--> $DIR/invalid.rs:234:12
|
||||
--> tests/ui/pin_project/invalid.rs:234:12
|
||||
|
|
||||
234 | struct UnitStruct; //~ ERROR may not be used on structs with zero fields
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on enums without variants
|
||||
--> $DIR/invalid.rs:237:20
|
||||
--> tests/ui/pin_project/invalid.rs:237:20
|
||||
|
|
||||
237 | enum EnumEmpty {} //~ ERROR may not be used on enums without variants
|
||||
| ^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on enums with discriminants
|
||||
--> $DIR/invalid.rs:241:13
|
||||
--> tests/ui/pin_project/invalid.rs:241:13
|
||||
|
|
||||
241 | V = 2, //~ ERROR may not be used on enums with discriminants
|
||||
| ^
|
||||
|
||||
error: #[pin_project] attribute may not be used on enums with zero fields
|
||||
--> $DIR/invalid.rs:246:9
|
||||
--> tests/ui/pin_project/invalid.rs:246:9
|
||||
|
|
||||
246 | / Unit, //~ ERROR may not be used on enums with zero fields
|
||||
247 | | Tuple(),
|
||||
|
@ -319,7 +319,7 @@ error: #[pin_project] attribute may not be used on enums with zero fields
|
|||
| |__________________^
|
||||
|
||||
error: #[pin_project] attribute may only be used on structs or enums
|
||||
--> $DIR/invalid.rs:252:5
|
||||
--> tests/ui/pin_project/invalid.rs:252:5
|
||||
|
|
||||
252 | / union Union {
|
||||
253 | | //~^ ERROR may only be used on structs or enums
|
||||
|
@ -328,19 +328,19 @@ error: #[pin_project] attribute may only be used on structs or enums
|
|||
| |_____^
|
||||
|
||||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/invalid.rs:263:12
|
||||
--> tests/ui/pin_project/invalid.rs:263:12
|
||||
|
|
||||
263 | #[repr(packed)]
|
||||
| ^^^^^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/invalid.rs:267:12
|
||||
--> tests/ui/pin_project/invalid.rs:267:12
|
||||
|
|
||||
267 | #[repr(packed)]
|
||||
| ^^^^^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/invalid.rs:271:12
|
||||
--> tests/ui/pin_project/invalid.rs:271:12
|
||||
|
|
||||
271 | #[repr(packed)]
|
||||
| ^^^^^^
|
||||
|
|
|
@ -1,11 +1,25 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/overlapping_unpin_struct.rs:17:5
|
||||
--> tests/ui/pin_project/overlapping_unpin_struct.rs:17:5
|
||||
|
|
||||
14 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
17 | is_unpin::<Foo<PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `_::__Foo<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `_::__Foo<'_, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned>`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `_::__Foo<'_, PhantomPinned>`
|
||||
--> tests/ui/pin_project/overlapping_unpin_struct.rs:5:8
|
||||
|
|
||||
5 | struct Foo<T> {
|
||||
| ^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned>`
|
||||
--> tests/ui/pin_project/overlapping_unpin_struct.rs:4:1
|
||||
|
|
||||
4 | #[pin_project]
|
||||
| ^^^^^^^^^^^^^^
|
||||
5 | struct Foo<T> {
|
||||
| ^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/pin_project/overlapping_unpin_struct.rs:14:16
|
||||
|
|
||||
14 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0517]: attribute should be applied to a struct or union
|
||||
--> $DIR/packed-enum.rs:3:8
|
||||
--> tests/ui/pin_project/packed-enum.rs:3:8
|
||||
|
|
||||
3 | #[repr(packed)] //~ ERROR E0517
|
||||
| ^^^^^^
|
||||
|
@ -9,7 +9,7 @@ error[E0517]: attribute should be applied to a struct or union
|
|||
| |_- not a struct or union
|
||||
|
||||
error[E0517]: attribute should be applied to a struct or union
|
||||
--> $DIR/packed-enum.rs:9:8
|
||||
--> tests/ui/pin_project/packed-enum.rs:9:8
|
||||
|
|
||||
9 | #[repr(packed)] //~ ERROR E0517
|
||||
| ^^^^^^
|
||||
|
@ -19,7 +19,7 @@ error[E0517]: attribute should be applied to a struct or union
|
|||
| |_- not a struct or union
|
||||
|
||||
error[E0517]: attribute should be applied to a struct or union
|
||||
--> $DIR/packed-enum.rs:14:8
|
||||
--> tests/ui/pin_project/packed-enum.rs:14:8
|
||||
|
|
||||
14 | #[repr(packed)] //~ ERROR E0517
|
||||
| ^^^^^^
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
error[E0552]: unrecognized representation hint
|
||||
--> $DIR/packed-name-value.rs:3:8
|
||||
error[E0693]: incorrect `repr(packed)` attribute format
|
||||
--> tests/ui/pin_project/packed-name-value.rs:3:8
|
||||
|
|
||||
3 | #[repr(packed = "")] //~ ERROR E0552
|
||||
| ^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^ help: use parentheses instead: `packed()`
|
||||
|
||||
error[E0552]: unrecognized representation hint
|
||||
--> $DIR/packed-name-value.rs:9:8
|
||||
error[E0693]: incorrect `repr(packed)` attribute format
|
||||
--> tests/ui/pin_project/packed-name-value.rs:9:8
|
||||
|
|
||||
9 | #[repr(packed = "")] //~ ERROR E0552
|
||||
| ^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^ help: use parentheses instead: `packed()`
|
||||
|
||||
error[E0552]: unrecognized representation hint
|
||||
--> $DIR/packed-name-value.rs:14:8
|
||||
error[E0693]: incorrect `repr(packed)` attribute format
|
||||
--> tests/ui/pin_project/packed-name-value.rs:14:8
|
||||
|
|
||||
14 | #[repr(packed = "")] //~ ERROR E0552
|
||||
| ^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^ help: use parentheses instead: `packed()`
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed.rs:4:8
|
||||
--> tests/ui/pin_project/packed.rs:4:8
|
||||
|
|
||||
4 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types
|
||||
| ^^^^^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed.rs:11:8
|
||||
--> tests/ui/pin_project/packed.rs:11:8
|
||||
|
|
||||
11 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types
|
||||
| ^^^^^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed.rs:19:8
|
||||
--> tests/ui/pin_project/packed.rs:19:8
|
||||
|
|
||||
19 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed.rs:26:8
|
||||
--> tests/ui/pin_project/packed.rs:26:8
|
||||
|
|
||||
26 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types
|
||||
| ^^^^^^^^^
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed_sneaky-1.rs:6:1
|
||||
--> tests/ui/pin_project/packed_sneaky-1.rs:6:1
|
||||
|
|
||||
6 | #[hidden_repr(packed)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed_sneaky-1.rs:13:1
|
||||
--> tests/ui/pin_project/packed_sneaky-1.rs:13:1
|
||||
|
|
||||
13 | #[hidden_repr(packed)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed_sneaky-1.rs:22:1
|
||||
--> tests/ui/pin_project/packed_sneaky-1.rs:22:1
|
||||
|
|
||||
22 | #[hidden_repr(packed)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
||||
--> $DIR/packed_sneaky-2.rs:4:1
|
||||
--> tests/ui/pin_project/packed_sneaky-2.rs:4:1
|
||||
|
|
||||
4 | / hidden_repr_macro! { //~ ERROR may not be used on #[repr(packed)] types
|
||||
5 | | #[pin_project]
|
||||
|
@ -10,4 +10,4 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types
|
|||
10 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `hidden_repr_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0446]: private type `PrivateEnum` in public interface
|
||||
--> $DIR/private_in_public-enum.rs:6:13
|
||||
--> tests/ui/pin_project/private_in_public-enum.rs:6:13
|
||||
|
|
||||
6 | Variant(PrivateEnum), //~ ERROR E0446
|
||||
| ^^^^^^^^^^^ can't leak private type
|
||||
|
@ -8,7 +8,7 @@ error[E0446]: private type `PrivateEnum` in public interface
|
|||
| ---------------- `PrivateEnum` declared as private
|
||||
|
||||
error[E0446]: private type `foo::PrivateEnum` in public interface
|
||||
--> $DIR/private_in_public-enum.rs:15:17
|
||||
--> tests/ui/pin_project/private_in_public-enum.rs:15:17
|
||||
|
|
||||
15 | Variant(PrivateEnum), //~ ERROR E0446
|
||||
| ^^^^^^^^^^^ can't leak private type
|
||||
|
|
|
@ -1,70 +1,109 @@
|
|||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized.rs:3:15
|
||||
--> tests/ui/pin_project/project_replace_unsized.rs:3:15
|
||||
|
|
||||
3 | #[pin_project(project_replace)] //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
4 | struct Struct<T: ?Sized> {
|
||||
| - this type parameter needs to be `Sized`
|
||||
| - this type parameter needs to be `std::marker::Sized`
|
||||
|
|
||||
= note: required because it appears within the type `Struct<T>`
|
||||
note: required because it appears within the type `Struct<T>`
|
||||
--> tests/ui/pin_project/project_replace_unsized.rs:4:8
|
||||
|
|
||||
4 | struct Struct<T: ?Sized> {
|
||||
| ^^^^^^
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
4 - struct Struct<T: ?Sized> {
|
||||
4 + struct Struct<T> {
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
3 | #[pin_project(&project_replace)] //~ ERROR E0277
|
||||
| ^
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized.rs:5:5
|
||||
--> tests/ui/pin_project/project_replace_unsized.rs:5:5
|
||||
|
|
||||
3 | #[pin_project(project_replace)] //~ ERROR E0277
|
||||
| ------------------------------- required by a bound introduced by this call
|
||||
4 | struct Struct<T: ?Sized> {
|
||||
| - this type parameter needs to be `Sized`
|
||||
| - this type parameter needs to be `std::marker::Sized`
|
||||
5 | x: T,
|
||||
| ^ doesn't have a size known at compile-time
|
||||
|
|
||||
note: required by a bound in `std::ptr::read`
|
||||
--> $RUST/core/src/ptr/mod.rs
|
||||
|
|
||||
| pub const unsafe fn read<T>(src: *const T) -> T {
|
||||
| ^ required by this bound in `std::ptr::read`
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
4 - struct Struct<T: ?Sized> {
|
||||
4 + struct Struct<T> {
|
||||
|
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized.rs:3:1
|
||||
--> tests/ui/pin_project/project_replace_unsized.rs:3:1
|
||||
|
|
||||
3 | #[pin_project(project_replace)] //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
4 | struct Struct<T: ?Sized> {
|
||||
| - this type parameter needs to be `Sized`
|
||||
| - this type parameter needs to be `std::marker::Sized`
|
||||
|
|
||||
= note: required because it appears within the type `__StructProjectionOwned<T>`
|
||||
note: required because it appears within the type `__StructProjectionOwned<T>`
|
||||
--> tests/ui/pin_project/project_replace_unsized.rs:4:8
|
||||
|
|
||||
4 | struct Struct<T: ?Sized> {
|
||||
| ^^^^^^
|
||||
= note: structs must have a statically known size to be initialized
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
4 - struct Struct<T: ?Sized> {
|
||||
4 + struct Struct<T> {
|
||||
|
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized.rs:8:15
|
||||
--> tests/ui/pin_project/project_replace_unsized.rs:8:15
|
||||
|
|
||||
8 | #[pin_project(project_replace)] //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
9 | struct TupleStruct<T: ?Sized>(T);
|
||||
| - this type parameter needs to be `Sized`
|
||||
| - this type parameter needs to be `std::marker::Sized`
|
||||
|
|
||||
= note: required because it appears within the type `TupleStruct<T>`
|
||||
note: required because it appears within the type `TupleStruct<T>`
|
||||
--> tests/ui/pin_project/project_replace_unsized.rs:9:8
|
||||
|
|
||||
9 | struct TupleStruct<T: ?Sized>(T);
|
||||
| ^^^^^^^^^^^
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
9 - struct TupleStruct<T: ?Sized>(T);
|
||||
9 + struct TupleStruct<T>(T);
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
8 | #[pin_project(&project_replace)] //~ ERROR E0277
|
||||
| ^
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized.rs:8:1
|
||||
--> tests/ui/pin_project/project_replace_unsized.rs:8:1
|
||||
|
|
||||
8 | #[pin_project(project_replace)] //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
9 | struct TupleStruct<T: ?Sized>(T);
|
||||
| - this type parameter needs to be `Sized`
|
||||
| - this type parameter needs to be `std::marker::Sized`
|
||||
|
|
||||
note: required by a bound in `std::ptr::read`
|
||||
--> $RUST/core/src/ptr/mod.rs
|
||||
|
|
||||
| pub const unsafe fn read<T>(src: *const T) -> T {
|
||||
| ^ required by this bound in `std::ptr::read`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
9 - struct TupleStruct<T: ?Sized>(T);
|
||||
9 + struct TupleStruct<T>(T);
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized.rs:9:8
|
||||
|
|
||||
9 | struct TupleStruct<T: ?Sized>(T);
|
||||
| ^^^^^^^^^^^ - this type parameter needs to be `Sized`
|
||||
| |
|
||||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= note: all function arguments must have a statically known size
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
|
|
|
@ -1,53 +1,103 @@
|
|||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized_fn_params.rs:6:8
|
||||
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8
|
||||
|
|
||||
6 | struct Struct<T: ?Sized> {
|
||||
| ^^^^^^^-^^^^^^^^^
|
||||
| | |
|
||||
| | this type parameter needs to be `Sized`
|
||||
| | this type parameter needs to be `std::marker::Sized`
|
||||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= note: required because it appears within the type `__StructProjectionOwned<T>`
|
||||
note: required because it appears within the type `__StructProjectionOwned<T>`
|
||||
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8
|
||||
|
|
||||
6 | struct Struct<T: ?Sized> {
|
||||
| ^^^^^^
|
||||
= note: the return type of a function must have a statically known size
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
6 - struct Struct<T: ?Sized> {
|
||||
6 + struct Struct<T> {
|
||||
|
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized_fn_params.rs:7:5
|
||||
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:7:5
|
||||
|
|
||||
5 | #[pin_project(project_replace)] //~ ERROR E0277
|
||||
| ------------------------------- required by a bound introduced by this call
|
||||
6 | struct Struct<T: ?Sized> {
|
||||
| - this type parameter needs to be `Sized`
|
||||
| - this type parameter needs to be `std::marker::Sized`
|
||||
7 | x: T,
|
||||
| ^ doesn't have a size known at compile-time
|
||||
|
|
||||
note: required by a bound in `std::ptr::read`
|
||||
--> $RUST/core/src/ptr/mod.rs
|
||||
|
|
||||
| pub const unsafe fn read<T>(src: *const T) -> T {
|
||||
| ^ required by this bound in `std::ptr::read`
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
6 - struct Struct<T: ?Sized> {
|
||||
6 + struct Struct<T> {
|
||||
|
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized_fn_params.rs:5:1
|
||||
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:5:1
|
||||
|
|
||||
5 | #[pin_project(project_replace)] //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
6 | struct Struct<T: ?Sized> {
|
||||
| - this type parameter needs to be `Sized`
|
||||
| - this type parameter needs to be `std::marker::Sized`
|
||||
|
|
||||
= note: required because it appears within the type `__StructProjectionOwned<T>`
|
||||
note: required because it appears within the type `__StructProjectionOwned<T>`
|
||||
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8
|
||||
|
|
||||
6 | struct Struct<T: ?Sized> {
|
||||
| ^^^^^^
|
||||
= note: structs must have a statically known size to be initialized
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
6 - struct Struct<T: ?Sized> {
|
||||
6 + struct Struct<T> {
|
||||
|
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized_fn_params.rs:11:8
|
||||
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:11:8
|
||||
|
|
||||
11 | struct TupleStruct<T: ?Sized>(T);
|
||||
| ^^^^^^^^^^^^-^^^^^^^^^
|
||||
| | |
|
||||
| | this type parameter needs to be `Sized`
|
||||
| | this type parameter needs to be `std::marker::Sized`
|
||||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= note: required because it appears within the type `__TupleStructProjectionOwned<T>`
|
||||
note: required because it appears within the type `__TupleStructProjectionOwned<T>`
|
||||
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:11:8
|
||||
|
|
||||
11 | struct TupleStruct<T: ?Sized>(T);
|
||||
| ^^^^^^^^^^^
|
||||
= note: the return type of a function must have a statically known size
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
11 - struct TupleStruct<T: ?Sized>(T);
|
||||
11 + struct TupleStruct<T>(T);
|
||||
|
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/project_replace_unsized_fn_params.rs:10:1
|
||||
--> tests/ui/pin_project/project_replace_unsized_fn_params.rs:10:1
|
||||
|
|
||||
10 | #[pin_project(project_replace)] //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
11 | struct TupleStruct<T: ?Sized>(T);
|
||||
| - this type parameter needs to be `Sized`
|
||||
| - this type parameter needs to be `std::marker::Sized`
|
||||
|
|
||||
note: required by a bound in `std::ptr::read`
|
||||
--> $RUST/core/src/ptr/mod.rs
|
||||
|
|
||||
| pub const unsafe fn read<T>(src: *const T) -> T {
|
||||
| ^ required by this bound in `std::ptr::read`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
11 - struct TupleStruct<T: ?Sized>(T);
|
||||
11 + struct TupleStruct<T>(T);
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,37 +1,87 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/proper_unpin.rs:31:5
|
||||
--> tests/ui/pin_project/proper_unpin.rs:31:5
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
31 | is_unpin::<Foo<PhantomPinned, ()>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__Foo<'_, PhantomPinned, ()>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `Inner<PhantomPinned>`
|
||||
= note: required because it appears within the type `__Foo<'_, PhantomPinned, ()>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned, ()>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/proper_unpin.rs:33:5
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `Inner<PhantomPinned>`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:4:8
|
||||
|
|
||||
4 | struct Inner<T> {
|
||||
| ^^^^^
|
||||
note: required because it appears within the type `__Foo<'_, PhantomPinned, ()>`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:9:8
|
||||
|
|
||||
9 | struct Foo<T, U> {
|
||||
| ^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned, ()>`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:8:1
|
||||
|
|
||||
8 | #[pin_project]
|
||||
| ^^^^^^^^^^^^^^
|
||||
9 | struct Foo<T, U> {
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/pin_project/proper_unpin.rs:33:5
|
||||
|
|
||||
33 | is_unpin::<Foo<PhantomPinned, PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__Foo<'_, PhantomPinned, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `Inner<PhantomPinned>`
|
||||
= note: required because it appears within the type `__Foo<'_, PhantomPinned, PhantomPinned>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned, PhantomPinned>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/proper_unpin.rs:35:5
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `Inner<PhantomPinned>`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:4:8
|
||||
|
|
||||
4 | struct Inner<T> {
|
||||
| ^^^^^
|
||||
note: required because it appears within the type `__Foo<'_, PhantomPinned, PhantomPinned>`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:9:8
|
||||
|
|
||||
9 | struct Foo<T, U> {
|
||||
| ^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned, PhantomPinned>`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:8:1
|
||||
|
|
||||
8 | #[pin_project]
|
||||
| ^^^^^^^^^^^^^^
|
||||
9 | struct Foo<T, U> {
|
||||
| ^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/pin_project/proper_unpin.rs:35:5
|
||||
|
|
||||
35 | is_unpin::<TrivialBounds>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ within `__TrivialBounds<'_>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `__TrivialBounds<'_>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `TrivialBounds`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `__TrivialBounds<'_>`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:16:8
|
||||
|
|
||||
16 | struct TrivialBounds {
|
||||
| ^^^^^^^^^^^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `TrivialBounds`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:15:1
|
||||
|
|
||||
15 | #[pin_project]
|
||||
| ^^^^^^^^^^^^^^
|
||||
16 | struct TrivialBounds {
|
||||
| ^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/pin_project/proper_unpin.rs:28:16
|
||||
|
|
||||
28 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/remove-attr-from-field.rs:27:38
|
||||
--> tests/ui/pin_project/remove-attr-from-field.rs:27:38
|
||||
|
|
||||
27 | let _: Pin<&mut PhantomPinned> = x.field; //~ ERROR E0308
|
||||
| ----------------------- ^^^^^^^ expected struct `Pin`, found `&mut PhantomPinned`
|
||||
|
@ -10,7 +10,7 @@ error[E0308]: mismatched types
|
|||
found mutable reference `&mut PhantomPinned`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/remove-attr-from-field.rs:31:38
|
||||
--> tests/ui/pin_project/remove-attr-from-field.rs:31:38
|
||||
|
|
||||
31 | let _: Pin<&mut PhantomPinned> = x.field; //~ ERROR E0308
|
||||
| ----------------------- ^^^^^^^ expected struct `Pin`, found `&mut PhantomPinned`
|
||||
|
|
|
@ -1,71 +1,107 @@
|
|||
error: #[pin_project] attribute has been removed
|
||||
--> $DIR/remove-attr-from-struct.rs:21:1
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:21:1
|
||||
|
|
||||
21 | #[pin_project] //~ ERROR has been removed
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: cannot find attribute `pin` in this scope
|
||||
--> $DIR/remove-attr-from-struct.rs:17:7
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:17:7
|
||||
|
|
||||
17 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `pin` in this scope
|
||||
--> $DIR/remove-attr-from-struct.rs:10:7
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:10:7
|
||||
|
|
||||
10 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
|
||||
| ^^^
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/remove-attr-from-struct.rs:34:5
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:34:5
|
||||
|
|
||||
5 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
34 | is_unpin::<A>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `A`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/remove-attr-from-struct.rs:35:5
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `A`
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:9:8
|
||||
|
|
||||
9 | struct A {
|
||||
| ^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:5:16
|
||||
|
|
||||
5 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:35:5
|
||||
|
|
||||
35 | is_unpin::<B>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `B`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `B`
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:16:8
|
||||
|
|
||||
16 | struct B {
|
||||
| ^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:5:16
|
||||
|
|
||||
5 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/remove-attr-from-struct.rs:39:13
|
||||
|
|
||||
39 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599
|
||||
| ^^^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `A`
|
||||
= note: required by `Pin::<P>::new`
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:39:22
|
||||
|
|
||||
39 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599
|
||||
| -------- ^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `A`
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:9:8
|
||||
|
|
||||
9 | struct A {
|
||||
| ^
|
||||
note: required by a bound in `Pin::<P>::new`
|
||||
--> $RUST/core/src/pin.rs
|
||||
|
|
||||
| impl<P: Deref<Target: Unpin>> Pin<P> {
|
||||
| ^^^^^ required by this bound in `Pin::<P>::new`
|
||||
|
||||
error[E0599]: no method named `project` found for struct `Pin<&mut A>` in the current scope
|
||||
--> $DIR/remove-attr-from-struct.rs:39:30
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:39:30
|
||||
|
|
||||
39 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599
|
||||
| ^^^^^^^ method not found in `Pin<&mut A>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/remove-attr-from-struct.rs:42:13
|
||||
|
|
||||
42 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599
|
||||
| ^^^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `B`
|
||||
= note: required by `Pin::<P>::new`
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:42:22
|
||||
|
|
||||
42 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599
|
||||
| -------- ^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `B`
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:16:8
|
||||
|
|
||||
16 | struct B {
|
||||
| ^
|
||||
note: required by a bound in `Pin::<P>::new`
|
||||
--> $RUST/core/src/pin.rs
|
||||
|
|
||||
| impl<P: Deref<Target: Unpin>> Pin<P> {
|
||||
| ^^^^^ required by this bound in `Pin::<P>::new`
|
||||
|
||||
error[E0599]: no method named `project` found for struct `Pin<&mut B>` in the current scope
|
||||
--> $DIR/remove-attr-from-struct.rs:42:30
|
||||
--> tests/ui/pin_project/remove-attr-from-struct.rs:42:30
|
||||
|
|
||||
42 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599
|
||||
| ^^^^^^^ method not found in `Pin<&mut B>`
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![forbid(safe_packed_borrows)]
|
||||
#![deny(renamed_and_removed_lints)]
|
||||
#![deny(safe_packed_borrows)] //~ ERROR has been renamed to `unaligned_references`
|
||||
#![allow(unaligned_references)]
|
||||
|
||||
// This lint was removed in https://github.com/rust-lang/rust/pull/82525 (nightly-2021-03-28).
|
||||
|
@ -18,10 +19,8 @@ struct PackedN {
|
|||
|
||||
fn main() {
|
||||
let a = Packed { f: 1 };
|
||||
&a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
|
||||
let _ = &a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
|
||||
let _ = &a.f;
|
||||
|
||||
let b = PackedN { f: 1 };
|
||||
&b.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
|
||||
let _ = &b.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
|
||||
let _ = &b.f;
|
||||
}
|
||||
|
|
|
@ -1,44 +1,11 @@
|
|||
error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
|
||||
--> $DIR/safe_packed_borrows.rs:21:5
|
||||
|
|
||||
21 | &a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
|
||||
| ^^^^
|
||||
|
|
||||
error: lint `safe_packed_borrows` has been renamed to `unaligned_references`
|
||||
--> tests/ui/pin_project/safe_packed_borrows.rs:2:9
|
||||
|
|
||||
2 | #![deny(safe_packed_borrows)] //~ ERROR has been renamed to `unaligned_references`
|
||||
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `unaligned_references`
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/safe_packed_borrows.rs:1:11
|
||||
|
|
||||
1 | #![forbid(safe_packed_borrows)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
|
||||
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
|
||||
|
||||
error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
|
||||
--> $DIR/safe_packed_borrows.rs:22:13
|
||||
|
|
||||
22 | let _ = &a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
|
||||
| ^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
|
||||
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
|
||||
|
||||
error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
|
||||
--> $DIR/safe_packed_borrows.rs:25:5
|
||||
|
|
||||
25 | &b.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
|
||||
| ^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
|
||||
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
|
||||
|
||||
error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
|
||||
--> $DIR/safe_packed_borrows.rs:26:13
|
||||
|
|
||||
26 | let _ = &b.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
|
||||
| ^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
|
||||
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
|
||||
--> tests/ui/pin_project/safe_packed_borrows.rs:1:9
|
||||
|
|
||||
1 | #![deny(renamed_and_removed_lints)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#![forbid(unaligned_references)]
|
||||
#![allow(safe_packed_borrows)]
|
||||
|
||||
// Refs: https://github.com/rust-lang/rust/issues/82523
|
||||
|
||||
|
@ -15,10 +14,8 @@ struct PackedN {
|
|||
|
||||
fn main() {
|
||||
let a = Packed { f: 1 };
|
||||
&a.f; //~ ERROR reference to packed field is unaligned
|
||||
let _ = &a.f; //~ ERROR reference to packed field is unaligned
|
||||
|
||||
let b = PackedN { f: 1 };
|
||||
&b.f; //~ ERROR reference to packed field is unaligned
|
||||
let _ = &b.f; //~ ERROR reference to packed field is unaligned
|
||||
}
|
||||
|
|
|
@ -1,36 +1,26 @@
|
|||
error: reference to packed field is unaligned
|
||||
--> $DIR/unaligned_references.rs:18:5
|
||||
--> tests/ui/pin_project/unaligned_references.rs:17:13
|
||||
|
|
||||
18 | &a.f; //~ ERROR reference to packed field is unaligned
|
||||
| ^^^^
|
||||
17 | let _ = &a.f; //~ ERROR reference to packed field is unaligned
|
||||
| ^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/unaligned_references.rs:1:11
|
||||
--> tests/ui/pin_project/unaligned_references.rs:1:11
|
||||
|
|
||||
1 | #![forbid(unaligned_references)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
|
||||
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
|
||||
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
|
||||
|
||||
error: reference to packed field is unaligned
|
||||
--> $DIR/unaligned_references.rs:19:13
|
||||
--> tests/ui/pin_project/unaligned_references.rs:20:13
|
||||
|
|
||||
19 | let _ = &a.f; //~ ERROR reference to packed field is unaligned
|
||||
| ^^^^
|
||||
|
|
||||
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
|
||||
|
||||
error: reference to packed field is unaligned
|
||||
--> $DIR/unaligned_references.rs:22:5
|
||||
|
|
||||
22 | &b.f; //~ ERROR reference to packed field is unaligned
|
||||
| ^^^^
|
||||
|
|
||||
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
|
||||
|
||||
error: reference to packed field is unaligned
|
||||
--> $DIR/unaligned_references.rs:23:13
|
||||
|
|
||||
23 | let _ = &b.f; //~ ERROR reference to packed field is unaligned
|
||||
20 | let _ = &b.f; //~ ERROR reference to packed field is unaligned
|
||||
| ^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
|
||||
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
|
||||
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
error[E0412]: cannot find type `__Foo` in this scope
|
||||
--> $DIR/unpin_sneaky.rs:9:16
|
||||
--> tests/ui/pin_project/unpin_sneaky.rs:9:16
|
||||
|
|
||||
9 | impl Unpin for __Foo {} //~ ERROR E0412,E0321
|
||||
| ^^^^^ not found in this scope
|
||||
|
||||
error[E0321]: cross-crate traits with a default impl, like `Unpin`, can only be implemented for a struct/enum type, not `[type error]`
|
||||
--> $DIR/unpin_sneaky.rs:9:1
|
||||
--> tests/ui/pin_project/unpin_sneaky.rs:9:1
|
||||
|
|
||||
9 | impl Unpin for __Foo {} //~ ERROR E0412,E0321
|
||||
| ^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type
|
||||
|
|
|
@ -1,79 +1,79 @@
|
|||
error[E0365]: `__DefaultProjection` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:12:13
|
||||
error[E0365]: `__DefaultProjection` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:12:13
|
||||
|
|
||||
12 | pub use crate::pub_::__DefaultProjection; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__DefaultProjection`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__DefaultProjection`
|
||||
|
|
||||
= note: consider declaring type or module `__DefaultProjection` with `pub`
|
||||
|
||||
error[E0365]: `__DefaultProjectionRef` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:14:13
|
||||
error[E0365]: `__DefaultProjectionRef` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:14:13
|
||||
|
|
||||
14 | pub use crate::pub_::__DefaultProjectionRef; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__DefaultProjectionRef`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__DefaultProjectionRef`
|
||||
|
|
||||
= note: consider declaring type or module `__DefaultProjectionRef` with `pub`
|
||||
|
||||
error[E0365]: `__ReplaceProjection` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:16:13
|
||||
error[E0365]: `__ReplaceProjection` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:16:13
|
||||
|
|
||||
16 | pub use crate::pub_::__ReplaceProjection; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__ReplaceProjection`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__ReplaceProjection`
|
||||
|
|
||||
= note: consider declaring type or module `__ReplaceProjection` with `pub`
|
||||
|
||||
error[E0365]: `__ReplaceProjectionOwned` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:18:13
|
||||
error[E0365]: `__ReplaceProjectionOwned` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:18:13
|
||||
|
|
||||
18 | pub use crate::pub_::__ReplaceProjectionOwned; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__ReplaceProjectionOwned`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__ReplaceProjectionOwned`
|
||||
|
|
||||
= note: consider declaring type or module `__ReplaceProjectionOwned` with `pub`
|
||||
|
||||
error[E0365]: `__ReplaceProjectionRef` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:20:13
|
||||
error[E0365]: `__ReplaceProjectionRef` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:20:13
|
||||
|
|
||||
20 | pub use crate::pub_::__ReplaceProjectionRef; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__ReplaceProjectionRef`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__ReplaceProjectionRef`
|
||||
|
|
||||
= note: consider declaring type or module `__ReplaceProjectionRef` with `pub`
|
||||
|
||||
error[E0365]: `DProj` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:63:13
|
||||
error[E0365]: `DProj` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:63:13
|
||||
|
|
||||
63 | pub use crate::pub_renamed::DProj; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `DProj`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `DProj`
|
||||
|
|
||||
= note: consider declaring type or module `DProj` with `pub`
|
||||
|
||||
error[E0365]: `DProjRef` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:65:13
|
||||
error[E0365]: `DProjRef` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:65:13
|
||||
|
|
||||
65 | pub use crate::pub_renamed::DProjRef; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `DProjRef`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `DProjRef`
|
||||
|
|
||||
= note: consider declaring type or module `DProjRef` with `pub`
|
||||
|
||||
error[E0365]: `RProj` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:67:13
|
||||
error[E0365]: `RProj` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:67:13
|
||||
|
|
||||
67 | pub use crate::pub_renamed::RProj; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `RProj`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `RProj`
|
||||
|
|
||||
= note: consider declaring type or module `RProj` with `pub`
|
||||
|
||||
error[E0365]: `RProjOwn` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:69:13
|
||||
error[E0365]: `RProjOwn` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:69:13
|
||||
|
|
||||
69 | pub use crate::pub_renamed::RProjOwn; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `RProjOwn`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `RProjOwn`
|
||||
|
|
||||
= note: consider declaring type or module `RProjOwn` with `pub`
|
||||
|
||||
error[E0365]: `RProjRef` is private, and cannot be re-exported
|
||||
--> $DIR/visibility.rs:71:13
|
||||
error[E0365]: `RProjRef` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/pin_project/visibility.rs:71:13
|
||||
|
|
||||
71 | pub use crate::pub_renamed::RProjRef; //~ ERROR E0365
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `RProjRef`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `RProjRef`
|
||||
|
|
||||
= note: consider declaring type or module `RProjRef` with `pub`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/call-drop-inner.rs:12:9
|
||||
--> tests/ui/pinned_drop/call-drop-inner.rs:12:9
|
||||
|
|
||||
12 | __drop_inner(__self);
|
||||
| ^^^^^^^^^^^^ ------ supplied 1 argument
|
||||
|
@ -7,7 +7,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
|||
| expected 0 arguments
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/call-drop-inner.rs:11:8
|
||||
--> tests/ui/pinned_drop/call-drop-inner.rs:11:8
|
||||
|
|
||||
11 | fn drop(mut self: Pin<&mut Self>) {
|
||||
| ^^^^
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not
|
||||
--> $DIR/conditional-drop-impl.rs:10:9
|
||||
--> tests/ui/pinned_drop/conditional-drop-impl.rs:10:9
|
||||
|
|
||||
10 | impl<T: Unpin> Drop for DropImpl<T> {
|
||||
| ^^^^^
|
||||
|
|
||||
note: the implementor must specify the same requirement
|
||||
--> $DIR/conditional-drop-impl.rs:6:1
|
||||
--> tests/ui/pinned_drop/conditional-drop-impl.rs:6:1
|
||||
|
|
||||
6 | / struct DropImpl<T> {
|
||||
7 | | field: T,
|
||||
|
@ -13,14 +13,18 @@ note: the implementor must specify the same requirement
|
|||
| |_^
|
||||
|
||||
error[E0277]: `T` cannot be unpinned
|
||||
--> $DIR/conditional-drop-impl.rs:15:15
|
||||
--> tests/ui/pinned_drop/conditional-drop-impl.rs:15:15
|
||||
|
|
||||
15 | #[pin_project(PinnedDrop)] //~ ERROR E0277
|
||||
| ^^^^^^^^^^ the trait `Unpin` is not implemented for `T`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `PinnedDrop` for `PinnedDropImpl<T>`
|
||||
= note: required by `pin_project::__private::PinnedDrop::drop`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because of the requirements on the impl of `PinnedDrop` for `PinnedDropImpl<T>`
|
||||
--> tests/ui/pinned_drop/conditional-drop-impl.rs:22:16
|
||||
|
|
||||
22 | impl<T: Unpin> PinnedDrop for PinnedDropImpl<T> {
|
||||
| ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
|
||||
help: consider restricting type parameter `T`
|
||||
|
|
||||
16 | struct PinnedDropImpl<T: Unpin> {
|
||||
| ^^^^^^^
|
||||
16 | struct PinnedDropImpl<T: std::marker::Unpin> {
|
||||
| ++++++++++++++++++++
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
error[E0277]: the trait bound `Struct: PinnedDrop` is not satisfied
|
||||
--> $DIR/forget-pinned-drop-impl.rs:3:15
|
||||
--> tests/ui/pinned_drop/forget-pinned-drop-impl.rs:3:15
|
||||
|
|
||||
3 | #[pin_project(PinnedDrop)] //~ ERROR E0277
|
||||
| ^^^^^^^^^^ the trait `PinnedDrop` is not implemented for `Struct`
|
||||
|
|
||||
= note: required by `pin_project::__private::PinnedDrop::drop`
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
error: expected identifier, found keyword `self`
|
||||
--> $DIR/invalid-self.rs:8:26
|
||||
--> tests/ui/pinned_drop/invalid-self.rs:8:26
|
||||
|
|
||||
8 | fn take_ref_self(ref self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
||||
error: expected identifier, found keyword `self`
|
||||
--> $DIR/invalid-self.rs:9:34
|
||||
--> tests/ui/pinned_drop/invalid-self.rs:9:34
|
||||
|
|
||||
9 | fn take_ref_mut_self(ref mut self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
|
||||
| ^^^^ expected identifier, found keyword
|
||||
|
||||
error: expected parameter name, found `@`
|
||||
--> $DIR/invalid-self.rs:11:25
|
||||
--> tests/ui/pinned_drop/invalid-self.rs:11:25
|
||||
|
|
||||
11 | fn self_subpat(self @ Struct {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@`
|
||||
| ^ expected parameter name
|
||||
|
||||
error: expected one of `)`, `,`, or `:`, found `@`
|
||||
--> $DIR/invalid-self.rs:11:25
|
||||
--> tests/ui/pinned_drop/invalid-self.rs:11:25
|
||||
|
|
||||
11 | fn self_subpat(self @ Struct {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@`
|
||||
| -^ expected one of `)`, `,`, or `:`
|
||||
|
|
|
@ -1,143 +1,143 @@
|
|||
error: unexpected token: foo
|
||||
--> $DIR/invalid.rs:8:19
|
||||
--> tests/ui/pinned_drop/invalid.rs:8:19
|
||||
|
|
||||
8 | #[pinned_drop(foo)] //~ ERROR unexpected token
|
||||
| ^^^
|
||||
|
||||
error: duplicate #[pinned_drop] attribute
|
||||
--> $DIR/invalid.rs:29:5
|
||||
--> tests/ui/pinned_drop/invalid.rs:29:5
|
||||
|
|
||||
29 | #[pinned_drop] //~ ERROR duplicate #[pinned_drop] attribute
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait
|
||||
--> $DIR/invalid.rs:42:10
|
||||
--> tests/ui/pinned_drop/invalid.rs:42:10
|
||||
|
|
||||
42 | impl Drop for TraitImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait
|
||||
| ^^^^
|
||||
|
||||
error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait
|
||||
--> $DIR/invalid.rs:48:10
|
||||
--> tests/ui/pinned_drop/invalid.rs:48:10
|
||||
|
|
||||
48 | impl InherentImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: expected `impl`
|
||||
--> $DIR/invalid.rs:51:5
|
||||
--> tests/ui/pinned_drop/invalid.rs:51:5
|
||||
|
|
||||
51 | fn drop(_: Pin<&mut ()>) {} //~ ERROR expected `impl`
|
||||
| ^^
|
||||
|
||||
error: implementing the trait `PinnedDrop` is not unsafe
|
||||
--> $DIR/invalid.rs:61:5
|
||||
--> tests/ui/pinned_drop/invalid.rs:61:5
|
||||
|
|
||||
61 | unsafe impl PinnedDrop for Impl {
|
||||
| ^^^^^^
|
||||
|
||||
error: implementing the method `drop` is not unsafe
|
||||
--> $DIR/invalid.rs:71:9
|
||||
--> tests/ui/pinned_drop/invalid.rs:71:9
|
||||
|
|
||||
71 | unsafe fn drop(self: Pin<&mut Self>) {} //~ ERROR implementing the method `drop` is not unsafe
|
||||
| ^^^^^^
|
||||
|
||||
error: not all trait items implemented, missing: `drop`
|
||||
--> $DIR/invalid.rs:82:5
|
||||
--> tests/ui/pinned_drop/invalid.rs:82:5
|
||||
|
|
||||
82 | impl PinnedDrop for Empty {} //~ ERROR not all trait items implemented, missing: `drop`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: const `A` is not a member of trait `PinnedDrop`
|
||||
--> $DIR/invalid.rs:89:9
|
||||
--> tests/ui/pinned_drop/invalid.rs:89:9
|
||||
|
|
||||
89 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop`
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: const `A` is not a member of trait `PinnedDrop`
|
||||
--> $DIR/invalid.rs:99:9
|
||||
--> tests/ui/pinned_drop/invalid.rs:99:9
|
||||
|
|
||||
99 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop`
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: type `A` is not a member of trait `PinnedDrop`
|
||||
--> $DIR/invalid.rs:107:9
|
||||
--> tests/ui/pinned_drop/invalid.rs:107:9
|
||||
|
|
||||
107 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop`
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: type `A` is not a member of trait `PinnedDrop`
|
||||
--> $DIR/invalid.rs:117:9
|
||||
--> tests/ui/pinned_drop/invalid.rs:117:9
|
||||
|
|
||||
117 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop`
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: duplicate definitions with name `drop`
|
||||
--> $DIR/invalid.rs:126:9
|
||||
--> tests/ui/pinned_drop/invalid.rs:126:9
|
||||
|
|
||||
126 | fn drop(self: Pin<&mut Self>) {} //~ ERROR duplicate definitions with name `drop`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: method `drop` must return the unit type
|
||||
--> $DIR/invalid.rs:147:42
|
||||
--> tests/ui/pinned_drop/invalid.rs:147:42
|
||||
|
|
||||
147 | fn drop(self: Pin<&mut Self>) -> Self {} //~ ERROR method `drop` must return the unit type
|
||||
| ^^^^
|
||||
|
||||
error: method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
--> $DIR/invalid.rs:155:16
|
||||
--> tests/ui/pinned_drop/invalid.rs:155:16
|
||||
|
|
||||
155 | fn drop() {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
| ^^
|
||||
|
||||
error: method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
--> $DIR/invalid.rs:163:17
|
||||
--> tests/ui/pinned_drop/invalid.rs:163:17
|
||||
|
|
||||
163 | fn drop(self: Pin<&mut Self>, _: ()) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
--> $DIR/invalid.rs:171:17
|
||||
--> tests/ui/pinned_drop/invalid.rs:171:17
|
||||
|
|
||||
171 | fn drop(&mut self) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
--> $DIR/invalid.rs:179:17
|
||||
--> tests/ui/pinned_drop/invalid.rs:179:17
|
||||
|
|
||||
179 | fn drop(_: Pin<&mut Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
--> $DIR/invalid.rs:187:17
|
||||
--> tests/ui/pinned_drop/invalid.rs:187:17
|
||||
|
|
||||
187 | fn drop(self: Pin<&Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
--> $DIR/invalid.rs:195:17
|
||||
--> tests/ui/pinned_drop/invalid.rs:195:17
|
||||
|
|
||||
195 | fn drop(self: Pin<&mut ()>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>`
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: method `pinned_drop` is not a member of trait `PinnedDrop
|
||||
--> $DIR/invalid.rs:203:12
|
||||
--> tests/ui/pinned_drop/invalid.rs:203:12
|
||||
|
|
||||
203 | fn pinned_drop(&mut self) {} //~ ERROR method `pinned_drop` is not a member of trait `PinnedDrop
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: implementing the trait `PinnedDrop` on this type is unsupported
|
||||
--> $DIR/invalid.rs:211:25
|
||||
--> tests/ui/pinned_drop/invalid.rs:211:25
|
||||
|
|
||||
211 | impl PinnedDrop for () {
|
||||
| ^^
|
||||
|
||||
error: implementing the trait `PinnedDrop` on this type is unsupported
|
||||
--> $DIR/invalid.rs:217:25
|
||||
--> tests/ui/pinned_drop/invalid.rs:217:25
|
||||
|
|
||||
217 | impl PinnedDrop for &mut A {
|
||||
| ^^^^^^
|
||||
|
||||
error: implementing the trait `PinnedDrop` on this type is unsupported
|
||||
--> $DIR/invalid.rs:223:25
|
||||
--> tests/ui/pinned_drop/invalid.rs:223:25
|
||||
|
|
||||
223 | impl PinnedDrop for [A] {
|
||||
| ^^^
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `pin_project::__private::PinnedDrop` for type `Foo`:
|
||||
--> $DIR/pinned-drop-no-attr-arg.rs:11:1
|
||||
error[E0119]: conflicting implementations of trait `pin_project::__private::PinnedDrop` for type `Foo`
|
||||
--> tests/ui/pinned_drop/pinned-drop-no-attr-arg.rs:11:1
|
||||
|
|
||||
4 | #[pin_project]
|
||||
| -------------- first implementation here
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
error: `self` parameter is only allowed in associated functions
|
||||
--> $DIR/self.rs:17:26
|
||||
--> tests/ui/pinned_drop/self.rs:17:26
|
||||
|
|
||||
17 | fn f(self: ()) {} //~ ERROR `self` parameter is only allowed in associated functions
|
||||
| ^^^^ not semantically valid as function parameter
|
||||
...
|
||||
20 | t!();
|
||||
| ----- in this macro invocation
|
||||
| ---- in this macro invocation
|
||||
|
|
||||
= note: associated functions are those in `impl` or `trait` definitions
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0434]: can't capture dynamic environment in a fn item
|
||||
--> $DIR/self.rs:15:29
|
||||
--> tests/ui/pinned_drop/self.rs:15:29
|
||||
|
|
||||
15 | let _ = self; //~ ERROR E0434
|
||||
| ^^^^
|
||||
...
|
||||
20 | t!();
|
||||
| ----- in this macro invocation
|
||||
| ---- in this macro invocation
|
||||
|
|
||||
= help: use the `|| { ... }` closure form instead
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0423]: expected value, found struct `S`
|
||||
--> $DIR/self.rs:38:27
|
||||
--> tests/ui/pinned_drop/self.rs:38:27
|
||||
|
|
||||
30 | / pub struct S {
|
||||
31 | | x: (),
|
||||
|
@ -34,7 +34,7 @@ error[E0423]: expected value, found struct `S`
|
|||
| ^^^^ help: use struct literal syntax instead: `S { x: val }`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/self.rs:37:25
|
||||
--> tests/ui/pinned_drop/self.rs:37:25
|
||||
|
|
||||
37 | let _: () = self; //~ ERROR E0308
|
||||
| -- ^^^^ expected `()`, found struct `Pin`
|
||||
|
@ -45,7 +45,7 @@ error[E0308]: mismatched types
|
|||
found struct `Pin<&mut S>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/self.rs:50:25
|
||||
--> tests/ui/pinned_drop/self.rs:50:25
|
||||
|
|
||||
50 | let _: () = self; //~ ERROR E0308
|
||||
| -- ^^^^ expected `()`, found struct `Pin`
|
||||
|
@ -56,7 +56,7 @@ error[E0308]: mismatched types
|
|||
found struct `Pin<&mut E>`
|
||||
|
||||
error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V`
|
||||
--> $DIR/self.rs:51:27
|
||||
--> tests/ui/pinned_drop/self.rs:51:27
|
||||
|
|
||||
51 | let _: Self = Self::V; //~ ERROR E0533
|
||||
| ^^^^^^^
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
|
||||
--> $DIR/unsafe-call.rs:13:9
|
||||
--> tests/ui/pinned_drop/unsafe-call.rs:13:9
|
||||
|
|
||||
13 | self.project().field.get_unchecked_mut(); //~ ERROR call to unsafe function is unsafe and requires unsafe function or block [E0133]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: Both initializer expression and pattern are replaceable, you need to split the initializer expression into separate let bindings to avoid ambiguity
|
||||
--> $DIR/ambiguous-let.rs:18:9
|
||||
--> tests/ui/project/ambiguous-let.rs:18:9
|
||||
|
|
||||
18 | let Struct(x) = match Pin::new(&mut foo).project() {
|
||||
| ^^^^^^^^^
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
error: use of deprecated macro `project`: consider naming projected type by passing `project` argument to #[pin_project] attribute instead, see release note <https://github.com/taiki-e/pin-project/releases/tag/v0.4.21> for details
|
||||
--> $DIR/deprecated.rs:5:3
|
||||
--> tests/ui/project/deprecated.rs:5:3
|
||||
|
|
||||
5 | #[project]
|
||||
| ^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/deprecated.rs:1:9
|
||||
--> tests/ui/project/deprecated.rs:1:9
|
||||
|
|
||||
1 | #![deny(deprecated)]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: use of deprecated macro `project_ref`: consider naming projected type by passing `project_ref` argument to #[pin_project] attribute instead, see release note <https://github.com/taiki-e/pin-project/releases/tag/v0.4.21> for details
|
||||
--> $DIR/deprecated.rs:6:3
|
||||
--> tests/ui/project/deprecated.rs:6:3
|
||||
|
|
||||
6 | #[project_ref]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: use of deprecated macro `project_replace`: consider naming projected type by passing `project_replace` argument to #[pin_project] attribute instead, see release note <https://github.com/taiki-e/pin-project/releases/tag/v0.4.21> for details
|
||||
--> $DIR/deprecated.rs:7:3
|
||||
--> tests/ui/project/deprecated.rs:7:3
|
||||
|
|
||||
7 | #[project_replace]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -1,155 +1,155 @@
|
|||
error: unexpected token: ()
|
||||
--> $DIR/invalid.rs:12:18
|
||||
--> tests/ui/project/invalid.rs:12:18
|
||||
|
|
||||
12 | #[project()] //~ ERROR unexpected token
|
||||
| ^^
|
||||
|
||||
error: unexpected token: (foo)
|
||||
--> $DIR/invalid.rs:19:18
|
||||
--> tests/ui/project/invalid.rs:19:18
|
||||
|
|
||||
19 | #[project(foo)] //~ ERROR unexpected token
|
||||
| ^^^^^
|
||||
|
||||
error: unexpected token: ()
|
||||
--> $DIR/invalid.rs:26:18
|
||||
--> tests/ui/project/invalid.rs:26:18
|
||||
|
|
||||
26 | #[project()] //~ ERROR unexpected token
|
||||
| ^^
|
||||
|
||||
error: unexpected token: (foo)
|
||||
--> $DIR/invalid.rs:35:18
|
||||
--> tests/ui/project/invalid.rs:35:18
|
||||
|
|
||||
35 | #[project(foo)] //~ ERROR unexpected token
|
||||
| ^^^^^
|
||||
|
||||
error: unexpected token: foo
|
||||
--> $DIR/invalid.rs:44:15
|
||||
--> tests/ui/project/invalid.rs:44:15
|
||||
|
|
||||
44 | #[project(foo)] //~ ERROR unexpected token
|
||||
| ^^^
|
||||
|
||||
error: duplicate #[project] attribute
|
||||
--> $DIR/invalid.rs:58:9
|
||||
--> tests/ui/project/invalid.rs:58:9
|
||||
|
|
||||
58 | #[project] //~ ERROR duplicate #[project] attribute
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project_ref] attribute
|
||||
--> $DIR/invalid.rs:66:9
|
||||
--> tests/ui/project/invalid.rs:66:9
|
||||
|
|
||||
66 | #[project_ref] //~ ERROR duplicate #[project_ref] attribute
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project_replace] attribute
|
||||
--> $DIR/invalid.rs:74:9
|
||||
--> tests/ui/project/invalid.rs:74:9
|
||||
|
|
||||
74 | #[project_replace] //~ ERROR duplicate #[project_replace] attribute
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project` and `project_ref` are mutually exclusive
|
||||
--> $DIR/invalid.rs:82:9
|
||||
--> tests/ui/project/invalid.rs:82:9
|
||||
|
|
||||
82 | #[project_ref] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project` and `project_replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:90:9
|
||||
--> tests/ui/project/invalid.rs:90:9
|
||||
|
|
||||
90 | #[project_replace] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project_ref` and `project_replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:98:9
|
||||
--> tests/ui/project/invalid.rs:98:9
|
||||
|
|
||||
98 | #[project_replace] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project` and `project_ref` are mutually exclusive
|
||||
--> $DIR/invalid.rs:106:9
|
||||
--> tests/ui/project/invalid.rs:106:9
|
||||
|
|
||||
106 | #[project_ref] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project` and `project_replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:114:9
|
||||
--> tests/ui/project/invalid.rs:114:9
|
||||
|
|
||||
114 | #[project_replace] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project_ref` and `project_replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:122:9
|
||||
--> tests/ui/project/invalid.rs:122:9
|
||||
|
|
||||
122 | #[project_replace] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project` and `project_ref` are mutually exclusive
|
||||
--> $DIR/invalid.rs:130:9
|
||||
--> tests/ui/project/invalid.rs:130:9
|
||||
|
|
||||
130 | #[project_ref] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project` and `project_replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:138:9
|
||||
--> tests/ui/project/invalid.rs:138:9
|
||||
|
|
||||
138 | #[project_replace] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: attributes `project_ref` and `project_replace` are mutually exclusive
|
||||
--> $DIR/invalid.rs:146:9
|
||||
--> tests/ui/project/invalid.rs:146:9
|
||||
|
|
||||
146 | #[project_replace] //~ ERROR are mutually exclusive
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project] attribute
|
||||
--> $DIR/invalid.rs:151:5
|
||||
--> tests/ui/project/invalid.rs:151:5
|
||||
|
|
||||
151 | #[project] //~ ERROR duplicate #[project] attribute
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project_ref] attribute
|
||||
--> $DIR/invalid.rs:155:5
|
||||
--> tests/ui/project/invalid.rs:155:5
|
||||
|
|
||||
155 | #[project_ref] //~ ERROR duplicate #[project_ref] attribute
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project_replace] attribute
|
||||
--> $DIR/invalid.rs:159:5
|
||||
--> tests/ui/project/invalid.rs:159:5
|
||||
|
|
||||
159 | #[project_replace] //~ ERROR duplicate #[project_replace] attribute
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project] attribute
|
||||
--> $DIR/invalid.rs:163:5
|
||||
--> tests/ui/project/invalid.rs:163:5
|
||||
|
|
||||
163 | #[project] //~ ERROR duplicate #[project] attribute
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project_ref] attribute
|
||||
--> $DIR/invalid.rs:167:5
|
||||
--> tests/ui/project/invalid.rs:167:5
|
||||
|
|
||||
167 | #[project_ref] //~ ERROR duplicate #[project_ref] attribute
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project_replace] attribute
|
||||
--> $DIR/invalid.rs:171:5
|
||||
--> tests/ui/project/invalid.rs:171:5
|
||||
|
|
||||
171 | #[project_replace] //~ ERROR duplicate #[project_replace] attribute
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project] attribute
|
||||
--> $DIR/invalid.rs:179:9
|
||||
--> tests/ui/project/invalid.rs:179:9
|
||||
|
|
||||
179 | #[project] //~ ERROR duplicate #[project] attribute
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project_ref] attribute
|
||||
--> $DIR/invalid.rs:183:9
|
||||
--> tests/ui/project/invalid.rs:183:9
|
||||
|
|
||||
183 | #[project_ref] //~ ERROR duplicate #[project_ref] attribute
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: duplicate #[project_replace] attribute
|
||||
--> $DIR/invalid.rs:187:9
|
||||
--> tests/ui/project/invalid.rs:187:9
|
||||
|
|
||||
187 | #[project_replace] //~ ERROR duplicate #[project_replace] attribute
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -1,23 +1,17 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/type-mismatch.rs:36:9
|
||||
--> tests/ui/project/type-mismatch.rs:68:9
|
||||
|
|
||||
24 | match &mut foo {
|
||||
| -------- this expression has type `&mut type_mismatch::__EnumProjection<'_, {integer}, {integer}, _, _>`
|
||||
...
|
||||
36 | None => {} //~ ERROR mismatched types
|
||||
| ^^^^ expected enum `type_mismatch::__EnumProjection`, found enum `Option`
|
||||
|
|
||||
= note: expected enum `type_mismatch::__EnumProjection<'_, {integer}, {integer}, _, _>`
|
||||
found enum `Option<_>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/type-mismatch.rs:68:9
|
||||
|
|
||||
56 | match &mut foo {
|
||||
| -------- this expression has type `&mut type_mismatch_span_issue::__EnumProjection<'_, {integer}, {integer}, _, _>`
|
||||
...
|
||||
68 | None => {} //~ ERROR mismatched types
|
||||
| ^^^^ expected enum `type_mismatch_span_issue::__EnumProjection`, found enum `Option`
|
||||
|
|
||||
= note: expected enum `type_mismatch_span_issue::__EnumProjection<'_, {integer}, {integer}, _, _>`
|
||||
found enum `Option<_>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> tests/ui/project/type-mismatch.rs:36:9
|
||||
|
|
||||
36 | None => {} //~ ERROR mismatched types
|
||||
| ^^^^ expected enum `type_mismatch::__EnumProjection`, found enum `Option`
|
||||
|
|
||||
= note: expected enum `type_mismatch::__EnumProjection<'_, {integer}, {integer}, _, _>`
|
||||
found enum `Option<_>`
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
error[E0365]: `__AProjection` is private, and cannot be re-exported
|
||||
--> $DIR/use-public.rs:14:13
|
||||
error[E0365]: `__AProjection` is only public within the crate, and cannot be re-exported outside
|
||||
--> tests/ui/project/use-public.rs:14:13
|
||||
|
|
||||
14 | pub use crate::A; //~ ERROR E0365
|
||||
| ^^^^^^^^ re-export of private `__AProjection`
|
||||
| ^^^^^^^^ re-export of crate public `__AProjection`
|
||||
|
|
||||
= note: consider declaring type or module `__AProjection` with `pub`
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
error: #[project] attribute may not be used on renamed imports
|
||||
--> $DIR/use.rs:14:16
|
||||
--> tests/ui/project/use.rs:14:16
|
||||
|
|
||||
14 | use crate::A as B; //~ ERROR #[project] attribute may not be used on renamed imports
|
||||
| ^^^^^^
|
||||
|
||||
error: #[project] attribute may not be used on glob imports
|
||||
--> $DIR/use.rs:16:16
|
||||
--> tests/ui/project/use.rs:16:16
|
||||
|
|
||||
16 | use crate::*; //~ ERROR #[project] attribute may not be used on glob imports
|
||||
| ^
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:3:15
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
|
||||
--> tests/ui/unsafe_unpin/conflict-unpin.rs:3:15
|
||||
|
|
||||
3 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^ conflicting implementation for `Foo<_, _>`
|
||||
|
@ -9,8 +9,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
|
|
||||
= note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Foo<_, _>>` in future versions
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:12:15
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`
|
||||
--> tests/ui/unsafe_unpin/conflict-unpin.rs:12:15
|
||||
|
|
||||
12 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^ conflicting implementation for `Bar<_, _>`
|
||||
|
@ -20,8 +20,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
|
|
||||
= note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Bar<_, _>>` in future versions
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`:
|
||||
--> $DIR/conflict-unpin.rs:21:15
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`
|
||||
--> tests/ui/unsafe_unpin/conflict-unpin.rs:21:15
|
||||
|
|
||||
21 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^ conflicting implementation for `Baz<_, _>`
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
error[E0277]: the trait bound `Struct<(), ()>: UnsafeUnpin` is not satisfied
|
||||
--> $DIR/not-implement-unsafe-unpin.rs:13:16
|
||||
--> tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs:13:16
|
||||
|
|
||||
10 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
13 | is_unpin::<Struct<(), ()>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^ the trait `UnsafeUnpin` is not implemented for `Struct<(), ()>`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, Struct<(), ()>>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Struct<(), ()>`
|
||||
note: required because of the requirements on the impl of `Unpin` for `Struct<(), ()>`
|
||||
--> tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs:3:15
|
||||
|
|
||||
3 | #[pin_project(UnsafeUnpin)]
|
||||
| ^^^^^^^^^^^
|
||||
4 | struct Struct<T, U> {
|
||||
| ^^^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs:10:16
|
||||
|
|
||||
10 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
|
|
@ -1,67 +1,127 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/proper_unpin.rs:33:5
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:33:5
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
33 | is_unpin::<Blah<PhantomPinned, ()>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `Blah<PhantomPinned, ()>`
|
||||
= note: 1 redundant requirements hidden
|
||||
= note: consider using `Box::pin`
|
||||
note: required because of the requirements on the impl of `UnsafeUnpin` for `Blah<PhantomPinned, ()>`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:13:26
|
||||
|
|
||||
13 | unsafe impl<T: Unpin, U> UnsafeUnpin for Blah<T, U> {}
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
= note: 1 redundant requirement hidden
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, Blah<PhantomPinned, ()>>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Blah<PhantomPinned, ()>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/proper_unpin.rs:35:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `Blah<PhantomPinned, ()>`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:6:15
|
||||
|
|
||||
6 | #[pin_project(UnsafeUnpin)]
|
||||
| ^^^^^^^^^^^
|
||||
7 | struct Blah<T, U> {
|
||||
| ^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:4:16
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:35:5
|
||||
|
|
||||
35 | is_unpin::<Blah<PhantomPinned, PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `Blah<PhantomPinned, PhantomPinned>`
|
||||
= note: 1 redundant requirements hidden
|
||||
= note: consider using `Box::pin`
|
||||
note: required because of the requirements on the impl of `UnsafeUnpin` for `Blah<PhantomPinned, PhantomPinned>`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:13:26
|
||||
|
|
||||
13 | unsafe impl<T: Unpin, U> UnsafeUnpin for Blah<T, U> {}
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
= note: 1 redundant requirement hidden
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, Blah<PhantomPinned, PhantomPinned>>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `Blah<PhantomPinned, PhantomPinned>`
|
||||
|
||||
error[E0277]: the trait bound `TrivialBounds: UnsafeUnpin` is not satisfied
|
||||
--> $DIR/proper_unpin.rs:37:16
|
||||
note: required because of the requirements on the impl of `Unpin` for `Blah<PhantomPinned, PhantomPinned>`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:6:15
|
||||
|
|
||||
6 | #[pin_project(UnsafeUnpin)]
|
||||
| ^^^^^^^^^^^
|
||||
7 | struct Blah<T, U> {
|
||||
| ^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:4:16
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: the trait bound `TrivialBounds: UnsafeUnpin` is not satisfied
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:37:16
|
||||
|
|
||||
37 | is_unpin::<TrivialBounds>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^ the trait `UnsafeUnpin` is not implemented for `TrivialBounds`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, TrivialBounds>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `TrivialBounds`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/proper_unpin.rs:39:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `TrivialBounds`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:15:15
|
||||
|
|
||||
15 | #[pin_project(UnsafeUnpin)]
|
||||
| ^^^^^^^^^^^
|
||||
16 | struct TrivialBounds {
|
||||
| ^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:4:16
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:39:5
|
||||
|
|
||||
39 | is_unpin::<OverlappingLifetimeNames<'_, PhantomPinned, ()>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `OverlappingLifetimeNames<'_, PhantomPinned, ()>`
|
||||
= note: 1 redundant requirements hidden
|
||||
= note: consider using `Box::pin`
|
||||
note: required because of the requirements on the impl of `UnsafeUnpin` for `OverlappingLifetimeNames<'_, PhantomPinned, ()>`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:30:33
|
||||
|
|
||||
30 | unsafe impl<T: Unpin, U: Unpin> UnsafeUnpin for OverlappingLifetimeNames<'_, T, U> {}
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: 1 redundant requirement hidden
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, OverlappingLifetimeNames<'_, PhantomPinned, ()>>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `OverlappingLifetimeNames<'_, PhantomPinned, ()>`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/proper_unpin.rs:40:5
|
||||
note: required because of the requirements on the impl of `Unpin` for `OverlappingLifetimeNames<'_, PhantomPinned, ()>`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:21:15
|
||||
|
|
||||
21 | #[pin_project(UnsafeUnpin)]
|
||||
| ^^^^^^^^^^^
|
||||
22 | struct OverlappingLifetimeNames<'pin, T, U> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:4:16
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ----- required by this bound in `is_unpin`
|
||||
...
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:40:5
|
||||
|
|
||||
40 | is_unpin::<OverlappingLifetimeNames<'_, (), PhantomPinned>>(); //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `OverlappingLifetimeNames<'_, (), PhantomPinned>`
|
||||
= note: 1 redundant requirements hidden
|
||||
= note: consider using `Box::pin`
|
||||
note: required because of the requirements on the impl of `UnsafeUnpin` for `OverlappingLifetimeNames<'_, (), PhantomPinned>`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:30:33
|
||||
|
|
||||
30 | unsafe impl<T: Unpin, U: Unpin> UnsafeUnpin for OverlappingLifetimeNames<'_, T, U> {}
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: 1 redundant requirement hidden
|
||||
= note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, OverlappingLifetimeNames<'_, (), PhantomPinned>>`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `OverlappingLifetimeNames<'_, (), PhantomPinned>`
|
||||
note: required because of the requirements on the impl of `Unpin` for `OverlappingLifetimeNames<'_, (), PhantomPinned>`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:21:15
|
||||
|
|
||||
21 | #[pin_project(UnsafeUnpin)]
|
||||
| ^^^^^^^^^^^
|
||||
22 | struct OverlappingLifetimeNames<'pin, T, U> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_unpin`
|
||||
--> tests/ui/unsafe_unpin/proper_unpin.rs:4:16
|
||||
|
|
||||
4 | fn is_unpin<T: Unpin>() {}
|
||||
| ^^^^^ required by this bound in `is_unpin`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`:
|
||||
--> $DIR/marker_trait_attr-feature-gate.rs:6:1
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
|
||||
--> tests/ui/unstable-features/marker_trait_attr-feature-gate.rs:6:1
|
||||
|
|
||||
6 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
|
||||
|
@ -7,4 +7,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
13 | impl<T> Unpin for Struct<T> {}
|
||||
| --------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`:
|
||||
--> $DIR/marker_trait_attr.rs:12:1
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
|
||||
--> tests/ui/unstable-features/marker_trait_attr.rs:12:1
|
||||
|
|
||||
12 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
|
||||
|
@ -7,4 +7,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
19 | impl<T> Unpin for Struct<T> {}
|
||||
| --------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`:
|
||||
--> $DIR/overlapping_marker_traits-feature-gate.rs:6:1
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
|
||||
--> tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs:6:1
|
||||
|
|
||||
6 | #[pin_project] //~ ERROR E0119
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
|
||||
|
@ -7,4 +7,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
13 | impl<T> Unpin for Struct<T> {}
|
||||
| --------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
error[E0557]: feature has been removed
|
||||
--> $DIR/overlapping_marker_traits.rs:11:12
|
||||
--> tests/ui/unstable-features/overlapping_marker_traits.rs:11:12
|
||||
|
|
||||
11 | #![feature(overlapping_marker_traits)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ feature has been removed
|
||||
|
|
||||
= note: removed in favor of `#![feature(marker_trait_attr)]`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`:
|
||||
--> $DIR/overlapping_marker_traits.rs:16:1
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`
|
||||
--> tests/ui/unstable-features/overlapping_marker_traits.rs:16:1
|
||||
|
|
||||
16 | #[pin_project]
|
||||
| ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>`
|
||||
|
@ -15,4 +15,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
|
|||
23 | impl<T> Unpin for Struct<T> {}
|
||||
| --------------------------- first implementation here
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0658]: attributes on expressions are experimental
|
||||
--> $DIR/stmt_expr_attributes-feature-gate.rs:24:5
|
||||
--> tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs:24:5
|
||||
|
|
||||
24 | #[project] //~ ERROR E0658
|
||||
| ^^^^^^^^^^
|
||||
|
@ -8,7 +8,7 @@ error[E0658]: attributes on expressions are experimental
|
|||
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: attributes on expressions are experimental
|
||||
--> $DIR/stmt_expr_attributes-feature-gate.rs:40:14
|
||||
--> tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs:40:14
|
||||
|
|
||||
40 | let () = #[project] //~ ERROR E0658
|
||||
| ^^^^^^^^^^
|
||||
|
@ -17,7 +17,7 @@ error[E0658]: attributes on expressions are experimental
|
|||
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to expressions
|
||||
--> $DIR/stmt_expr_attributes-feature-gate.rs:24:5
|
||||
--> tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs:24:5
|
||||
|
|
||||
24 | #[project] //~ ERROR E0658
|
||||
| ^^^^^^^^^^
|
||||
|
@ -26,7 +26,7 @@ error[E0658]: custom attributes cannot be applied to expressions
|
|||
= help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: custom attributes cannot be applied to expressions
|
||||
--> $DIR/stmt_expr_attributes-feature-gate.rs:40:14
|
||||
--> tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs:40:14
|
||||
|
|
||||
40 | let () = #[project] //~ ERROR E0658
|
||||
| ^^^^^^^^^^
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
// NB: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time.
|
||||
|
||||
// trivial_bounds
|
||||
// Tracking issue: https://github.com/rust-lang/rust/issues/48214
|
||||
#![feature(trivial_bounds)]
|
||||
|
||||
mod phantom_pinned {
|
||||
use std::marker::{PhantomData, PhantomPinned};
|
||||
|
||||
struct A(PhantomPinned);
|
||||
|
||||
// bug of trivial_bounds?
|
||||
impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
|
||||
|
||||
struct Wrapper<T>(T);
|
||||
|
||||
impl<T> Unpin for Wrapper<T> where T: Unpin {}
|
||||
|
||||
struct B(PhantomPinned);
|
||||
|
||||
impl Unpin for B where Wrapper<PhantomPinned>: Unpin {} // Ok
|
||||
|
||||
struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T);
|
||||
|
||||
impl<T> Unpin for WrapperWithLifetime<'_, T> where T: Unpin {}
|
||||
|
||||
struct C(PhantomPinned);
|
||||
|
||||
// Ok
|
||||
impl<'a> Unpin for C where WrapperWithLifetime<'a, PhantomPinned>: Unpin {}
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -1,5 +0,0 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/trivial_bounds-bug.rs:13:43
|
||||
|
|
||||
13 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
|
||||
| ^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
|
@ -1,45 +1,59 @@
|
|||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/trivial_bounds-feature-gate.rs:8:5
|
||||
--> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:8:28
|
||||
|
|
||||
8 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: consider using `Box::pin`
|
||||
= help: see issue #48214
|
||||
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/trivial_bounds-feature-gate.rs:8:43
|
||||
|
|
||||
8 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277
|
||||
| ^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/trivial_bounds-feature-gate.rs:16:5
|
||||
--> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:16:28
|
||||
|
|
||||
16 | impl Unpin for B where Wrapper<PhantomPinned>: Unpin {} //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `Unpin` for `phantom_pinned::Wrapper<PhantomPinned>`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because of the requirements on the impl of `Unpin` for `phantom_pinned::Wrapper<PhantomPinned>`
|
||||
--> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:12:13
|
||||
|
|
||||
12 | impl<T> Unpin for Wrapper<T> where T: Unpin {}
|
||||
| ^^^^^ ^^^^^^^^^^
|
||||
= help: see issue #48214
|
||||
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/trivial_bounds-feature-gate.rs:35:5
|
||||
--> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:35:28
|
||||
|
|
||||
35 | impl Unpin for A where Inner: Unpin {} //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
| ^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `Inner`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `Inner`
|
||||
--> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:31:12
|
||||
|
|
||||
31 | struct Inner(PhantomPinned);
|
||||
| ^^^^^
|
||||
= help: see issue #48214
|
||||
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
||||
|
||||
error[E0277]: `PhantomPinned` cannot be unpinned
|
||||
--> $DIR/trivial_bounds-feature-gate.rs:43:5
|
||||
--> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:43:28
|
||||
|
|
||||
43 | impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR E0277
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned`
|
||||
|
|
||||
= note: required because it appears within the type `Inner`
|
||||
= note: required because of the requirements on the impl of `Unpin` for `inner::Wrapper<Inner>`
|
||||
= note: consider using `Box::pin`
|
||||
note: required because it appears within the type `Inner`
|
||||
--> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:31:12
|
||||
|
|
||||
31 | struct Inner(PhantomPinned);
|
||||
| ^^^^^
|
||||
note: required because of the requirements on the impl of `Unpin` for `inner::Wrapper<Inner>`
|
||||
--> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:39:13
|
||||
|
|
||||
39 | impl<T> Unpin for Wrapper<T> where T: Unpin {}
|
||||
| ^^^^^ ^^^^^^^^^^
|
||||
= help: see issue #48214
|
||||
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// NB: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time.
|
||||
// Note: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time.
|
||||
|
||||
// trivial_bounds
|
||||
// Tracking issue: https://github.com/rust-lang/rust/issues/48214
|
||||
|
@ -10,25 +10,29 @@ use std::marker::{PhantomData, PhantomPinned};
|
|||
fn inner() {
|
||||
struct Inner(PhantomPinned);
|
||||
|
||||
struct A(Inner);
|
||||
struct A(PhantomPinned);
|
||||
|
||||
impl Unpin for A where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
|
||||
impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
|
||||
|
||||
struct B(Inner);
|
||||
|
||||
impl Unpin for B where Inner: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
|
||||
|
||||
struct Wrapper<T>(T);
|
||||
|
||||
impl<T> Unpin for Wrapper<T> where T: Unpin {}
|
||||
|
||||
struct B(Inner);
|
||||
struct C(Inner);
|
||||
|
||||
impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
|
||||
impl Unpin for C where Wrapper<Inner>: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
|
||||
|
||||
struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T);
|
||||
|
||||
impl<T> Unpin for WrapperWithLifetime<'_, T> where T: Unpin {}
|
||||
|
||||
struct C(Inner);
|
||||
struct D(Inner);
|
||||
|
||||
impl<'a> Unpin for C where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok
|
||||
impl<'a> Unpin for D where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -1,17 +1,23 @@
|
|||
error: Trait bound Inner: Unpin does not depend on any type or lifetime parameters
|
||||
--> $DIR/trivial_bounds.rs:15:35
|
||||
error: trait bound PhantomPinned: Unpin does not depend on any type or lifetime parameters
|
||||
--> tests/ui/unstable-features/trivial_bounds.rs:15:43
|
||||
|
|
||||
15 | impl Unpin for A where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
|
||||
| ^^^^^
|
||||
15 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
|
||||
| ^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/trivial_bounds.rs:6:9
|
||||
--> tests/ui/unstable-features/trivial_bounds.rs:6:9
|
||||
|
|
||||
6 | #![deny(trivial_bounds)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: Trait bound Wrapper<Inner>: Unpin does not depend on any type or lifetime parameters
|
||||
--> $DIR/trivial_bounds.rs:23:44
|
||||
error: trait bound Inner: Unpin does not depend on any type or lifetime parameters
|
||||
--> tests/ui/unstable-features/trivial_bounds.rs:19:35
|
||||
|
|
||||
23 | impl Unpin for B where Wrapper<Inner>: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters
|
||||
19 | impl Unpin for B where Inner: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
|
||||
| ^^^^^
|
||||
|
||||
error: trait bound Wrapper<Inner>: Unpin does not depend on any type or lifetime parameters
|
||||
--> tests/ui/unstable-features/trivial_bounds.rs:27:44
|
||||
|
|
||||
27 | impl Unpin for C where Wrapper<Inner>: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters
|
||||
| ^^^^^
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"CHANGELOG.md":"1c60eb6231812ffe4b276d94092d406e10cdf2cfb2f13005a11509b6fdd38d12","Cargo.toml":"301f08ce329cb75af34a9def9f93392db0d19ae62237e8ddb71e2ff0c0baf8d0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"37f11a56c969237dcfd15368e96bf686ec92b0254e38fb84636e178d632c0492","src/lib.rs":"da375f79b79233081a1cf0dfee29f71665fabad2ffaf1b9222a06eeb48f41831","tests/escape.pc":"00caa4136799dbe5bd504239ba90d1156c12def365c8d761da319fe8a83b398e","tests/foo.pc":"4a1c442c5d1c10761ea1644f8fd58f93cc5a706391bc67b04c243bbd35d70d79","tests/framework.pc":"304fdb6cea92973650e410ab1f70ce1ebeb7718af3f139e806efbf182acd565c","tests/test.rs":"5ed13fc28a1853d20d27798819a1228673cb1e57097951dbb892e51327a21adb"},"package":"d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e"}
|
||||
{"files":{"CHANGELOG.md":"2e631b60f6a27dd02bc16b0c2990d1cd3d66864361d5d41fe6e292b166b3552f","Cargo.toml":"843c2c53de2699012af5b516a030ef0dc4852682ae100b757148d2256eb229e6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"37f11a56c969237dcfd15368e96bf686ec92b0254e38fb84636e178d632c0492","src/lib.rs":"8593d4de26866f869a496e054b7671dab3c9c68962d0850f487fd46e33722f0d","tests/escape.pc":"00caa4136799dbe5bd504239ba90d1156c12def365c8d761da319fe8a83b398e","tests/foo.pc":"4a1c442c5d1c10761ea1644f8fd58f93cc5a706391bc67b04c243bbd35d70d79","tests/framework.pc":"304fdb6cea92973650e410ab1f70ce1ebeb7718af3f139e806efbf182acd565c","tests/test.rs":"5ed13fc28a1853d20d27798819a1228673cb1e57097951dbb892e51327a21adb"},"package":"58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"}
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.3.24] - 2021-12-11
|
||||
|
||||
### Fixed
|
||||
|
||||
- Re-add `target_supported()`, which was accidentally removed in 0.3.15 (#128).
|
||||
|
||||
## [0.3.23] - 2021-12-06
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
[package]
|
||||
name = "pkg-config"
|
||||
version = "0.3.23"
|
||||
version = "0.3.24"
|
||||
authors = ["Alex Crichton <alex@alexcrichton.com>"]
|
||||
description = "A library to run the pkg-config system tool at build time in order to be used in\nCargo build scripts.\n"
|
||||
documentation = "https://docs.rs/pkg-config"
|
||||
|
|
|
@ -246,6 +246,12 @@ pub fn probe_library(name: &str) -> Result<Library, Error> {
|
|||
Config::new().probe(name)
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deprecated(note = "use config.target_supported() instance method instead")]
|
||||
pub fn target_supported() -> bool {
|
||||
Config::new().target_supported()
|
||||
}
|
||||
|
||||
/// Run `pkg-config` to get the value of a variable from a package using
|
||||
/// `--variable`.
|
||||
///
|
||||
|
@ -394,6 +400,7 @@ impl Config {
|
|||
Ok(library)
|
||||
}
|
||||
|
||||
/// True if pkg-config is used for the host system, or configured for cross-compilation
|
||||
pub fn target_supported(&self) -> bool {
|
||||
let target = env::var_os("TARGET").unwrap_or_default();
|
||||
let host = env::var_os("HOST").unwrap_or_default();
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"files":{"Cargo.toml":"a3b4c03b3b8faad8965a6177b8d10d005aaf72dba4e0460f7e4602da15f63bc2","LICENSE-APACHE":"0218327e7a480793ffdd4eb792379a9709e5c135c7ba267f709d6f6d4d70af0a","LICENSE-MIT":"4cada0bd02ea3692eee6f16400d86c6508bbd3bafb2b65fed0419f36d4f83e8f","src/generic.rs":"3fcf342f83e6410abb7be6b2e8cf7e0673c872d53ace794eaabd12929489beea","src/lib.rs":"bcf308d7037e259d6640a785556fcdb86653cb4f72f64fbfeda9899857c14479","src/soft.rs":"4cc23fa9451ea44a4e3c492c66627dae6008746aab6d5290712ecc66846f2ea0","src/types.rs":"d51ea12b78b771ce3823b4fd23b1df125f4719d2e3ac63c842813b0cfc6cdb8b","src/x86_64/mod.rs":"e868eab93b96df599667c6e5de0f253946aed691bc39ee4c4f8ed72a758105d9","src/x86_64/sse2.rs":"5d958d134fcb0a4a264aadc51abddc24baeeaef41ae9b36bd49d6ab8dcff5d2c"},"package":"ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"}
|
||||
{"files":{"CHANGELOG.md":"0bd1d2bdb4a940a0d867a782644eb007e79611be0a8d74d4ba106e83597716df","Cargo.toml":"3bd5de9ba4df3b05b80f05a777b148897137a43fbbfe7f35eea276a6d3b048e2","LICENSE-APACHE":"0218327e7a480793ffdd4eb792379a9709e5c135c7ba267f709d6f6d4d70af0a","LICENSE-MIT":"4cada0bd02ea3692eee6f16400d86c6508bbd3bafb2b65fed0419f36d4f83e8f","src/generic.rs":"a49f9f8fbe3d9e67d67861e77ae9e69cc9f8181edad578be99b19cdf05bd8046","src/lib.rs":"bcf308d7037e259d6640a785556fcdb86653cb4f72f64fbfeda9899857c14479","src/soft.rs":"11d7c36036444d3ad1267564b0913e4301d9ba485a7bb596eb39bf2a5973ff57","src/types.rs":"a1c9e993f85a99d1762597193d72ee8ff00c3f1116885040b4e4ecfbdedabf0a","src/x86_64/mod.rs":"145200e7f2dae24e4e0fd1020269132dddd652f30373f70a6b8dd40bf8327fea","src/x86_64/sse2.rs":"a7395837200b4eb03c178c762f3269ce9030187718b8ca62e15070c5c19cba96"},"package":"eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"}
|
|
@ -0,0 +1,10 @@
|
|||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.2.16]
|
||||
### Added
|
||||
- add [u64; 4] conversion for generic vec256, to support BLAKE on non-x86.
|
||||
- impl `From` (rather than just `Into`) for conversions between `*_storage` types and arrays.
|
|
@ -12,7 +12,7 @@
|
|||
[package]
|
||||
edition = "2018"
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.15"
|
||||
version = "0.2.16"
|
||||
authors = ["The CryptoCorrosion Contributors"]
|
||||
description = "Implementation of the crypto-simd API for x86"
|
||||
keywords = ["crypto", "simd", "x86"]
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче