Auto merge of #57354 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests Successful merges: - #57219 (Remove some unused code) - #57229 (Fix #56806 by using `delay_span_bug` in object safety layout sanity checks) - #57233 (Rename and fix nolink-with-link-args test) - #57238 (Fix backtraces for inlined functions on Windows) - #57249 (Fix broken links to second edition TRPL.) - #57267 (src/jemalloc is gone, remove its mention from COPYRIGHT) - #57273 (Update the stdsimd submodule) - #57278 (Add Clippy to config.toml.example) - #57295 (Fix 'be be' constructs) - #57311 (VaList::copy should not require a mutable ref) - #57312 (`const fn` is no longer coming soon (const keyword docs)) - #57313 (Improve Box<T> -> Pin<Box<T>> conversion) - #57314 (Fix repeated word typos) - #57326 (Doc rewording, use the same name `writer`) - #57338 (rustdoc: force binary filename for compiled doctests) - #57342 (librustc_mir: Make qualify_min_const_fn module public) - #57343 (Calculate privacy access only via query) Failed merges: - #57340 (Use correct tracking issue for c_variadic) r? @ghost
This commit is contained in:
commit
68fe5182c9
32
COPYRIGHT
32
COPYRIGHT
@ -229,35 +229,3 @@ their own copyright notices and license terms:
|
|||||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||||
OF SUCH DAMAGE. */
|
OF SUCH DAMAGE. */
|
||||||
|
|
||||||
* jemalloc, under src/jemalloc:
|
|
||||||
|
|
||||||
Copyright (C) 2002-2014 Jason Evans
|
|
||||||
<jasone@canonware.com>. All rights reserved.
|
|
||||||
Copyright (C) 2007-2012 Mozilla Foundation.
|
|
||||||
All rights reserved.
|
|
||||||
Copyright (C) 2009-2014 Facebook, Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
1. Redistributions of source code must retain the above copyright notice(s),
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice(s),
|
|
||||||
this list of conditions and the following disclaimer in the documentation
|
|
||||||
and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S)
|
|
||||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
||||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S)
|
|
||||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
||||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
||||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
||||||
OF SUCH DAMAGE.
|
|
||||||
|
@ -171,7 +171,7 @@
|
|||||||
|
|
||||||
# Installs chosen set of extended tools if enables. By default builds all.
|
# Installs chosen set of extended tools if enables. By default builds all.
|
||||||
# If chosen tool failed to build the installation fails.
|
# If chosen tool failed to build the installation fails.
|
||||||
#tools = ["cargo", "rls", "rustfmt", "analysis", "src"]
|
#tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]
|
||||||
|
|
||||||
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
|
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
|
||||||
#verbose = 0
|
#verbose = 0
|
||||||
|
@ -24,7 +24,7 @@ warning: attempt to add with overflow
|
|||||||
|
|
||||||
## dead-code
|
## dead-code
|
||||||
|
|
||||||
This lint detects detect unused, unexported items. Some
|
This lint detects unused, unexported items. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -44,7 +44,7 @@ warning: function is never used: `foo`
|
|||||||
|
|
||||||
## deprecated
|
## deprecated
|
||||||
|
|
||||||
This lint detects detects use of deprecated items. Some
|
This lint detects use of deprecated items. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -119,7 +119,7 @@ warning: found struct without foreign-function-safe representation annotation in
|
|||||||
|
|
||||||
## late-bound-lifetime-arguments
|
## late-bound-lifetime-arguments
|
||||||
|
|
||||||
This lint detects detects generic lifetime arguments in path segments with
|
This lint detects generic lifetime arguments in path segments with
|
||||||
late bound lifetime parameters. Some example code that triggers this lint:
|
late bound lifetime parameters. Some example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -381,7 +381,7 @@ extern crate macro_crate_test;
|
|||||||
|
|
||||||
## private-in-public
|
## private-in-public
|
||||||
|
|
||||||
This lint detects detect private items in public interfaces not caught by the old implementation. Some
|
This lint detects private items in public interfaces not caught by the old implementation. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
@ -659,7 +659,7 @@ warning: unknown lint: `not_a_real_lint`
|
|||||||
|
|
||||||
## unreachable-code
|
## unreachable-code
|
||||||
|
|
||||||
This lint detects detects unreachable code paths. Some example code that
|
This lint detects unreachable code paths. Some example code that
|
||||||
triggers this lint:
|
triggers this lint:
|
||||||
|
|
||||||
```rust,no_run
|
```rust,no_run
|
||||||
@ -681,7 +681,7 @@ warning: unreachable statement
|
|||||||
|
|
||||||
## unreachable-patterns
|
## unreachable-patterns
|
||||||
|
|
||||||
This lint detects detects unreachable patterns. Some
|
This lint detects unreachable patterns. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -716,11 +716,11 @@ annotations now.
|
|||||||
|
|
||||||
## unused-allocation
|
## unused-allocation
|
||||||
|
|
||||||
This lint detects detects unnecessary allocations that can be eliminated.
|
This lint detects unnecessary allocations that can be eliminated.
|
||||||
|
|
||||||
## unused-assignments
|
## unused-assignments
|
||||||
|
|
||||||
This lint detects detect assignments that will never be read. Some
|
This lint detects assignments that will never be read. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -741,7 +741,7 @@ warning: value assigned to `x` is never read
|
|||||||
|
|
||||||
## unused-attributes
|
## unused-attributes
|
||||||
|
|
||||||
This lint detects detects attributes that were not used by the compiler. Some
|
This lint detects attributes that were not used by the compiler. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -785,7 +785,7 @@ warning: comparison is useless due to type limits
|
|||||||
|
|
||||||
## unused-doc-comment
|
## unused-doc-comment
|
||||||
|
|
||||||
This lint detects detects doc comments that aren't used by rustdoc. Some
|
This lint detects doc comments that aren't used by rustdoc. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -831,7 +831,7 @@ warning: unused import: `std::collections::HashMap`
|
|||||||
|
|
||||||
## unused-macros
|
## unused-macros
|
||||||
|
|
||||||
This lint detects detects macros that were not used. Some example code that
|
This lint detects macros that were not used. Some example code that
|
||||||
triggers this lint:
|
triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -884,7 +884,7 @@ warning: unused `std::result::Result` that must be used
|
|||||||
|
|
||||||
## unused-mut
|
## unused-mut
|
||||||
|
|
||||||
This lint detects detect mut variables which don't need to be mutable. Some
|
This lint detects mut variables which don't need to be mutable. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -946,7 +946,7 @@ warning: unnecessary `unsafe` block
|
|||||||
|
|
||||||
## unused-variables
|
## unused-variables
|
||||||
|
|
||||||
This lint detects detect variables which are not used in any way. Some
|
This lint detects variables which are not used in any way. Some
|
||||||
example code that triggers this lint:
|
example code that triggers this lint:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
@ -171,7 +171,7 @@ compiles, while only showing the parts that are relevant to that part of your
|
|||||||
explanation.
|
explanation.
|
||||||
|
|
||||||
The `#`-hiding of lines can be prevented by using two consecutive hashes
|
The `#`-hiding of lines can be prevented by using two consecutive hashes
|
||||||
`##`. This only needs to be done with with the first `#` which would've
|
`##`. This only needs to be done with the first `#` which would've
|
||||||
otherwise caused hiding. If we have a string literal like the following,
|
otherwise caused hiding. If we have a string literal like the following,
|
||||||
which has a line that starts with a `#`:
|
which has a line that starts with a `#`:
|
||||||
|
|
||||||
|
@ -257,6 +257,19 @@ impl<T: ?Sized> Box<T> {
|
|||||||
{
|
{
|
||||||
unsafe { &mut *Box::into_raw(b) }
|
unsafe { &mut *Box::into_raw(b) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Converts a `Box<T>` into a `Pin<Box<T>>`
|
||||||
|
///
|
||||||
|
/// This conversion does not allocate on the heap and happens in place.
|
||||||
|
///
|
||||||
|
/// This is also available via [`From`].
|
||||||
|
#[unstable(feature = "box_into_pin", issue = "0")]
|
||||||
|
pub fn into_pin(boxed: Box<T>) -> Pin<Box<T>> {
|
||||||
|
// It's not possible to move or replace the insides of a `Pin<Box<T>>`
|
||||||
|
// when `T: !Unpin`, so it's safe to pin it directly without any
|
||||||
|
// additional requirements.
|
||||||
|
unsafe { Pin::new_unchecked(boxed) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
@ -451,15 +464,12 @@ impl<T> From<T> for Box<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "pin", since = "1.33.0")]
|
#[stable(feature = "pin", since = "1.33.0")]
|
||||||
impl<T> From<Box<T>> for Pin<Box<T>> {
|
impl<T: ?Sized> From<Box<T>> for Pin<Box<T>> {
|
||||||
/// Converts a `Box<T>` into a `Pin<Box<T>>`
|
/// Converts a `Box<T>` into a `Pin<Box<T>>`
|
||||||
///
|
///
|
||||||
/// This conversion does not allocate on the heap and happens in place.
|
/// This conversion does not allocate on the heap and happens in place.
|
||||||
fn from(boxed: Box<T>) -> Self {
|
fn from(boxed: Box<T>) -> Self {
|
||||||
// It's not possible to move or replace the insides of a `Pin<Box<T>>`
|
Box::into_pin(boxed)
|
||||||
// when `T: !Unpin`, so it's safe to pin it directly without any
|
|
||||||
// additional requirements.
|
|
||||||
unsafe { Pin::new_unchecked(boxed) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ impl<'a> VaList<'a> {
|
|||||||
reason = "the `c_variadic` feature has not been properly tested on \
|
reason = "the `c_variadic` feature has not been properly tested on \
|
||||||
all supported platforms",
|
all supported platforms",
|
||||||
issue = "27745")]
|
issue = "27745")]
|
||||||
pub unsafe fn copy<F, R>(&mut self, f: F) -> R
|
pub unsafe fn copy<F, R>(&self, f: F) -> R
|
||||||
where F: for<'copy> FnOnce(VaList<'copy>) -> R {
|
where F: for<'copy> FnOnce(VaList<'copy>) -> R {
|
||||||
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
|
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
|
||||||
not(target_arch = "x86_64")),
|
not(target_arch = "x86_64")),
|
||||||
|
@ -110,6 +110,7 @@
|
|||||||
#![feature(aarch64_target_feature)]
|
#![feature(aarch64_target_feature)]
|
||||||
#![feature(wasm_target_feature)]
|
#![feature(wasm_target_feature)]
|
||||||
#![feature(avx512_target_feature)]
|
#![feature(avx512_target_feature)]
|
||||||
|
#![cfg_attr(not(stage0), feature(cmpxchg16b_target_feature))]
|
||||||
#![feature(const_slice_len)]
|
#![feature(const_slice_len)]
|
||||||
#![feature(const_str_as_bytes)]
|
#![feature(const_str_as_bytes)]
|
||||||
#![feature(const_str_len)]
|
#![feature(const_str_len)]
|
||||||
|
@ -85,7 +85,7 @@ impl<T: ?Sized> !Send for *mut T { }
|
|||||||
on(parent_trait="std::path::Path", label="borrow the `Path` instead"),
|
on(parent_trait="std::path::Path", label="borrow the `Path` instead"),
|
||||||
message="the size for values of type `{Self}` cannot be known at compilation time",
|
message="the size for values of type `{Self}` cannot be known at compilation time",
|
||||||
label="doesn't have a size known at compile-time",
|
label="doesn't have a size known at compile-time",
|
||||||
note="to learn more, visit <https://doc.rust-lang.org/book/second-edition/\
|
note="to learn more, visit <https://doc.rust-lang.org/book/\
|
||||||
ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>",
|
ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>",
|
||||||
)]
|
)]
|
||||||
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
|
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
/// [book] as well as the reference sections on [the dereference operator]
|
/// [book] as well as the reference sections on [the dereference operator]
|
||||||
/// [ref-deref-op], [method resolution] and [type coercions].
|
/// [ref-deref-op], [method resolution] and [type coercions].
|
||||||
///
|
///
|
||||||
/// [book]: ../../book/second-edition/ch15-02-deref.html
|
/// [book]: ../../book/ch15-02-deref.html
|
||||||
/// [`DerefMut`]: trait.DerefMut.html
|
/// [`DerefMut`]: trait.DerefMut.html
|
||||||
/// [more]: #more-on-deref-coercion
|
/// [more]: #more-on-deref-coercion
|
||||||
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
|
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
|
||||||
@ -117,7 +117,7 @@ impl<T: ?Sized> Deref for &mut T {
|
|||||||
/// [book] as well as the reference sections on [the dereference operator]
|
/// [book] as well as the reference sections on [the dereference operator]
|
||||||
/// [ref-deref-op], [method resolution] and [type coercions].
|
/// [ref-deref-op], [method resolution] and [type coercions].
|
||||||
///
|
///
|
||||||
/// [book]: ../../book/second-edition/ch15-02-deref.html
|
/// [book]: ../../book/ch15-02-deref.html
|
||||||
/// [`Deref`]: trait.Deref.html
|
/// [`Deref`]: trait.Deref.html
|
||||||
/// [more]: #more-on-deref-coercion
|
/// [more]: #more-on-deref-coercion
|
||||||
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
|
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
/// Refer to [the chapter on `Drop` in *The Rust Programming Language*][book]
|
/// Refer to [the chapter on `Drop` in *The Rust Programming Language*][book]
|
||||||
/// for some more elaboration.
|
/// for some more elaboration.
|
||||||
///
|
///
|
||||||
/// [book]: ../../book/second-edition/ch15-03-drop.html
|
/// [book]: ../../book/ch15-03-drop.html
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
|
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
|
||||||
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
|
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
|
||||||
///
|
///
|
||||||
/// [book]: ../../book/second-edition/ch13-01-closures.html
|
/// [book]: ../../book/ch13-01-closures.html
|
||||||
/// [`FnMut`]: trait.FnMut.html
|
/// [`FnMut`]: trait.FnMut.html
|
||||||
/// [`FnOnce`]: trait.FnOnce.html
|
/// [`FnOnce`]: trait.FnOnce.html
|
||||||
/// [function pointers]: ../../std/primitive.fn.html
|
/// [function pointers]: ../../std/primitive.fn.html
|
||||||
@ -95,7 +95,7 @@ pub trait Fn<Args> : FnMut<Args> {
|
|||||||
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
|
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
|
||||||
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
|
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
|
||||||
///
|
///
|
||||||
/// [book]: ../../book/second-edition/ch13-01-closures.html
|
/// [book]: ../../book/ch13-01-closures.html
|
||||||
/// [`Fn`]: trait.Fn.html
|
/// [`Fn`]: trait.Fn.html
|
||||||
/// [`FnOnce`]: trait.FnOnce.html
|
/// [`FnOnce`]: trait.FnOnce.html
|
||||||
/// [function pointers]: ../../std/primitive.fn.html
|
/// [function pointers]: ../../std/primitive.fn.html
|
||||||
@ -173,7 +173,7 @@ pub trait FnMut<Args> : FnOnce<Args> {
|
|||||||
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
|
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
|
||||||
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
|
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
|
||||||
///
|
///
|
||||||
/// [book]: ../../book/second-edition/ch13-01-closures.html
|
/// [book]: ../../book/ch13-01-closures.html
|
||||||
/// [`Fn`]: trait.Fn.html
|
/// [`Fn`]: trait.Fn.html
|
||||||
/// [`FnMut`]: trait.FnMut.html
|
/// [`FnMut`]: trait.FnMut.html
|
||||||
/// [function pointers]: ../../std/primitive.fn.html
|
/// [function pointers]: ../../std/primitive.fn.html
|
||||||
|
@ -477,22 +477,6 @@ impl_stable_hash_for!(enum mir::interpret::InboundsCheck {
|
|||||||
MaybeDead
|
MaybeDead
|
||||||
});
|
});
|
||||||
|
|
||||||
impl_stable_hash_for!(enum mir::interpret::Lock {
|
|
||||||
NoLock,
|
|
||||||
WriteLock(dl),
|
|
||||||
ReadLock(v)
|
|
||||||
});
|
|
||||||
|
|
||||||
impl_stable_hash_for!(struct mir::interpret::DynamicLifetime {
|
|
||||||
frame,
|
|
||||||
region
|
|
||||||
});
|
|
||||||
|
|
||||||
impl_stable_hash_for!(enum mir::interpret::AccessKind {
|
|
||||||
Read,
|
|
||||||
Write
|
|
||||||
});
|
|
||||||
|
|
||||||
impl_stable_hash_for!(enum ty::Variance {
|
impl_stable_hash_for!(enum ty::Variance {
|
||||||
Covariant,
|
Covariant,
|
||||||
Invariant,
|
Invariant,
|
||||||
|
@ -19,7 +19,7 @@ pub type OpaqueTypeMap<'tcx> = DefIdMap<OpaqueTypeDecl<'tcx>>;
|
|||||||
/// appear in the return type).
|
/// appear in the return type).
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct OpaqueTypeDecl<'tcx> {
|
pub struct OpaqueTypeDecl<'tcx> {
|
||||||
/// The substitutions that we apply to the abstract that that this
|
/// The substitutions that we apply to the abstract that this
|
||||||
/// `impl Trait` desugars to. e.g., if:
|
/// `impl Trait` desugars to. e.g., if:
|
||||||
///
|
///
|
||||||
/// fn foo<'a, 'b, T>() -> impl Trait<'a>
|
/// fn foo<'a, 'b, T>() -> impl Trait<'a>
|
||||||
|
@ -173,8 +173,8 @@ impl<'a> LintLevelsBuilder<'a> {
|
|||||||
|
|
||||||
/// Pushes a list of AST lint attributes onto this context.
|
/// Pushes a list of AST lint attributes onto this context.
|
||||||
///
|
///
|
||||||
/// This function will return a `BuilderPush` object which should be be
|
/// This function will return a `BuilderPush` object which should be passed
|
||||||
/// passed to `pop` when this scope for the attributes provided is exited.
|
/// to `pop` when this scope for the attributes provided is exited.
|
||||||
///
|
///
|
||||||
/// This function will perform a number of tasks:
|
/// This function will perform a number of tasks:
|
||||||
///
|
///
|
||||||
|
@ -29,7 +29,6 @@ use mir;
|
|||||||
use hir::def_id::DefId;
|
use hir::def_id::DefId;
|
||||||
use ty::{self, TyCtxt, Instance};
|
use ty::{self, TyCtxt, Instance};
|
||||||
use ty::layout::{self, Size};
|
use ty::layout::{self, Size};
|
||||||
use middle::region;
|
|
||||||
use std::io;
|
use std::io;
|
||||||
use rustc_serialize::{Encoder, Decodable, Encodable};
|
use rustc_serialize::{Encoder, Decodable, Encodable};
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
use rustc_data_structures::fx::FxHashMap;
|
||||||
@ -40,27 +39,6 @@ use ty::codec::TyDecoder;
|
|||||||
use std::sync::atomic::{AtomicU32, Ordering};
|
use std::sync::atomic::{AtomicU32, Ordering};
|
||||||
use std::num::NonZeroU32;
|
use std::num::NonZeroU32;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
|
|
||||||
pub enum Lock {
|
|
||||||
NoLock,
|
|
||||||
WriteLock(DynamicLifetime),
|
|
||||||
/// This should never be empty -- that would be a read lock held and nobody
|
|
||||||
/// there to release it...
|
|
||||||
ReadLock(Vec<DynamicLifetime>),
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
|
|
||||||
pub struct DynamicLifetime {
|
|
||||||
pub frame: usize,
|
|
||||||
pub region: Option<region::Scope>, // "None" indicates "until the function ends"
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
|
|
||||||
pub enum AccessKind {
|
|
||||||
Read,
|
|
||||||
Write,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Uniquely identifies a specific constant or static.
|
/// Uniquely identifies a specific constant or static.
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, RustcEncodable, RustcDecodable)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, RustcEncodable, RustcDecodable)]
|
||||||
pub struct GlobalId<'tcx> {
|
pub struct GlobalId<'tcx> {
|
||||||
|
@ -79,7 +79,7 @@ pub enum Scalar<Tag=(), Id=AllocId> {
|
|||||||
/// The raw bytes of a simple value.
|
/// The raw bytes of a simple value.
|
||||||
Bits {
|
Bits {
|
||||||
/// The first `size` bytes are the value.
|
/// The first `size` bytes are the value.
|
||||||
/// Do not try to read less or more bytes that that. The remaining bytes must be 0.
|
/// Do not try to read less or more bytes than that. The remaining bytes must be 0.
|
||||||
size: u8,
|
size: u8,
|
||||||
bits: u128,
|
bits: u128,
|
||||||
},
|
},
|
||||||
|
@ -1311,12 +1311,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
|
|||||||
"Disable the instrumentation pre-inliner, useful for profiling / PGO."),
|
"Disable the instrumentation pre-inliner, useful for profiling / PGO."),
|
||||||
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
|
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
|
||||||
"choose which RELRO level to use"),
|
"choose which RELRO level to use"),
|
||||||
nll_subminimal_causes: bool = (false, parse_bool, [UNTRACKED],
|
|
||||||
"when tracking region error causes, accept subminimal results for faster execution."),
|
|
||||||
nll_facts: bool = (false, parse_bool, [UNTRACKED],
|
nll_facts: bool = (false, parse_bool, [UNTRACKED],
|
||||||
"dump facts from NLL analysis into side files"),
|
"dump facts from NLL analysis into side files"),
|
||||||
disable_nll_user_type_assert: bool = (false, parse_bool, [UNTRACKED],
|
|
||||||
"disable user provided type assertion in NLL"),
|
|
||||||
nll_dont_emit_read_for_match: bool = (false, parse_bool, [UNTRACKED],
|
nll_dont_emit_read_for_match: bool = (false, parse_bool, [UNTRACKED],
|
||||||
"in match codegen, do not include FakeRead statements (used by mir-borrowck)"),
|
"in match codegen, do not include FakeRead statements (used by mir-borrowck)"),
|
||||||
dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],
|
dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],
|
||||||
|
@ -359,7 +359,15 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
|
|||||||
|
|
||||||
match abi_of_ty(unit_receiver_ty) {
|
match abi_of_ty(unit_receiver_ty) {
|
||||||
&Abi::Scalar(..) => (),
|
&Abi::Scalar(..) => (),
|
||||||
abi => bug!("Receiver when Self = () should have a Scalar ABI, found {:?}", abi)
|
abi => {
|
||||||
|
self.sess.delay_span_bug(
|
||||||
|
self.def_span(method.def_id),
|
||||||
|
&format!(
|
||||||
|
"Receiver when Self = () should have a Scalar ABI, found {:?}",
|
||||||
|
abi
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let trait_object_ty = self.object_ty_for_trait(
|
let trait_object_ty = self.object_ty_for_trait(
|
||||||
@ -373,10 +381,15 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
|
|||||||
|
|
||||||
match abi_of_ty(trait_object_receiver) {
|
match abi_of_ty(trait_object_receiver) {
|
||||||
&Abi::ScalarPair(..) => (),
|
&Abi::ScalarPair(..) => (),
|
||||||
abi => bug!(
|
abi => {
|
||||||
"Receiver when Self = {} should have a ScalarPair ABI, found {:?}",
|
self.sess.delay_span_bug(
|
||||||
trait_object_ty, abi
|
self.def_span(method.def_id),
|
||||||
)
|
&format!(
|
||||||
|
"Receiver when Self = {} should have a ScalarPair ABI, found {:?}",
|
||||||
|
trait_object_ty, abi
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ pub trait TypeFoldable<'tcx>: fmt::Debug + Clone {
|
|||||||
self.has_type_flags(TypeFlags::HAS_FREE_REGIONS)
|
self.has_type_flags(TypeFlags::HAS_FREE_REGIONS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// True if there any any un-erased free regions.
|
/// True if there are any un-erased free regions.
|
||||||
fn has_erasable_regions(&self) -> bool {
|
fn has_erasable_regions(&self) -> bool {
|
||||||
self.has_type_flags(TypeFlags::HAS_FREE_REGIONS)
|
self.has_type_flags(TypeFlags::HAS_FREE_REGIONS)
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ use ich::Fingerprint;
|
|||||||
use ich::StableHashingContext;
|
use ich::StableHashingContext;
|
||||||
use infer::canonical::Canonical;
|
use infer::canonical::Canonical;
|
||||||
use middle::lang_items::{FnTraitLangItem, FnMutTraitLangItem, FnOnceTraitLangItem};
|
use middle::lang_items::{FnTraitLangItem, FnMutTraitLangItem, FnOnceTraitLangItem};
|
||||||
use middle::privacy::AccessLevels;
|
|
||||||
use middle::resolve_lifetime::ObjectLifetimeDefault;
|
use middle::resolve_lifetime::ObjectLifetimeDefault;
|
||||||
use mir::Mir;
|
use mir::Mir;
|
||||||
use mir::interpret::{GlobalId, ErrorHandled};
|
use mir::interpret::{GlobalId, ErrorHandled};
|
||||||
@ -123,8 +122,6 @@ mod sty;
|
|||||||
/// *on-demand* infrastructure.
|
/// *on-demand* infrastructure.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct CrateAnalysis {
|
pub struct CrateAnalysis {
|
||||||
pub access_levels: Lrc<AccessLevels>,
|
|
||||||
pub name: String,
|
|
||||||
pub glob_map: Option<hir::GlobMap>,
|
pub glob_map: Option<hir::GlobMap>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -974,7 +974,7 @@ macro_rules! define_queries_inner {
|
|||||||
// HACK(eddyb) it's possible crates may be loaded after
|
// HACK(eddyb) it's possible crates may be loaded after
|
||||||
// the query engine is created, and because crate loading
|
// the query engine is created, and because crate loading
|
||||||
// is not yet integrated with the query engine, such crates
|
// is not yet integrated with the query engine, such crates
|
||||||
// would be be missing appropriate entries in `providers`.
|
// would be missing appropriate entries in `providers`.
|
||||||
.unwrap_or(&tcx.queries.fallback_extern_providers)
|
.unwrap_or(&tcx.queries.fallback_extern_providers)
|
||||||
.$name;
|
.$name;
|
||||||
provider(tcx.global_tcx(), key)
|
provider(tcx.global_tcx(), key)
|
||||||
|
@ -2341,7 +2341,7 @@ mod sig {
|
|||||||
// Our exponent should not underflow.
|
// Our exponent should not underflow.
|
||||||
*exp = exp.checked_sub(bits as ExpInt).unwrap();
|
*exp = exp.checked_sub(bits as ExpInt).unwrap();
|
||||||
|
|
||||||
// Jump is the inter-limb jump; shift is is intra-limb shift.
|
// Jump is the inter-limb jump; shift is the intra-limb shift.
|
||||||
let jump = bits / LIMB_BITS;
|
let jump = bits / LIMB_BITS;
|
||||||
let shift = bits % LIMB_BITS;
|
let shift = bits % LIMB_BITS;
|
||||||
|
|
||||||
@ -2375,7 +2375,7 @@ mod sig {
|
|||||||
// Our exponent should not overflow.
|
// Our exponent should not overflow.
|
||||||
*exp = exp.checked_add(bits as ExpInt).unwrap();
|
*exp = exp.checked_add(bits as ExpInt).unwrap();
|
||||||
|
|
||||||
// Jump is the inter-limb jump; shift is is intra-limb shift.
|
// Jump is the inter-limb jump; shift is the intra-limb shift.
|
||||||
let jump = bits / LIMB_BITS;
|
let jump = bits / LIMB_BITS;
|
||||||
let shift = bits % LIMB_BITS;
|
let shift = bits % LIMB_BITS;
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ use rustc::hir::lowering::lower_crate;
|
|||||||
use rustc::hir::map as hir_map;
|
use rustc::hir::map as hir_map;
|
||||||
use rustc::lint;
|
use rustc::lint;
|
||||||
use rustc::middle::{self, reachable, resolve_lifetime, stability};
|
use rustc::middle::{self, reachable, resolve_lifetime, stability};
|
||||||
use rustc::middle::privacy::AccessLevels;
|
|
||||||
use rustc::ty::{self, AllArenas, Resolutions, TyCtxt};
|
use rustc::ty::{self, AllArenas, Resolutions, TyCtxt};
|
||||||
use rustc::traits;
|
use rustc::traits;
|
||||||
use rustc::util::common::{install_panic_hook, time, ErrorReported};
|
use rustc::util::common::{install_panic_hook, time, ErrorReported};
|
||||||
@ -18,7 +17,7 @@ use rustc_borrowck as borrowck;
|
|||||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||||
use rustc_data_structures::fingerprint::Fingerprint;
|
use rustc_data_structures::fingerprint::Fingerprint;
|
||||||
use rustc_data_structures::stable_hasher::StableHasher;
|
use rustc_data_structures::stable_hasher::StableHasher;
|
||||||
use rustc_data_structures::sync::{self, Lrc, Lock};
|
use rustc_data_structures::sync::{self, Lock};
|
||||||
use rustc_incremental;
|
use rustc_incremental;
|
||||||
use rustc_metadata::creader::CrateLoader;
|
use rustc_metadata::creader::CrateLoader;
|
||||||
use rustc_metadata::cstore::{self, CStore};
|
use rustc_metadata::cstore::{self, CStore};
|
||||||
@ -785,8 +784,6 @@ where
|
|||||||
},
|
},
|
||||||
|
|
||||||
analysis: ty::CrateAnalysis {
|
analysis: ty::CrateAnalysis {
|
||||||
access_levels: Lrc::new(AccessLevels::default()),
|
|
||||||
name: crate_name.to_string(),
|
|
||||||
glob_map: if resolver.make_glob_map {
|
glob_map: if resolver.make_glob_map {
|
||||||
Some(resolver.glob_map)
|
Some(resolver.glob_map)
|
||||||
} else {
|
} else {
|
||||||
@ -1193,7 +1190,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(
|
|||||||
sess: &'tcx Session,
|
sess: &'tcx Session,
|
||||||
cstore: &'tcx CStore,
|
cstore: &'tcx CStore,
|
||||||
hir_map: hir_map::Map<'tcx>,
|
hir_map: hir_map::Map<'tcx>,
|
||||||
mut analysis: ty::CrateAnalysis,
|
analysis: ty::CrateAnalysis,
|
||||||
resolutions: Resolutions,
|
resolutions: Resolutions,
|
||||||
arenas: &'tcx mut AllArenas<'tcx>,
|
arenas: &'tcx mut AllArenas<'tcx>,
|
||||||
name: &str,
|
name: &str,
|
||||||
@ -1275,8 +1272,9 @@ where
|
|||||||
rvalue_promotion::check_crate(tcx)
|
rvalue_promotion::check_crate(tcx)
|
||||||
});
|
});
|
||||||
|
|
||||||
analysis.access_levels =
|
time(sess, "privacy checking", || {
|
||||||
time(sess, "privacy checking", || rustc_privacy::check_crate(tcx));
|
rustc_privacy::check_crate(tcx)
|
||||||
|
});
|
||||||
|
|
||||||
time(sess, "intrinsic checking", || {
|
time(sess, "intrinsic checking", || {
|
||||||
middle::intrinsicck::check_crate(tcx)
|
middle::intrinsicck::check_crate(tcx)
|
||||||
|
@ -673,7 +673,7 @@ impl EarlyLintPass for AnonymousParameters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks for incorrect use use of `repr` attributes.
|
/// Checks for incorrect use of `repr` attributes.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct BadRepr;
|
pub struct BadRepr;
|
||||||
|
|
||||||
|
@ -723,7 +723,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
|
|||||||
functions can only return borrows to data passed as arguments",
|
functions can only return borrows to data passed as arguments",
|
||||||
);
|
);
|
||||||
err.note(
|
err.note(
|
||||||
"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch04-02-\
|
"to learn more, visit <https://doc.rust-lang.org/book/ch04-02-\
|
||||||
references-and-borrowing.html#dangling-references>",
|
references-and-borrowing.html#dangling-references>",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -2139,7 +2139,7 @@ impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
|
|||||||
"argument and return type have the same lifetime due to lifetime elision rules",
|
"argument and return type have the same lifetime due to lifetime elision rules",
|
||||||
);
|
);
|
||||||
diag.note(
|
diag.note(
|
||||||
"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch10-03-\
|
"to learn more, visit <https://doc.rust-lang.org/book/ch10-03-\
|
||||||
lifetime-syntax.html#lifetime-elision>",
|
lifetime-syntax.html#lifetime-elision>",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -279,20 +279,6 @@ impl<'a, 'gcx, 'tcx> BitDenotation<'tcx> for Borrows<'a, 'gcx, 'tcx> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
sets.gen(*index);
|
sets.gen(*index);
|
||||||
|
|
||||||
// Issue #46746: Two-phase borrows handles
|
|
||||||
// stmts of form `Tmp = &mut Borrow` ...
|
|
||||||
match lhs {
|
|
||||||
Place::Promoted(_) |
|
|
||||||
Place::Local(..) | Place::Static(..) => {} // okay
|
|
||||||
Place::Projection(..) => {
|
|
||||||
// ... can assign into projections,
|
|
||||||
// e.g., `box (&mut _)`. Current
|
|
||||||
// conservative solution: force
|
|
||||||
// immediate activation here.
|
|
||||||
sets.gen(*index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ pub mod elaborate_drops;
|
|||||||
pub mod add_call_guards;
|
pub mod add_call_guards;
|
||||||
pub mod promote_consts;
|
pub mod promote_consts;
|
||||||
pub mod qualify_consts;
|
pub mod qualify_consts;
|
||||||
mod qualify_min_const_fn;
|
pub mod qualify_min_const_fn;
|
||||||
pub mod remove_noop_landing_pads;
|
pub mod remove_noop_landing_pads;
|
||||||
pub mod dump_mir;
|
pub mod dump_mir;
|
||||||
pub mod deaggregator;
|
pub mod deaggregator;
|
||||||
|
@ -192,7 +192,7 @@ use foo::core; // error: an extern crate named `core` has already
|
|||||||
fn main() {}
|
fn main() {}
|
||||||
```
|
```
|
||||||
|
|
||||||
To fix issue issue, you have to rename at least one of the two imports.
|
To fix this issue, you have to rename at least one of the two imports.
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
//! recording the output.
|
//! recording the output.
|
||||||
|
|
||||||
use rustc::hir::def::Def as HirDef;
|
use rustc::hir::def::Def as HirDef;
|
||||||
use rustc::hir::def_id::DefId;
|
use rustc::hir::def_id::{DefId, LOCAL_CRATE};
|
||||||
use rustc::session::config::Input;
|
use rustc::session::config::Input;
|
||||||
use rustc::ty::{self, TyCtxt};
|
use rustc::ty::{self, TyCtxt};
|
||||||
use rustc_data_structures::fx::FxHashSet;
|
use rustc_data_structures::fx::FxHashSet;
|
||||||
@ -56,14 +56,14 @@ macro_rules! access_from {
|
|||||||
($save_ctxt:expr, $vis:expr, $id:expr) => {
|
($save_ctxt:expr, $vis:expr, $id:expr) => {
|
||||||
Access {
|
Access {
|
||||||
public: $vis.node.is_pub(),
|
public: $vis.node.is_pub(),
|
||||||
reachable: $save_ctxt.analysis.access_levels.is_reachable($id),
|
reachable: $save_ctxt.tcx.privacy_access_levels(LOCAL_CRATE).is_reachable($id),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
($save_ctxt:expr, $item:expr) => {
|
($save_ctxt:expr, $item:expr) => {
|
||||||
Access {
|
Access {
|
||||||
public: $item.vis.node.is_pub(),
|
public: $item.vis.node.is_pub(),
|
||||||
reachable: $save_ctxt.analysis.access_levels.is_reachable($item.id),
|
reachable: $save_ctxt.tcx.privacy_access_levels(LOCAL_CRATE).is_reachable($item.id),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//! Conversion from AST representation of types to the `ty.rs` representation.
|
//! Conversion from AST representation of types to the `ty.rs` representation.
|
||||||
//! The main routine here is `ast_ty_to_ty()`; each use is is parameterized by
|
//! The main routine here is `ast_ty_to_ty()`; each use is parameterized by an
|
||||||
//! an instance of `AstConv`.
|
//! instance of `AstConv`.
|
||||||
|
|
||||||
use errors::{Applicability, FatalError, DiagnosticId};
|
use errors::{Applicability, FatalError, DiagnosticId};
|
||||||
use hir::{self, GenericArg, GenericArgs};
|
use hir::{self, GenericArg, GenericArgs};
|
||||||
|
@ -496,7 +496,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||||||
self.infcx.commit_if_ok(|_| {
|
self.infcx.commit_if_ok(|_| {
|
||||||
let mut all_obligations = vec![];
|
let mut all_obligations = vec![];
|
||||||
|
|
||||||
// The liberated version of this signature should be be a subtype
|
// The liberated version of this signature should be a subtype
|
||||||
// of the liberated form of the expectation.
|
// of the liberated form of the expectation.
|
||||||
for ((hir_ty, &supplied_ty), expected_ty) in decl.inputs.iter()
|
for ((hir_ty, &supplied_ty), expected_ty) in decl.inputs.iter()
|
||||||
.zip(*supplied_sig.inputs().skip_binder()) // binder moved to (*) below
|
.zip(*supplied_sig.inputs().skip_binder()) // binder moved to (*) below
|
||||||
|
@ -335,7 +335,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||||||
// we may want to suggest adding a `*`, or removing
|
// we may want to suggest adding a `*`, or removing
|
||||||
// a `&`.
|
// a `&`.
|
||||||
//
|
//
|
||||||
// (But, also check check the `expn_info()` to see if this is
|
// (But, also check the `expn_info()` to see if this is
|
||||||
// a macro; if so, it's hard to extract the text and make a good
|
// a macro; if so, it's hard to extract the text and make a good
|
||||||
// suggestion, so don't bother.)
|
// suggestion, so don't bother.)
|
||||||
if self.infcx.can_sub(self.param_env, checked, &expected).is_ok() &&
|
if self.infcx.can_sub(self.param_env, checked, &expected).is_ok() &&
|
||||||
|
@ -534,7 +534,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
|
|||||||
did, param_env, type_generics, existing_predicates
|
did, param_env, type_generics, existing_predicates
|
||||||
);
|
);
|
||||||
|
|
||||||
// The `Sized` trait must be handled specially, since we only only display it when
|
// The `Sized` trait must be handled specially, since we only display it when
|
||||||
// it is *not* required (i.e., '?Sized')
|
// it is *not* required (i.e., '?Sized')
|
||||||
let sized_trait = self.cx
|
let sized_trait = self.cx
|
||||||
.tcx
|
.tcx
|
||||||
|
@ -476,8 +476,6 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
|
|||||||
}).collect(),
|
}).collect(),
|
||||||
};
|
};
|
||||||
let analysis = ty::CrateAnalysis {
|
let analysis = ty::CrateAnalysis {
|
||||||
access_levels: Lrc::new(AccessLevels::default()),
|
|
||||||
name: name.to_string(),
|
|
||||||
glob_map: if resolver.make_glob_map { Some(resolver.glob_map.clone()) } else { None },
|
glob_map: if resolver.make_glob_map { Some(resolver.glob_map.clone()) } else { None },
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -500,12 +498,12 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
|
|||||||
&mut arenas,
|
&mut arenas,
|
||||||
&name,
|
&name,
|
||||||
&output_filenames,
|
&output_filenames,
|
||||||
|tcx, analysis, _, result| {
|
|tcx, _, _, result| {
|
||||||
if result.is_err() {
|
if result.is_err() {
|
||||||
sess.fatal("Compilation failed, aborting rustdoc");
|
sess.fatal("Compilation failed, aborting rustdoc");
|
||||||
}
|
}
|
||||||
|
|
||||||
let ty::CrateAnalysis { access_levels, .. } = analysis;
|
let access_levels = tcx.privacy_access_levels(LOCAL_CRATE);
|
||||||
|
|
||||||
// Convert from a NodeId set to a DefId set since we don't always have easy access
|
// Convert from a NodeId set to a DefId set since we don't always have easy access
|
||||||
// to the map from defid -> nodeid
|
// to the map from defid -> nodeid
|
||||||
|
@ -278,7 +278,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
|
|||||||
target_features::add_configuration(&mut cfg, &sess, &*codegen_backend);
|
target_features::add_configuration(&mut cfg, &sess, &*codegen_backend);
|
||||||
sess.parse_sess.config = cfg;
|
sess.parse_sess.config = cfg;
|
||||||
|
|
||||||
let out = Some(outdir.lock().unwrap().path().to_path_buf());
|
let out = Some(outdir.lock().unwrap().path().join("rust_out"));
|
||||||
|
|
||||||
if no_run {
|
if no_run {
|
||||||
control.after_analysis.stop = Compilation::Stop;
|
control.after_analysis.stop = Compilation::Stop;
|
||||||
@ -291,8 +291,8 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
|
|||||||
&cstore,
|
&cstore,
|
||||||
&None,
|
&None,
|
||||||
&input,
|
&input,
|
||||||
&out,
|
|
||||||
&None,
|
&None,
|
||||||
|
&out,
|
||||||
None,
|
None,
|
||||||
&control
|
&control
|
||||||
)
|
)
|
||||||
|
@ -179,7 +179,7 @@ impl<T, S> HashSet<T, S>
|
|||||||
HashSet { map: HashMap::with_hasher(hasher) }
|
HashSet { map: HashMap::with_hasher(hasher) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates an empty `HashSet` with with the specified capacity, using
|
/// Creates an empty `HashSet` with the specified capacity, using
|
||||||
/// `hasher` to hash the keys.
|
/// `hasher` to hash the keys.
|
||||||
///
|
///
|
||||||
/// The hash set will be able to hold at least `capacity` elements without
|
/// The hash set will be able to hold at least `capacity` elements without
|
||||||
|
@ -948,7 +948,7 @@ impl Initializer {
|
|||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[doc(spotlight)]
|
#[doc(spotlight)]
|
||||||
pub trait Write {
|
pub trait Write {
|
||||||
/// Write a buffer into this object, returning how many bytes were written.
|
/// Write a buffer into this writer, returning how many bytes were written.
|
||||||
///
|
///
|
||||||
/// This function will attempt to write the entire contents of `buf`, but
|
/// This function will attempt to write the entire contents of `buf`, but
|
||||||
/// the entire write may not succeed, or the write may also generate an
|
/// the entire write may not succeed, or the write may also generate an
|
||||||
@ -1023,7 +1023,7 @@ pub trait Write {
|
|||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
fn flush(&mut self) -> Result<()>;
|
fn flush(&mut self) -> Result<()>;
|
||||||
|
|
||||||
/// Attempts to write an entire buffer into this write.
|
/// Attempts to write an entire buffer into this writer.
|
||||||
///
|
///
|
||||||
/// This method will continuously call [`write`] until there is no more data
|
/// This method will continuously call [`write`] until there is no more data
|
||||||
/// to be written or an error of non-[`ErrorKind::Interrupted`] kind is
|
/// to be written or an error of non-[`ErrorKind::Interrupted`] kind is
|
||||||
|
@ -47,8 +47,8 @@ mod as_keyword { }
|
|||||||
///
|
///
|
||||||
/// Constants must be explicitly typed, unlike with `let` you can't ignore its type and let the
|
/// Constants must be explicitly typed, unlike with `let` you can't ignore its type and let the
|
||||||
/// compiler figure it out. Any constant value can be defined in a const, which in practice happens
|
/// compiler figure it out. Any constant value can be defined in a const, which in practice happens
|
||||||
/// to be most things that would be reasonable to have a constant (barring `const fn`s, coming
|
/// to be most things that would be reasonable to have a constant (barring `const fn`s). For
|
||||||
/// soon). For example, you can't have a File as a `const`.
|
/// example, you can't have a File as a `const`.
|
||||||
///
|
///
|
||||||
/// The only lifetime allowed in a constant is `'static`, which is the lifetime that encompasses
|
/// The only lifetime allowed in a constant is `'static`, which is the lifetime that encompasses
|
||||||
/// all others in a Rust program. For example, if you wanted to define a constant string, it would
|
/// all others in a Rust program. For example, if you wanted to define a constant string, it would
|
||||||
@ -169,7 +169,7 @@ mod crate_keyword { }
|
|||||||
///
|
///
|
||||||
/// [Algebraic Data Types]: https://en.wikipedia.org/wiki/Algebraic_data_type
|
/// [Algebraic Data Types]: https://en.wikipedia.org/wiki/Algebraic_data_type
|
||||||
/// [`Option`]: option/enum.Option.html
|
/// [`Option`]: option/enum.Option.html
|
||||||
/// [Rust Book]: https://doc.rust-lang.org/book/second-edition/ch06-01-defining-an-enum.html
|
/// [Rust Book]: https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html
|
||||||
/// [Reference]: https://doc.rust-lang.org/reference/items/enumerations.html
|
/// [Reference]: https://doc.rust-lang.org/reference/items/enumerations.html
|
||||||
mod enum_keyword { }
|
mod enum_keyword { }
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ mod enum_keyword { }
|
|||||||
/// For more information on FFI, check the [Rust book] or the [Reference].
|
/// For more information on FFI, check the [Rust book] or the [Reference].
|
||||||
///
|
///
|
||||||
/// [Rust book]:
|
/// [Rust book]:
|
||||||
/// https://doc.rust-lang.org/book/second-edition/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code
|
/// https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code
|
||||||
/// [Reference]: https://doc.rust-lang.org/reference/items/external-blocks.html
|
/// [Reference]: https://doc.rust-lang.org/reference/items/external-blocks.html
|
||||||
mod extern_keyword { }
|
mod extern_keyword { }
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ mod extern_keyword { }
|
|||||||
///
|
///
|
||||||
/// [`impl`]: keyword.impl.html
|
/// [`impl`]: keyword.impl.html
|
||||||
/// [`extern`]: keyword.extern.html
|
/// [`extern`]: keyword.extern.html
|
||||||
/// [Rust book]: https://doc.rust-lang.org/book/second-edition/ch03-03-how-functions-work.html
|
/// [Rust book]: https://doc.rust-lang.org/book/ch03-03-how-functions-work.html
|
||||||
/// [Reference]: https://doc.rust-lang.org/reference/items/functions.html
|
/// [Reference]: https://doc.rust-lang.org/reference/items/functions.html
|
||||||
mod fn_keyword { }
|
mod fn_keyword { }
|
||||||
|
|
||||||
@ -705,6 +705,6 @@ mod loop_keyword { }
|
|||||||
/// [Reference][reference].
|
/// [Reference][reference].
|
||||||
///
|
///
|
||||||
/// [`PhantomData`]: marker/struct.PhantomData.html
|
/// [`PhantomData`]: marker/struct.PhantomData.html
|
||||||
/// [book]: https://doc.rust-lang.org/book/second-edition/ch05-01-defining-structs.html
|
/// [book]: https://doc.rust-lang.org/book/ch05-01-defining-structs.html
|
||||||
/// [reference]: https://doc.rust-lang.org/reference/items/structs.html
|
/// [reference]: https://doc.rust-lang.org/reference/items/structs.html
|
||||||
mod struct_keyword { }
|
mod struct_keyword { }
|
||||||
|
@ -923,7 +923,7 @@ mod prim_usize { }
|
|||||||
/// For more information on how to use references, see [the book's section on "References and
|
/// For more information on how to use references, see [the book's section on "References and
|
||||||
/// Borrowing"][book-refs].
|
/// Borrowing"][book-refs].
|
||||||
///
|
///
|
||||||
/// [book-refs]: ../book/second-edition/ch04-02-references-and-borrowing.html
|
/// [book-refs]: ../book/ch04-02-references-and-borrowing.html
|
||||||
///
|
///
|
||||||
/// # Trait implementations
|
/// # Trait implementations
|
||||||
///
|
///
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
//!
|
//!
|
||||||
//! ## Specification of the ABI
|
//! ## Specification of the ABI
|
||||||
//!
|
//!
|
||||||
//! The entire ABI is specified in a a file called
|
//! The entire ABI is specified in a file called
|
||||||
//! [`cloudabi.txt`](https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt),
|
//! [`cloudabi.txt`](https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt),
|
||||||
//! from which all
|
//! from which all
|
||||||
//! [headers](https://github.com/NuxiNL/cloudabi/tree/master/headers)
|
//! [headers](https://github.com/NuxiNL/cloudabi/tree/master/headers)
|
||||||
|
@ -103,7 +103,7 @@ fn set_frames<W: StackWalker>(StackWalk: W, frames: &mut [Frame]) -> io::Result<
|
|||||||
frames[i] = Frame {
|
frames[i] = Frame {
|
||||||
symbol_addr: addr,
|
symbol_addr: addr,
|
||||||
exact_position: addr,
|
exact_position: addr,
|
||||||
inline_context: 0,
|
inline_context: frame.get_inline_context(),
|
||||||
};
|
};
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
@ -209,6 +209,7 @@ trait StackFrame {
|
|||||||
fn new() -> Self;
|
fn new() -> Self;
|
||||||
fn init(&mut self, ctx: &c::CONTEXT) -> c::DWORD;
|
fn init(&mut self, ctx: &c::CONTEXT) -> c::DWORD;
|
||||||
fn get_addr(&self) -> *const u8;
|
fn get_addr(&self) -> *const u8;
|
||||||
|
fn get_inline_context(&self) -> u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StackFrame for c::STACKFRAME_EX {
|
impl StackFrame for c::STACKFRAME_EX {
|
||||||
@ -263,6 +264,10 @@ impl StackFrame for c::STACKFRAME_EX {
|
|||||||
fn get_addr(&self) -> *const u8 {
|
fn get_addr(&self) -> *const u8 {
|
||||||
(self.AddrPC.Offset - 1) as *const u8
|
(self.AddrPC.Offset - 1) as *const u8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_inline_context(&self) -> u32 {
|
||||||
|
self.InlineFrameContext
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StackFrame for c::STACKFRAME64 {
|
impl StackFrame for c::STACKFRAME64 {
|
||||||
@ -317,6 +322,10 @@ impl StackFrame for c::STACKFRAME64 {
|
|||||||
fn get_addr(&self) -> *const u8 {
|
fn get_addr(&self) -> *const u8 {
|
||||||
(self.AddrPC.Offset - 1) as *const u8
|
(self.AddrPC.Offset - 1) as *const u8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_inline_context(&self) -> u32 {
|
||||||
|
0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum StackWalkVariant {
|
enum StackWalkVariant {
|
||||||
|
@ -126,7 +126,7 @@ pub trait OpenOptionsExt {
|
|||||||
///
|
///
|
||||||
/// By default `share_mode` is set to
|
/// By default `share_mode` is set to
|
||||||
/// `FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE`. This allows
|
/// `FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE`. This allows
|
||||||
/// other processes to to read, write, and delete/rename the same file
|
/// other processes to read, write, and delete/rename the same file
|
||||||
/// while it is open. Removing any of the flags will prevent other
|
/// while it is open. Removing any of the flags will prevent other
|
||||||
/// processes from performing the corresponding operation until the file
|
/// processes from performing the corresponding operation until the file
|
||||||
/// handle is closed.
|
/// handle is closed.
|
||||||
|
@ -161,7 +161,7 @@ struct MatcherPos<'root, 'tt: 'root> {
|
|||||||
/// The position of the "dot" in this matcher
|
/// The position of the "dot" in this matcher
|
||||||
idx: usize,
|
idx: usize,
|
||||||
|
|
||||||
/// The first span of source source that the beginning of this matcher corresponds to. In other
|
/// The first span of source that the beginning of this matcher corresponds to. In other
|
||||||
/// words, the token in the source whose span is `sp_open` is matched against the first token of
|
/// words, the token in the source whose span is `sp_open` is matched against the first token of
|
||||||
/// the matcher.
|
/// the matcher.
|
||||||
sp_open: Span,
|
sp_open: Span,
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 513e067908f3e2eb8b31ad1c12b2e0a62817e557
|
Subproject commit ddb30221d7985e813b4214d14c2a560ed6ee0991
|
12
src/test/compile-fail/invalid-link-args.rs
Normal file
12
src/test/compile-fail/invalid-link-args.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// ignore-msvc due to linker-flavor=ld
|
||||||
|
// error-pattern:aFdEfSeVEEE
|
||||||
|
// compile-flags: -C linker-flavor=ld
|
||||||
|
|
||||||
|
/* Make sure invalid link_args are printed to stderr. */
|
||||||
|
|
||||||
|
#![feature(link_args)]
|
||||||
|
|
||||||
|
#[link_args = "aFdEfSeVEEE"]
|
||||||
|
extern {}
|
||||||
|
|
||||||
|
fn main() { }
|
@ -1,13 +0,0 @@
|
|||||||
// error-pattern:aFdEfSeVEE
|
|
||||||
// compile-flags: -C linker-flavor=ld
|
|
||||||
|
|
||||||
/* We're testing that link_args are indeed passed when nolink is specified.
|
|
||||||
So we try to compile with junk link_args and make sure they are visible in
|
|
||||||
the compiler output. */
|
|
||||||
|
|
||||||
#![feature(link_args)]
|
|
||||||
|
|
||||||
#[link_args = "aFdEfSeVEEE"]
|
|
||||||
extern {}
|
|
||||||
|
|
||||||
fn main() { }
|
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
// FIXME: LLVM generates invalid debug info for variables requiring
|
// FIXME: LLVM generates invalid debug info for variables requiring
|
||||||
// dynamic stack realignment, which is the case on s390x for vector
|
// dynamic stack realignment, which is the case on s390x for vector
|
||||||
// types with with non-vector ABI.
|
// types with non-vector ABI.
|
||||||
// ignore-s390x
|
// ignore-s390x
|
||||||
|
|
||||||
// compile-flags:-g
|
// compile-flags:-g
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-include ../tools.mk
|
-include ../tools.mk
|
||||||
|
|
||||||
# This tests the different -Zrelro-level values, and makes sure that they they work properly.
|
# This tests the different -Zrelro-level values, and makes sure that they work properly.
|
||||||
|
|
||||||
all:
|
all:
|
||||||
ifeq ($(UNAME),Linux)
|
ifeq ($(UNAME),Linux)
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
// revisions:lexical nll
|
// revisions:lexical nll
|
||||||
//[nll]compile-flags: -Z disable-nll-user-type-assert
|
|
||||||
#![cfg_attr(nll, feature(nll))]
|
#![cfg_attr(nll, feature(nll))]
|
||||||
|
|
||||||
#![feature(generators)]
|
#![feature(generators)]
|
||||||
|
7
src/test/rustdoc/doctest-manual-crate-name.rs
Normal file
7
src/test/rustdoc/doctest-manual-crate-name.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// compile-flags:--test
|
||||||
|
|
||||||
|
//! ```
|
||||||
|
//! #![crate_name="asdf"]
|
||||||
|
//!
|
||||||
|
//! println!("yo");
|
||||||
|
//! ```
|
@ -5,7 +5,7 @@ LL | let x = t.get(); //~ ERROR the size for values of type
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `<T as Get>::Value`
|
= help: the trait `std::marker::Sized` is not implemented for `<T as Get>::Value`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: consider adding a `where <T as Get>::Value: std::marker::Sized` bound
|
= help: consider adding a `where <T as Get>::Value: std::marker::Sized` bound
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
@ -11,7 +11,7 @@ LL | let x: Vec<Trait + Sized> = Vec::new();
|
|||||||
| ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `dyn Trait`
|
= help: the trait `std::marker::Sized` is not implemented for `dyn Trait`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required by `std::vec::Vec`
|
= note: required by `std::vec::Vec`
|
||||||
|
|
||||||
error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
|
error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
|
||||||
@ -21,7 +21,7 @@ LL | let x: Vec<Trait + Sized> = Vec::new();
|
|||||||
| ^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `dyn Trait`
|
= help: the trait `std::marker::Sized` is not implemented for `dyn Trait`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required by `<std::vec::Vec<T>>::new`
|
= note: required by `<std::vec::Vec<T>>::new`
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
@ -5,7 +5,7 @@ LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
|
|||||||
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
||||||
--> $DIR/const-unsized.rs:6:18
|
--> $DIR/const-unsized.rs:6:18
|
||||||
@ -14,7 +14,7 @@ LL | const CONST_FOO: str = *"foo";
|
|||||||
| ^^^ doesn't have a size known at compile-time
|
| ^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error[E0277]: the size for values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
|
error[E0277]: the size for values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
|
||||||
--> $DIR/const-unsized.rs:9:18
|
--> $DIR/const-unsized.rs:9:18
|
||||||
@ -23,7 +23,7 @@ LL | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
|
|||||||
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
||||||
--> $DIR/const-unsized.rs:12:20
|
--> $DIR/const-unsized.rs:12:20
|
||||||
@ -32,7 +32,7 @@ LL | static STATIC_BAR: str = *"bar";
|
|||||||
| ^^^ doesn't have a size known at compile-time
|
| ^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | f5.ptr = *z;
|
|||||||
| ^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `dyn ToBar`
|
= help: the trait `std::marker::Sized` is not implemented for `dyn ToBar`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: the left-hand-side of an assignment must have a statically known size
|
= note: the left-hand-side of an assignment must have a statically known size
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -14,7 +14,7 @@ LL | f5.2 = Bar1 {f: 36};
|
|||||||
| ^^^^ doesn't have a size known at compile-time
|
| ^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `dyn ToBar`
|
= help: the trait `std::marker::Sized` is not implemented for `dyn ToBar`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: the left-hand-side of an assignment must have a statically known size
|
= note: the left-hand-side of an assignment must have a statically known size
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
@ -14,7 +14,7 @@ LL | f5.ptr = Bar1 {f: 36};
|
|||||||
| ^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `dyn ToBar`
|
= help: the trait `std::marker::Sized` is not implemented for `dyn ToBar`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: the left-hand-side of an assignment must have a statically known size
|
= note: the left-hand-side of an assignment must have a statically known size
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
@ -5,7 +5,7 @@ LL | let h: &(([isize],),) = &(*g,);
|
|||||||
| ^^^^^ doesn't have a size known at compile-time
|
| ^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: within `(([isize],),)`, the trait `std::marker::Sized` is not implemented for `[isize]`
|
= help: within `(([isize],),)`, the trait `std::marker::Sized` is not implemented for `[isize]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `([isize],)`
|
= note: required because it appears within the type `([isize],)`
|
||||||
= note: required because it appears within the type `(([isize],),)`
|
= note: required because it appears within the type `(([isize],),)`
|
||||||
= note: tuples must have a statically known size to be initialized
|
= note: tuples must have a statically known size to be initialized
|
||||||
|
@ -5,7 +5,7 @@ LL | let h: &Fat<Fat<[isize]>> = &Fat { ptr: *g };
|
|||||||
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: within `Fat<Fat<[isize]>>`, the trait `std::marker::Sized` is not implemented for `[isize]`
|
= help: within `Fat<Fat<[isize]>>`, the trait `std::marker::Sized` is not implemented for `[isize]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `Fat<[isize]>`
|
= note: required because it appears within the type `Fat<[isize]>`
|
||||||
= note: required because it appears within the type `Fat<Fat<[isize]>>`
|
= note: required because it appears within the type `Fat<Fat<[isize]>>`
|
||||||
= note: structs must have a statically known size to be initialized
|
= note: structs must have a statically known size to be initialized
|
||||||
|
@ -5,7 +5,7 @@ LL | let u: &Foo = t;
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `T`
|
= help: the trait `std::marker::Sized` is not implemented for `T`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: consider adding a `where T: std::marker::Sized` bound
|
= help: consider adding a `where T: std::marker::Sized` bound
|
||||||
= note: required for the cast to the object type `dyn Foo`
|
= note: required for the cast to the object type `dyn Foo`
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ LL | let v: &Foo = t as &Foo;
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `T`
|
= help: the trait `std::marker::Sized` is not implemented for `T`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: consider adding a `where T: std::marker::Sized` bound
|
= help: consider adding a `where T: std::marker::Sized` bound
|
||||||
= note: required for the cast to the object type `dyn Foo`
|
= note: required for the cast to the object type `dyn Foo`
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ LL | let _: &[&Foo] = &["hi"];
|
|||||||
| ^^^^ doesn't have a size known at compile-time
|
| ^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required for the cast to the object type `dyn Foo`
|
= note: required for the cast to the object type `dyn Foo`
|
||||||
|
|
||||||
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
|
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
|
||||||
@ -37,7 +37,7 @@ LL | let _: &Foo = x as &Foo;
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
|
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required for the cast to the object type `dyn Foo`
|
= note: required for the cast to the object type `dyn Foo`
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
@ -5,7 +5,7 @@ LL | impl Foo<[isize]> for usize { }
|
|||||||
| ^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[isize]`
|
= help: the trait `std::marker::Sized` is not implemented for `[isize]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
|
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
|
||||||
--> $DIR/dst-sized-trait-param.rs:10:6
|
--> $DIR/dst-sized-trait-param.rs:10:6
|
||||||
@ -14,7 +14,7 @@ LL | impl Foo<isize> for [usize] { }
|
|||||||
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[usize]`
|
= help: the trait `std::marker::Sized` is not implemented for `[usize]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | fn f(p: Path) { }
|
|||||||
| ^ borrow the `Path` instead
|
| ^ borrow the `Path` instead
|
||||||
|
|
|
|
||||||
= help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
|
= help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `std::path::Path`
|
= note: required because it appears within the type `std::path::Path`
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
@ -5,7 +5,7 @@ LL | assert_sized::<A>();
|
|||||||
| ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `A`
|
= help: the trait `std::marker::Sized` is not implemented for `A`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
note: required by `assert_sized`
|
note: required by `assert_sized`
|
||||||
--> $DIR/extern-types-unsized.rs:19:1
|
--> $DIR/extern-types-unsized.rs:19:1
|
||||||
|
|
|
|
||||||
@ -19,7 +19,7 @@ LL | assert_sized::<Foo>();
|
|||||||
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: within `Foo`, the trait `std::marker::Sized` is not implemented for `A`
|
= help: within `Foo`, the trait `std::marker::Sized` is not implemented for `A`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `Foo`
|
= note: required because it appears within the type `Foo`
|
||||||
note: required by `assert_sized`
|
note: required by `assert_sized`
|
||||||
--> $DIR/extern-types-unsized.rs:19:1
|
--> $DIR/extern-types-unsized.rs:19:1
|
||||||
@ -34,7 +34,7 @@ LL | assert_sized::<Bar<A>>();
|
|||||||
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: within `Bar<A>`, the trait `std::marker::Sized` is not implemented for `A`
|
= help: within `Bar<A>`, the trait `std::marker::Sized` is not implemented for `A`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `Bar<A>`
|
= note: required because it appears within the type `Bar<A>`
|
||||||
note: required by `assert_sized`
|
note: required by `assert_sized`
|
||||||
--> $DIR/extern-types-unsized.rs:19:1
|
--> $DIR/extern-types-unsized.rs:19:1
|
||||||
@ -49,7 +49,7 @@ LL | assert_sized::<Bar<Bar<A>>>();
|
|||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: within `Bar<Bar<A>>`, the trait `std::marker::Sized` is not implemented for `A`
|
= help: within `Bar<Bar<A>>`, the trait `std::marker::Sized` is not implemented for `A`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `Bar<A>`
|
= note: required because it appears within the type `Bar<A>`
|
||||||
= note: required because it appears within the type `Bar<Bar<A>>`
|
= note: required because it appears within the type `Bar<Bar<A>>`
|
||||||
note: required by `assert_sized`
|
note: required by `assert_sized`
|
||||||
|
@ -95,7 +95,7 @@ LL | struct TwoStrs(str, str) where str: Sized; //~ ERROR
|
|||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: see issue #48214
|
= help: see issue #48214
|
||||||
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
|
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ LL | | }
|
|||||||
| |_^ doesn't have a size known at compile-time
|
| |_^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: within `Dst<(dyn A + 'static)>`, the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
|
= help: within `Dst<(dyn A + 'static)>`, the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `Dst<(dyn A + 'static)>`
|
= note: required because it appears within the type `Dst<(dyn A + 'static)>`
|
||||||
= help: see issue #48214
|
= help: see issue #48214
|
||||||
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
|
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
|
||||||
@ -122,7 +122,7 @@ LL | | }
|
|||||||
| |_^ doesn't have a size known at compile-time
|
| |_^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: see issue #48214
|
= help: see issue #48214
|
||||||
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
|
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | fn f(f: FnOnce()) {}
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::FnOnce() + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::FnOnce() + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ LL | | };
|
|||||||
| |____^ doesn't have a size known at compile-time
|
| |____^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: the yield type of a generator must have a statically known size
|
= note: the yield type of a generator must have a statically known size
|
||||||
|
|
||||||
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
||||||
@ -19,7 +19,7 @@ LL | unsafe { gen.resume(); }
|
|||||||
| ^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | let _x = "test" as &::std::any::Any;
|
|||||||
| ^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required for the cast to the object type `dyn std::any::Any`
|
= note: required for the cast to the object type `dyn std::any::Any`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -5,7 +5,7 @@ LL | &mut something
|
|||||||
| ^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[T]`
|
= help: the trait `std::marker::Sized` is not implemented for `[T]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | (|| Box::new(*(&[0][..])))();
|
|||||||
| ^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[{integer}]`
|
= help: the trait `std::marker::Sized` is not implemented for `[{integer}]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required by `<std::boxed::Box<T>>::new`
|
= note: required by `<std::boxed::Box<T>>::new`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -5,7 +5,7 @@ LL | AbstractRenderer
|
|||||||
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn AbstractRenderer + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn AbstractRenderer + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: the return type of a function must have a statically known size
|
= note: the return type of a function must have a statically known size
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -7,7 +7,7 @@ LL | | }
|
|||||||
| |_^ doesn't have a size known at compile-time
|
| |_^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `dyn for<'r> std::ops::Fn(&'r isize) -> isize`
|
= help: the trait `std::marker::Sized` is not implemented for `dyn for<'r> std::ops::Fn(&'r isize) -> isize`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required by `std::option::Option`
|
= note: required by `std::option::Option`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -9,7 +9,7 @@ LL | | }
|
|||||||
| |_____^ doesn't have a size known at compile-time
|
| |_____^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `Self`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: consider adding a `where Self: std::marker::Sized` bound
|
= help: consider adding a `where Self: std::marker::Sized` bound
|
||||||
note: required by `From`
|
note: required by `From`
|
||||||
--> $DIR/issue-20005.rs:1:1
|
--> $DIR/issue-20005.rs:1:1
|
||||||
|
@ -5,7 +5,7 @@ LL | fn iceman(c: Vec<[i32]>) {}
|
|||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[i32]`
|
= help: the trait `std::marker::Sized` is not implemented for `[i32]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required by `std::vec::Vec`
|
= note: required by `std::vec::Vec`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -5,7 +5,7 @@ LL | for item in *things { *item = 0 }
|
|||||||
| ^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `dyn std::iter::Iterator<Item=&mut u8>`
|
= help: the trait `std::marker::Sized` is not implemented for `dyn std::iter::Iterator<Item=&mut u8>`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required by `std::iter::IntoIterator::into_iter`
|
= note: required by `std::iter::IntoIterator::into_iter`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -5,7 +5,7 @@ LL | rows: [[String]],
|
|||||||
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[std::string::String]`
|
= help: the trait `std::marker::Sized` is not implemented for `[std::string::String]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: slice and array elements must have `Sized` type
|
= note: slice and array elements must have `Sized` type
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -5,7 +5,7 @@ LL | pub fn function(funs: Vec<Fn() -> ()>) {}
|
|||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required by `std::vec::Vec`
|
= note: required by `std::vec::Vec`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -5,7 +5,7 @@ LL | static foo: Fn() -> u32 = || -> u32 {
|
|||||||
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() -> u32 + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() -> u32 + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | data: T, //~ ERROR the size for values of type
|
|||||||
| ^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `T`
|
= help: the trait `std::marker::Sized` is not implemented for `T`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: consider adding a `where T: std::marker::Sized` bound
|
= help: consider adding a `where T: std::marker::Sized` bound
|
||||||
= note: the last field of a packed struct may only have a dynamically sized type if it does not need drop to be run
|
= note: the last field of a packed struct may only have a dynamically sized type if it does not need drop to be run
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | fn foo(self) -> &'static i32 {
|
|||||||
| ^^^^ doesn't have a size known at compile-time
|
| ^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `Self`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: consider adding a `where Self: std::marker::Sized` bound
|
= help: consider adding a `where Self: std::marker::Sized` bound
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
@ -5,7 +5,7 @@ LL | &X(*Y)
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
|
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all function arguments must have a statically known size
|
= note: all function arguments must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | V([Box<E>]),
|
|||||||
| ^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[std::boxed::Box<E>]`
|
= help: the trait `std::marker::Sized` is not implemented for `[std::boxed::Box<E>]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: no field of an enum variant may have a dynamically sized type
|
= note: no field of an enum variant may have a dynamically sized type
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -5,7 +5,7 @@ LL | fn _test(ref _p: str) {}
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all function arguments must have a statically known size
|
= note: all function arguments must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | pub fn example(ref s: str) {}
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all function arguments must have a statically known size
|
= note: all function arguments must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | fn baz(_: Self::Target) where Self: Deref {}
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `<Self as std::ops::Deref>::Target`
|
= help: the trait `std::marker::Sized` is not implemented for `<Self as std::ops::Deref>::Target`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= help: consider adding a `where <Self as std::ops::Deref>::Target: std::marker::Sized` bound
|
= help: consider adding a `where <Self as std::ops::Deref>::Target: std::marker::Sized` bound
|
||||||
= note: all function arguments must have a statically known size
|
= note: all function arguments must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
@ -17,7 +17,7 @@ LL | pub fn f(_: ToString) {}
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::string::ToString + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::string::ToString + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all function arguments must have a statically known size
|
= note: all function arguments must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | pub static mut symbol: [i8];
|
|||||||
| ^^^^ doesn't have a size known at compile-time
|
| ^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[i8]`
|
= help: the trait `std::marker::Sized` is not implemented for `[i8]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
7
src/test/ui/issues/issue-56806.rs
Normal file
7
src/test/ui/issues/issue-56806.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
pub trait Trait {
|
||||||
|
fn dyn_instead_of_self(self: Box<dyn Trait>);
|
||||||
|
//~^ ERROR invalid method receiver type: std::boxed::Box<(dyn Trait + 'static)>
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn main() {
|
||||||
|
}
|
12
src/test/ui/issues/issue-56806.stderr
Normal file
12
src/test/ui/issues/issue-56806.stderr
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
error[E0307]: invalid method receiver type: std::boxed::Box<(dyn Trait + 'static)>
|
||||||
|
--> $DIR/issue-56806.rs:2:34
|
||||||
|
|
|
||||||
|
LL | fn dyn_instead_of_self(self: Box<dyn Trait>);
|
||||||
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: type must be `Self` or a type that dereferences to it
|
||||||
|
= help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0307`.
|
@ -5,7 +5,7 @@ LL | fn new_struct(r: A+'static)
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ LL | -> Struct { //~^ ERROR the size for values of type
|
|||||||
| ^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: within `Struct`, the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
|
= help: within `Struct`, the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `Struct`
|
= note: required because it appears within the type `Struct`
|
||||||
= note: the return type of a function must have a statically known size
|
= note: the return type of a function must have a statically known size
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ LL | let _ = fat_v as *const Foo; //~ ERROR the size for values of type
|
|||||||
| ^^^^^ doesn't have a size known at compile-time
|
| ^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
|
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required for the cast to the object type `dyn Foo`
|
= note: required for the cast to the object type `dyn Foo`
|
||||||
|
|
||||||
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
||||||
@ -233,7 +233,7 @@ LL | let _ = a as *const Foo; //~ ERROR the size for values of type
|
|||||||
| ^ doesn't have a size known at compile-time
|
| ^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required for the cast to the object type `dyn Foo`
|
= note: required for the cast to the object type `dyn Foo`
|
||||||
|
|
||||||
error[E0606]: casting `&{float}` as `f32` is invalid
|
error[E0606]: casting `&{float}` as `f32` is invalid
|
||||||
|
@ -10,7 +10,7 @@ LL | }
|
|||||||
| - ...but `x` will be dropped here, when the function `bar` returns
|
| - ...but `x` will be dropped here, when the function `bar` returns
|
||||||
|
|
|
|
||||||
= note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
|
= note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch04-02-references-and-borrowing.html#dangling-references>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#dangling-references>
|
||||||
|
|
||||||
error[E0597]: `y` does not live long enough
|
error[E0597]: `y` does not live long enough
|
||||||
--> $DIR/issue-52534.rs:18:26
|
--> $DIR/issue-52534.rs:18:26
|
||||||
@ -24,7 +24,7 @@ LL | }
|
|||||||
| - ...but `y` will be dropped here, when the function `foobar` returns
|
| - ...but `y` will be dropped here, when the function `foobar` returns
|
||||||
|
|
|
|
||||||
= note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
|
= note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch04-02-references-and-borrowing.html#dangling-references>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#dangling-references>
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ LL | let range = *arr..;
|
|||||||
| ^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `[{integer}]`
|
= help: the trait `std::marker::Sized` is not implemented for `[{integer}]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required by `std::ops::RangeFrom`
|
= note: required by `std::ops::RangeFrom`
|
||||||
|
|
||||||
error: aborting due to 3 previous errors
|
error: aborting due to 3 previous errors
|
||||||
|
@ -5,7 +5,7 @@ LL | fn foo(_x: K) {}
|
|||||||
| ^^ doesn't have a size known at compile-time
|
| ^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn I + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn I + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0597]: `c2` does not live long enough
|
error[E0597]: `c2` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:103:24
|
--> $DIR/dropck_vec_cycle_checked.rs:98:24
|
||||||
|
|
|
|
||||||
LL | c1.v[0].v.set(Some(&c2));
|
LL | c1.v[0].v.set(Some(&c2));
|
||||||
| ^^^ borrowed value does not live long enough
|
| ^^^ borrowed value does not live long enough
|
||||||
@ -13,7 +13,7 @@ LL | }
|
|||||||
= note: values in a scope are dropped in the opposite order they are defined
|
= note: values in a scope are dropped in the opposite order they are defined
|
||||||
|
|
||||||
error[E0597]: `c3` does not live long enough
|
error[E0597]: `c3` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:105:24
|
--> $DIR/dropck_vec_cycle_checked.rs:100:24
|
||||||
|
|
|
|
||||||
LL | c1.v[1].v.set(Some(&c3));
|
LL | c1.v[1].v.set(Some(&c3));
|
||||||
| ^^^ borrowed value does not live long enough
|
| ^^^ borrowed value does not live long enough
|
||||||
@ -27,7 +27,7 @@ LL | }
|
|||||||
= note: values in a scope are dropped in the opposite order they are defined
|
= note: values in a scope are dropped in the opposite order they are defined
|
||||||
|
|
||||||
error[E0597]: `c1` does not live long enough
|
error[E0597]: `c1` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:111:24
|
--> $DIR/dropck_vec_cycle_checked.rs:106:24
|
||||||
|
|
|
|
||||||
LL | c3.v[0].v.set(Some(&c1));
|
LL | c3.v[0].v.set(Some(&c1));
|
||||||
| ^^^ borrowed value does not live long enough
|
| ^^^ borrowed value does not live long enough
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
// compile-flags: -Z nll-subminimal-causes
|
|
||||||
// (Work around rust-lang/rust#49998 by opting into nll-subminimal-causes.)
|
|
||||||
|
|
||||||
// Reject mixing cyclic structure and Drop when using Vec.
|
// Reject mixing cyclic structure and Drop when using Vec.
|
||||||
//
|
//
|
||||||
// (Compare against compile-fail/dropck_arr_cycle_checked.rs)
|
// (Compare against compile-fail/dropck_arr_cycle_checked.rs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use id::Id;
|
use id::Id;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0597]: `c2` does not live long enough
|
error[E0597]: `c2` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:103:25
|
--> $DIR/dropck_vec_cycle_checked.rs:98:25
|
||||||
|
|
|
|
||||||
LL | c1.v[0].v.set(Some(&c2));
|
LL | c1.v[0].v.set(Some(&c2));
|
||||||
| ^^ borrowed value does not live long enough
|
| ^^ borrowed value does not live long enough
|
||||||
@ -10,7 +10,7 @@ LL | }
|
|||||||
= note: values in a scope are dropped in the opposite order they are created
|
= note: values in a scope are dropped in the opposite order they are created
|
||||||
|
|
||||||
error[E0597]: `c3` does not live long enough
|
error[E0597]: `c3` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:105:25
|
--> $DIR/dropck_vec_cycle_checked.rs:100:25
|
||||||
|
|
|
|
||||||
LL | c1.v[1].v.set(Some(&c3));
|
LL | c1.v[1].v.set(Some(&c3));
|
||||||
| ^^ borrowed value does not live long enough
|
| ^^ borrowed value does not live long enough
|
||||||
@ -21,7 +21,7 @@ LL | }
|
|||||||
= note: values in a scope are dropped in the opposite order they are created
|
= note: values in a scope are dropped in the opposite order they are created
|
||||||
|
|
||||||
error[E0597]: `c2` does not live long enough
|
error[E0597]: `c2` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:107:25
|
--> $DIR/dropck_vec_cycle_checked.rs:102:25
|
||||||
|
|
|
|
||||||
LL | c2.v[0].v.set(Some(&c2));
|
LL | c2.v[0].v.set(Some(&c2));
|
||||||
| ^^ borrowed value does not live long enough
|
| ^^ borrowed value does not live long enough
|
||||||
@ -32,7 +32,7 @@ LL | }
|
|||||||
= note: values in a scope are dropped in the opposite order they are created
|
= note: values in a scope are dropped in the opposite order they are created
|
||||||
|
|
||||||
error[E0597]: `c3` does not live long enough
|
error[E0597]: `c3` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:109:25
|
--> $DIR/dropck_vec_cycle_checked.rs:104:25
|
||||||
|
|
|
|
||||||
LL | c2.v[1].v.set(Some(&c3));
|
LL | c2.v[1].v.set(Some(&c3));
|
||||||
| ^^ borrowed value does not live long enough
|
| ^^ borrowed value does not live long enough
|
||||||
@ -43,7 +43,7 @@ LL | }
|
|||||||
= note: values in a scope are dropped in the opposite order they are created
|
= note: values in a scope are dropped in the opposite order they are created
|
||||||
|
|
||||||
error[E0597]: `c1` does not live long enough
|
error[E0597]: `c1` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:111:25
|
--> $DIR/dropck_vec_cycle_checked.rs:106:25
|
||||||
|
|
|
|
||||||
LL | c3.v[0].v.set(Some(&c1));
|
LL | c3.v[0].v.set(Some(&c1));
|
||||||
| ^^ borrowed value does not live long enough
|
| ^^ borrowed value does not live long enough
|
||||||
@ -54,7 +54,7 @@ LL | }
|
|||||||
= note: values in a scope are dropped in the opposite order they are created
|
= note: values in a scope are dropped in the opposite order they are created
|
||||||
|
|
||||||
error[E0597]: `c2` does not live long enough
|
error[E0597]: `c2` does not live long enough
|
||||||
--> $DIR/dropck_vec_cycle_checked.rs:113:25
|
--> $DIR/dropck_vec_cycle_checked.rs:108:25
|
||||||
|
|
|
|
||||||
LL | c3.v[1].v.set(Some(&c2));
|
LL | c3.v[1].v.set(Some(&c2));
|
||||||
| ^^ borrowed value does not live long enough
|
| ^^ borrowed value does not live long enough
|
||||||
|
@ -28,7 +28,7 @@ LL | let v = s[..2];
|
|||||||
| doesn't have a size known at compile-time
|
| doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ LL | s[1..2] = bot();
|
|||||||
| ^^^ doesn't have a size known at compile-time
|
| ^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
note: required by `bot`
|
note: required by `bot`
|
||||||
--> $DIR/str-mut-idx.rs:1:1
|
--> $DIR/str-mut-idx.rs:1:1
|
||||||
|
|
|
|
||||||
@ -19,7 +19,7 @@ LL | s[1..2] = bot();
|
|||||||
| ^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: the left-hand-side of an assignment must have a statically known size
|
= note: the left-hand-side of an assignment must have a statically known size
|
||||||
|
|
||||||
error[E0277]: the type `str` cannot be mutably indexed by `usize`
|
error[E0277]: the type `str` cannot be mutably indexed by `usize`
|
||||||
|
@ -41,7 +41,7 @@ LL | <str as Foo<u8>>::bar;
|
|||||||
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for `str`
|
= note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for `str`
|
||||||
note: required by `Foo::bar`
|
note: required by `Foo::bar`
|
||||||
--> $DIR/substs-ppaux.rs:7:5
|
--> $DIR/substs-ppaux.rs:7:5
|
||||||
|
@ -41,7 +41,7 @@ LL | <str as Foo<u8>>::bar;
|
|||||||
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `str`
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>` for `str`
|
= note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>` for `str`
|
||||||
note: required by `Foo::bar`
|
note: required by `Foo::bar`
|
||||||
--> $DIR/substs-ppaux.rs:7:5
|
--> $DIR/substs-ppaux.rs:7:5
|
||||||
|
@ -5,7 +5,7 @@ LL | fn f(p: Path) { }
|
|||||||
| ^ borrow the `Path` instead
|
| ^ borrow the `Path` instead
|
||||||
|
|
|
|
||||||
= help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
|
= help: within `std::path::Path`, the trait `std::marker::Sized` is not implemented for `[u8]`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: required because it appears within the type `std::path::Path`
|
= note: required because it appears within the type `std::path::Path`
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
@ -5,7 +5,7 @@ LL | fn foo(_x: Foo + Send) {
|
|||||||
| ^^ doesn't have a size known at compile-time
|
| ^^ doesn't have a size known at compile-time
|
||||||
|
|
|
|
||||||
= help: the trait `std::marker::Sized` is not implemented for `(dyn Foo + std::marker::Send + 'static)`
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn Foo + std::marker::Send + 'static)`
|
||||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||||
= note: all local variables must have a statically known size
|
= note: all local variables must have a statically known size
|
||||||
= help: unsized locals are gated as an unstable feature
|
= help: unsized locals are gated as an unstable feature
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user