提交 5a72ecf2 编写于 作者: B bors

Auto merge of #70016 - Dylan-DPC:rollup-5k7lxs3, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #69357 (Emit 1-based column numbers in debuginfo)
 - #69471 (Remove `sip::Hasher::short_write`.)
 - #69498 (Change "method" to "associated function")
 - #69967 (Remove a few `Rc`s from RegionInferenceCtxt)
 - #69987 (Add self to .mailmap)
 - #69991 (fix E0117 message out of sync)
 - #69993 (Add long error explanation for E0693)

Failed merges:

r? @ghost
...@@ -172,6 +172,9 @@ Mateusz Mikuła <matti@marinelayer.io> <mati865@gmail.com> ...@@ -172,6 +172,9 @@ Mateusz Mikuła <matti@marinelayer.io> <mati865@gmail.com>
Mateusz Mikuła <matti@marinelayer.io> <mati865@users.noreply.github.com> Mateusz Mikuła <matti@marinelayer.io> <mati865@users.noreply.github.com>
Matt Brubeck <mbrubeck@limpet.net> <mbrubeck@cs.hmc.edu> Matt Brubeck <mbrubeck@limpet.net> <mbrubeck@cs.hmc.edu>
Matthew Auld <matthew.auld@intel.com> Matthew Auld <matthew.auld@intel.com>
Matthew Kraai <kraai@ftbfs.org>
Matthew Kraai <kraai@ftbfs.org> <matt.kraai@abbott.com>
Matthew Kraai <kraai@ftbfs.org> <mkraai@its.jnj.com>
Matthew McPherrin <matthew@mcpherrin.ca> <matt@mcpherrin.ca> Matthew McPherrin <matthew@mcpherrin.ca> <matt@mcpherrin.ca>
Matthijs Hofstra <thiezz@gmail.com> Matthijs Hofstra <thiezz@gmail.com>
Melody Horn <melody@boringcactus.com> <mathphreak@gmail.com> Melody Horn <melody@boringcactus.com> <mathphreak@gmail.com>
......
...@@ -220,37 +220,6 @@ fn reset(&mut self) { ...@@ -220,37 +220,6 @@ fn reset(&mut self) {
self.state.v3 = self.k1 ^ 0x7465646279746573; self.state.v3 = self.k1 ^ 0x7465646279746573;
self.ntail = 0; self.ntail = 0;
} }
// Specialized write function that is only valid for buffers with len <= 8.
// It's used to force inlining of write_u8 and write_usize, those would normally be inlined
// except for composite types (that includes slices and str hashing because of delimiter).
// Without this extra push the compiler is very reluctant to inline delimiter writes,
// degrading performance substantially for the most common use cases.
#[inline]
fn short_write(&mut self, msg: &[u8]) {
debug_assert!(msg.len() <= 8);
let length = msg.len();
self.length += length;
let needed = 8 - self.ntail;
let fill = cmp::min(length, needed);
if fill == 8 {
self.tail = unsafe { load_int_le!(msg, 0, u64) };
} else {
self.tail |= unsafe { u8to64_le(msg, 0, fill) } << (8 * self.ntail);
if length < needed {
self.ntail += length;
return;
}
}
self.state.v3 ^= self.tail;
S::c_rounds(&mut self.state);
self.state.v0 ^= self.tail;
// Buffered tail is now flushed, process new input.
self.ntail = length - needed;
self.tail = unsafe { u8to64_le(msg, needed, self.ntail) };
}
} }
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
...@@ -280,21 +249,13 @@ fn finish(&self) -> u64 { ...@@ -280,21 +249,13 @@ fn finish(&self) -> u64 {
} }
impl<S: Sip> super::Hasher for Hasher<S> { impl<S: Sip> super::Hasher for Hasher<S> {
// see short_write comment for explanation // Note: no integer hashing methods (`write_u*`, `write_i*`) are defined
#[inline] // for this type. We could add them, copy the `short_write` implementation
fn write_usize(&mut self, i: usize) { // in librustc_data_structures/sip128.rs, and add `write_u*`/`write_i*`
let bytes = unsafe { // methods to `SipHasher`, `SipHasher13`, and `DefaultHasher`. This would
crate::slice::from_raw_parts(&i as *const usize as *const u8, mem::size_of::<usize>()) // greatly speed up integer hashing by those hashers, at the cost of
}; // slightly slowing down compile speeds on some benchmarks. See #69152 for
self.short_write(bytes); // details.
}
// see short_write comment for explanation
#[inline]
fn write_u8(&mut self, i: u8) {
self.short_write(&[i]);
}
#[inline] #[inline]
fn write(&mut self, msg: &[u8]) { fn write(&mut self, msg: &[u8]) {
let length = msg.len(); let length = msg.len();
......
use super::metadata::file_metadata; use super::metadata::{file_metadata, UNKNOWN_COLUMN_NUMBER, UNKNOWN_LINE_NUMBER};
use super::utils::{span_start, DIB}; use super::utils::DIB;
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext}; use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
use crate::common::CodegenCx; use crate::common::CodegenCx;
...@@ -7,10 +7,6 @@ ...@@ -7,10 +7,6 @@
use crate::llvm::debuginfo::{DIScope, DISubprogram}; use crate::llvm::debuginfo::{DIScope, DISubprogram};
use rustc::mir::{Body, SourceScope}; use rustc::mir::{Body, SourceScope};
use libc::c_uint;
use rustc_span::Pos;
use rustc_index::bit_set::BitSet; use rustc_index::bit_set::BitSet;
use rustc_index::vec::Idx; use rustc_index::vec::Idx;
...@@ -54,7 +50,7 @@ fn make_mir_scope( ...@@ -54,7 +50,7 @@ fn make_mir_scope(
debug_context.scopes[parent] debug_context.scopes[parent]
} else { } else {
// The root is the function itself. // The root is the function itself.
let loc = span_start(cx, mir.span); let loc = cx.lookup_debug_loc(mir.span.lo());
debug_context.scopes[scope] = DebugScope { debug_context.scopes[scope] = DebugScope {
scope_metadata: Some(fn_metadata), scope_metadata: Some(fn_metadata),
file_start_pos: loc.file.start_pos, file_start_pos: loc.file.start_pos,
...@@ -70,7 +66,7 @@ fn make_mir_scope( ...@@ -70,7 +66,7 @@ fn make_mir_scope(
return; return;
} }
let loc = span_start(cx, scope_data.span); let loc = cx.lookup_debug_loc(scope_data.span.lo());
let file_metadata = file_metadata(cx, &loc.file.name, debug_context.defining_crate); let file_metadata = file_metadata(cx, &loc.file.name, debug_context.defining_crate);
let scope_metadata = unsafe { let scope_metadata = unsafe {
...@@ -78,8 +74,8 @@ fn make_mir_scope( ...@@ -78,8 +74,8 @@ fn make_mir_scope(
DIB(cx), DIB(cx),
parent_scope.scope_metadata.unwrap(), parent_scope.scope_metadata.unwrap(),
file_metadata, file_metadata,
loc.line as c_uint, loc.line.unwrap_or(UNKNOWN_LINE_NUMBER),
loc.col.to_usize() as c_uint, loc.col.unwrap_or(UNKNOWN_COLUMN_NUMBER),
)) ))
}; };
debug_context.scopes[scope] = DebugScope { debug_context.scopes[scope] = DebugScope {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
use super::namespace::mangled_name_of_instance; use super::namespace::mangled_name_of_instance;
use super::type_names::compute_debuginfo_type_name; use super::type_names::compute_debuginfo_type_name;
use super::utils::{ use super::utils::{
create_DIArray, debug_context, get_namespace_for_item, is_node_local_to_unit, span_start, DIB, create_DIArray, debug_context, get_namespace_for_item, is_node_local_to_unit, DIB,
}; };
use super::CrateDebugContext; use super::CrateDebugContext;
...@@ -2309,10 +2309,10 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global ...@@ -2309,10 +2309,10 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
let span = tcx.def_span(def_id); let span = tcx.def_span(def_id);
let (file_metadata, line_number) = if !span.is_dummy() { let (file_metadata, line_number) = if !span.is_dummy() {
let loc = span_start(cx, span); let loc = cx.lookup_debug_loc(span.lo());
(file_metadata(cx, &loc.file.name, LOCAL_CRATE), loc.line as c_uint) (file_metadata(cx, &loc.file.name, LOCAL_CRATE), loc.line)
} else { } else {
(unknown_file_metadata(cx), UNKNOWN_LINE_NUMBER) (unknown_file_metadata(cx), None)
}; };
let is_local_to_unit = is_node_local_to_unit(cx, def_id); let is_local_to_unit = is_node_local_to_unit(cx, def_id);
...@@ -2339,7 +2339,7 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global ...@@ -2339,7 +2339,7 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
linkage_name.as_ptr().cast(), linkage_name.as_ptr().cast(),
linkage_name.len(), linkage_name.len(),
file_metadata, file_metadata,
line_number, line_number.unwrap_or(UNKNOWN_LINE_NUMBER),
type_metadata, type_metadata,
is_local_to_unit, is_local_to_unit,
global, global,
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
use rustc_codegen_ssa::mir::debuginfo::VariableKind::*; use rustc_codegen_ssa::mir::debuginfo::VariableKind::*;
use self::metadata::{file_metadata, type_metadata, TypeMap}; use self::metadata::{file_metadata, type_metadata, TypeMap, UNKNOWN_LINE_NUMBER};
use self::namespace::mangled_name_of_instance; use self::namespace::mangled_name_of_instance;
use self::type_names::compute_debuginfo_type_name; use self::type_names::compute_debuginfo_type_name;
use self::utils::{create_DIArray, is_node_local_to_unit, span_start, DIB}; use self::utils::{create_DIArray, is_node_local_to_unit, DIB};
use crate::llvm; use crate::llvm;
use crate::llvm::debuginfo::{ use crate::llvm::debuginfo::{
...@@ -248,7 +248,7 @@ fn create_function_debug_context( ...@@ -248,7 +248,7 @@ fn create_function_debug_context(
let def_id = instance.def_id(); let def_id = instance.def_id();
let containing_scope = get_containing_scope(self, instance); let containing_scope = get_containing_scope(self, instance);
let loc = span_start(self, span); let loc = self.lookup_debug_loc(span.lo());
let file_metadata = file_metadata(self, &loc.file.name, def_id.krate); let file_metadata = file_metadata(self, &loc.file.name, def_id.krate);
let function_type_metadata = unsafe { let function_type_metadata = unsafe {
...@@ -304,9 +304,9 @@ fn create_function_debug_context( ...@@ -304,9 +304,9 @@ fn create_function_debug_context(
linkage_name.as_ptr().cast(), linkage_name.as_ptr().cast(),
linkage_name.len(), linkage_name.len(),
file_metadata, file_metadata,
loc.line as c_uint, loc.line.unwrap_or(UNKNOWN_LINE_NUMBER),
function_type_metadata, function_type_metadata,
scope_line as c_uint, scope_line.unwrap_or(UNKNOWN_LINE_NUMBER),
flags, flags,
spflags, spflags,
llfn, llfn,
...@@ -530,7 +530,7 @@ fn create_dbg_var( ...@@ -530,7 +530,7 @@ fn create_dbg_var(
variable_kind: VariableKind, variable_kind: VariableKind,
span: Span, span: Span,
) -> &'ll DIVariable { ) -> &'ll DIVariable {
let loc = span_start(self, span); let loc = self.lookup_debug_loc(span.lo());
let file_metadata = file_metadata(self, &loc.file.name, dbg_context.defining_crate); let file_metadata = file_metadata(self, &loc.file.name, dbg_context.defining_crate);
let type_metadata = type_metadata(self, variable_type, span); let type_metadata = type_metadata(self, variable_type, span);
...@@ -550,7 +550,7 @@ fn create_dbg_var( ...@@ -550,7 +550,7 @@ fn create_dbg_var(
name.as_ptr().cast(), name.as_ptr().cast(),
name.len(), name.len(),
file_metadata, file_metadata,
loc.line as c_uint, loc.line.unwrap_or(UNKNOWN_LINE_NUMBER),
type_metadata, type_metadata,
true, true,
DIFlags::FlagZero, DIFlags::FlagZero,
......
use super::metadata::UNKNOWN_COLUMN_NUMBER; use super::metadata::{UNKNOWN_COLUMN_NUMBER, UNKNOWN_LINE_NUMBER};
use super::utils::{debug_context, span_start}; use super::utils::debug_context;
use crate::common::CodegenCx; use crate::common::CodegenCx;
use crate::llvm::debuginfo::DIScope; use crate::llvm::debuginfo::DIScope;
use crate::llvm::{self, Value}; use crate::llvm::{self, Value};
use rustc_codegen_ssa::traits::*; use rustc_codegen_ssa::traits::*;
use libc::c_uint; use rustc_data_structures::sync::Lrc;
use rustc_span::{Pos, Span}; use rustc_span::{BytePos, Pos, SourceFile, SourceFileAndLine, Span};
/// A source code location used to generate debug information.
pub struct DebugLoc {
/// Information about the original source file.
pub file: Lrc<SourceFile>,
/// The (1-based) line number.
pub line: Option<u32>,
/// The (1-based) column number.
pub col: Option<u32>,
}
impl CodegenCx<'ll, '_> { impl CodegenCx<'ll, '_> {
pub fn create_debug_loc(&self, scope: &'ll DIScope, span: Span) -> &'ll Value { /// Looks up debug source information about a `BytePos`.
let loc = span_start(self, span); pub fn lookup_debug_loc(&self, pos: BytePos) -> DebugLoc {
let (file, line, col) = match self.sess().source_map().lookup_line(pos) {
Ok(SourceFileAndLine { sf: file, line }) => {
let line_pos = file.line_begin_pos(pos);
// Use 1-based indexing.
let line = (line + 1) as u32;
let col = (pos - line_pos).to_u32() + 1;
(file, Some(line), Some(col))
}
Err(file) => (file, None, None),
};
// For MSVC, set the column number to zero. // For MSVC, omit the column number.
// Otherwise, emit it. This mimics clang behaviour. // Otherwise, emit it. This mimics clang behaviour.
// See discussion in https://github.com/rust-lang/rust/issues/42921 // See discussion in https://github.com/rust-lang/rust/issues/42921
let col_used = if self.sess().target.target.options.is_like_msvc { if self.sess().target.target.options.is_like_msvc {
UNKNOWN_COLUMN_NUMBER DebugLoc { file, line, col: None }
} else { } else {
loc.col.to_usize() as c_uint DebugLoc { file, line, col }
}; }
}
pub fn create_debug_loc(&self, scope: &'ll DIScope, span: Span) -> &'ll Value {
let DebugLoc { line, col, .. } = self.lookup_debug_loc(span.lo());
unsafe { unsafe {
llvm::LLVMRustDIBuilderCreateDebugLocation( llvm::LLVMRustDIBuilderCreateDebugLocation(
debug_context(self).llcontext, debug_context(self).llcontext,
loc.line as c_uint, line.unwrap_or(UNKNOWN_LINE_NUMBER),
col_used, col.unwrap_or(UNKNOWN_COLUMN_NUMBER),
scope, scope,
None, None,
) )
......
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
use crate::common::CodegenCx; use crate::common::CodegenCx;
use crate::llvm; use crate::llvm;
use crate::llvm::debuginfo::{DIArray, DIBuilder, DIDescriptor, DIScope}; use crate::llvm::debuginfo::{DIArray, DIBuilder, DIDescriptor, DIScope};
use rustc_codegen_ssa::traits::*;
use rustc_span::Span;
pub fn is_node_local_to_unit(cx: &CodegenCx<'_, '_>, def_id: DefId) -> bool { pub fn is_node_local_to_unit(cx: &CodegenCx<'_, '_>, def_id: DefId) -> bool {
// The is_local_to_unit flag indicates whether a function is local to the // The is_local_to_unit flag indicates whether a function is local to the
...@@ -32,11 +29,6 @@ pub fn create_DIArray(builder: &DIBuilder<'ll>, arr: &[Option<&'ll DIDescriptor> ...@@ -32,11 +29,6 @@ pub fn create_DIArray(builder: &DIBuilder<'ll>, arr: &[Option<&'ll DIDescriptor>
}; };
} }
/// Returns rustc_span::Loc corresponding to the beginning of the span
pub fn span_start(cx: &CodegenCx<'_, '_>, span: Span) -> rustc_span::Loc {
cx.sess().source_map().lookup_char_pos(span.lo())
}
#[inline] #[inline]
pub fn debug_context(cx: &'a CodegenCx<'ll, 'tcx>) -> &'a CrateDebugContext<'ll, 'tcx> { pub fn debug_context(cx: &'a CodegenCx<'ll, 'tcx>) -> &'a CrateDebugContext<'ll, 'tcx> {
cx.dbg_cx.as_ref().unwrap() cx.dbg_cx.as_ref().unwrap()
......
//! An immutable, owned value (except for interior mutability).
//!
//! The purpose of `Frozen` is to make a value immutable for the sake of defensive programming. For example,
//! suppose we have the following:
//!
//! ```rust
//! struct Bar { /* some data */ }
//!
//! struct Foo {
//! /// Some computed data that should never change after construction.
//! pub computed: Bar,
//!
//! /* some other fields */
//! }
//!
//! impl Bar {
//! /// Mutate the `Bar`.
//! pub fn mutate(&mut self) { }
//! }
//! ```
//!
//! Now suppose we want to pass around a mutable `Foo` instance but, we want to make sure that
//! `computed` does not change accidentally (e.g. somebody might accidentally call
//! `foo.computed.mutate()`). This is what `Frozen` is for. We can do the following:
//!
//! ```rust
//! use rustc_data_structures::frozen::Frozen;
//!
//! struct Foo {
//! /// Some computed data that should never change after construction.
//! pub computed: Frozen<Bar>,
//!
//! /* some other fields */
//! }
//! ```
//!
//! `Frozen` impls `Deref`, so we can ergonomically call methods on `Bar`, but it doesn't `impl
//! DerefMut`. Now calling `foo.compute.mutate()` will result in a compile-time error stating that
//! `mutate` requires a mutable reference but we don't have one.
//!
//! # Caveats
//!
//! - `Frozen` doesn't try to defend against interior mutability (e.g. `Frozen<RefCell<Bar>>`).
//! - `Frozen` doesn't pin it's contents (e.g. one could still do `foo.computed =
//! Frozen::freeze(new_bar)`).
/// An owned immutable value.
#[derive(Debug)]
pub struct Frozen<T>(T);
impl<T> Frozen<T> {
pub fn freeze(val: T) -> Self {
Frozen(val)
}
}
impl<T> std::ops::Deref for Frozen<T> {
type Target = T;
fn deref(&self) -> &T {
&self.0
}
}
...@@ -94,6 +94,7 @@ pub fn cold_path<F: FnOnce() -> R, R>(f: F) -> R { ...@@ -94,6 +94,7 @@ pub fn cold_path<F: FnOnce() -> R, R>(f: F) -> R {
pub mod vec_linked_list; pub mod vec_linked_list;
pub mod work_queue; pub mod work_queue;
pub use atomic_ref::AtomicRef; pub use atomic_ref::AtomicRef;
pub mod frozen;
pub struct OnDrop<F: Fn()>(pub F); pub struct OnDrop<F: Fn()>(pub F);
......
...@@ -380,6 +380,7 @@ ...@@ -380,6 +380,7 @@
E0690: include_str!("./error_codes/E0690.md"), E0690: include_str!("./error_codes/E0690.md"),
E0691: include_str!("./error_codes/E0691.md"), E0691: include_str!("./error_codes/E0691.md"),
E0692: include_str!("./error_codes/E0692.md"), E0692: include_str!("./error_codes/E0692.md"),
E0693: include_str!("./error_codes/E0693.md"),
E0695: include_str!("./error_codes/E0695.md"), E0695: include_str!("./error_codes/E0695.md"),
E0697: include_str!("./error_codes/E0697.md"), E0697: include_str!("./error_codes/E0697.md"),
E0698: include_str!("./error_codes/E0698.md"), E0698: include_str!("./error_codes/E0698.md"),
...@@ -595,7 +596,6 @@ ...@@ -595,7 +596,6 @@
E0667, // `impl Trait` in projections E0667, // `impl Trait` in projections
E0687, // in-band lifetimes cannot be used in `fn`/`Fn` syntax E0687, // in-band lifetimes cannot be used in `fn`/`Fn` syntax
E0688, // in-band lifetimes cannot be mixed with explicit lifetime binders E0688, // in-band lifetimes cannot be mixed with explicit lifetime binders
E0693, // incorrect `repr(align)` attribute format
// E0694, // an unknown tool name found in scoped attributes // E0694, // an unknown tool name found in scoped attributes
E0696, // `continue` pointing to a labeled block E0696, // `continue` pointing to a labeled block
// E0702, // replaced with a generic attribute input check // E0702, // replaced with a generic attribute input check
......
The `Drop` trait was implemented on a non-struct type. Only traits defined in the current crate can be implemented for arbitrary types.
Erroneous code example: Erroneous code example:
......
`align` representation hint was incorrectly declared.
Erroneous code examples:
```compile_fail,E0693
#[repr(align=8)] // error!
struct Align8(i8);
#[repr(align="8")] // error!
struct Align8(i8);
```
This is a syntax error at the level of attribute declarations. The proper
syntax for `align` representation hint is the following:
```
#[repr(align(8))] // ok!
struct Align8(i8);
```
...@@ -107,8 +107,7 @@ pub fn descr(self, def_id: DefId) -> &'static str { ...@@ -107,8 +107,7 @@ pub fn descr(self, def_id: DefId) -> &'static str {
DefKind::Union => "union", DefKind::Union => "union",
DefKind::Trait => "trait", DefKind::Trait => "trait",
DefKind::ForeignTy => "foreign type", DefKind::ForeignTy => "foreign type",
// FIXME: Update the description to "assoc fn" DefKind::AssocFn => "associated function",
DefKind::AssocFn => "method",
DefKind::Const => "constant", DefKind::Const => "constant",
DefKind::AssocConst => "associated constant", DefKind::AssocConst => "associated constant",
DefKind::TyParam => "type parameter", DefKind::TyParam => "type parameter",
...@@ -123,6 +122,7 @@ pub fn article(&self) -> &'static str { ...@@ -123,6 +122,7 @@ pub fn article(&self) -> &'static str {
DefKind::AssocTy DefKind::AssocTy
| DefKind::AssocConst | DefKind::AssocConst
| DefKind::AssocOpaqueTy | DefKind::AssocOpaqueTy
| DefKind::AssocFn
| DefKind::Enum | DefKind::Enum
| DefKind::OpaqueTy => "an", | DefKind::OpaqueTy => "an",
DefKind::Macro(macro_kind) => macro_kind.article(), DefKind::Macro(macro_kind) => macro_kind.article(),
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
}; };
use rustc::ty::{self, subst::SubstsRef, RegionVid, Ty, TyCtxt, TypeFoldable}; use rustc::ty::{self, subst::SubstsRef, RegionVid, Ty, TyCtxt, TypeFoldable};
use rustc_data_structures::binary_search_util; use rustc_data_structures::binary_search_util;
use rustc_data_structures::frozen::Frozen;
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::graph::scc::Sccs; use rustc_data_structures::graph::scc::Sccs;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
...@@ -54,12 +55,12 @@ pub struct RegionInferenceContext<'tcx> { ...@@ -54,12 +55,12 @@ pub struct RegionInferenceContext<'tcx> {
liveness_constraints: LivenessValues<RegionVid>, liveness_constraints: LivenessValues<RegionVid>,
/// The outlives constraints computed by the type-check. /// The outlives constraints computed by the type-check.
constraints: Rc<OutlivesConstraintSet>, constraints: Frozen<OutlivesConstraintSet>,
/// The constraint-set, but in graph form, making it easy to traverse /// The constraint-set, but in graph form, making it easy to traverse
/// the constraints adjacent to a particular region. Used to construct /// the constraints adjacent to a particular region. Used to construct
/// the SCC (see `constraint_sccs`) and for error reporting. /// the SCC (see `constraint_sccs`) and for error reporting.
constraint_graph: Rc<NormalConstraintGraph>, constraint_graph: Frozen<NormalConstraintGraph>,
/// The SCC computed from `constraints` and the constraint /// The SCC computed from `constraints` and the constraint
/// graph. We have an edge from SCC A to SCC B if `A: B`. Used to /// graph. We have an edge from SCC A to SCC B if `A: B`. Used to
...@@ -112,7 +113,7 @@ pub struct RegionInferenceContext<'tcx> { ...@@ -112,7 +113,7 @@ pub struct RegionInferenceContext<'tcx> {
/// Information about how the universally quantified regions in /// Information about how the universally quantified regions in
/// scope on this function relate to one another. /// scope on this function relate to one another.
universal_region_relations: Rc<UniversalRegionRelations<'tcx>>, universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
} }
/// Each time that `apply_member_constraint` is successful, it appends /// Each time that `apply_member_constraint` is successful, it appends
...@@ -242,11 +243,11 @@ impl<'tcx> RegionInferenceContext<'tcx> { ...@@ -242,11 +243,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
/// ///
/// The `outlives_constraints` and `type_tests` are an initial set /// The `outlives_constraints` and `type_tests` are an initial set
/// of constraints produced by the MIR type check. /// of constraints produced by the MIR type check.
pub(crate) fn new( pub(in crate::borrow_check) fn new(
var_infos: VarInfos, var_infos: VarInfos,
universal_regions: Rc<UniversalRegions<'tcx>>, universal_regions: Rc<UniversalRegions<'tcx>>,
placeholder_indices: Rc<PlaceholderIndices>, placeholder_indices: Rc<PlaceholderIndices>,
universal_region_relations: Rc<UniversalRegionRelations<'tcx>>, universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
outlives_constraints: OutlivesConstraintSet, outlives_constraints: OutlivesConstraintSet,
member_constraints_in: MemberConstraintSet<'tcx, RegionVid>, member_constraints_in: MemberConstraintSet<'tcx, RegionVid>,
closure_bounds_mapping: FxHashMap< closure_bounds_mapping: FxHashMap<
...@@ -263,8 +264,8 @@ pub(crate) fn new( ...@@ -263,8 +264,8 @@ pub(crate) fn new(
.map(|info| RegionDefinition::new(info.universe, info.origin)) .map(|info| RegionDefinition::new(info.universe, info.origin))
.collect(); .collect();
let constraints = Rc::new(outlives_constraints); // freeze constraints let constraints = Frozen::freeze(outlives_constraints);
let constraint_graph = Rc::new(constraints.graph(definitions.len())); let constraint_graph = Frozen::freeze(constraints.graph(definitions.len()));
let fr_static = universal_regions.fr_static; let fr_static = universal_regions.fr_static;
let constraint_sccs = Rc::new(constraints.compute_sccs(&constraint_graph, fr_static)); let constraint_sccs = Rc::new(constraints.compute_sccs(&constraint_graph, fr_static));
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
use rustc::traits::query::OutlivesBound; use rustc::traits::query::OutlivesBound;
use rustc::ty::free_region_map::FreeRegionRelations; use rustc::ty::free_region_map::FreeRegionRelations;
use rustc::ty::{self, RegionVid, Ty, TyCtxt}; use rustc::ty::{self, RegionVid, Ty, TyCtxt};
use rustc_data_structures::frozen::Frozen;
use rustc_data_structures::transitive_relation::TransitiveRelation; use rustc_data_structures::transitive_relation::TransitiveRelation;
use rustc_infer::infer::canonical::QueryRegionConstraints; use rustc_infer::infer::canonical::QueryRegionConstraints;
use rustc_infer::infer::outlives; use rustc_infer::infer::outlives;
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
type NormalizedInputsAndOutput<'tcx> = Vec<Ty<'tcx>>; type NormalizedInputsAndOutput<'tcx> = Vec<Ty<'tcx>>;
crate struct CreateResult<'tcx> { crate struct CreateResult<'tcx> {
crate universal_region_relations: Rc<UniversalRegionRelations<'tcx>>, pub(in crate::borrow_check) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
crate region_bound_pairs: RegionBoundPairs<'tcx>, crate region_bound_pairs: RegionBoundPairs<'tcx>,
crate normalized_inputs_and_output: NormalizedInputsAndOutput<'tcx>, crate normalized_inputs_and_output: NormalizedInputsAndOutput<'tcx>,
} }
...@@ -298,7 +299,7 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> { ...@@ -298,7 +299,7 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> {
} }
CreateResult { CreateResult {
universal_region_relations: Rc::new(self.relations), universal_region_relations: Frozen::freeze(self.relations),
region_bound_pairs: self.region_bound_pairs, region_bound_pairs: self.region_bound_pairs,
normalized_inputs_and_output, normalized_inputs_and_output,
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, RegionVid, ToPolyTraitRef, Ty, self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, RegionVid, ToPolyTraitRef, Ty,
TyCtxt, UserType, UserTypeAnnotationIndex, TyCtxt, UserType, UserTypeAnnotationIndex,
}; };
use rustc_data_structures::frozen::Frozen;
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::struct_span_err; use rustc_errors::struct_span_err;
use rustc_hir as hir; use rustc_hir as hir;
...@@ -830,7 +831,7 @@ struct BorrowCheckContext<'a, 'tcx> { ...@@ -830,7 +831,7 @@ struct BorrowCheckContext<'a, 'tcx> {
crate struct MirTypeckResults<'tcx> { crate struct MirTypeckResults<'tcx> {
crate constraints: MirTypeckRegionConstraints<'tcx>, crate constraints: MirTypeckRegionConstraints<'tcx>,
crate universal_region_relations: Rc<UniversalRegionRelations<'tcx>>, pub(in crate::borrow_check) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
crate opaque_type_values: FxHashMap<DefId, ty::ResolvedOpaqueTy<'tcx>>, crate opaque_type_values: FxHashMap<DefId, ty::ResolvedOpaqueTy<'tcx>>,
} }
......
// Verify that no column information is emitted for MSVC targets
//
// only-msvc
// compile-flags: -C debuginfo=2
// CHECK-NOT: !DILexicalBlock({{.*}}column: {{.*}})
// CHECK-NOT: !DILocation({{.*}}column: {{.*}})
pub fn add(a: u32, b: u32) -> u32 {
a + b
}
fn main() {
let c = add(1, 2);
println!("{}", c);
}
// Verify that debuginfo column nubmers are 1-based byte offsets.
//
// ignore-windows
// compile-flags: -C debuginfo=2
fn main() {
unsafe {
// Column numbers are 1-based. Regression test for #65437.
// CHECK: call void @giraffe(), !dbg [[A:!.*]]
giraffe();
// Column numbers use byte offests. Regression test for #67360
// CHECK: call void @turtle(), !dbg [[B:!.*]]
/* ż */ turtle();
// CHECK: [[A]] = !DILocation(line: 10, column: 9,
// CHECK: [[B]] = !DILocation(line: 14, column: 10,
}
}
extern {
fn giraffe();
fn turtle();
}
...@@ -8,7 +8,7 @@ LL | Enum::mispellable(); ...@@ -8,7 +8,7 @@ LL | Enum::mispellable();
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| | | |
| variant or associated item not found in `Enum` | variant or associated item not found in `Enum`
| help: there is a method with a similar name: `misspellable` | help: there is an associated function with a similar name: `misspellable`
error[E0599]: no variant or associated item named `mispellable_trait` found for enum `Enum` in the current scope error[E0599]: no variant or associated item named `mispellable_trait` found for enum `Enum` in the current scope
--> $DIR/associated-item-enum.rs:18:11 --> $DIR/associated-item-enum.rs:18:11
......
...@@ -16,13 +16,13 @@ help: to force the closure to take ownership of `self` (and any other referenced ...@@ -16,13 +16,13 @@ help: to force the closure to take ownership of `self` (and any other referenced
LL | foo(move || self.bar()).await; LL | foo(move || self.bar()).await;
| ^^^^^^^ | ^^^^^^^
error[E0521]: borrowed data escapes outside of method error[E0521]: borrowed data escapes outside of associated function
--> $DIR/issue-62097.rs:13:9 --> $DIR/issue-62097.rs:13:9
| |
LL | pub async fn run_dummy_fn(&self) { LL | pub async fn run_dummy_fn(&self) {
| ----- `self` is a reference that is only valid in the method body | ----- `self` is a reference that is only valid in the associated function body
LL | foo(|| self.bar()).await; LL | foo(|| self.bar()).await;
| ^^^^^^^^^^^^^^^^^^ `self` escapes the method body here | ^^^^^^^^^^^^^^^^^^ `self` escapes the associated function body here
error: aborting due to 2 previous errors error: aborting due to 2 previous errors
......
...@@ -9,7 +9,7 @@ LL | ) -> &dyn Foo ...@@ -9,7 +9,7 @@ LL | ) -> &dyn Foo
LL | / { LL | / {
LL | | foo LL | | foo
LL | | } LL | | }
| |_____^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1` | |_____^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
error: aborting due to previous error error: aborting due to previous error
...@@ -2,7 +2,7 @@ error[E0599]: no method named `test_mut` found for struct `std::vec::Vec<{intege ...@@ -2,7 +2,7 @@ error[E0599]: no method named `test_mut` found for struct `std::vec::Vec<{intege
--> $DIR/auto-ref-slice-plus-ref.rs:7:7 --> $DIR/auto-ref-slice-plus-ref.rs:7:7
| |
LL | a.test_mut(); LL | a.test_mut();
| ^^^^^^^^ help: there is a method with a similar name: `get_mut` | ^^^^^^^^ help: there is an associated function with a similar name: `get_mut`
| |
= help: items from traits can only be used if the trait is implemented and in scope = help: items from traits can only be used if the trait is implemented and in scope
note: `MyIter` defines an item `test_mut`, perhaps you need to implement it note: `MyIter` defines an item `test_mut`, perhaps you need to implement it
......
...@@ -2,7 +2,7 @@ error[E0599]: no method named `b` found for reference `&Self` in the current sco ...@@ -2,7 +2,7 @@ error[E0599]: no method named `b` found for reference `&Self` in the current sco
--> $DIR/issue-3563.rs:3:17 --> $DIR/issue-3563.rs:3:17
| |
LL | || self.b() LL | || self.b()
| ^ help: there is a method with a similar name: `a` | ^ help: there is an associated function with a similar name: `a`
error: aborting due to previous error error: aborting due to previous error
......
...@@ -8,5 +8,5 @@ fn method(&self) {} ...@@ -8,5 +8,5 @@ fn method(&self) {}
fn main() { fn main() {
let foo = inner::Foo; let foo = inner::Foo;
foo.method(); //~ ERROR method `method` is private [E0624] foo.method(); //~ ERROR associated function `method` is private [E0624]
} }
error[E0624]: method `method` is private error[E0624]: associated function `method` is private
--> $DIR/E0624.rs:11:9 --> $DIR/E0624.rs:11:9
| |
LL | foo.method(); LL | foo.method();
......
...@@ -79,19 +79,19 @@ LL | r.unstable_undeclared(); ...@@ -79,19 +79,19 @@ LL | r.unstable_undeclared();
= note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information = note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0624]: method `pub_crate` is private error[E0624]: associated function `pub_crate` is private
--> $DIR/explore-issue-38412.rs:50:7 --> $DIR/explore-issue-38412.rs:50:7
| |
LL | r.pub_crate(); LL | r.pub_crate();
| ^^^^^^^^^ | ^^^^^^^^^
error[E0624]: method `pub_mod` is private error[E0624]: associated function `pub_mod` is private
--> $DIR/explore-issue-38412.rs:51:7 --> $DIR/explore-issue-38412.rs:51:7
| |
LL | r.pub_mod(); LL | r.pub_mod();
| ^^^^^^^ | ^^^^^^^
error[E0624]: method `private` is private error[E0624]: associated function `private` is private
--> $DIR/explore-issue-38412.rs:52:7 --> $DIR/explore-issue-38412.rs:52:7
| |
LL | r.private(); LL | r.private();
...@@ -115,19 +115,19 @@ LL | t.unstable_undeclared(); ...@@ -115,19 +115,19 @@ LL | t.unstable_undeclared();
= note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information = note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0624]: method `pub_crate` is private error[E0624]: associated function `pub_crate` is private
--> $DIR/explore-issue-38412.rs:63:7 --> $DIR/explore-issue-38412.rs:63:7
| |
LL | t.pub_crate(); LL | t.pub_crate();
| ^^^^^^^^^ | ^^^^^^^^^
error[E0624]: method `pub_mod` is private error[E0624]: associated function `pub_mod` is private
--> $DIR/explore-issue-38412.rs:64:7 --> $DIR/explore-issue-38412.rs:64:7
| |
LL | t.pub_mod(); LL | t.pub_mod();
| ^^^^^^^ | ^^^^^^^
error[E0624]: method `private` is private error[E0624]: associated function `private` is private
--> $DIR/explore-issue-38412.rs:65:7 --> $DIR/explore-issue-38412.rs:65:7
| |
LL | t.private(); LL | t.private();
......
...@@ -8,7 +8,7 @@ fn hof<F>(_: F) where F: FnMut(()) {} ...@@ -8,7 +8,7 @@ fn hof<F>(_: F) where F: FnMut(()) {}
fn ice() { fn ice() {
hof(|c| match c { hof(|c| match c {
A::new() => (), //~ ERROR expected tuple struct or tuple variant, found method A::new() => (), //~ ERROR expected tuple struct or tuple variant, found associated function
_ => () _ => ()
}) })
} }
......
error[E0164]: expected tuple struct or tuple variant, found method `A::new` error[E0164]: expected tuple struct or tuple variant, found associated function `A::new`
--> $DIR/fn-in-pat.rs:11:9 --> $DIR/fn-in-pat.rs:11:9
| |
LL | A::new() => (), LL | A::new() => (),
......
error[E0521]: borrowed data escapes outside of method error[E0521]: borrowed data escapes outside of associated function
--> $DIR/issue-16683.rs:4:9 --> $DIR/issue-16683.rs:4:9
| |
LL | fn b(&self) { LL | fn b(&self) {
| ----- `self` is a reference that is only valid in the method body | ----- `self` is a reference that is only valid in the associated function body
LL | self.a(); LL | self.a();
| ^^^^^^^^ `self` escapes the method body here | ^^^^^^^^ `self` escapes the associated function body here
error: aborting due to previous error error: aborting due to previous error
error[E0521]: borrowed data escapes outside of method error[E0521]: borrowed data escapes outside of associated function
--> $DIR/issue-17758.rs:7:9 --> $DIR/issue-17758.rs:7:9
| |
LL | fn bar(&self) { LL | fn bar(&self) {
| ----- `self` is a reference that is only valid in the method body | ----- `self` is a reference that is only valid in the associated function body
LL | self.foo(); LL | self.foo();
| ^^^^^^^^^^ `self` escapes the method body here | ^^^^^^^^^^ `self` escapes the associated function body here
error: aborting due to previous error error: aborting due to previous error
...@@ -8,7 +8,7 @@ mod B { ...@@ -8,7 +8,7 @@ mod B {
use crate1::A::Foo; use crate1::A::Foo;
fn bar(f: Foo) { fn bar(f: Foo) {
Foo::foo(&f); Foo::foo(&f);
//~^ ERROR: method `foo` is private //~^ ERROR: associated function `foo` is private
} }
} }
......
error[E0624]: method `foo` is private error[E0624]: associated function `foo` is private
--> $DIR/issue-21202.rs:10:9 --> $DIR/issue-21202.rs:10:9
| |
LL | Foo::foo(&f); LL | Foo::foo(&f);
......
...@@ -11,7 +11,7 @@ LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); ...@@ -11,7 +11,7 @@ LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
| ^^^^^ | ^^^^^
| | | |
| function or associated item not found in `dyn std::ops::BitXor<_>` | function or associated item not found in `dyn std::ops::BitXor<_>`
| help: there is a method with a similar name: `bitxor` | help: there is an associated function with a similar name: `bitxor`
error[E0191]: the value of the associated type `Output` (from trait `std::ops::BitXor`) must be specified error[E0191]: the value of the associated type `Output` (from trait `std::ops::BitXor`) must be specified
--> $DIR/issue-28344.rs:8:13 --> $DIR/issue-28344.rs:8:13
...@@ -26,7 +26,7 @@ LL | let g = BitXor::bitor; ...@@ -26,7 +26,7 @@ LL | let g = BitXor::bitor;
| ^^^^^ | ^^^^^
| | | |
| function or associated item not found in `dyn std::ops::BitXor<_>` | function or associated item not found in `dyn std::ops::BitXor<_>`
| help: there is a method with a similar name: `bitxor` | help: there is an associated function with a similar name: `bitxor`
error: aborting due to 4 previous errors error: aborting due to 4 previous errors
......
...@@ -21,9 +21,9 @@ fn main() { ...@@ -21,9 +21,9 @@ fn main() {
let _woohoo = (Box::new(my_struct)).priv_field; let _woohoo = (Box::new(my_struct)).priv_field;
//~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
(&my_struct).happyfun(); //~ ERROR method `happyfun` is private (&my_struct).happyfun(); //~ ERROR associated function `happyfun` is private
(Box::new(my_struct)).happyfun(); //~ ERROR method `happyfun` is private (Box::new(my_struct)).happyfun(); //~ ERROR associated function `happyfun` is private
let nope = my_struct.priv_field; let nope = my_struct.priv_field;
//~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
} }
...@@ -10,13 +10,13 @@ error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private ...@@ -10,13 +10,13 @@ error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
LL | let _woohoo = (Box::new(my_struct)).priv_field; LL | let _woohoo = (Box::new(my_struct)).priv_field;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0624]: method `happyfun` is private error[E0624]: associated function `happyfun` is private
--> $DIR/issue-3763.rs:24:18 --> $DIR/issue-3763.rs:24:18
| |
LL | (&my_struct).happyfun(); LL | (&my_struct).happyfun();
| ^^^^^^^^ | ^^^^^^^^
error[E0624]: method `happyfun` is private error[E0624]: associated function `happyfun` is private
--> $DIR/issue-3763.rs:26:27 --> $DIR/issue-3763.rs:26:27
| |
LL | (Box::new(my_struct)).happyfun(); LL | (Box::new(my_struct)).happyfun();
......
...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref` found for enum `std::option::Option<{in ...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref` found for enum `std::option::Option<{in
--> $DIR/option-as_deref.rs:2:29 --> $DIR/option-as_deref.rs:2:29
| |
LL | let _result = &Some(42).as_deref(); LL | let _result = &Some(42).as_deref();
| ^^^^^^^^ help: there is a method with a similar name: `as_ref` | ^^^^^^^^ help: there is an associated function with a similar name: `as_ref`
| |
= note: the method `as_deref` exists but the following trait bounds were not satisfied: = note: the method `as_deref` exists but the following trait bounds were not satisfied:
`{integer}: std::ops::Deref` `{integer}: std::ops::Deref`
......
...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref` found for enum `std::result::Result<{in ...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref` found for enum `std::result::Result<{in
--> $DIR/result-as_deref.rs:4:27 --> $DIR/result-as_deref.rs:4:27
| |
LL | let _result = &Ok(42).as_deref(); LL | let _result = &Ok(42).as_deref();
| ^^^^^^^^ help: there is a method with a similar name: `as_ref` | ^^^^^^^^ help: there is an associated function with a similar name: `as_ref`
| |
= note: the method `as_deref` exists but the following trait bounds were not satisfied: = note: the method `as_deref` exists but the following trait bounds were not satisfied:
`{integer}: std::ops::Deref` `{integer}: std::ops::Deref`
......
...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_err` found for enum `std::result::Result ...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_err` found for enum `std::result::Result
--> $DIR/result-as_deref_err.rs:4:28 --> $DIR/result-as_deref_err.rs:4:28
| |
LL | let _result = &Err(41).as_deref_err(); LL | let _result = &Err(41).as_deref_err();
| ^^^^^^^^^^^^ help: there is a method with a similar name: `as_deref_mut` | ^^^^^^^^^^^^ help: there is an associated function with a similar name: `as_deref_mut`
| |
= note: the method `as_deref_err` exists but the following trait bounds were not satisfied: = note: the method `as_deref_err` exists but the following trait bounds were not satisfied:
`{integer}: std::ops::Deref` `{integer}: std::ops::Deref`
......
...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut` found for enum `std::result::Result ...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut` found for enum `std::result::Result
--> $DIR/result-as_deref_mut.rs:4:31 --> $DIR/result-as_deref_mut.rs:4:31
| |
LL | let _result = &mut Ok(42).as_deref_mut(); LL | let _result = &mut Ok(42).as_deref_mut();
| ^^^^^^^^^^^^ help: there is a method with a similar name: `as_deref_err` | ^^^^^^^^^^^^ help: there is an associated function with a similar name: `as_deref_err`
| |
= note: the method `as_deref_mut` exists but the following trait bounds were not satisfied: = note: the method `as_deref_mut` exists but the following trait bounds were not satisfied:
`{integer}: std::ops::DerefMut` `{integer}: std::ops::DerefMut`
......
...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut_err` found for enum `std::result::Re ...@@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut_err` found for enum `std::result::Re
--> $DIR/result-as_deref_mut_err.rs:4:32 --> $DIR/result-as_deref_mut_err.rs:4:32
| |
LL | let _result = &mut Err(41).as_deref_mut_err(); LL | let _result = &mut Err(41).as_deref_mut_err();
| ^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `as_deref_mut` | ^^^^^^^^^^^^^^^^ help: there is an associated function with a similar name: `as_deref_mut`
| |
= note: the method `as_deref_mut_err` exists but the following trait bounds were not satisfied: = note: the method `as_deref_mut_err` exists but the following trait bounds were not satisfied:
`{integer}: std::ops::DerefMut` `{integer}: std::ops::DerefMut`
......
...@@ -13,5 +13,5 @@ fn foo() {} ...@@ -13,5 +13,5 @@ fn foo() {}
} }
fn main() { fn main() {
test::Foo::<test::B>::foo(); //~ ERROR method `foo` is private test::Foo::<test::B>::foo(); //~ ERROR associated function `foo` is private
} }
error[E0624]: method `foo` is private error[E0624]: associated function `foo` is private
--> $DIR/issue-53498.rs:16:5 --> $DIR/issue-53498.rs:16:5
| |
LL | test::Foo::<test::B>::foo(); LL | test::Foo::<test::B>::foo();
......
error[E0164]: expected tuple struct or tuple variant, found method `Path::new` error[E0164]: expected tuple struct or tuple variant, found associated function `Path::new`
--> $DIR/issue-55587.rs:4:9 --> $DIR/issue-55587.rs:4:9
| |
LL | let Path::new(); LL | let Path::new();
......
...@@ -7,7 +7,7 @@ LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 { ...@@ -7,7 +7,7 @@ LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
| lifetime `'a` defined here | lifetime `'a` defined here
LL | LL |
LL | if x > y { x } else { y } LL | if x > y { x } else { y }
| ^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
error: aborting due to previous error error: aborting due to previous error
...@@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a i32) -> &i32 { ...@@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a i32) -> &i32 {
| lifetime `'a` defined here | lifetime `'a` defined here
LL | LL |
LL | x LL | x
| ^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` | ^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
error: aborting due to previous error error: aborting due to previous error
...@@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo { ...@@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
| lifetime `'a` defined here | lifetime `'a` defined here
LL | LL |
LL | if true { x } else { self } LL | if true { x } else { self }
| ^^^^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1` | ^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
error: aborting due to previous error error: aborting due to previous error
...@@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &i32) -> &i32 { ...@@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &i32) -> &i32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | x LL | x
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to previous error error: aborting due to previous error
...@@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &Foo) -> &Foo { ...@@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &Foo) -> &Foo {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | if true { x } else { self } LL | if true { x } else { self }
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to previous error error: aborting due to previous error
error[E0164]: expected tuple struct or tuple variant, found method `Path::new` error[E0164]: expected tuple struct or tuple variant, found associated function `Path::new`
--> $DIR/match-fn-call.rs:6:9 --> $DIR/match-fn-call.rs:6:9
| |
LL | Path::new("foo") => println!("foo"), LL | Path::new("foo") => println!("foo"),
...@@ -6,7 +6,7 @@ LL | Path::new("foo") => println!("foo"), ...@@ -6,7 +6,7 @@ LL | Path::new("foo") => println!("foo"),
| |
= help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html = help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html
error[E0164]: expected tuple struct or tuple variant, found method `Path::new` error[E0164]: expected tuple struct or tuple variant, found associated function `Path::new`
--> $DIR/match-fn-call.rs:8:9 --> $DIR/match-fn-call.rs:8:9
| |
LL | Path::new("bar") => println!("bar"), LL | Path::new("bar") => println!("bar"),
......
...@@ -13,20 +13,20 @@ impl MyTrait for Foo {} ...@@ -13,20 +13,20 @@ impl MyTrait for Foo {}
fn main() { fn main() {
match 0u32 { match 0u32 {
Foo::bar => {} Foo::bar => {}
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::bar` //~^ ERROR expected unit struct, unit variant or constant, found associated function
} }
match 0u32 { match 0u32 {
<Foo>::bar => {} <Foo>::bar => {}
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::bar` //~^ ERROR expected unit struct, unit variant or constant, found associated function
} }
match 0u32 { match 0u32 {
<Foo>::trait_bar => {} <Foo>::trait_bar => {}
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::trait_bar` //~^ ERROR expected unit struct, unit variant or constant, found associated function
} }
if let Foo::bar = 0u32 {} if let Foo::bar = 0u32 {}
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::bar` //~^ ERROR expected unit struct, unit variant or constant, found associated function
if let <Foo>::bar = 0u32 {} if let <Foo>::bar = 0u32 {}
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::bar` //~^ ERROR expected unit struct, unit variant or constant, found associated function
if let Foo::trait_bar = 0u32 {} if let Foo::trait_bar = 0u32 {}
//~^ ERROR expected unit struct, unit variant or constant, found method `Foo::trait_bar` //~^ ERROR expected unit struct, unit variant or constant, found associated function
} }
error[E0533]: expected unit struct, unit variant or constant, found method `Foo::bar` error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::bar`
--> $DIR/method-path-in-pattern.rs:15:9 --> $DIR/method-path-in-pattern.rs:15:9
| |
LL | Foo::bar => {} LL | Foo::bar => {}
| ^^^^^^^^ | ^^^^^^^^
error[E0533]: expected unit struct, unit variant or constant, found method `Foo::bar` error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::bar`
--> $DIR/method-path-in-pattern.rs:19:9 --> $DIR/method-path-in-pattern.rs:19:9
| |
LL | <Foo>::bar => {} LL | <Foo>::bar => {}
| ^^^^^^^^^^ | ^^^^^^^^^^
error[E0533]: expected unit struct, unit variant or constant, found method `Foo::trait_bar` error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::trait_bar`
--> $DIR/method-path-in-pattern.rs:23:9 --> $DIR/method-path-in-pattern.rs:23:9
| |
LL | <Foo>::trait_bar => {} LL | <Foo>::trait_bar => {}
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error[E0533]: expected unit struct, unit variant or constant, found method `Foo::bar` error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::bar`
--> $DIR/method-path-in-pattern.rs:26:12 --> $DIR/method-path-in-pattern.rs:26:12
| |
LL | if let Foo::bar = 0u32 {} LL | if let Foo::bar = 0u32 {}
| ^^^^^^^^ | ^^^^^^^^
error[E0533]: expected unit struct, unit variant or constant, found method `Foo::bar` error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::bar`
--> $DIR/method-path-in-pattern.rs:28:12 --> $DIR/method-path-in-pattern.rs:28:12
| |
LL | if let <Foo>::bar = 0u32 {} LL | if let <Foo>::bar = 0u32 {}
| ^^^^^^^^^^ | ^^^^^^^^^^
error[E0533]: expected unit struct, unit variant or constant, found method `Foo::trait_bar` error[E0533]: expected unit struct, unit variant or constant, found associated function `Foo::trait_bar`
--> $DIR/method-path-in-pattern.rs:30:12 --> $DIR/method-path-in-pattern.rs:30:12
| |
LL | if let Foo::trait_bar = 0u32 {} LL | if let Foo::trait_bar = 0u32 {}
......
...@@ -9,6 +9,6 @@ impl MyTrait for Foo {} ...@@ -9,6 +9,6 @@ impl MyTrait for Foo {}
fn main() { fn main() {
match 0u32 { match 0u32 {
<Foo as MyTrait>::trait_bar => {} <Foo as MyTrait>::trait_bar => {}
//~^ ERROR expected unit struct, unit variant or constant, found method `MyTrait::trait_bar` //~^ ERROR expected unit struct, unit variant or constant, found associated function
} }
} }
error[E0532]: expected unit struct, unit variant or constant, found method `MyTrait::trait_bar` error[E0532]: expected unit struct, unit variant or constant, found associated function `MyTrait::trait_bar`
--> $DIR/method-resolvable-path-in-pattern.rs:11:9 --> $DIR/method-resolvable-path-in-pattern.rs:11:9
| |
LL | <Foo as MyTrait>::trait_bar => {} LL | <Foo as MyTrait>::trait_bar => {}
......
...@@ -70,7 +70,7 @@ pub struct Foo2<'a> { ...@@ -70,7 +70,7 @@ pub struct Foo2<'a> {
impl<'a> Foo2<'a> { impl<'a> Foo2<'a> {
// should not produce outlives suggestions to name 'self // should not produce outlives suggestions to name 'self
fn get_bar(&self) -> Bar2 { fn get_bar(&self) -> Bar2 {
Bar2::new(&self) //~ERROR borrowed data escapes outside of method Bar2::new(&self) //~ERROR borrowed data escapes outside of associated function
} }
} }
......
...@@ -93,16 +93,16 @@ LL | self.x ...@@ -93,16 +93,16 @@ LL | self.x
| |
= help: consider adding the following bound: `'b: 'a` = help: consider adding the following bound: `'b: 'a`
error[E0521]: borrowed data escapes outside of method error[E0521]: borrowed data escapes outside of associated function
--> $DIR/outlives-suggestion-simple.rs:73:9 --> $DIR/outlives-suggestion-simple.rs:73:9
| |
LL | fn get_bar(&self) -> Bar2 { LL | fn get_bar(&self) -> Bar2 {
| ----- | -----
| | | |
| `self` declared here, outside of the method body | `self` declared here, outside of the associated function body
| `self` is a reference that is only valid in the method body | `self` is a reference that is only valid in the associated function body
LL | Bar2::new(&self) LL | Bar2::new(&self)
| ^^^^^^^^^^^^^^^^ `self` escapes the method body here | ^^^^^^^^^^^^^^^^ `self` escapes the associated function body here
error: aborting due to 9 previous errors error: aborting due to 9 previous errors
...@@ -74,7 +74,7 @@ fn test() { ...@@ -74,7 +74,7 @@ fn test() {
} }
self::baz::A; self::baz::A;
self::baz::A::foo(); self::baz::A::foo();
self::baz::A::bar(); //~ ERROR: method `bar` is private self::baz::A::bar(); //~ ERROR: associated function `bar` is private
self::baz::A.foo2(); self::baz::A.foo2();
// this used to cause an ICE in privacy traversal. // this used to cause an ICE in privacy traversal.
...@@ -92,21 +92,21 @@ pub fn gpub() {} ...@@ -92,21 +92,21 @@ pub fn gpub() {}
fn lol() { fn lol() {
bar::A; bar::A;
bar::A::foo(); bar::A::foo();
bar::A::bar(); //~ ERROR: method `bar` is private bar::A::bar(); //~ ERROR: associated function `bar` is private
bar::A.foo2(); bar::A.foo2();
} }
mod foo { mod foo {
fn test() { fn test() {
::bar::A::foo(); ::bar::A::foo();
::bar::A::bar(); //~ ERROR: method `bar` is private ::bar::A::bar(); //~ ERROR: associated function `bar` is private
::bar::A.foo2(); ::bar::A.foo2();
::bar::baz::A::foo(); //~ ERROR: module `baz` is private ::bar::baz::A::foo(); //~ ERROR: module `baz` is private
::bar::baz::A::bar(); //~ ERROR: module `baz` is private ::bar::baz::A::bar(); //~ ERROR: module `baz` is private
//~^ ERROR: method `bar` is private //~^ ERROR: associated function `bar` is private
::bar::baz::A.foo2(); //~ ERROR: module `baz` is private ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private
::bar::baz::A.bar2(); //~ ERROR: module `baz` is private ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private
//~^ ERROR: method `bar2` is private //~^ ERROR: associated function `bar2` is private
let _: isize = let _: isize =
::bar::B::foo(); //~ ERROR: trait `B` is private ::bar::B::foo(); //~ ERROR: trait `B` is private
......
...@@ -154,31 +154,31 @@ note: the trait `B` is defined here ...@@ -154,31 +154,31 @@ note: the trait `B` is defined here
LL | trait B { LL | trait B {
| ^^^^^^^ | ^^^^^^^
error[E0624]: method `bar` is private error[E0624]: associated function `bar` is private
--> $DIR/privacy1.rs:77:9 --> $DIR/privacy1.rs:77:9
| |
LL | self::baz::A::bar(); LL | self::baz::A::bar();
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0624]: method `bar` is private error[E0624]: associated function `bar` is private
--> $DIR/privacy1.rs:95:5 --> $DIR/privacy1.rs:95:5
| |
LL | bar::A::bar(); LL | bar::A::bar();
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error[E0624]: method `bar` is private error[E0624]: associated function `bar` is private
--> $DIR/privacy1.rs:102:9 --> $DIR/privacy1.rs:102:9
| |
LL | ::bar::A::bar(); LL | ::bar::A::bar();
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
error[E0624]: method `bar` is private error[E0624]: associated function `bar` is private
--> $DIR/privacy1.rs:105:9 --> $DIR/privacy1.rs:105:9
| |
LL | ::bar::baz::A::bar(); LL | ::bar::baz::A::bar();
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
error[E0624]: method `bar2` is private error[E0624]: associated function `bar2` is private
--> $DIR/privacy1.rs:108:23 --> $DIR/privacy1.rs:108:23
| |
LL | ::bar::baz::A.bar2(); LL | ::bar::baz::A.bar2();
......
...@@ -17,5 +17,5 @@ fn bar(&self) {} // This should be visible outside `f` ...@@ -17,5 +17,5 @@ fn bar(&self) {} // This should be visible outside `f`
fn main() { fn main() {
let s = a::Foo { x: 1 }; let s = a::Foo { x: 1 };
s.bar(); s.bar();
s.foo(); //~ ERROR method `foo` is private s.foo(); //~ ERROR associated function `foo` is private
} }
error[E0624]: method `foo` is private error[E0624]: associated function `foo` is private
--> $DIR/private-impl-method.rs:20:7 --> $DIR/private-impl-method.rs:20:7
| |
LL | s.foo(); LL | s.foo();
......
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
fn main() { fn main() {
let nyan : cat = cat(52, 99); let nyan : cat = cat(52, 99);
nyan.nap(); //~ ERROR method `nap` is private nyan.nap(); //~ ERROR associated function `nap` is private
} }
error[E0624]: method `nap` is private error[E0624]: associated function `nap` is private
--> $DIR/private-method-cross-crate.rs:7:8 --> $DIR/private-method-cross-crate.rs:7:8
| |
LL | nyan.nap(); LL | nyan.nap();
......
...@@ -10,5 +10,5 @@ fn f(self) {} ...@@ -10,5 +10,5 @@ fn f(self) {}
fn main() { fn main() {
let x = a::Foo; let x = a::Foo;
x.f(); //~ ERROR method `f` is private x.f(); //~ ERROR associated function `f` is private
} }
error[E0624]: method `f` is private error[E0624]: associated function `f` is private
--> $DIR/private-method-inherited.rs:13:7 --> $DIR/private-method-inherited.rs:13:7
| |
LL | x.f(); LL | x.f();
......
...@@ -19,5 +19,5 @@ pub fn cat(in_x : usize, in_y : isize) -> Cat { ...@@ -19,5 +19,5 @@ pub fn cat(in_x : usize, in_y : isize) -> Cat {
fn main() { fn main() {
let nyan : kitties::Cat = kitties::cat(52, 99); let nyan : kitties::Cat = kitties::cat(52, 99);
nyan.nap(); //~ ERROR method `nap` is private nyan.nap(); //~ ERROR associated function `nap` is private
} }
error[E0624]: method `nap` is private error[E0624]: associated function `nap` is private
--> $DIR/private-method.rs:22:8 --> $DIR/private-method.rs:22:8
| |
LL | nyan.nap(); LL | nyan.nap();
......
...@@ -52,13 +52,13 @@ error[E0616]: field `x` of struct `foo::bar::S` is private ...@@ -52,13 +52,13 @@ error[E0616]: field `x` of struct `foo::bar::S` is private
LL | S::default().x; LL | S::default().x;
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error[E0624]: method `f` is private error[E0624]: associated function `f` is private
--> $DIR/test.rs:32:18 --> $DIR/test.rs:32:18
| |
LL | S::default().f(); LL | S::default().f();
| ^ | ^
error[E0624]: method `g` is private error[E0624]: associated function `g` is private
--> $DIR/test.rs:33:5 --> $DIR/test.rs:33:5
| |
LL | S::g(); LL | S::g();
...@@ -76,13 +76,13 @@ error[E0616]: field `z` of struct `pub_restricted::Universe` is private ...@@ -76,13 +76,13 @@ error[E0616]: field `z` of struct `pub_restricted::Universe` is private
LL | let _ = u.z; LL | let _ = u.z;
| ^^^ | ^^^
error[E0624]: method `g` is private error[E0624]: associated function `g` is private
--> $DIR/test.rs:45:7 --> $DIR/test.rs:45:7
| |
LL | u.g(); LL | u.g();
| ^ | ^
error[E0624]: method `h` is private error[E0624]: associated function `h` is private
--> $DIR/test.rs:46:7 --> $DIR/test.rs:46:7
| |
LL | u.h(); LL | u.h();
......
...@@ -18,7 +18,7 @@ fn f<T>() {} ...@@ -18,7 +18,7 @@ fn f<T>() {}
fn main() { fn main() {
match 10 { match 10 {
<S as Tr>::A::f::<u8> => {} <S as Tr>::A::f::<u8> => {}
//~^ ERROR expected unit struct, unit variant or constant, found method `<<S as Tr>::A>::f<u8>` //~^ ERROR expected unit struct, unit variant or constant, found associated function
0 ..= <S as Tr>::A::f::<u8> => {} //~ ERROR only char and numeric types are allowed in range 0 ..= <S as Tr>::A::f::<u8> => {} //~ ERROR only char and numeric types are allowed in range
} }
} }
error[E0533]: expected unit struct, unit variant or constant, found method `<<S as Tr>::A>::f<u8>` error[E0533]: expected unit struct, unit variant or constant, found associated function `<<S as Tr>::A>::f<u8>`
--> $DIR/qualified-path-params.rs:20:9 --> $DIR/qualified-path-params.rs:20:9
| |
LL | <S as Tr>::A::f::<u8> => {} LL | <S as Tr>::A::f::<u8> => {}
......
...@@ -24,3 +24,4 @@ LL | #[repr(align="8")] ...@@ -24,3 +24,4 @@ LL | #[repr(align="8")]
error: aborting due to 4 previous errors error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0693`.
...@@ -2,7 +2,7 @@ error: lifetime may not live long enough ...@@ -2,7 +2,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52 --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:8:52
| |
LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } LL | async fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
| - - ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | - - ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | | | | |
| | let's call the lifetime of this reference `'1` | | let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
...@@ -11,7 +11,7 @@ error: lifetime may not live long enough ...@@ -11,7 +11,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:75 --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:11:75
| |
LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } LL | async fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| - - ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | - - ^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | | | | |
| | let's call the lifetime of this reference `'1` | | let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
...@@ -20,7 +20,7 @@ error: lifetime may not live long enough ...@@ -20,7 +20,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64 --> $DIR/arbitrary_self_types_pin_lifetime_mismatch-async.rs:17:64
| |
LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } LL | async fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
| -- - ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` | -- - ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| | | | | |
| | let's call the lifetime of this reference `'1` | | let's call the lifetime of this reference `'1`
| lifetime `'a` defined here | lifetime `'a` defined here
......
...@@ -2,7 +2,7 @@ error: lifetime may not live long enough ...@@ -2,7 +2,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46 --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:6:46
| |
LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f } LL | fn a(self: Pin<&Foo>, f: &Foo) -> &Foo { f }
| - - ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | - - ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | | | | |
| | let's call the lifetime of this reference `'1` | | let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
...@@ -11,7 +11,7 @@ error: lifetime may not live long enough ...@@ -11,7 +11,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:8:69 --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:8:69
| |
LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) } LL | fn c(self: Pin<&Self>, f: &Foo, g: &Foo) -> (Pin<&Foo>, &Foo) { (self, f) }
| - - ^^^^^^^^^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | - - ^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| | | | | |
| | let's call the lifetime of this reference `'1` | | let's call the lifetime of this reference `'1`
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
...@@ -20,7 +20,7 @@ error: lifetime may not live long enough ...@@ -20,7 +20,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:13:58 --> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:13:58
| |
LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg } LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
| -- ---- has type `std::pin::Pin<&'1 Foo>` ^^^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` | -- ---- has type `std::pin::Pin<&'1 Foo>` ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| | | |
| lifetime `'a` defined here | lifetime `'a` defined here
......
...@@ -6,7 +6,7 @@ LL | async fn ref_self(&self, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | async fn ref_self(&self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self-async.rs:19:9 --> $DIR/lt-ref-self-async.rs:19:9
...@@ -16,7 +16,7 @@ LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | async fn ref_Self(self: &Self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self-async.rs:23:9 --> $DIR/lt-ref-self-async.rs:23:9
...@@ -26,7 +26,7 @@ LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | async fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self-async.rs:27:9 --> $DIR/lt-ref-self-async.rs:27:9
...@@ -36,7 +36,7 @@ LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { ...@@ -36,7 +36,7 @@ LL | async fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self-async.rs:31:9 --> $DIR/lt-ref-self-async.rs:31:9
...@@ -46,7 +46,7 @@ LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 { ...@@ -46,7 +46,7 @@ LL | async fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self-async.rs:35:9 --> $DIR/lt-ref-self-async.rs:35:9
...@@ -56,7 +56,7 @@ LL | async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 { ...@@ -56,7 +56,7 @@ LL | async fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 6 previous errors error: aborting due to 6 previous errors
...@@ -6,7 +6,7 @@ LL | fn ref_self(&self, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | fn ref_self(&self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self.rs:17:9 --> $DIR/lt-ref-self.rs:17:9
...@@ -16,7 +16,7 @@ LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | fn ref_Self(self: &Self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self.rs:21:9 --> $DIR/lt-ref-self.rs:21:9
...@@ -26,7 +26,7 @@ LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self.rs:25:9 --> $DIR/lt-ref-self.rs:25:9
...@@ -36,7 +36,7 @@ LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { ...@@ -36,7 +36,7 @@ LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self.rs:29:9 --> $DIR/lt-ref-self.rs:29:9
...@@ -46,7 +46,7 @@ LL | fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 { ...@@ -46,7 +46,7 @@ LL | fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/lt-ref-self.rs:33:9 --> $DIR/lt-ref-self.rs:33:9
...@@ -56,7 +56,7 @@ LL | fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 { ...@@ -56,7 +56,7 @@ LL | fn box_pin_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 6 previous errors error: aborting due to 6 previous errors
...@@ -6,7 +6,7 @@ LL | async fn ref_self(&mut self, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | async fn ref_self(&mut self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self-async.rs:19:9 --> $DIR/ref-mut-self-async.rs:19:9
...@@ -16,7 +16,7 @@ LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | async fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self-async.rs:23:9 --> $DIR/ref-mut-self-async.rs:23:9
...@@ -26,7 +26,7 @@ LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | async fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self-async.rs:27:9 --> $DIR/ref-mut-self-async.rs:27:9
...@@ -36,7 +36,7 @@ LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { ...@@ -36,7 +36,7 @@ LL | async fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self-async.rs:31:9 --> $DIR/ref-mut-self-async.rs:31:9
...@@ -46,7 +46,7 @@ LL | async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 { ...@@ -46,7 +46,7 @@ LL | async fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self-async.rs:35:9 --> $DIR/ref-mut-self-async.rs:35:9
...@@ -56,7 +56,7 @@ LL | async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 { ...@@ -56,7 +56,7 @@ LL | async fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 6 previous errors error: aborting due to 6 previous errors
...@@ -6,7 +6,7 @@ LL | fn ref_self(&mut self, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | fn ref_self(&mut self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self.rs:17:9 --> $DIR/ref-mut-self.rs:17:9
...@@ -16,7 +16,7 @@ LL | fn ref_Self(self: &mut Self, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | fn ref_Self(self: &mut Self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self.rs:21:9 --> $DIR/ref-mut-self.rs:21:9
...@@ -26,7 +26,7 @@ LL | fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | fn box_ref_Self(self: Box<&mut Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self.rs:25:9 --> $DIR/ref-mut-self.rs:25:9
...@@ -36,7 +36,7 @@ LL | fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 { ...@@ -36,7 +36,7 @@ LL | fn pin_ref_Self(self: Pin<&mut Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self.rs:29:9 --> $DIR/ref-mut-self.rs:29:9
...@@ -46,7 +46,7 @@ LL | fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 { ...@@ -46,7 +46,7 @@ LL | fn box_box_ref_Self(self: Box<Box<&mut Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-self.rs:33:9 --> $DIR/ref-mut-self.rs:33:9
...@@ -56,7 +56,7 @@ LL | fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 { ...@@ -56,7 +56,7 @@ LL | fn box_pin_ref_Self(self: Box<Pin<&mut Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 6 previous errors error: aborting due to 6 previous errors
...@@ -6,7 +6,7 @@ LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-struct-async.rs:17:9 --> $DIR/ref-mut-struct-async.rs:17:9
...@@ -16,7 +16,7 @@ LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-struct-async.rs:21:9 --> $DIR/ref-mut-struct-async.rs:21:9
...@@ -26,7 +26,7 @@ LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-struct-async.rs:25:9 --> $DIR/ref-mut-struct-async.rs:25:9
...@@ -36,7 +36,7 @@ LL | async fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u ...@@ -36,7 +36,7 @@ LL | async fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-struct-async.rs:29:9 --> $DIR/ref-mut-struct-async.rs:29:9
...@@ -46,7 +46,7 @@ LL | async fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u ...@@ -46,7 +46,7 @@ LL | async fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 5 previous errors error: aborting due to 5 previous errors
...@@ -6,7 +6,7 @@ LL | fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-struct.rs:15:9 --> $DIR/ref-mut-struct.rs:15:9
...@@ -16,7 +16,7 @@ LL | fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-struct.rs:19:9 --> $DIR/ref-mut-struct.rs:19:9
...@@ -26,7 +26,7 @@ LL | fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-struct.rs:23:9 --> $DIR/ref-mut-struct.rs:23:9
...@@ -36,7 +36,7 @@ LL | fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 { ...@@ -36,7 +36,7 @@ LL | fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-mut-struct.rs:27:9 --> $DIR/ref-mut-struct.rs:27:9
...@@ -46,7 +46,7 @@ LL | fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 { ...@@ -46,7 +46,7 @@ LL | fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 5 previous errors error: aborting due to 5 previous errors
...@@ -6,7 +6,7 @@ LL | fn ref_self(&self, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | fn ref_self(&self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-self.rs:27:9 --> $DIR/ref-self.rs:27:9
...@@ -16,7 +16,7 @@ LL | fn ref_Self(self: &Self, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | fn ref_Self(self: &Self, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-self.rs:31:9 --> $DIR/ref-self.rs:31:9
...@@ -26,7 +26,7 @@ LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | fn box_ref_Self(self: Box<&Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-self.rs:35:9 --> $DIR/ref-self.rs:35:9
...@@ -36,7 +36,7 @@ LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 { ...@@ -36,7 +36,7 @@ LL | fn pin_ref_Self(self: Pin<&Self>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-self.rs:39:9 --> $DIR/ref-self.rs:39:9
...@@ -46,7 +46,7 @@ LL | fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 { ...@@ -46,7 +46,7 @@ LL | fn box_box_ref_Self(self: Box<Box<&Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-self.rs:43:9 --> $DIR/ref-self.rs:43:9
...@@ -56,7 +56,7 @@ LL | fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 { ...@@ -56,7 +56,7 @@ LL | fn box_pin_ref_Self(self: Box<Pin<&Self>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-self.rs:47:9 --> $DIR/ref-self.rs:47:9
...@@ -66,7 +66,7 @@ LL | fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 { ...@@ -66,7 +66,7 @@ LL | fn wrap_ref_Self_Self(self: Wrap<&Self, Self>, f: &u8) -> &u8 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 7 previous errors error: aborting due to 7 previous errors
...@@ -6,7 +6,7 @@ LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | async fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-struct-async.rs:17:9 --> $DIR/ref-struct-async.rs:17:9
...@@ -16,7 +16,7 @@ LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | async fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-struct-async.rs:21:9 --> $DIR/ref-struct-async.rs:21:9
...@@ -26,7 +26,7 @@ LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | async fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-struct-async.rs:25:9 --> $DIR/ref-struct-async.rs:25:9
...@@ -36,7 +36,7 @@ LL | async fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 { ...@@ -36,7 +36,7 @@ LL | async fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-struct-async.rs:29:9 --> $DIR/ref-struct-async.rs:29:9
...@@ -46,7 +46,7 @@ LL | async fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 { ...@@ -46,7 +46,7 @@ LL | async fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 5 previous errors error: aborting due to 5 previous errors
...@@ -6,7 +6,7 @@ LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { ...@@ -6,7 +6,7 @@ LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-struct.rs:15:9 --> $DIR/ref-struct.rs:15:9
...@@ -16,7 +16,7 @@ LL | fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { ...@@ -16,7 +16,7 @@ LL | fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-struct.rs:19:9 --> $DIR/ref-struct.rs:19:9
...@@ -26,7 +26,7 @@ LL | fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { ...@@ -26,7 +26,7 @@ LL | fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-struct.rs:23:9 --> $DIR/ref-struct.rs:23:9
...@@ -36,7 +36,7 @@ LL | fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 { ...@@ -36,7 +36,7 @@ LL | fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: lifetime may not live long enough error: lifetime may not live long enough
--> $DIR/ref-struct.rs:27:9 --> $DIR/ref-struct.rs:27:9
...@@ -46,7 +46,7 @@ LL | fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 { ...@@ -46,7 +46,7 @@ LL | fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | f LL | f
| ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
error: aborting due to 5 previous errors error: aborting due to 5 previous errors
...@@ -4,7 +4,7 @@ error[E0282]: type annotations needed ...@@ -4,7 +4,7 @@ error[E0282]: type annotations needed
LL | let _ = (vec![1,2,3]).into_iter().sum() as f64; LL | let _ = (vec![1,2,3]).into_iter().sum() as f64;
| ^^^ | ^^^
| | | |
| cannot infer type for type parameter `S` declared on the method `sum` | cannot infer type for type parameter `S` declared on the associated function `sum`
| help: consider specifying the type argument in the method call: `sum::<S>` | help: consider specifying the type argument in the method call: `sum::<S>`
| |
= note: type must be known at this point = note: type must be known at this point
......
...@@ -6,5 +6,5 @@ fn new() -> S { S } ...@@ -6,5 +6,5 @@ fn new() -> S { S }
} }
fn main() { fn main() {
let _ = a::S::new(); //~ ERROR method `new` is private let _ = a::S::new(); //~ ERROR associated function `new` is private
} }
error[E0624]: method `new` is private error[E0624]: associated function `new` is private
--> $DIR/static-method-privacy.rs:9:13 --> $DIR/static-method-privacy.rs:9:13
| |
LL | let _ = a::S::new(); LL | let _ = a::S::new();
......
...@@ -5,19 +5,19 @@ LL | struct Foo; ...@@ -5,19 +5,19 @@ LL | struct Foo;
| ----------- method `bat` not found for this | ----------- method `bat` not found for this
... ...
LL | f.bat(1.0); LL | f.bat(1.0);
| ^^^ help: there is a method with a similar name: `bar` | ^^^ help: there is an associated function with a similar name: `bar`
error[E0599]: no method named `is_emtpy` found for struct `std::string::String` in the current scope error[E0599]: no method named `is_emtpy` found for struct `std::string::String` in the current scope
--> $DIR/suggest-methods.rs:21:15 --> $DIR/suggest-methods.rs:21:15
| |
LL | let _ = s.is_emtpy(); LL | let _ = s.is_emtpy();
| ^^^^^^^^ help: there is a method with a similar name: `is_empty` | ^^^^^^^^ help: there is an associated function with a similar name: `is_empty`
error[E0599]: no method named `count_eos` found for type `u32` in the current scope error[E0599]: no method named `count_eos` found for type `u32` in the current scope
--> $DIR/suggest-methods.rs:25:19 --> $DIR/suggest-methods.rs:25:19
| |
LL | let _ = 63u32.count_eos(); LL | let _ = 63u32.count_eos();
| ^^^^^^^^^ help: there is a method with a similar name: `count_zeros` | ^^^^^^^^^ help: there is an associated function with a similar name: `count_zeros`
error[E0599]: no method named `count_o` found for type `u32` in the current scope error[E0599]: no method named `count_o` found for type `u32` in the current scope
--> $DIR/suggest-methods.rs:28:19 --> $DIR/suggest-methods.rs:28:19
......
...@@ -69,7 +69,7 @@ fn check_method() { ...@@ -69,7 +69,7 @@ fn check_method() {
S.c(); // OK S.c(); // OK
// a, b, c are resolved as inherent items, their traits don't need to be in scope // a, b, c are resolved as inherent items, their traits don't need to be in scope
let c = &S as &dyn C; let c = &S as &dyn C;
c.a(); //~ ERROR method `a` is private c.a(); //~ ERROR associated function `a` is private
c.b(); // OK c.b(); // OK
c.c(); // OK c.c(); // OK
...@@ -81,7 +81,7 @@ fn check_method() { ...@@ -81,7 +81,7 @@ fn check_method() {
//~^ ERROR no function or associated item named `b` found //~^ ERROR no function or associated item named `b` found
S::c(&S); // OK S::c(&S); // OK
// a, b, c are resolved as inherent items, their traits don't need to be in scope // a, b, c are resolved as inherent items, their traits don't need to be in scope
C::a(&S); //~ ERROR method `a` is private C::a(&S); //~ ERROR associated function `a` is private
C::b(&S); // OK C::b(&S); // OK
C::c(&S); // OK C::c(&S); // OK
} }
......
...@@ -36,7 +36,7 @@ help: the following trait is implemented but not in scope; perhaps add a `use` f ...@@ -36,7 +36,7 @@ help: the following trait is implemented but not in scope; perhaps add a `use` f
LL | use method::B; LL | use method::B;
| |
error[E0624]: method `a` is private error[E0624]: associated function `a` is private
--> $DIR/trait-item-privacy.rs:72:7 --> $DIR/trait-item-privacy.rs:72:7
| |
LL | c.a(); LL | c.a();
...@@ -73,7 +73,7 @@ help: the following trait is implemented but not in scope; perhaps add a `use` f ...@@ -73,7 +73,7 @@ help: the following trait is implemented but not in scope; perhaps add a `use` f
LL | use method::B; LL | use method::B;
| |
error[E0624]: method `a` is private error[E0624]: associated function `a` is private
--> $DIR/trait-item-privacy.rs:84:5 --> $DIR/trait-item-privacy.rs:84:5
| |
LL | C::a(&S); LL | C::a(&S);
......
error[E0624]: method `method` is private error[E0624]: associated function `method` is private
--> $DIR/trait-method-private.rs:19:9 --> $DIR/trait-method-private.rs:19:9
| |
LL | foo.method(); LL | foo.method();
......
...@@ -4,7 +4,7 @@ error[E0282]: type annotations needed ...@@ -4,7 +4,7 @@ error[E0282]: type annotations needed
LL | .or_else(|err| { LL | .or_else(|err| {
| ^^^^^^^ | ^^^^^^^
| | | |
| cannot infer type for type parameter `F` declared on the method `or_else` | cannot infer type for type parameter `F` declared on the associated function `or_else`
| help: consider specifying the type arguments in the method call: `or_else::<F, O>` | help: consider specifying the type arguments in the method call: `or_else::<F, O>`
error: aborting due to previous error error: aborting due to previous error
......
...@@ -4,7 +4,7 @@ error[E0282]: type annotations needed ...@@ -4,7 +4,7 @@ error[E0282]: type annotations needed
LL | lst.sort_by_key(|&(v, _)| v.iter().sum()); LL | lst.sort_by_key(|&(v, _)| v.iter().sum());
| ^^^^^^^^^^^ --- help: consider specifying the type argument in the method call: `sum::<S>` | ^^^^^^^^^^^ --- help: consider specifying the type argument in the method call: `sum::<S>`
| | | |
| cannot infer type for type parameter `K` declared on the method `sort_by_key` | cannot infer type for type parameter `K` declared on the associated function `sort_by_key`
error: aborting due to previous error error: aborting due to previous error
......
...@@ -49,8 +49,8 @@ fn main() { ...@@ -49,8 +49,8 @@ fn main() {
<u8 as Tr::Y>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::Y` <u8 as Tr::Y>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::Y`
<u8 as E::Y>::NN; //~ ERROR failed to resolve: `Y` is a variant, not a module <u8 as E::Y>::NN; //~ ERROR failed to resolve: `Y` is a variant, not a module
let _: <u8 as Dr>::Z; //~ ERROR expected associated type, found method `Dr::Z` let _: <u8 as Dr>::Z; //~ ERROR expected associated type, found associated function `Dr::Z`
<u8 as Dr>::X; //~ ERROR expected method or associated constant, found associated type `Dr::X` <u8 as Dr>::X; //~ ERROR expected method or associated constant, found associated type `Dr::X`
let _: <u8 as Dr>::Z::N; //~ ERROR expected associated type, found method `Dr::Z` let _: <u8 as Dr>::Z::N; //~ ERROR expected associated type, found associated function `Dr::Z`
<u8 as Dr>::X::N; //~ ERROR no associated item named `N` found for type `u16` <u8 as Dr>::X::N; //~ ERROR no associated item named `N` found for type `u16`
} }
...@@ -35,10 +35,10 @@ error[E0576]: cannot find method or associated constant `N` in trait `Tr` ...@@ -35,10 +35,10 @@ error[E0576]: cannot find method or associated constant `N` in trait `Tr`
--> $DIR/ufcs-partially-resolved.rs:22:17 --> $DIR/ufcs-partially-resolved.rs:22:17
| |
LL | fn Y() {} LL | fn Y() {}
| --------- similarly named method `Y` defined here | --------- similarly named associated function `Y` defined here
... ...
LL | <u8 as Tr>::N; LL | <u8 as Tr>::N;
| ^ help: a method with a similar name exists: `Y` | ^ help: an associated function with a similar name exists: `Y`
error[E0576]: cannot find method or associated constant `N` in enum `E` error[E0576]: cannot find method or associated constant `N` in enum `E`
--> $DIR/ufcs-partially-resolved.rs:23:16 --> $DIR/ufcs-partially-resolved.rs:23:16
...@@ -166,7 +166,7 @@ error[E0576]: cannot find method or associated constant `NN` in `Tr::Y` ...@@ -166,7 +166,7 @@ error[E0576]: cannot find method or associated constant `NN` in `Tr::Y`
LL | <u8 as Tr::Y>::NN; LL | <u8 as Tr::Y>::NN;
| ^^ not found in `Tr::Y` | ^^ not found in `Tr::Y`
error[E0575]: expected associated type, found method `Dr::Z` error[E0575]: expected associated type, found associated function `Dr::Z`
--> $DIR/ufcs-partially-resolved.rs:52:12 --> $DIR/ufcs-partially-resolved.rs:52:12
| |
LL | type X = u16; LL | type X = u16;
...@@ -181,16 +181,16 @@ error[E0575]: expected method or associated constant, found associated type `Dr: ...@@ -181,16 +181,16 @@ error[E0575]: expected method or associated constant, found associated type `Dr:
--> $DIR/ufcs-partially-resolved.rs:53:5 --> $DIR/ufcs-partially-resolved.rs:53:5
| |
LL | fn Z() {} LL | fn Z() {}
| --------- similarly named method `Z` defined here | --------- similarly named associated function `Z` defined here
... ...
LL | <u8 as Dr>::X; LL | <u8 as Dr>::X;
| ^^^^^^^^^^^^- | ^^^^^^^^^^^^-
| | | |
| help: a method with a similar name exists: `Z` | help: an associated function with a similar name exists: `Z`
| |
= note: can't use a type alias as a constructor = note: can't use a type alias as a constructor
error[E0575]: expected associated type, found method `Dr::Z` error[E0575]: expected associated type, found associated function `Dr::Z`
--> $DIR/ufcs-partially-resolved.rs:54:12 --> $DIR/ufcs-partially-resolved.rs:54:12
| |
LL | type X = u16; LL | type X = u16;
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
fn main() { fn main() {
let _ = xc_private_method_lib::Struct::static_meth_struct(); let _ = xc_private_method_lib::Struct::static_meth_struct();
//~^ ERROR: method `static_meth_struct` is private //~^ ERROR: associated function `static_meth_struct` is private
let _ = xc_private_method_lib::Enum::static_meth_enum(); let _ = xc_private_method_lib::Enum::static_meth_enum();
//~^ ERROR: method `static_meth_enum` is private //~^ ERROR: associated function `static_meth_enum` is private
} }
error[E0624]: method `static_meth_struct` is private error[E0624]: associated function `static_meth_struct` is private
--> $DIR/xc-private-method.rs:6:13 --> $DIR/xc-private-method.rs:6:13
| |
LL | let _ = xc_private_method_lib::Struct::static_meth_struct(); LL | let _ = xc_private_method_lib::Struct::static_meth_struct();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0624]: method `static_meth_enum` is private error[E0624]: associated function `static_meth_enum` is private
--> $DIR/xc-private-method.rs:9:13 --> $DIR/xc-private-method.rs:9:13
| |
LL | let _ = xc_private_method_lib::Enum::static_meth_enum(); LL | let _ = xc_private_method_lib::Enum::static_meth_enum();
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
fn main() { fn main() {
let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct(); let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct();
//~^ ERROR method `meth_struct` is private //~^ ERROR associated function `meth_struct` is private
let _ = xc_private_method_lib::Enum::Variant1(20).meth_enum(); let _ = xc_private_method_lib::Enum::Variant1(20).meth_enum();
//~^ ERROR method `meth_enum` is private //~^ ERROR associated function `meth_enum` is private
} }
error[E0624]: method `meth_struct` is private error[E0624]: associated function `meth_struct` is private
--> $DIR/xc-private-method2.rs:6:52 --> $DIR/xc-private-method2.rs:6:52
| |
LL | let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct(); LL | let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct();
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error[E0624]: method `meth_enum` is private error[E0624]: associated function `meth_enum` is private
--> $DIR/xc-private-method2.rs:9:55 --> $DIR/xc-private-method2.rs:9:55
| |
LL | let _ = xc_private_method_lib::Enum::Variant1(20).meth_enum(); LL | let _ = xc_private_method_lib::Enum::Variant1(20).meth_enum();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册