1
Fork 0

Auto merge of #128169 - matthiaskrgr:rollup-ylsoq30, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #127054 (Reorder trait bound modifiers *after* `for<...>` binder in trait bounds)
 - #127528 (Replace ASCII control chars with Unicode Control Pictures)
 - #127872 (Migrate `pointer-auth-link-with-c`, `c-dynamic-rlib` and `c-dynamic-dylib` `run-make` tests to rmake)
 - #128111 (Do not use question as label)
 - #128160 (Don't ICE when auto trait has assoc ty in old solver)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-07-25 04:17:47 +00:00
commit 004e155c46
147 changed files with 789 additions and 604 deletions

View file

@ -3882,7 +3882,6 @@ dependencies = [
"termcolor", "termcolor",
"termize", "termize",
"tracing", "tracing",
"unicode-width",
"windows", "windows",
] ]

View file

@ -155,8 +155,6 @@ ast_passes_impl_trait_path = `impl Trait` is not allowed in path parameters
ast_passes_incompatible_features = `{$f1}` and `{$f2}` are incompatible, using them at the same time is not allowed ast_passes_incompatible_features = `{$f1}` and `{$f2}` are incompatible, using them at the same time is not allowed
.help = remove one of these features .help = remove one of these features
ast_passes_incompatible_trait_bound_modifiers = `{$left}` and `{$right}` are mutually exclusive
ast_passes_inherent_cannot_be = inherent impls cannot be {$annotation} ast_passes_inherent_cannot_be = inherent impls cannot be {$annotation}
.because = {$annotation} because of this .because = {$annotation} because of this
.type = inherent impl for this type .type = inherent impl for this type

View file

@ -1366,17 +1366,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
{ {
self.dcx().emit_err(errors::TildeConstDisallowed { span, reason }); self.dcx().emit_err(errors::TildeConstDisallowed { span, reason });
} }
(
_,
BoundConstness::Always(_) | BoundConstness::Maybe(_),
BoundPolarity::Negative(_) | BoundPolarity::Maybe(_),
) => {
self.dcx().emit_err(errors::IncompatibleTraitBoundModifiers {
span: bound.span(),
left: modifiers.constness.as_str(),
right: modifiers.polarity.as_str(),
});
}
_ => {} _ => {}
} }

View file

@ -656,15 +656,6 @@ pub enum TildeConstReason {
Item, Item,
} }
#[derive(Diagnostic)]
#[diag(ast_passes_incompatible_trait_bound_modifiers)]
pub struct IncompatibleTraitBoundModifiers {
#[primary_span]
pub span: Span,
pub left: &'static str,
pub right: &'static str,
}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(ast_passes_const_and_async)] #[diag(ast_passes_const_and_async)]
pub struct ConstAndAsync { pub struct ConstAndAsync {

View file

@ -26,7 +26,6 @@ serde_json = "1.0.59"
termcolor = "1.2.0" termcolor = "1.2.0"
termize = "0.1.1" termize = "0.1.1"
tracing = "0.1" tracing = "0.1"
unicode-width = "0.1.4"
# tidy-alphabetical-end # tidy-alphabetical-end
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]

View file

@ -8,7 +8,7 @@
//! The output types are defined in `rustc_session::config::ErrorOutputType`. //! The output types are defined in `rustc_session::config::ErrorOutputType`.
use rustc_span::source_map::SourceMap; use rustc_span::source_map::SourceMap;
use rustc_span::{FileLines, FileName, SourceFile, Span}; use rustc_span::{char_width, FileLines, FileName, SourceFile, Span};
use crate::snippet::{ use crate::snippet::{
Annotation, AnnotationColumn, AnnotationType, Line, MultilineAnnotation, Style, StyledString, Annotation, AnnotationColumn, AnnotationType, Line, MultilineAnnotation, Style, StyledString,
@ -677,10 +677,7 @@ impl HumanEmitter {
.skip(left) .skip(left)
.take_while(|ch| { .take_while(|ch| {
// Make sure that the trimming on the right will fall within the terminal width. // Make sure that the trimming on the right will fall within the terminal width.
// FIXME: `unicode_width` sometimes disagrees with terminals on how wide a `char` let next = char_width(*ch);
// is. For now, just accept that sometimes the code line will be longer than
// desired.
let next = unicode_width::UnicodeWidthChar::width(*ch).unwrap_or(1);
if taken + next > right - left { if taken + next > right - left {
return false; return false;
} }
@ -742,11 +739,7 @@ impl HumanEmitter {
let left = margin.left(source_string.len()); let left = margin.left(source_string.len());
// Account for unicode characters of width !=0 that were removed. // Account for unicode characters of width !=0 that were removed.
let left = source_string let left = source_string.chars().take(left).map(|ch| char_width(ch)).sum();
.chars()
.take(left)
.map(|ch| unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1))
.sum();
self.draw_line( self.draw_line(
buffer, buffer,
@ -2039,7 +2032,7 @@ impl HumanEmitter {
let sub_len: usize = let sub_len: usize =
if is_whitespace_addition { &part.snippet } else { part.snippet.trim() } if is_whitespace_addition { &part.snippet } else { part.snippet.trim() }
.chars() .chars()
.map(|ch| unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1)) .map(|ch| char_width(ch))
.sum(); .sum();
let offset: isize = offsets let offset: isize = offsets
@ -2076,11 +2069,8 @@ impl HumanEmitter {
} }
// length of the code after substitution // length of the code after substitution
let full_sub_len = part let full_sub_len =
.snippet part.snippet.chars().map(|ch| char_width(ch)).sum::<usize>() as isize;
.chars()
.map(|ch| unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1))
.sum::<usize>() as isize;
// length of the code to be substituted // length of the code to be substituted
let snippet_len = span_end_pos as isize - span_start_pos as isize; let snippet_len = span_end_pos as isize - span_start_pos as isize;
@ -2568,18 +2558,53 @@ fn num_decimal_digits(num: usize) -> usize {
} }
// We replace some characters so the CLI output is always consistent and underlines aligned. // We replace some characters so the CLI output is always consistent and underlines aligned.
// Keep the following list in sync with `rustc_span::char_width`.
const OUTPUT_REPLACEMENTS: &[(char, &str)] = &[ const OUTPUT_REPLACEMENTS: &[(char, &str)] = &[
('\t', " "), // We do our own tab replacement ('\t', " "), // We do our own tab replacement
('\u{200D}', ""), // Replace ZWJ with nothing for consistent terminal output of grapheme clusters. ('\u{200D}', ""), // Replace ZWJ with nothing for consistent terminal output of grapheme clusters.
('\u{202A}', ""), // The following unicode text flow control characters are inconsistently ('\u{202A}', "<EFBFBD>"), // The following unicode text flow control characters are inconsistently
('\u{202B}', ""), // supported across CLIs and can cause confusion due to the bytes on disk ('\u{202B}', "<EFBFBD>"), // supported across CLIs and can cause confusion due to the bytes on disk
('\u{202D}', ""), // not corresponding to the visible source code, so we replace them always. ('\u{202D}', "<EFBFBD>"), // not corresponding to the visible source code, so we replace them always.
('\u{202E}', ""), ('\u{202E}', "<EFBFBD>"),
('\u{2066}', ""), ('\u{2066}', "<EFBFBD>"),
('\u{2067}', ""), ('\u{2067}', "<EFBFBD>"),
('\u{2068}', ""), ('\u{2068}', "<EFBFBD>"),
('\u{202C}', ""), ('\u{202C}', "<EFBFBD>"),
('\u{2069}', ""), ('\u{2069}', "<EFBFBD>"),
// In terminals without Unicode support the following will be garbled, but in *all* terminals
// the underlying codepoint will be as well. We could gate this replacement behind a "unicode
// support" gate.
('\u{0000}', ""),
('\u{0001}', ""),
('\u{0002}', ""),
('\u{0003}', ""),
('\u{0004}', ""),
('\u{0005}', ""),
('\u{0006}', ""),
('\u{0007}', ""),
('\u{0008}', ""),
('\u{000B}', ""),
('\u{000C}', ""),
('\u{000D}', ""),
('\u{000E}', ""),
('\u{000F}', ""),
('\u{0010}', ""),
('\u{0011}', ""),
('\u{0012}', ""),
('\u{0013}', ""),
('\u{0014}', ""),
('\u{0015}', ""),
('\u{0016}', ""),
('\u{0017}', ""),
('\u{0018}', ""),
('\u{0019}', ""),
('\u{001A}', ""),
('\u{001B}', ""),
('\u{001C}', ""),
('\u{001D}', ""),
('\u{001E}', ""),
('\u{001F}', ""),
('\u{007F}', ""),
]; ];
fn normalize_whitespace(str: &str) -> String { fn normalize_whitespace(str: &str) -> String {

View file

@ -1728,7 +1728,6 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
source_len, source_len,
lines, lines,
multibyte_chars, multibyte_chars,
non_narrow_chars,
normalized_pos, normalized_pos,
stable_id, stable_id,
.. ..
@ -1780,7 +1779,6 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
self.cnum, self.cnum,
lines, lines,
multibyte_chars, multibyte_chars,
non_narrow_chars,
normalized_pos, normalized_pos,
source_file_index, source_file_index,
); );

View file

@ -53,6 +53,12 @@ parse_bare_cr = {$double_quotes ->
parse_bare_cr_in_raw_string = bare CR not allowed in raw string parse_bare_cr_in_raw_string = bare CR not allowed in raw string
parse_binder_and_polarity = `for<...>` binder not allowed with `{$polarity}` trait polarity modifier
.label = there is not a well-defined meaning for a higher-ranked `{$polarity}` trait
parse_binder_before_modifiers = `for<...>` binder should be placed before trait bound modifiers
.label = place the `for<...>` binder before any modifiers
parse_bounds_not_allowed_on_trait_aliases = bounds are not allowed on trait aliases parse_bounds_not_allowed_on_trait_aliases = bounds are not allowed on trait aliases
parse_box_not_pat = expected pattern, found {$descr} parse_box_not_pat = expected pattern, found {$descr}
@ -577,6 +583,9 @@ parse_missing_trait_in_trait_impl = missing trait in a trait impl
parse_modifier_lifetime = `{$modifier}` may only modify trait bounds, not lifetime bounds parse_modifier_lifetime = `{$modifier}` may only modify trait bounds, not lifetime bounds
.suggestion = remove the `{$modifier}` .suggestion = remove the `{$modifier}`
parse_modifiers_and_polarity = `{$modifiers_concatenated}` trait not allowed with `{$polarity}` trait polarity modifier
.label = there is not a well-defined meaning for a `{$modifiers_concatenated} {$polarity}` trait
parse_more_than_one_char = character literal may only contain one codepoint parse_more_than_one_char = character literal may only contain one codepoint
.followed_by = this `{$chr}` is followed by the combining {$len -> .followed_by = this `{$chr}` is followed by the combining {$len ->
[one] mark [one] mark

View file

@ -3212,3 +3212,33 @@ pub struct UnsafeAttrOutsideUnsafeSuggestion {
#[suggestion_part(code = ")")] #[suggestion_part(code = ")")]
pub right: Span, pub right: Span,
} }
#[derive(Diagnostic)]
#[diag(parse_binder_before_modifiers)]
pub struct BinderBeforeModifiers {
#[primary_span]
pub binder_span: Span,
#[label]
pub modifiers_span: Span,
}
#[derive(Diagnostic)]
#[diag(parse_binder_and_polarity)]
pub struct BinderAndPolarity {
#[primary_span]
pub polarity_span: Span,
#[label]
pub binder_span: Span,
pub polarity: &'static str,
}
#[derive(Diagnostic)]
#[diag(parse_modifiers_and_polarity)]
pub struct PolarityAndModifiers {
#[primary_span]
pub polarity_span: Span,
#[label]
pub modifiers_span: Span,
pub polarity: &'static str,
pub modifiers_concatenated: String,
}

View file

@ -935,9 +935,14 @@ impl<'a> Parser<'a> {
/// If no modifiers are present, this does not consume any tokens. /// If no modifiers are present, this does not consume any tokens.
/// ///
/// ```ebnf /// ```ebnf
/// TRAIT_BOUND_MODIFIERS = [["~"] "const"] ["async"] ["?" | "!"] /// CONSTNESS = [["~"] "const"]
/// ASYNCNESS = ["async"]
/// POLARITY = ["?" | "!"]
/// ``` /// ```
///
/// See `parse_generic_ty_bound` for the complete grammar of trait bound modifiers.
fn parse_trait_bound_modifiers(&mut self) -> PResult<'a, TraitBoundModifiers> { fn parse_trait_bound_modifiers(&mut self) -> PResult<'a, TraitBoundModifiers> {
let modifier_lo = self.token.span;
let constness = if self.eat(&token::Tilde) { let constness = if self.eat(&token::Tilde) {
let tilde = self.prev_token.span; let tilde = self.prev_token.span;
self.expect_keyword(kw::Const)?; self.expect_keyword(kw::Const)?;
@ -970,6 +975,7 @@ impl<'a> Parser<'a> {
} else { } else {
BoundAsyncness::Normal BoundAsyncness::Normal
}; };
let modifier_hi = self.prev_token.span;
let polarity = if self.eat(&token::Question) { let polarity = if self.eat(&token::Question) {
BoundPolarity::Maybe(self.prev_token.span) BoundPolarity::Maybe(self.prev_token.span)
@ -980,13 +986,40 @@ impl<'a> Parser<'a> {
BoundPolarity::Positive BoundPolarity::Positive
}; };
// Enforce the mutual-exclusivity of `const`/`async` and `?`/`!`.
match polarity {
BoundPolarity::Positive => {
// All trait bound modifiers allowed to combine with positive polarity
}
BoundPolarity::Maybe(polarity_span) | BoundPolarity::Negative(polarity_span) => {
match (asyncness, constness) {
(BoundAsyncness::Normal, BoundConstness::Never) => {
// Ok, no modifiers.
}
(_, _) => {
let constness = constness.as_str();
let asyncness = asyncness.as_str();
let glue =
if !constness.is_empty() && !asyncness.is_empty() { " " } else { "" };
let modifiers_concatenated = format!("{constness}{glue}{asyncness}");
self.dcx().emit_err(errors::PolarityAndModifiers {
polarity_span,
polarity: polarity.as_str(),
modifiers_span: modifier_lo.to(modifier_hi),
modifiers_concatenated,
});
}
}
}
}
Ok(TraitBoundModifiers { constness, asyncness, polarity }) Ok(TraitBoundModifiers { constness, asyncness, polarity })
} }
/// Parses a type bound according to: /// Parses a type bound according to:
/// ```ebnf /// ```ebnf
/// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN) /// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
/// TY_BOUND_NOPAREN = [TRAIT_BOUND_MODIFIERS] [for<LT_PARAM_DEFS>] SIMPLE_PATH /// TY_BOUND_NOPAREN = [for<GENERIC_PARAMS> CONSTNESS ASYNCNESS | POLARITY] SIMPLE_PATH
/// ``` /// ```
/// ///
/// For example, this grammar accepts `for<'a: 'b> ~const ?m::Trait<'a>`. /// For example, this grammar accepts `for<'a: 'b> ~const ?m::Trait<'a>`.
@ -996,9 +1029,25 @@ impl<'a> Parser<'a> {
has_parens: bool, has_parens: bool,
leading_token: &Token, leading_token: &Token,
) -> PResult<'a, GenericBound> { ) -> PResult<'a, GenericBound> {
let modifiers = self.parse_trait_bound_modifiers()?;
let (mut lifetime_defs, binder_span) = self.parse_late_bound_lifetime_defs()?; let (mut lifetime_defs, binder_span) = self.parse_late_bound_lifetime_defs()?;
let modifiers_lo = self.token.span;
let modifiers = self.parse_trait_bound_modifiers()?;
let modifiers_span = modifiers_lo.to(self.prev_token.span);
if let Some(binder_span) = binder_span {
match modifiers.polarity {
BoundPolarity::Negative(polarity_span) | BoundPolarity::Maybe(polarity_span) => {
self.dcx().emit_err(errors::BinderAndPolarity {
binder_span,
polarity_span,
polarity: modifiers.polarity.as_str(),
});
}
BoundPolarity::Positive => {}
}
}
// Recover erroneous lifetime bound with modifiers or binder. // Recover erroneous lifetime bound with modifiers or binder.
// e.g. `T: for<'a> 'a` or `T: ~const 'a`. // e.g. `T: for<'a> 'a` or `T: ~const 'a`.
if self.token.is_lifetime() { if self.token.is_lifetime() {
@ -1006,6 +1055,11 @@ impl<'a> Parser<'a> {
return self.parse_generic_lt_bound(lo, has_parens); return self.parse_generic_lt_bound(lo, has_parens);
} }
if let (more_lifetime_defs, Some(binder_span)) = self.parse_late_bound_lifetime_defs()? {
lifetime_defs.extend(more_lifetime_defs);
self.dcx().emit_err(errors::BinderBeforeModifiers { binder_span, modifiers_span });
}
let mut path = if self.token.is_keyword(kw::Fn) let mut path = if self.token.is_keyword(kw::Fn)
&& self.look_ahead(1, |tok| tok.kind == TokenKind::OpenDelim(Delimiter::Parenthesis)) && self.look_ahead(1, |tok| tok.kind == TokenKind::OpenDelim(Delimiter::Parenthesis))
&& let Some(path) = self.recover_path_from_fn() && let Some(path) = self.recover_path_from_fn()

View file

@ -73,7 +73,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for SourceFile {
source_len: _, source_len: _,
lines: _, lines: _,
ref multibyte_chars, ref multibyte_chars,
ref non_narrow_chars,
ref normalized_pos, ref normalized_pos,
} = *self; } = *self;
@ -98,11 +97,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for SourceFile {
char_pos.hash_stable(hcx, hasher); char_pos.hash_stable(hcx, hasher);
} }
non_narrow_chars.len().hash_stable(hcx, hasher);
for &char_pos in non_narrow_chars.iter() {
char_pos.hash_stable(hcx, hasher);
}
normalized_pos.len().hash_stable(hcx, hasher); normalized_pos.len().hash_stable(hcx, hasher);
for &char_pos in normalized_pos.iter() { for &char_pos in normalized_pos.iter() {
char_pos.hash_stable(hcx, hasher); char_pos.hash_stable(hcx, hasher);

View file

@ -2012,7 +2012,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
) )
} else if ident.name == sym::core { } else if ident.name == sym::core {
( (
format!("maybe a missing crate `{ident}`?"), format!("you might be missing crate `{ident}`"),
Some(( Some((
vec![(ident.span, "std".to_string())], vec![(ident.span, "std".to_string())],
"try using `std` instead of `core`".to_string(), "try using `std` instead of `core`".to_string(),
@ -2021,7 +2021,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
) )
} else if self.tcx.sess.is_rust_2015() { } else if self.tcx.sess.is_rust_2015() {
( (
format!("maybe a missing crate `{ident}`?"), format!("you might be missing crate `{ident}`"),
Some(( Some((
vec![], vec![],
format!( format!(

View file

@ -1,5 +1,4 @@
use super::*; use super::*;
use unicode_width::UnicodeWidthChar;
#[cfg(test)] #[cfg(test)]
mod tests; mod tests;
@ -9,15 +8,12 @@ mod tests;
/// ///
/// This function will use an SSE2 enhanced implementation if hardware support /// This function will use an SSE2 enhanced implementation if hardware support
/// is detected at runtime. /// is detected at runtime.
pub fn analyze_source_file( pub fn analyze_source_file(src: &str) -> (Vec<RelativeBytePos>, Vec<MultiByteChar>) {
src: &str,
) -> (Vec<RelativeBytePos>, Vec<MultiByteChar>, Vec<NonNarrowChar>) {
let mut lines = vec![RelativeBytePos::from_u32(0)]; let mut lines = vec![RelativeBytePos::from_u32(0)];
let mut multi_byte_chars = vec![]; let mut multi_byte_chars = vec![];
let mut non_narrow_chars = vec![];
// Calls the right implementation, depending on hardware support available. // Calls the right implementation, depending on hardware support available.
analyze_source_file_dispatch(src, &mut lines, &mut multi_byte_chars, &mut non_narrow_chars); analyze_source_file_dispatch(src, &mut lines, &mut multi_byte_chars);
// The code above optimistically registers a new line *after* each \n // The code above optimistically registers a new line *after* each \n
// it encounters. If that point is already outside the source_file, remove // it encounters. If that point is already outside the source_file, remove
@ -30,7 +26,7 @@ pub fn analyze_source_file(
} }
} }
(lines, multi_byte_chars, non_narrow_chars) (lines, multi_byte_chars)
} }
cfg_match! { cfg_match! {
@ -39,11 +35,10 @@ cfg_match! {
src: &str, src: &str,
lines: &mut Vec<RelativeBytePos>, lines: &mut Vec<RelativeBytePos>,
multi_byte_chars: &mut Vec<MultiByteChar>, multi_byte_chars: &mut Vec<MultiByteChar>,
non_narrow_chars: &mut Vec<NonNarrowChar>,
) { ) {
if is_x86_feature_detected!("sse2") { if is_x86_feature_detected!("sse2") {
unsafe { unsafe {
analyze_source_file_sse2(src, lines, multi_byte_chars, non_narrow_chars); analyze_source_file_sse2(src, lines, multi_byte_chars);
} }
} else { } else {
analyze_source_file_generic( analyze_source_file_generic(
@ -52,7 +47,6 @@ cfg_match! {
RelativeBytePos::from_u32(0), RelativeBytePos::from_u32(0),
lines, lines,
multi_byte_chars, multi_byte_chars,
non_narrow_chars,
); );
} }
} }
@ -66,7 +60,6 @@ cfg_match! {
src: &str, src: &str,
lines: &mut Vec<RelativeBytePos>, lines: &mut Vec<RelativeBytePos>,
multi_byte_chars: &mut Vec<MultiByteChar>, multi_byte_chars: &mut Vec<MultiByteChar>,
non_narrow_chars: &mut Vec<NonNarrowChar>,
) { ) {
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]
use std::arch::x86::*; use std::arch::x86::*;
@ -159,7 +152,6 @@ cfg_match! {
RelativeBytePos::from_usize(scan_start), RelativeBytePos::from_usize(scan_start),
lines, lines,
multi_byte_chars, multi_byte_chars,
non_narrow_chars,
); );
} }
@ -172,7 +164,6 @@ cfg_match! {
RelativeBytePos::from_usize(tail_start), RelativeBytePos::from_usize(tail_start),
lines, lines,
multi_byte_chars, multi_byte_chars,
non_narrow_chars,
); );
} }
} }
@ -183,7 +174,6 @@ cfg_match! {
src: &str, src: &str,
lines: &mut Vec<RelativeBytePos>, lines: &mut Vec<RelativeBytePos>,
multi_byte_chars: &mut Vec<MultiByteChar>, multi_byte_chars: &mut Vec<MultiByteChar>,
non_narrow_chars: &mut Vec<NonNarrowChar>,
) { ) {
analyze_source_file_generic( analyze_source_file_generic(
src, src,
@ -191,7 +181,6 @@ cfg_match! {
RelativeBytePos::from_u32(0), RelativeBytePos::from_u32(0),
lines, lines,
multi_byte_chars, multi_byte_chars,
non_narrow_chars,
); );
} }
} }
@ -205,7 +194,6 @@ fn analyze_source_file_generic(
output_offset: RelativeBytePos, output_offset: RelativeBytePos,
lines: &mut Vec<RelativeBytePos>, lines: &mut Vec<RelativeBytePos>,
multi_byte_chars: &mut Vec<MultiByteChar>, multi_byte_chars: &mut Vec<MultiByteChar>,
non_narrow_chars: &mut Vec<NonNarrowChar>,
) -> usize { ) -> usize {
assert!(src.len() >= scan_len); assert!(src.len() >= scan_len);
let mut i = 0; let mut i = 0;
@ -227,17 +215,9 @@ fn analyze_source_file_generic(
let pos = RelativeBytePos::from_usize(i) + output_offset; let pos = RelativeBytePos::from_usize(i) + output_offset;
match byte { if let b'\n' = byte {
b'\n' => {
lines.push(pos + RelativeBytePos(1)); lines.push(pos + RelativeBytePos(1));
} }
b'\t' => {
non_narrow_chars.push(NonNarrowChar::Tab(pos));
}
_ => {
non_narrow_chars.push(NonNarrowChar::ZeroWidth(pos));
}
}
} else if byte >= 127 { } else if byte >= 127 {
// The slow path: // The slow path:
// This is either ASCII control character "DEL" or the beginning of // This is either ASCII control character "DEL" or the beginning of
@ -252,14 +232,6 @@ fn analyze_source_file_generic(
let mbc = MultiByteChar { pos, bytes: char_len as u8 }; let mbc = MultiByteChar { pos, bytes: char_len as u8 };
multi_byte_chars.push(mbc); multi_byte_chars.push(mbc);
} }
// Assume control characters are zero width.
// FIXME: How can we decide between `width` and `width_cjk`?
let char_width = UnicodeWidthChar::width(c).unwrap_or(0);
if char_width != 1 {
non_narrow_chars.push(NonNarrowChar::new(pos, char_width));
}
} }
i += char_len; i += char_len;

View file

@ -4,11 +4,10 @@ macro_rules! test {
(case: $test_name:ident, (case: $test_name:ident,
text: $text:expr, text: $text:expr,
lines: $lines:expr, lines: $lines:expr,
multi_byte_chars: $multi_byte_chars:expr, multi_byte_chars: $multi_byte_chars:expr,) => {
non_narrow_chars: $non_narrow_chars:expr,) => {
#[test] #[test]
fn $test_name() { fn $test_name() {
let (lines, multi_byte_chars, non_narrow_chars) = analyze_source_file($text); let (lines, multi_byte_chars) = analyze_source_file($text);
let expected_lines: Vec<RelativeBytePos> = let expected_lines: Vec<RelativeBytePos> =
$lines.into_iter().map(RelativeBytePos).collect(); $lines.into_iter().map(RelativeBytePos).collect();
@ -21,13 +20,6 @@ macro_rules! test {
.collect(); .collect();
assert_eq!(multi_byte_chars, expected_mbcs); assert_eq!(multi_byte_chars, expected_mbcs);
let expected_nncs: Vec<NonNarrowChar> = $non_narrow_chars
.into_iter()
.map(|(pos, width)| NonNarrowChar::new(RelativeBytePos(pos), width))
.collect();
assert_eq!(non_narrow_chars, expected_nncs);
} }
}; };
} }
@ -37,7 +29,6 @@ test!(
text: "", text: "",
lines: vec![], lines: vec![],
multi_byte_chars: vec![], multi_byte_chars: vec![],
non_narrow_chars: vec![],
); );
test!( test!(
@ -45,7 +36,6 @@ test!(
text: "a\nc", text: "a\nc",
lines: vec![0, 2], lines: vec![0, 2],
multi_byte_chars: vec![], multi_byte_chars: vec![],
non_narrow_chars: vec![],
); );
test!( test!(
@ -53,7 +43,6 @@ test!(
text: "012345678\nabcdef012345678\na", text: "012345678\nabcdef012345678\na",
lines: vec![0, 10, 26], lines: vec![0, 10, 26],
multi_byte_chars: vec![], multi_byte_chars: vec![],
non_narrow_chars: vec![],
); );
test!( test!(
@ -61,7 +50,6 @@ test!(
text: "01234β789\nbcdef0123456789abcdef", text: "01234β789\nbcdef0123456789abcdef",
lines: vec![0, 11], lines: vec![0, 11],
multi_byte_chars: vec![(5, 2)], multi_byte_chars: vec![(5, 2)],
non_narrow_chars: vec![],
); );
test!( test!(
@ -69,7 +57,6 @@ test!(
text: "01234\u{07}6789\nbcdef0123456789abcdef", text: "01234\u{07}6789\nbcdef0123456789abcdef",
lines: vec![0, 11], lines: vec![0, 11],
multi_byte_chars: vec![], multi_byte_chars: vec![],
non_narrow_chars: vec![(5, 0)],
); );
test!( test!(
@ -77,7 +64,6 @@ test!(
text: "aβc", text: "aβc",
lines: vec![0], lines: vec![0],
multi_byte_chars: vec![(1, 2)], multi_byte_chars: vec![(1, 2)],
non_narrow_chars: vec![],
); );
test!( test!(
@ -85,7 +71,6 @@ test!(
text: "0123456789abcΔf012345β", text: "0123456789abcΔf012345β",
lines: vec![0], lines: vec![0],
multi_byte_chars: vec![(13, 2), (22, 2)], multi_byte_chars: vec![(13, 2), (22, 2)],
non_narrow_chars: vec![],
); );
test!( test!(
@ -93,7 +78,6 @@ test!(
text: "0123456789abcdeΔ123456789abcdef01234", text: "0123456789abcdeΔ123456789abcdef01234",
lines: vec![0], lines: vec![0],
multi_byte_chars: vec![(15, 2)], multi_byte_chars: vec![(15, 2)],
non_narrow_chars: vec![],
); );
test!( test!(
@ -101,7 +85,6 @@ test!(
text: "0123456789abcdeΔ....", text: "0123456789abcdeΔ....",
lines: vec![0], lines: vec![0],
multi_byte_chars: vec![(15, 2)], multi_byte_chars: vec![(15, 2)],
non_narrow_chars: vec![],
); );
test!( test!(
@ -109,7 +92,6 @@ test!(
text: "0\t2", text: "0\t2",
lines: vec![0], lines: vec![0],
multi_byte_chars: vec![], multi_byte_chars: vec![],
non_narrow_chars: vec![(1, 4)],
); );
test!( test!(
@ -117,7 +99,6 @@ test!(
text: "01\t3456789abcdef01234567\u{07}9", text: "01\t3456789abcdef01234567\u{07}9",
lines: vec![0], lines: vec![0],
multi_byte_chars: vec![], multi_byte_chars: vec![],
non_narrow_chars: vec![(2, 4), (24, 0)],
); );
test!( test!(
@ -125,5 +106,4 @@ test!(
text: "01\t345\n789abcΔf01234567\u{07}9\nbcΔf", text: "01\t345\n789abcΔf01234567\u{07}9\nbcΔf",
lines: vec![0, 7, 27], lines: vec![0, 7, 27],
multi_byte_chars: vec![(13, 2), (29, 2)], multi_byte_chars: vec![(13, 2), (29, 2)],
non_narrow_chars: vec![(2, 4), (24, 0)],
); );

View file

@ -1345,68 +1345,6 @@ pub struct MultiByteChar {
pub bytes: u8, pub bytes: u8,
} }
/// Identifies an offset of a non-narrow character in a `SourceFile`.
#[derive(Copy, Clone, Encodable, Decodable, Eq, PartialEq, Debug, HashStable_Generic)]
pub enum NonNarrowChar {
/// Represents a zero-width character.
ZeroWidth(RelativeBytePos),
/// Represents a wide (full-width) character.
Wide(RelativeBytePos),
/// Represents a tab character, represented visually with a width of 4 characters.
Tab(RelativeBytePos),
}
impl NonNarrowChar {
fn new(pos: RelativeBytePos, width: usize) -> Self {
match width {
0 => NonNarrowChar::ZeroWidth(pos),
2 => NonNarrowChar::Wide(pos),
4 => NonNarrowChar::Tab(pos),
_ => panic!("width {width} given for non-narrow character"),
}
}
/// Returns the relative offset of the character in the `SourceFile`.
pub fn pos(&self) -> RelativeBytePos {
match *self {
NonNarrowChar::ZeroWidth(p) | NonNarrowChar::Wide(p) | NonNarrowChar::Tab(p) => p,
}
}
/// Returns the width of the character, 0 (zero-width) or 2 (wide).
pub fn width(&self) -> usize {
match *self {
NonNarrowChar::ZeroWidth(_) => 0,
NonNarrowChar::Wide(_) => 2,
NonNarrowChar::Tab(_) => 4,
}
}
}
impl Add<RelativeBytePos> for NonNarrowChar {
type Output = Self;
fn add(self, rhs: RelativeBytePos) -> Self {
match self {
NonNarrowChar::ZeroWidth(pos) => NonNarrowChar::ZeroWidth(pos + rhs),
NonNarrowChar::Wide(pos) => NonNarrowChar::Wide(pos + rhs),
NonNarrowChar::Tab(pos) => NonNarrowChar::Tab(pos + rhs),
}
}
}
impl Sub<RelativeBytePos> for NonNarrowChar {
type Output = Self;
fn sub(self, rhs: RelativeBytePos) -> Self {
match self {
NonNarrowChar::ZeroWidth(pos) => NonNarrowChar::ZeroWidth(pos - rhs),
NonNarrowChar::Wide(pos) => NonNarrowChar::Wide(pos - rhs),
NonNarrowChar::Tab(pos) => NonNarrowChar::Tab(pos - rhs),
}
}
}
/// Identifies an offset of a character that was normalized away from `SourceFile`. /// Identifies an offset of a character that was normalized away from `SourceFile`.
#[derive(Copy, Clone, Encodable, Decodable, Eq, PartialEq, Debug, HashStable_Generic)] #[derive(Copy, Clone, Encodable, Decodable, Eq, PartialEq, Debug, HashStable_Generic)]
pub struct NormalizedPos { pub struct NormalizedPos {
@ -1581,8 +1519,6 @@ pub struct SourceFile {
pub lines: FreezeLock<SourceFileLines>, pub lines: FreezeLock<SourceFileLines>,
/// Locations of multi-byte characters in the source code. /// Locations of multi-byte characters in the source code.
pub multibyte_chars: Vec<MultiByteChar>, pub multibyte_chars: Vec<MultiByteChar>,
/// Width of characters that are not narrow in the source code.
pub non_narrow_chars: Vec<NonNarrowChar>,
/// Locations of characters removed during normalization. /// Locations of characters removed during normalization.
pub normalized_pos: Vec<NormalizedPos>, pub normalized_pos: Vec<NormalizedPos>,
/// A hash of the filename & crate-id, used for uniquely identifying source /// A hash of the filename & crate-id, used for uniquely identifying source
@ -1604,7 +1540,6 @@ impl Clone for SourceFile {
source_len: self.source_len, source_len: self.source_len,
lines: self.lines.clone(), lines: self.lines.clone(),
multibyte_chars: self.multibyte_chars.clone(), multibyte_chars: self.multibyte_chars.clone(),
non_narrow_chars: self.non_narrow_chars.clone(),
normalized_pos: self.normalized_pos.clone(), normalized_pos: self.normalized_pos.clone(),
stable_id: self.stable_id, stable_id: self.stable_id,
cnum: self.cnum, cnum: self.cnum,
@ -1679,7 +1614,6 @@ impl<S: SpanEncoder> Encodable<S> for SourceFile {
} }
self.multibyte_chars.encode(s); self.multibyte_chars.encode(s);
self.non_narrow_chars.encode(s);
self.stable_id.encode(s); self.stable_id.encode(s);
self.normalized_pos.encode(s); self.normalized_pos.encode(s);
self.cnum.encode(s); self.cnum.encode(s);
@ -1706,7 +1640,6 @@ impl<D: SpanDecoder> Decodable<D> for SourceFile {
} }
}; };
let multibyte_chars: Vec<MultiByteChar> = Decodable::decode(d); let multibyte_chars: Vec<MultiByteChar> = Decodable::decode(d);
let non_narrow_chars: Vec<NonNarrowChar> = Decodable::decode(d);
let stable_id = Decodable::decode(d); let stable_id = Decodable::decode(d);
let normalized_pos: Vec<NormalizedPos> = Decodable::decode(d); let normalized_pos: Vec<NormalizedPos> = Decodable::decode(d);
let cnum: CrateNum = Decodable::decode(d); let cnum: CrateNum = Decodable::decode(d);
@ -1721,7 +1654,6 @@ impl<D: SpanDecoder> Decodable<D> for SourceFile {
external_src: FreezeLock::frozen(ExternalSource::Unneeded), external_src: FreezeLock::frozen(ExternalSource::Unneeded),
lines: FreezeLock::new(lines), lines: FreezeLock::new(lines),
multibyte_chars, multibyte_chars,
non_narrow_chars,
normalized_pos, normalized_pos,
stable_id, stable_id,
cnum, cnum,
@ -1809,8 +1741,7 @@ impl SourceFile {
let source_len = src.len(); let source_len = src.len();
let source_len = u32::try_from(source_len).map_err(|_| OffsetOverflowError)?; let source_len = u32::try_from(source_len).map_err(|_| OffsetOverflowError)?;
let (lines, multibyte_chars, non_narrow_chars) = let (lines, multibyte_chars) = analyze_source_file::analyze_source_file(&src);
analyze_source_file::analyze_source_file(&src);
Ok(SourceFile { Ok(SourceFile {
name, name,
@ -1821,7 +1752,6 @@ impl SourceFile {
source_len: RelativeBytePos::from_u32(source_len), source_len: RelativeBytePos::from_u32(source_len),
lines: FreezeLock::frozen(SourceFileLines::Lines(lines)), lines: FreezeLock::frozen(SourceFileLines::Lines(lines)),
multibyte_chars, multibyte_chars,
non_narrow_chars,
normalized_pos, normalized_pos,
stable_id, stable_id,
cnum: LOCAL_CRATE, cnum: LOCAL_CRATE,
@ -2130,41 +2060,45 @@ impl SourceFile {
let pos = self.relative_position(pos); let pos = self.relative_position(pos);
let (line, col_or_chpos) = self.lookup_file_pos(pos); let (line, col_or_chpos) = self.lookup_file_pos(pos);
if line > 0 { if line > 0 {
let col = col_or_chpos; let Some(code) = self.get_line(line - 1) else {
let linebpos = self.lines()[line - 1]; // If we don't have the code available, it is ok as a fallback to return the bytepos
let col_display = { // instead of the "display" column, which is only used to properly show underlines
let start_width_idx = self // in the terminal.
.non_narrow_chars // FIXME: we'll want better handling of this in the future for the sake of tools
.binary_search_by_key(&linebpos, |x| x.pos()) // that want to use the display col instead of byte offsets to modify Rust code, but
.unwrap_or_else(|x| x); // that is a problem for another day, the previous code was already incorrect for
let end_width_idx = self // both displaying *and* third party tools using the json output naïvely.
.non_narrow_chars tracing::info!("couldn't find line {line} {:?}", self.name);
.binary_search_by_key(&pos, |x| x.pos()) return (line, col_or_chpos, col_or_chpos.0);
.unwrap_or_else(|x| x);
let special_chars = end_width_idx - start_width_idx;
let non_narrow: usize = self.non_narrow_chars[start_width_idx..end_width_idx]
.iter()
.map(|x| x.width())
.sum();
col.0 - special_chars + non_narrow
}; };
(line, col, col_display) let display_col = code.chars().take(col_or_chpos.0).map(|ch| char_width(ch)).sum();
(line, col_or_chpos, display_col)
} else { } else {
let chpos = col_or_chpos; // This is never meant to happen?
let col_display = { (0, col_or_chpos, col_or_chpos.0)
let end_width_idx = self
.non_narrow_chars
.binary_search_by_key(&pos, |x| x.pos())
.unwrap_or_else(|x| x);
let non_narrow: usize =
self.non_narrow_chars[0..end_width_idx].iter().map(|x| x.width()).sum();
chpos.0 - end_width_idx + non_narrow
};
(0, chpos, col_display)
} }
} }
} }
pub fn char_width(ch: char) -> usize {
// FIXME: `unicode_width` sometimes disagrees with terminals on how wide a `char` is. For now,
// just accept that sometimes the code line will be longer than desired.
match ch {
'\t' => 4,
// Keep the following list in sync with `rustc_errors::emitter::OUTPUT_REPLACEMENTS`. These
// are control points that we replace before printing with a visible codepoint for the sake
// of being able to point at them with underlines.
'\u{0000}' | '\u{0001}' | '\u{0002}' | '\u{0003}' | '\u{0004}' | '\u{0005}'
| '\u{0006}' | '\u{0007}' | '\u{0008}' | '\u{000B}' | '\u{000C}' | '\u{000D}'
| '\u{000E}' | '\u{000F}' | '\u{0010}' | '\u{0011}' | '\u{0012}' | '\u{0013}'
| '\u{0014}' | '\u{0015}' | '\u{0016}' | '\u{0017}' | '\u{0018}' | '\u{0019}'
| '\u{001A}' | '\u{001B}' | '\u{001C}' | '\u{001D}' | '\u{001E}' | '\u{001F}'
| '\u{007F}' | '\u{202A}' | '\u{202B}' | '\u{202D}' | '\u{202E}' | '\u{2066}'
| '\u{2067}' | '\u{2068}' | '\u{202C}' | '\u{2069}' => 1,
_ => unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1),
}
}
/// Normalizes the source code and records the normalizations. /// Normalizes the source code and records the normalizations.
fn normalize_src(src: &mut String) -> Vec<NormalizedPos> { fn normalize_src(src: &mut String) -> Vec<NormalizedPos> {
let mut normalized_pos = vec![]; let mut normalized_pos = vec![];

View file

@ -330,7 +330,6 @@ impl SourceMap {
cnum: CrateNum, cnum: CrateNum,
file_local_lines: FreezeLock<SourceFileLines>, file_local_lines: FreezeLock<SourceFileLines>,
multibyte_chars: Vec<MultiByteChar>, multibyte_chars: Vec<MultiByteChar>,
non_narrow_chars: Vec<NonNarrowChar>,
normalized_pos: Vec<NormalizedPos>, normalized_pos: Vec<NormalizedPos>,
metadata_index: u32, metadata_index: u32,
) -> Lrc<SourceFile> { ) -> Lrc<SourceFile> {
@ -348,7 +347,6 @@ impl SourceMap {
source_len, source_len,
lines: file_local_lines, lines: file_local_lines,
multibyte_chars, multibyte_chars,
non_narrow_chars,
normalized_pos, normalized_pos,
stable_id, stable_id,
cnum, cnum,

View file

@ -232,7 +232,6 @@ fn t10() {
source_len, source_len,
lines, lines,
multibyte_chars, multibyte_chars,
non_narrow_chars,
normalized_pos, normalized_pos,
stable_id, stable_id,
.. ..
@ -246,7 +245,6 @@ fn t10() {
CrateNum::ZERO, CrateNum::ZERO,
FreezeLock::new(lines.read().clone()), FreezeLock::new(lines.read().clone()),
multibyte_chars, multibyte_chars,
non_narrow_chars,
normalized_pos, normalized_pos,
0, 0,
); );

View file

@ -1202,6 +1202,12 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
false false
} }
} }
} else if tcx.trait_is_auto(trait_ref.def_id) {
tcx.dcx().span_delayed_bug(
tcx.def_span(obligation.predicate.def_id),
"associated types not allowed on auto traits",
);
false
} else { } else {
bug!("unexpected builtin trait with associated type: {trait_ref:?}") bug!("unexpected builtin trait with associated type: {trait_ref:?}")
} }

View file

@ -1,10 +1,13 @@
use std::path::PathBuf; use std::path::PathBuf;
use crate::artifact_names::static_lib_name; use super::cygpath::get_windows_path;
use crate::artifact_names::{dynamic_lib_name, static_lib_name};
use crate::external_deps::cc::cc; use crate::external_deps::cc::cc;
use crate::external_deps::llvm::llvm_ar; use crate::external_deps::llvm::llvm_ar;
use crate::path_helpers::path; use crate::path_helpers::path;
use crate::targets::is_msvc; use crate::targets::{is_darwin, is_msvc, is_windows};
// FIXME(Oneirical): These native build functions should take a Path-based generic.
/// Builds a static lib (`.lib` on Windows MSVC and `.a` for the rest) with the given name. /// Builds a static lib (`.lib` on Windows MSVC and `.a` for the rest) with the given name.
#[track_caller] #[track_caller]
@ -25,3 +28,33 @@ pub fn build_native_static_lib(lib_name: &str) -> PathBuf {
llvm_ar().obj_to_ar().output_input(&lib_path, &obj_file).run(); llvm_ar().obj_to_ar().output_input(&lib_path, &obj_file).run();
path(lib_path) path(lib_path)
} }
/// Builds a dynamic lib. The filename is computed in a target-dependent manner, relying on
/// [`std::env::consts::DLL_PREFIX`] and [`std::env::consts::DLL_EXTENSION`].
#[track_caller]
pub fn build_native_dynamic_lib(lib_name: &str) -> PathBuf {
let obj_file = if is_msvc() { format!("{lib_name}") } else { format!("{lib_name}.o") };
let src = format!("{lib_name}.c");
let lib_path = dynamic_lib_name(lib_name);
if is_msvc() {
cc().arg("-c").out_exe(&obj_file).input(src).run();
} else {
cc().arg("-v").arg("-c").out_exe(&obj_file).input(src).run();
};
let obj_file = if is_msvc() { format!("{lib_name}.obj") } else { format!("{lib_name}.o") };
if is_msvc() {
let mut out_arg = "-out:".to_owned();
out_arg.push_str(&get_windows_path(&lib_path));
cc().input(&obj_file).args(&["-link", "-dll", &out_arg]).run();
} else if is_darwin() {
cc().out_exe(&lib_path).input(&obj_file).args(&["-dynamiclib", "-Wl,-dylib"]).run();
} else if is_windows() {
cc().out_exe(&lib_path)
.input(&obj_file)
.args(&["-shared", &format!("-Wl,--out-implib={lib_path}.a")])
.run();
} else {
cc().out_exe(&lib_path).input(&obj_file).arg("-shared").run();
}
path(lib_path)
}

View file

@ -1,5 +1,5 @@
use std::io; use std::io;
use std::path::Path; use std::path::{Path, PathBuf};
// FIXME(jieyouxu): modify create_symlink to panic on windows. // FIXME(jieyouxu): modify create_symlink to panic on windows.
@ -176,3 +176,16 @@ pub fn set_permissions<P: AsRef<Path>>(path: P, perm: std::fs::Permissions) {
path.as_ref().display() path.as_ref().display()
)); ));
} }
/// A function which prints all file names in the directory `dir` similarly to Unix's `ls`.
/// Useful for debugging.
/// Usage: `eprintln!("{:#?}", shallow_find_dir_entries(some_dir));`
#[track_caller]
pub fn shallow_find_dir_entries<P: AsRef<Path>>(dir: P) -> Vec<PathBuf> {
let paths = read_dir(dir);
let mut output = Vec::new();
for path in paths {
output.push(path.unwrap().path());
}
output
}

View file

@ -43,7 +43,7 @@ pub use wasmparser;
pub use external_deps::{c_build, cc, clang, htmldocck, llvm, python, rustc, rustdoc}; pub use external_deps::{c_build, cc, clang, htmldocck, llvm, python, rustc, rustdoc};
// These rely on external dependencies. // These rely on external dependencies.
pub use c_build::build_native_static_lib; pub use c_build::{build_native_dynamic_lib, build_native_static_lib};
pub use cc::{cc, extra_c_flags, extra_cxx_flags, Cc}; pub use cc::{cc, extra_c_flags, extra_cxx_flags, Cc};
pub use clang::{clang, Clang}; pub use clang::{clang, Clang};
pub use htmldocck::htmldocck; pub use htmldocck::htmldocck;

View file

@ -146,8 +146,6 @@ trait T: ~ const Super {}
const fn not_quite_const<S: ~ const T>() -> i32 { <S as T>::CONST } const fn not_quite_const<S: ~ const T>() -> i32 { <S as T>::CONST }
struct S<T:~ const ? Sized>(std::marker::PhantomData<T>);
impl ~ const T {} impl ~ const T {}
fn apit(_: impl ~ const T) {} fn apit(_: impl ~ const T) {}

View file

@ -3,9 +3,3 @@ where
i32: !Copy, i32: !Copy,
{ {
} }
fn maybe_const_negative()
where
i32: ~const !Copy,
{
}

View file

@ -153,8 +153,6 @@ const fn not_quite_const<S: ~const T>() -> i32 {
<S as T>::CONST <S as T>::CONST
} }
struct S<T: ~const ?Sized>(std::marker::PhantomData<T>);
impl ~const T {} impl ~const T {}
fn apit(_: impl ~const T) {} fn apit(_: impl ~const T) {}

View file

@ -1,6 +1,4 @@
run-make/branch-protection-check-IBT/Makefile run-make/branch-protection-check-IBT/Makefile
run-make/c-dynamic-dylib/Makefile
run-make/c-dynamic-rlib/Makefile
run-make/c-unwind-abi-catch-lib-panic/Makefile run-make/c-unwind-abi-catch-lib-panic/Makefile
run-make/cat-and-grep-sanity-check/Makefile run-make/cat-and-grep-sanity-check/Makefile
run-make/cdylib-dylib-linkage/Makefile run-make/cdylib-dylib-linkage/Makefile
@ -51,7 +49,6 @@ run-make/panic-abort-eh_frame/Makefile
run-make/pdb-buildinfo-cl-cmd/Makefile run-make/pdb-buildinfo-cl-cmd/Makefile
run-make/pgo-gen-lto/Makefile run-make/pgo-gen-lto/Makefile
run-make/pgo-indirect-call-promotion/Makefile run-make/pgo-indirect-call-promotion/Makefile
run-make/pointer-auth-link-with-c/Makefile
run-make/print-calling-conventions/Makefile run-make/print-calling-conventions/Makefile
run-make/print-target-list/Makefile run-make/print-target-list/Makefile
run-make/raw-dylib-alt-calling-convention/Makefile run-make/raw-dylib-alt-calling-convention/Makefile

View file

@ -16,7 +16,7 @@ use std::path::{Path, PathBuf};
const ENTRY_LIMIT: u32 = 901; const ENTRY_LIMIT: u32 = 901;
// FIXME: The following limits should be reduced eventually. // FIXME: The following limits should be reduced eventually.
const ISSUES_ENTRY_LIMIT: u32 = 1672; const ISSUES_ENTRY_LIMIT: u32 = 1673;
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files "rs", // test source files

View file

@ -1,14 +0,0 @@
//@ known-bug: #117829
#![feature(auto_traits)]
trait B {}
auto trait Z<T>
where
T: Z<u16>,
<T as Z<u16>>::W: B,
{
type W;
}
fn main() {}

View file

@ -1,9 +0,0 @@
//@ known-bug: #117829
auto trait Z<'a, T: ?Sized>
where
T: Z<'a, u16>,
for<'b> <T as Z<'b, u16>>::W: Clone,
{
type W: ?Sized;
}

View file

@ -1,16 +0,0 @@
# This test checks that dynamic Rust linking with C does not encounter any errors, with dynamic dependencies given preference over static.
# See https://github.com/rust-lang/rust/issues/10434
# ignore-cross-compile
include ../tools.mk
# ignore-apple
#
# This hits an assertion in the linker on older versions of osx apparently
all: $(call DYLIB,cfoo)
$(RUSTC) foo.rs -C prefer-dynamic
$(RUSTC) bar.rs
$(call RUN,bar)
$(call REMOVE_DYLIBS,cfoo)
$(call FAIL,bar)

View file

@ -0,0 +1,17 @@
// This test checks that dynamic Rust linking with C does not encounter any errors in both
// compilation and execution, with dynamic dependencies given preference over static.
// See https://github.com/rust-lang/rust/issues/10434
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{build_native_dynamic_lib, dynamic_lib_name, rfs, run, run_fail, rustc};
fn main() {
build_native_dynamic_lib("cfoo");
rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
rustc().input("bar.rs").run();
run("bar");
rfs::remove_file(dynamic_lib_name("cfoo"));
run_fail("bar");
}

View file

@ -1,19 +0,0 @@
# This test checks that dynamic Rust linking with C does not encounter any errors, with static dependencies given preference over dynamic. (This is the default behaviour.)
# See https://github.com/rust-lang/rust/issues/10434
# ignore-cross-compile
include ../tools.mk
# ignore-apple
#
# This hits an assertion in the linker on older versions of osx apparently
# This overrides the LD_LIBRARY_PATH for RUN
TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR)
all: $(call DYLIB,cfoo)
$(RUSTC) foo.rs
$(RUSTC) bar.rs
$(call RUN,bar)
$(call REMOVE_DYLIBS,cfoo)
$(call FAIL,bar)

View file

@ -0,0 +1,18 @@
// This test checks that dynamic Rust linking with C does not encounter any errors in both
// compilation and execution, with static dependencies given preference over dynamic.
// (This is the default behaviour.)
// See https://github.com/rust-lang/rust/issues/10434
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{build_native_dynamic_lib, dynamic_lib_name, rfs, run, run_fail, rustc};
fn main() {
build_native_dynamic_lib("cfoo");
rustc().input("foo.rs").run();
rustc().input("bar.rs").run();
run("bar");
rfs::remove_file(dynamic_lib_name("cfoo"));
run_fail("bar");
}

View file

@ -1,15 +0,0 @@
include ../tools.mk
# only-aarch64
# ignore-cross-compile
all:
$(COMPILE_OBJ) $(TMPDIR)/test.o test.c
$(AR) rcs $(TMPDIR)/libtest.a $(TMPDIR)/test.o
$(RUSTC) --target $(TARGET) -Z branch-protection=bti,pac-ret,leaf test.rs
$(call RUN,test)
$(COMPILE_OBJ) $(TMPDIR)/test.o test.c -mbranch-protection=bti+pac-ret+leaf
$(AR) rcs $(TMPDIR)/libtest.a $(TMPDIR)/test.o
$(RUSTC) --target $(TARGET) -Z branch-protection=bti,pac-ret,leaf test.rs
$(call RUN,test)

View file

@ -0,0 +1,28 @@
// `-Z branch protection` is an unstable compiler feature which adds pointer-authentication
// code (PAC), a useful hashing measure for verifying that pointers have not been modified.
// This test checks that compilation and execution is successful when this feature is activated,
// with some of its possible extra arguments (bti, pac-ret, leaf).
// See https://github.com/rust-lang/rust/pull/88354
//@ only-aarch64
// Reason: branch protection is not supported on other architectures
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{build_native_static_lib, cc, is_msvc, llvm_ar, run, rustc};
fn main() {
build_native_static_lib("test");
rustc().arg("-Zbranch-protection=bti,pac-ret,leaf").input("test.rs").run();
run("test");
cc().arg("-v")
.arg("-c")
.out_exe("test")
.input("test.c")
.arg("-mbranch-protection=bti+pac-ret+leaf")
.run();
let obj_file = if is_msvc() { "test.obj" } else { "test" };
llvm_ar().obj_to_ar().output_input("libtest.a", &obj_file).run();
rustc().arg("-Zbranch-protection=bti,pac-ret,leaf").input("test.rs").run();
run("test");
}

View file

@ -2,7 +2,7 @@ error[E0765]: unterminated double quote string
--> $DIR/test-compile-fail3.rs:3:1 --> $DIR/test-compile-fail3.rs:3:1
| |
3 | "fail 3 | "fail
| ^^^^^^ | ^^^^^
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `inner`
--> $DIR/ice-unresolved-import-100241.rs:9:13 --> $DIR/ice-unresolved-import-100241.rs:9:13
| |
LL | pub use inner::S; LL | pub use inner::S;
| ^^^^^ maybe a missing crate `inner`? | ^^^^^ you might be missing crate `inner`
| |
= help: consider adding `extern crate inner` to use the `inner` crate = help: consider adding `extern crate inner` to use the `inner` crate

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: maybe a missing crate `unresolved_crate`? error[E0433]: failed to resolve: you might be missing crate `unresolved_crate`
--> $DIR/unresolved-import-recovery.rs:3:5 --> $DIR/unresolved-import-recovery.rs:3:5
| |
LL | use unresolved_crate::module::Name; LL | use unresolved_crate::module::Name;
| ^^^^^^^^^^^^^^^^ maybe a missing crate `unresolved_crate`? | ^^^^^^^^^^^^^^^^ you might be missing crate `unresolved_crate`
| |
= help: consider adding `extern crate unresolved_crate` to use the `unresolved_crate` crate = help: consider adding `extern crate unresolved_crate` to use the `unresolved_crate` crate

View file

@ -1,4 +1,4 @@
// This previously triggered an ICE. // This previously triggered an ICE.
pub(in crate::r#mod) fn main() {} pub(in crate::r#mod) fn main() {}
//~^ ERROR failed to resolve: maybe a missing crate `r#mod` //~^ ERROR failed to resolve: you might be missing crate `r#mod`

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: maybe a missing crate `r#mod`? error[E0433]: failed to resolve: you might be missing crate `r#mod`
--> $DIR/issue-61732.rs:3:15 --> $DIR/issue-61732.rs:3:15
| |
LL | pub(in crate::r#mod) fn main() {} LL | pub(in crate::r#mod) fn main() {}
| ^^^^^ maybe a missing crate `r#mod`? | ^^^^^ you might be missing crate `r#mod`
| |
= help: consider adding `extern crate r#mod` to use the `r#mod` crate = help: consider adding `extern crate r#mod` to use the `r#mod` crate

View file

@ -56,7 +56,7 @@ enum DiagnosticOnEnum {
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(no_crate_example, code = E0123)] #[diag(no_crate_example, code = E0123)]
#[diag = "E0123"] #[diag = "E0123"]
//~^ ERROR failed to resolve: maybe a missing crate `core` //~^ ERROR failed to resolve: you might be missing crate `core`
struct WrongStructAttrStyle {} struct WrongStructAttrStyle {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
@ -801,7 +801,7 @@ struct SuggestionsNoItem {
struct SuggestionsInvalidItem { struct SuggestionsInvalidItem {
#[suggestion(code(foo))] #[suggestion(code(foo))]
//~^ ERROR `code(...)` must contain only string literals //~^ ERROR `code(...)` must contain only string literals
//~| ERROR failed to resolve: maybe a missing crate `core` //~| ERROR failed to resolve: you might be missing crate `core`
sub: Span, sub: Span,
} }
@ -809,7 +809,7 @@ struct SuggestionsInvalidItem {
#[diag(no_crate_example)] #[diag(no_crate_example)]
struct SuggestionsInvalidLiteral { struct SuggestionsInvalidLiteral {
#[suggestion(code = 3)] #[suggestion(code = 3)]
//~^ ERROR failed to resolve: maybe a missing crate `core` //~^ ERROR failed to resolve: you might be missing crate `core`
sub: Span, sub: Span,
} }

View file

@ -524,23 +524,23 @@ LL | #[suggestion(no_crate_suggestion, code = "")]
= help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]` = help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]`
= help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]` = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/diagnostic-derive.rs:58:8 --> $DIR/diagnostic-derive.rs:58:8
| |
LL | #[diag = "E0123"] LL | #[diag = "E0123"]
| ^ maybe a missing crate `core`? | ^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/diagnostic-derive.rs:802:23 --> $DIR/diagnostic-derive.rs:802:23
| |
LL | #[suggestion(code(foo))] LL | #[suggestion(code(foo))]
| ^^^ maybe a missing crate `core`? | ^^^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/diagnostic-derive.rs:811:25 --> $DIR/diagnostic-derive.rs:811:25
| |
LL | #[suggestion(code = 3)] LL | #[suggestion(code = 3)]
| ^ maybe a missing crate `core`? | ^ you might be missing crate `core`
error: cannot find attribute `nonsense` in this scope error: cannot find attribute `nonsense` in this scope
--> $DIR/diagnostic-derive.rs:63:3 --> $DIR/diagnostic-derive.rs:63:3

View file

@ -94,8 +94,8 @@ struct G {
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
#[label("...")] #[label("...")]
//~^ ERROR failed to resolve: maybe a missing crate `core`? //~^ ERROR failed to resolve: you might be missing crate `core`
//~| NOTE maybe a missing crate `core`? //~| NOTE you might be missing crate `core`
struct H { struct H {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -310,8 +310,8 @@ struct AB {
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
union AC { union AC {
//~^ ERROR failed to resolve: maybe a missing crate `core`? //~^ ERROR failed to resolve: you might be missing crate `core`
//~| NOTE maybe a missing crate `core`? //~| NOTE you might be missing crate `core`
span: u32, span: u32,
b: u64, b: u64,
} }
@ -581,8 +581,8 @@ struct BD {
span2: Span, span2: Span,
#[suggestion_part(foo = "bar")] #[suggestion_part(foo = "bar")]
//~^ ERROR `code` is the only valid nested attribute //~^ ERROR `code` is the only valid nested attribute
//~| ERROR failed to resolve: maybe a missing crate `core`? //~| ERROR failed to resolve: you might be missing crate `core`
//~| NOTE maybe a missing crate `core`? //~| NOTE you might be missing crate `core`
span4: Span, span4: Span,
#[suggestion_part(code = "...")] #[suggestion_part(code = "...")]
//~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` //~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@ -674,8 +674,8 @@ enum BL {
struct BM { struct BM {
#[suggestion_part(code("foo"))] #[suggestion_part(code("foo"))]
//~^ ERROR expected exactly one string literal for `code = ...` //~^ ERROR expected exactly one string literal for `code = ...`
//~| ERROR failed to resolve: maybe a missing crate `core`? //~| ERROR failed to resolve: you might be missing crate `core`
//~| NOTE maybe a missing crate `core`? //~| NOTE you might be missing crate `core`
span: Span, span: Span,
r#type: String, r#type: String,
} }
@ -685,8 +685,8 @@ struct BM {
struct BN { struct BN {
#[suggestion_part(code("foo", "bar"))] #[suggestion_part(code("foo", "bar"))]
//~^ ERROR expected exactly one string literal for `code = ...` //~^ ERROR expected exactly one string literal for `code = ...`
//~| ERROR failed to resolve: maybe a missing crate `core`? //~| ERROR failed to resolve: you might be missing crate `core`
//~| NOTE maybe a missing crate `core`? //~| NOTE you might be missing crate `core`
span: Span, span: Span,
r#type: String, r#type: String,
} }
@ -696,8 +696,8 @@ struct BN {
struct BO { struct BO {
#[suggestion_part(code(3))] #[suggestion_part(code(3))]
//~^ ERROR expected exactly one string literal for `code = ...` //~^ ERROR expected exactly one string literal for `code = ...`
//~| ERROR failed to resolve: maybe a missing crate `core`? //~| ERROR failed to resolve: you might be missing crate `core`
//~| NOTE maybe a missing crate `core`? //~| NOTE you might be missing crate `core`
span: Span, span: Span,
r#type: String, r#type: String,
} }
@ -718,8 +718,8 @@ struct BP {
#[multipart_suggestion(no_crate_example)] #[multipart_suggestion(no_crate_example)]
struct BQ { struct BQ {
#[suggestion_part(code = 3)] #[suggestion_part(code = 3)]
//~^ ERROR failed to resolve: maybe a missing crate `core`? //~^ ERROR failed to resolve: you might be missing crate `core`
//~| NOTE maybe a missing crate `core`? //~| NOTE you might be missing crate `core`
span: Span, span: Span,
r#type: String, r#type: String,
} }
@ -811,8 +811,8 @@ struct SuggestionStyleInvalid3 {
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
#[suggestion(no_crate_example, code = "", style("foo"))] #[suggestion(no_crate_example, code = "", style("foo"))]
//~^ ERROR expected `= "xxx"` //~^ ERROR expected `= "xxx"`
//~| ERROR failed to resolve: maybe a missing crate `core`? //~| ERROR failed to resolve: you might be missing crate `core`
//~| NOTE maybe a missing crate `core`? //~| NOTE you might be missing crate `core`
struct SuggestionStyleInvalid4 { struct SuggestionStyleInvalid4 {
#[primary_span] #[primary_span]
sub: Span, sub: Span,

View file

@ -451,53 +451,53 @@ error: suggestion without `#[primary_span]` field
LL | #[suggestion(no_crate_example, code = "")] LL | #[suggestion(no_crate_example, code = "")]
| ^ | ^
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/subdiagnostic-derive.rs:96:9 --> $DIR/subdiagnostic-derive.rs:96:9
| |
LL | #[label("...")] LL | #[label("...")]
| ^^^^^ maybe a missing crate `core`? | ^^^^^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/subdiagnostic-derive.rs:312:1 --> $DIR/subdiagnostic-derive.rs:312:1
| |
LL | union AC { LL | union AC {
| ^^^^^ maybe a missing crate `core`? | ^^^^^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/subdiagnostic-derive.rs:582:27 --> $DIR/subdiagnostic-derive.rs:582:27
| |
LL | #[suggestion_part(foo = "bar")] LL | #[suggestion_part(foo = "bar")]
| ^ maybe a missing crate `core`? | ^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/subdiagnostic-derive.rs:675:28 --> $DIR/subdiagnostic-derive.rs:675:28
| |
LL | #[suggestion_part(code("foo"))] LL | #[suggestion_part(code("foo"))]
| ^^^^^ maybe a missing crate `core`? | ^^^^^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/subdiagnostic-derive.rs:686:28 --> $DIR/subdiagnostic-derive.rs:686:28
| |
LL | #[suggestion_part(code("foo", "bar"))] LL | #[suggestion_part(code("foo", "bar"))]
| ^^^^^ maybe a missing crate `core`? | ^^^^^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/subdiagnostic-derive.rs:697:28 --> $DIR/subdiagnostic-derive.rs:697:28
| |
LL | #[suggestion_part(code(3))] LL | #[suggestion_part(code(3))]
| ^ maybe a missing crate `core`? | ^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/subdiagnostic-derive.rs:720:30 --> $DIR/subdiagnostic-derive.rs:720:30
| |
LL | #[suggestion_part(code = 3)] LL | #[suggestion_part(code = 3)]
| ^ maybe a missing crate `core`? | ^ you might be missing crate `core`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/subdiagnostic-derive.rs:812:48 --> $DIR/subdiagnostic-derive.rs:812:48
| |
LL | #[suggestion(no_crate_example, code = "", style("foo"))] LL | #[suggestion(no_crate_example, code = "", style("foo"))]
| ^ maybe a missing crate `core`? | ^ you might be missing crate `core`
error: cannot find attribute `foo` in this scope error: cannot find attribute `foo` in this scope
--> $DIR/subdiagnostic-derive.rs:67:3 --> $DIR/subdiagnostic-derive.rs:67:3

View file

@ -15,7 +15,7 @@ async fn f(arg: &i32) {}
async fn func<F>(f: F) async fn func<F>(f: F)
where where
F: async for<'a> Fn(&'a i32), F: for<'a> async Fn(&'a i32),
{ {
let x: i32 = 0; let x: i32 = 0;
f(&x).await; f(&x).await;

View file

@ -1,16 +1,16 @@
error[E0433]: failed to resolve: maybe a missing crate `nonexistent`? error[E0433]: failed to resolve: you might be missing crate `nonexistent`
--> $DIR/field-attributes-vis-unresolved.rs:17:12 --> $DIR/field-attributes-vis-unresolved.rs:17:12
| |
LL | pub(in nonexistent) field: u8 LL | pub(in nonexistent) field: u8
| ^^^^^^^^^^^ maybe a missing crate `nonexistent`? | ^^^^^^^^^^^ you might be missing crate `nonexistent`
| |
= help: consider adding `extern crate nonexistent` to use the `nonexistent` crate = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate
error[E0433]: failed to resolve: maybe a missing crate `nonexistent`? error[E0433]: failed to resolve: you might be missing crate `nonexistent`
--> $DIR/field-attributes-vis-unresolved.rs:22:12 --> $DIR/field-attributes-vis-unresolved.rs:22:12
| |
LL | pub(in nonexistent) u8 LL | pub(in nonexistent) u8
| ^^^^^^^^^^^ maybe a missing crate `nonexistent`? | ^^^^^^^^^^^ you might be missing crate `nonexistent`
| |
= help: consider adding `extern crate nonexistent` to use the `nonexistent` crate = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate

View file

@ -0,0 +1,40 @@
error[E0380]: auto traits cannot have associated items
--> $DIR/assoc-ty.rs:10:10
|
LL | auto trait Trait {
| ----- auto traits cannot have associated items
LL |
LL | type Output;
| -----^^^^^^- help: remove these associated items
error[E0658]: auto traits are experimental and possibly buggy
--> $DIR/assoc-ty.rs:8:1
|
LL | / auto trait Trait {
LL | |
LL | | type Output;
LL | |
LL | | }
| |_^
|
= note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
= help: add `#![feature(auto_traits)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0308]: mismatched types
--> $DIR/assoc-ty.rs:15:36
|
LL | let _: <() as Trait>::Output = ();
| --------------------- ^^ expected associated type, found `()`
| |
| expected due to this
|
= note: expected associated type `<() as Trait>::Output`
found unit type `()`
= help: consider constraining the associated type `<() as Trait>::Output` to `()` or calling a method that returns `<() as Trait>::Output`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0308, E0380, E0658.
For more information about an error, try `rustc --explain E0308`.

View file

@ -0,0 +1,40 @@
error[E0380]: auto traits cannot have associated items
--> $DIR/assoc-ty.rs:10:10
|
LL | auto trait Trait {
| ----- auto traits cannot have associated items
LL |
LL | type Output;
| -----^^^^^^- help: remove these associated items
error[E0658]: auto traits are experimental and possibly buggy
--> $DIR/assoc-ty.rs:8:1
|
LL | / auto trait Trait {
LL | |
LL | | type Output;
LL | |
LL | | }
| |_^
|
= note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
= help: add `#![feature(auto_traits)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0308]: mismatched types
--> $DIR/assoc-ty.rs:15:36
|
LL | let _: <() as Trait>::Output = ();
| --------------------- ^^ types differ
| |
| expected due to this
|
= note: expected associated type `<() as Trait>::Output`
found unit type `()`
= help: consider constraining the associated type `<() as Trait>::Output` to `()` or calling a method that returns `<() as Trait>::Output`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0308, E0380, E0658.
For more information about an error, try `rustc --explain E0308`.

View file

@ -0,0 +1,17 @@
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
// Tests that projection doesn't explode if we accidentally
// put an associated type on an auto trait.
auto trait Trait {
//~^ ERROR auto traits are experimental and possibly buggy
type Output;
//~^ ERROR auto traits cannot have associated items
}
fn main() {
let _: <() as Trait>::Output = ();
//~^ ERROR mismatched types
}

View file

@ -4,7 +4,7 @@ error[E0765]: unterminated double quote string
LL | """; LL | """;
| ___________________^ | ___________________^
LL | | } LL | | }
| |__^ | |_^
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `something`
--> $DIR/E0432.rs:1:5 --> $DIR/E0432.rs:1:5
| |
LL | use something::Foo; LL | use something::Foo;
| ^^^^^^^^^ maybe a missing crate `something`? | ^^^^^^^^^ you might be missing crate `something`
| |
= help: consider adding `extern crate something` to use the `something` crate = help: consider adding `extern crate something` to use the `something` crate

View file

@ -4,14 +4,14 @@ error[E0432]: unresolved import `core`
LL | use core::default; LL | use core::default;
| ^^^^ | ^^^^
| | | |
| maybe a missing crate `core`? | you might be missing crate `core`
| help: try using `std` instead of `core`: `std` | help: try using `std` instead of `core`: `std`
error[E0433]: failed to resolve: maybe a missing crate `core`? error[E0433]: failed to resolve: you might be missing crate `core`
--> $DIR/feature-gate-extern_absolute_paths.rs:4:19 --> $DIR/feature-gate-extern_absolute_paths.rs:4:19
| |
LL | let _: u8 = ::core::default::Default(); LL | let _: u8 = ::core::default::Default();
| ^^^^ maybe a missing crate `core`? | ^^^^ you might be missing crate `core`
| |
help: try using `std` instead of `core` help: try using `std` instead of `core`
| |

View file

@ -24,7 +24,7 @@ mod foo {
} }
use foo::*; use foo::*;
const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
fun(filter_positive()); fun(filter_positive());
} }

View file

@ -1,13 +1,13 @@
error: `~const` can only be applied to `#[const_trait]` traits error: `~const` can only be applied to `#[const_trait]` traits
--> $DIR/normalize-tait-in-const.rs:27:42 --> $DIR/normalize-tait-in-const.rs:27:42
| |
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: `~const` can only be applied to `#[const_trait]` traits error: `~const` can only be applied to `#[const_trait]` traits
--> $DIR/normalize-tait-in-const.rs:27:69 --> $DIR/normalize-tait-in-const.rs:27:69
| |
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
| ^^^^^^^^ | ^^^^^^^^
error[E0015]: cannot call non-const closure in constant functions error[E0015]: cannot call non-const closure in constant functions
@ -19,7 +19,7 @@ LL | fun(filter_positive());
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const Fn(&foo::Alias<'_>)>(fun: F) { LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct + ~const Fn(&foo::Alias<'_>)>(fun: F) {
| ++++++++++++++++++++++++++++ | ++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable help: add `#![feature(effects)]` to the crate attributes to enable
| |
@ -29,7 +29,7 @@ LL + #![feature(effects)]
error[E0493]: destructor of `F` cannot be evaluated at compile-time error[E0493]: destructor of `F` cannot be evaluated at compile-time
--> $DIR/normalize-tait-in-const.rs:27:79 --> $DIR/normalize-tait-in-const.rs:27:79
| |
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
| ^^^ the destructor for this type cannot be evaluated in constant functions | ^^^ the destructor for this type cannot be evaluated in constant functions
LL | fun(filter_positive()); LL | fun(filter_positive());
LL | } LL | }

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `spam`
--> $DIR/import-from-missing-star-2.rs:2:9 --> $DIR/import-from-missing-star-2.rs:2:9
| |
LL | use spam::*; LL | use spam::*;
| ^^^^ maybe a missing crate `spam`? | ^^^^ you might be missing crate `spam`
| |
= help: consider adding `extern crate spam` to use the `spam` crate = help: consider adding `extern crate spam` to use the `spam` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `spam`
--> $DIR/import-from-missing-star-3.rs:2:9 --> $DIR/import-from-missing-star-3.rs:2:9
| |
LL | use spam::*; LL | use spam::*;
| ^^^^ maybe a missing crate `spam`? | ^^^^ you might be missing crate `spam`
| |
= help: consider adding `extern crate spam` to use the `spam` crate = help: consider adding `extern crate spam` to use the `spam` crate
@ -10,7 +10,7 @@ error[E0432]: unresolved import `spam`
--> $DIR/import-from-missing-star-3.rs:27:13 --> $DIR/import-from-missing-star-3.rs:27:13
| |
LL | use spam::*; LL | use spam::*;
| ^^^^ maybe a missing crate `spam`? | ^^^^ you might be missing crate `spam`
| |
= help: consider adding `extern crate spam` to use the `spam` crate = help: consider adding `extern crate spam` to use the `spam` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `spam`
--> $DIR/import-from-missing-star.rs:1:5 --> $DIR/import-from-missing-star.rs:1:5
| |
LL | use spam::*; LL | use spam::*;
| ^^^^ maybe a missing crate `spam`? | ^^^^ you might be missing crate `spam`
| |
= help: consider adding `extern crate spam` to use the `spam` crate = help: consider adding `extern crate spam` to use the `spam` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `main`
--> $DIR/import3.rs:2:5 --> $DIR/import3.rs:2:5
| |
LL | use main::bar; LL | use main::bar;
| ^^^^ maybe a missing crate `main`? | ^^^^ you might be missing crate `main`
| |
= help: consider adding `extern crate main` to use the `main` crate = help: consider adding `extern crate main` to use the `main` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `unresolved`
--> $DIR/issue-109343.rs:4:9 --> $DIR/issue-109343.rs:4:9
| |
LL | pub use unresolved::f; LL | pub use unresolved::f;
| ^^^^^^^^^^ maybe a missing crate `unresolved`? | ^^^^^^^^^^ you might be missing crate `unresolved`
| |
= help: consider adding `extern crate unresolved` to use the `unresolved` crate = help: consider adding `extern crate unresolved` to use the `unresolved` crate

View file

@ -1,6 +1,8 @@
// Testing that we don't fail abnormally after hitting the errors // Testing that we don't fail abnormally after hitting the errors
use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432] use unresolved::*;
//~^ maybe a missing crate `unresolved`? //~^ ERROR unresolved import `unresolved` [E0432]
//~| NOTE you might be missing crate `unresolved`
//~| HELP consider adding `extern crate unresolved` to use the `unresolved` crate
fn main() {} fn main() {}

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `unresolved`
--> $DIR/issue-1697.rs:3:5 --> $DIR/issue-1697.rs:3:5
| |
LL | use unresolved::*; LL | use unresolved::*;
| ^^^^^^^^^^ maybe a missing crate `unresolved`? | ^^^^^^^^^^ you might be missing crate `unresolved`
| |
= help: consider adding `extern crate unresolved` to use the `unresolved` crate = help: consider adding `extern crate unresolved` to use the `unresolved` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `abc`
--> $DIR/issue-33464.rs:3:5 --> $DIR/issue-33464.rs:3:5
| |
LL | use abc::one_el; LL | use abc::one_el;
| ^^^ maybe a missing crate `abc`? | ^^^ you might be missing crate `abc`
| |
= help: consider adding `extern crate abc` to use the `abc` crate = help: consider adding `extern crate abc` to use the `abc` crate
@ -10,7 +10,7 @@ error[E0432]: unresolved import `abc`
--> $DIR/issue-33464.rs:5:5 --> $DIR/issue-33464.rs:5:5
| |
LL | use abc::{a, bbb, cccccc}; LL | use abc::{a, bbb, cccccc};
| ^^^ maybe a missing crate `abc`? | ^^^ you might be missing crate `abc`
| |
= help: consider adding `extern crate abc` to use the `abc` crate = help: consider adding `extern crate abc` to use the `abc` crate
@ -18,7 +18,7 @@ error[E0432]: unresolved import `a_very_long_name`
--> $DIR/issue-33464.rs:7:5 --> $DIR/issue-33464.rs:7:5
| |
LL | use a_very_long_name::{el, el2}; LL | use a_very_long_name::{el, el2};
| ^^^^^^^^^^^^^^^^ maybe a missing crate `a_very_long_name`? | ^^^^^^^^^^^^^^^^ you might be missing crate `a_very_long_name`
| |
= help: consider adding `extern crate a_very_long_name` to use the `a_very_long_name` crate = help: consider adding `extern crate a_very_long_name` to use the `a_very_long_name` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `issue_36881_aux`
--> $DIR/issue-36881.rs:5:9 --> $DIR/issue-36881.rs:5:9
| |
LL | use issue_36881_aux::Foo; LL | use issue_36881_aux::Foo;
| ^^^^^^^^^^^^^^^ maybe a missing crate `issue_36881_aux`? | ^^^^^^^^^^^^^^^ you might be missing crate `issue_36881_aux`
| |
= help: consider adding `extern crate issue_36881_aux` to use the `issue_36881_aux` crate = help: consider adding `extern crate issue_36881_aux` to use the `issue_36881_aux` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `test`
--> $DIR/issue-37887.rs:3:9 --> $DIR/issue-37887.rs:3:9
| |
LL | use test::*; LL | use test::*;
| ^^^^ maybe a missing crate `test`? | ^^^^ you might be missing crate `test`
| |
= help: consider adding `extern crate test` to use the `test` crate = help: consider adding `extern crate test` to use the `test` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `nonexistent_module`
--> $DIR/issue-53269.rs:6:9 --> $DIR/issue-53269.rs:6:9
| |
LL | use nonexistent_module::mac; LL | use nonexistent_module::mac;
| ^^^^^^^^^^^^^^^^^^ maybe a missing crate `nonexistent_module`? | ^^^^^^^^^^^^^^^^^^ you might be missing crate `nonexistent_module`
| |
= help: consider adding `extern crate nonexistent_module` to use the `nonexistent_module` crate = help: consider adding `extern crate nonexistent_module` to use the `nonexistent_module` crate

View file

@ -11,7 +11,7 @@ error[E0432]: unresolved import `non_existent`
--> $DIR/issue-55457.rs:2:5 --> $DIR/issue-55457.rs:2:5
| |
LL | use non_existent::non_existent; LL | use non_existent::non_existent;
| ^^^^^^^^^^^^ maybe a missing crate `non_existent`? | ^^^^^^^^^^^^ you might be missing crate `non_existent`
| |
= help: consider adding `extern crate non_existent` to use the `non_existent` crate = help: consider adding `extern crate non_existent` to use the `non_existent` crate

View file

@ -2,7 +2,7 @@ error[E0432]: unresolved import `doesnt_exist`
--> $DIR/issue-81413.rs:7:9 --> $DIR/issue-81413.rs:7:9
| |
LL | pub use doesnt_exist::*; LL | pub use doesnt_exist::*;
| ^^^^^^^^^^^^ maybe a missing crate `doesnt_exist`? | ^^^^^^^^^^^^ you might be missing crate `doesnt_exist`
| |
= help: consider adding `extern crate doesnt_exist` to use the `doesnt_exist` crate = help: consider adding `extern crate doesnt_exist` to use the `doesnt_exist` crate

View file

@ -1,7 +1,7 @@
use clippy::a; //~ ERROR unresolved import `clippy` use clippy::a; //~ ERROR unresolved import `clippy`
use clippy::a::b; //~ ERROR failed to resolve: maybe a missing crate `clippy`? use clippy::a::b; //~ ERROR failed to resolve: you might be missing crate `clippy`
use rustdoc::a; //~ ERROR unresolved import `rustdoc` use rustdoc::a; //~ ERROR unresolved import `rustdoc`
use rustdoc::a::b; //~ ERROR failed to resolve: maybe a missing crate `rustdoc`? use rustdoc::a::b; //~ ERROR failed to resolve: you might be missing crate `rustdoc`
fn main() {} fn main() {}

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: maybe a missing crate `clippy`? error[E0433]: failed to resolve: you might be missing crate `clippy`
--> $DIR/tool-mod-child.rs:2:5 --> $DIR/tool-mod-child.rs:2:5
| |
LL | use clippy::a::b; LL | use clippy::a::b;
| ^^^^^^ maybe a missing crate `clippy`? | ^^^^^^ you might be missing crate `clippy`
| |
= help: consider adding `extern crate clippy` to use the `clippy` crate = help: consider adding `extern crate clippy` to use the `clippy` crate
@ -10,15 +10,15 @@ error[E0432]: unresolved import `clippy`
--> $DIR/tool-mod-child.rs:1:5 --> $DIR/tool-mod-child.rs:1:5
| |
LL | use clippy::a; LL | use clippy::a;
| ^^^^^^ maybe a missing crate `clippy`? | ^^^^^^ you might be missing crate `clippy`
| |
= help: consider adding `extern crate clippy` to use the `clippy` crate = help: consider adding `extern crate clippy` to use the `clippy` crate
error[E0433]: failed to resolve: maybe a missing crate `rustdoc`? error[E0433]: failed to resolve: you might be missing crate `rustdoc`
--> $DIR/tool-mod-child.rs:5:5 --> $DIR/tool-mod-child.rs:5:5
| |
LL | use rustdoc::a::b; LL | use rustdoc::a::b;
| ^^^^^^^ maybe a missing crate `rustdoc`? | ^^^^^^^ you might be missing crate `rustdoc`
| |
= help: consider adding `extern crate rustdoc` to use the `rustdoc` crate = help: consider adding `extern crate rustdoc` to use the `rustdoc` crate
@ -26,7 +26,7 @@ error[E0432]: unresolved import `rustdoc`
--> $DIR/tool-mod-child.rs:4:5 --> $DIR/tool-mod-child.rs:4:5
| |
LL | use rustdoc::a; LL | use rustdoc::a;
| ^^^^^^^ maybe a missing crate `rustdoc`? | ^^^^^^^ you might be missing crate `rustdoc`
| |
= help: consider adding `extern crate rustdoc` to use the `rustdoc` crate = help: consider adding `extern crate rustdoc` to use the `rustdoc` crate

View file

@ -14,7 +14,7 @@ error[E0432]: unresolved import `foo`
--> $DIR/unresolved-imports-used.rs:11:5 --> $DIR/unresolved-imports-used.rs:11:5
| |
LL | use foo::bar; LL | use foo::bar;
| ^^^ maybe a missing crate `foo`? | ^^^ you might be missing crate `foo`
| |
= help: consider adding `extern crate foo` to use the `foo` crate = help: consider adding `extern crate foo` to use the `foo` crate
@ -22,7 +22,7 @@ error[E0432]: unresolved import `baz`
--> $DIR/unresolved-imports-used.rs:12:5 --> $DIR/unresolved-imports-used.rs:12:5
| |
LL | use baz::*; LL | use baz::*;
| ^^^ maybe a missing crate `baz`? | ^^^ you might be missing crate `baz`
| |
= help: consider adding `extern crate baz` to use the `baz` crate = help: consider adding `extern crate baz` to use the `baz` crate
@ -30,7 +30,7 @@ error[E0432]: unresolved import `foo2`
--> $DIR/unresolved-imports-used.rs:14:5 --> $DIR/unresolved-imports-used.rs:14:5
| |
LL | use foo2::bar2; LL | use foo2::bar2;
| ^^^^ maybe a missing crate `foo2`? | ^^^^ you might be missing crate `foo2`
| |
= help: consider adding `extern crate foo2` to use the `foo2` crate = help: consider adding `extern crate foo2` to use the `foo2` crate
@ -38,7 +38,7 @@ error[E0432]: unresolved import `baz2`
--> $DIR/unresolved-imports-used.rs:15:5 --> $DIR/unresolved-imports-used.rs:15:5
| |
LL | use baz2::*; LL | use baz2::*;
| ^^^^ maybe a missing crate `baz2`? | ^^^^ you might be missing crate `baz2`
| |
= help: consider adding `extern crate baz2` to use the `baz2` crate = help: consider adding `extern crate baz2` to use the `baz2` crate

View file

@ -1,5 +1,4 @@
//@ check-pass
#![allow(dead_code)]
fn f<T: ?for<'a> Sized>() {} fn f<T: ?for<'a> Sized>() {}
//~^ ERROR `for<...>` binder should be placed before trait bound modifiers
fn main() {} fn main() {}

View file

@ -0,0 +1,10 @@
error: `for<...>` binder should be placed before trait bound modifiers
--> $DIR/issue-39089.rs:1:13
|
LL | fn f<T: ?for<'a> Sized>() {}
| - ^^^^
| |
| place the `for<...>` binder before any modifiers
error: aborting due to 1 previous error

View file

@ -4,7 +4,7 @@ error[E0765]: unterminated double quote string
LL | "😊""; LL | "😊"";
| _________^ | _________^
LL | | } LL | | }
| |__^ | |_^
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -13,7 +13,7 @@ error[E0432]: unresolved import `r#extern`
--> $DIR/keyword-extern-as-identifier-use.rs:1:5 --> $DIR/keyword-extern-as-identifier-use.rs:1:5
| |
LL | use extern::foo; LL | use extern::foo;
| ^^^^^^ maybe a missing crate `r#extern`? | ^^^^^^ you might be missing crate `r#extern`
| |
= help: consider adding `extern crate r#extern` to use the `r#extern` crate = help: consider adding `extern crate r#extern` to use the `r#extern` crate

View file

@ -1,31 +1,31 @@
error: bare CR not allowed in doc-comment error: bare CR not allowed in doc-comment
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:3:32 --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:3:32
| |
LL | /// doc comment with bare CR: ' ' LL | /// doc comment with bare CR: ''
| ^ | ^
error: bare CR not allowed in block doc-comment error: bare CR not allowed in block doc-comment
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:7:38 --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:7:38
| |
LL | /** block doc comment with bare CR: ' ' */ LL | /** block doc comment with bare CR: '' */
| ^ | ^
error: bare CR not allowed in doc-comment error: bare CR not allowed in doc-comment
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:12:36 --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:12:36
| |
LL | //! doc comment with bare CR: ' ' LL | //! doc comment with bare CR: ''
| ^ | ^
error: bare CR not allowed in block doc-comment error: bare CR not allowed in block doc-comment
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:15:42 --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:15:42
| |
LL | /*! block doc comment with bare CR: ' ' */ LL | /*! block doc comment with bare CR: '' */
| ^ | ^
error: bare CR not allowed in string, use `\r` instead error: bare CR not allowed in string, use `\r` instead
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:19:18 --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:19:18
| |
LL | let _s = "foo bar"; LL | let _s = "foobar";
| ^ | ^
| |
help: escape the character help: escape the character
@ -36,13 +36,13 @@ LL | let _s = "foo\rbar";
error: bare CR not allowed in raw string error: bare CR not allowed in raw string
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:22:19 --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:22:19
| |
LL | let _s = r"bar foo"; LL | let _s = r"barfoo";
| ^ | ^
error: unknown character escape: `\r` error: unknown character escape: `\r`
--> $DIR/lex-bare-cr-string-literal-doc-comment.rs:25:19 --> $DIR/lex-bare-cr-string-literal-doc-comment.rs:25:19
| |
LL | let _s = "foo\ bar"; LL | let _s = "foo\bar";
| ^ unknown character escape | ^ unknown character escape
| |
= help: this is an isolated carriage return; consider checking your editor and version control settings = help: this is an isolated carriage return; consider checking your editor and version control settings

View file

@ -2,7 +2,7 @@ error[E0758]: unterminated block comment
--> $DIR/unterminated-comment.rs:1:1 --> $DIR/unterminated-comment.rs:1:1
| |
LL | /* LL | /*
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -12,7 +12,7 @@ LL | | /*
| | | | | |
| | ...as last nested comment starts here, maybe you want to close this instead? | | ...as last nested comment starts here, maybe you want to close this instead?
LL | | */ LL | | */
| |_--^ | |_-^
| | | |
| ...and last nested comment terminates here. | ...and last nested comment terminates here.

View file

@ -1,14 +1,14 @@
error[E0433]: failed to resolve: maybe a missing crate `Absolute`? error[E0433]: failed to resolve: you might be missing crate `Absolute`
--> $DIR/meta-item-absolute-path.rs:1:12 --> $DIR/meta-item-absolute-path.rs:1:12
| |
LL | #[derive(::Absolute)] LL | #[derive(::Absolute)]
| ^^^^^^^^ maybe a missing crate `Absolute`? | ^^^^^^^^ you might be missing crate `Absolute`
error[E0433]: failed to resolve: maybe a missing crate `Absolute`? error[E0433]: failed to resolve: you might be missing crate `Absolute`
--> $DIR/meta-item-absolute-path.rs:1:12 --> $DIR/meta-item-absolute-path.rs:1:12
| |
LL | #[derive(::Absolute)] LL | #[derive(::Absolute)]
| ^^^^^^^^ maybe a missing crate `Absolute`? | ^^^^^^^^ you might be missing crate `Absolute`
| |
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

Binary file not shown.

View file

@ -25,7 +25,7 @@ LL | '\n';
error: character constant must be escaped: `\r` error: character constant must be escaped: `\r`
--> $DIR/bad-char-literals.rs:15:6 --> $DIR/bad-char-literals.rs:15:6
| |
LL | ' '; LL | '';
| ^ | ^
| |
help: escape the character help: escape the character
@ -33,8 +33,19 @@ help: escape the character
LL | '\r'; LL | '\r';
| ++ | ++
error: character literal may only contain one codepoint
--> $DIR/bad-char-literals.rs:18:5
|
LL | '-␀-';
| ^^^^^
|
help: if you meant to write a string literal, use double quotes
|
LL | "-␀-";
| ~ ~
error: character constant must be escaped: `\t` error: character constant must be escaped: `\t`
--> $DIR/bad-char-literals.rs:18:6 --> $DIR/bad-char-literals.rs:21:6
| |
LL | ' '; LL | ' ';
| ^^^^ | ^^^^
@ -44,5 +55,5 @@ help: escape the character
LL | '\t'; LL | '\t';
| ++ | ++
error: aborting due to 4 previous errors error: aborting due to 5 previous errors

View file

@ -1,19 +1,30 @@
//@ compile-flags: -Z parse-only //@ compile-flags: -Z parse-only
//@ edition: 2021
struct S< struct S<
T: 'a + Tr, // OK T: 'a + Tr, // OK
T: Tr + 'a, // OK T: Tr + 'a, // OK
T: 'a, // OK T: 'a, // OK
T:, // OK T:, // OK
T: ?for<'a> Trait, // OK T: for<'a> ?Trait, //~ ERROR `for<...>` binder not allowed with `?` trait polarity modifier
T: Tr +, // OK T: Tr +, // OK
T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds
T: ~const Tr, // OK T: ~const Tr, // OK
T: ~const ?Tr, // OK T: ~const ?Tr, //~ ERROR `~const` trait not allowed with `?` trait polarity modifier
T: ~const Tr + 'a, // OK T: ~const Tr + 'a, // OK
T: ~const 'a, //~ ERROR `~const` may only modify trait bounds, not lifetime bounds T: ~const 'a, //~ ERROR `~const` may only modify trait bounds, not lifetime bounds
T: const 'a, //~ ERROR `const` may only modify trait bounds, not lifetime bounds T: const 'a, //~ ERROR `const` may only modify trait bounds, not lifetime bounds
T: async Tr, // OK
T: async ?Tr, //~ ERROR `async` trait not allowed with `?` trait polarity modifier
T: async Tr + 'a, // OK
T: async 'a, //~ ERROR `async` may only modify trait bounds, not lifetime bounds
T: const async Tr, // OK
T: const async ?Tr, //~ ERROR `const async` trait not allowed with `?` trait polarity modifier
T: const async Tr + 'a, // OK
T: const async 'a, //~ ERROR `const` may only modify trait bounds, not lifetime bounds
>; >;
fn main() {} fn main() {}

View file

@ -1,20 +1,64 @@
error: `for<...>` binder not allowed with `?` trait polarity modifier
--> $DIR/bounds-type.rs:9:16
|
LL | T: for<'a> ?Trait,
| ---- ^
| |
| there is not a well-defined meaning for a higher-ranked `?` trait
error: `?` may only modify trait bounds, not lifetime bounds error: `?` may only modify trait bounds, not lifetime bounds
--> $DIR/bounds-type.rs:10:8 --> $DIR/bounds-type.rs:11:8
| |
LL | T: ?'a, LL | T: ?'a,
| ^ | ^
error: `~const` trait not allowed with `?` trait polarity modifier
--> $DIR/bounds-type.rs:14:15
|
LL | T: ~const ?Tr,
| ------ ^
| |
| there is not a well-defined meaning for a `~const ?` trait
error: `~const` may only modify trait bounds, not lifetime bounds error: `~const` may only modify trait bounds, not lifetime bounds
--> $DIR/bounds-type.rs:15:8 --> $DIR/bounds-type.rs:16:8
| |
LL | T: ~const 'a, LL | T: ~const 'a,
| ^^^^^^ | ^^^^^^
error: `const` may only modify trait bounds, not lifetime bounds error: `const` may only modify trait bounds, not lifetime bounds
--> $DIR/bounds-type.rs:16:8 --> $DIR/bounds-type.rs:17:8
| |
LL | T: const 'a, LL | T: const 'a,
| ^^^^^ | ^^^^^
error: aborting due to 3 previous errors error: `async` trait not allowed with `?` trait polarity modifier
--> $DIR/bounds-type.rs:20:14
|
LL | T: async ?Tr,
| ----- ^
| |
| there is not a well-defined meaning for a `async ?` trait
error: `async` may only modify trait bounds, not lifetime bounds
--> $DIR/bounds-type.rs:22:8
|
LL | T: async 'a,
| ^^^^^
error: `const async` trait not allowed with `?` trait polarity modifier
--> $DIR/bounds-type.rs:25:20
|
LL | T: const async ?Tr,
| ----------- ^
| |
| there is not a well-defined meaning for a `const async ?` trait
error: `const` may only modify trait bounds, not lifetime bounds
--> $DIR/bounds-type.rs:27:8
|
LL | T: const async 'a,
| ^^^^^
error: aborting due to 9 previous errors

View file

@ -43,7 +43,7 @@ error[E0766]: unterminated double quote byte string
LL | b"a LL | b"a
| ______^ | ______^
LL | | } LL | | }
| |__^ | |_^
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View file

@ -1,7 +1,7 @@
error: bare CR not allowed in raw string error: bare CR not allowed in raw string
--> $DIR/raw-byte-string-literals.rs:4:9 --> $DIR/raw-byte-string-literals.rs:4:9
| |
LL | br"a "; LL | br"a";
| ^ | ^
error: non-ASCII character in raw byte string literal error: non-ASCII character in raw byte string literal

View file

@ -1,19 +1,19 @@
error: bare CR not allowed in doc-comment error: bare CR not allowed in doc-comment
--> $DIR/several-carriage-returns-in-doc-comment.rs:6:12 --> $DIR/several-carriage-returns-in-doc-comment.rs:6:12
| |
LL | /// This do c comment contains three isolated `\r` symbols LL | /// This do␍c comment contains ␍three isolated `\r`␍ symbols
| ^ | ^
error: bare CR not allowed in doc-comment error: bare CR not allowed in doc-comment
--> $DIR/several-carriage-returns-in-doc-comment.rs:6:32 --> $DIR/several-carriage-returns-in-doc-comment.rs:6:32
| |
LL | /// This do c comment contains three isolated `\r` symbols LL | /// This do␍c comment contains ␍three isolated `\r`␍ symbols
| ^ | ^
error: bare CR not allowed in doc-comment error: bare CR not allowed in doc-comment
--> $DIR/several-carriage-returns-in-doc-comment.rs:6:52 --> $DIR/several-carriage-returns-in-doc-comment.rs:6:52
| |
LL | /// This do c comment contains three isolated `\r` symbols LL | /// This do␍c comment contains ␍three isolated `\r`␍ symbols
| ^ | ^
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -1,7 +1,7 @@
error: unknown character escape: `\r` error: unknown character escape: `\r`
--> $DIR/trailing-carriage-return-in-string.rs:10:25 --> $DIR/trailing-carriage-return-in-string.rs:10:25
| |
LL | let bad = "This is \ a test"; LL | let bad = "This is \ a test";
| ^ unknown character escape | ^ unknown character escape
| |
= help: this is an isolated carriage return; consider checking your editor and version control settings = help: this is an isolated carriage return; consider checking your editor and version control settings

View file

@ -3,7 +3,7 @@ error[E0765]: unterminated double quote string
| |
LL | / " LL | / "
LL | | } LL | | }
| |__^ | |_^
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -17,76 +17,76 @@ LL | println!("{:?}", b"us\u{202B}e\u{202A}r");
error: non-ASCII character in byte string literal error: non-ASCII character in byte string literal
--> $DIR/unicode-control-codepoints.rs:16:26 --> $DIR/unicode-control-codepoints.rs:16:26
| |
LL | println!("{:?}", b"/* } if isAdmin begin admins only "); LL | println!("{:?}", b"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only ");
| ^ must be ASCII but is '\u{202e}' | ^ must be ASCII but is '\u{202e}'
| |
help: if you meant to use the UTF-8 encoding of '\u{202e}', use \xHH escapes help: if you meant to use the UTF-8 encoding of '\u{202e}', use \xHH escapes
| |
LL | println!("{:?}", b"/*\xE2\x80\xAE } if isAdmin begin admins only "); LL | println!("{:?}", b"/*\xE2\x80\xAE } <EFBFBD>if isAdmin<69> <20> begin admins only ");
| ~~~~~~~~~~~~ | ~~~~~~~~~~~~
error: non-ASCII character in byte string literal error: non-ASCII character in byte string literal
--> $DIR/unicode-control-codepoints.rs:16:30 --> $DIR/unicode-control-codepoints.rs:16:30
| |
LL | println!("{:?}", b"/* } if isAdmin begin admins only "); LL | println!("{:?}", b"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only ");
| ^ must be ASCII but is '\u{2066}' | ^ must be ASCII but is '\u{2066}'
| |
help: if you meant to use the UTF-8 encoding of '\u{2066}', use \xHH escapes help: if you meant to use the UTF-8 encoding of '\u{2066}', use \xHH escapes
| |
LL | println!("{:?}", b"/* } \xE2\x81\xA6if isAdmin begin admins only "); LL | println!("{:?}", b"/*<EFBFBD> } \xE2\x81\xA6if isAdmin<69> <20> begin admins only ");
| ~~~~~~~~~~~~ | ~~~~~~~~~~~~
error: non-ASCII character in byte string literal error: non-ASCII character in byte string literal
--> $DIR/unicode-control-codepoints.rs:16:41 --> $DIR/unicode-control-codepoints.rs:16:41
| |
LL | println!("{:?}", b"/* } if isAdmin begin admins only "); LL | println!("{:?}", b"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only ");
| ^ must be ASCII but is '\u{2069}' | ^ must be ASCII but is '\u{2069}'
| |
help: if you meant to use the UTF-8 encoding of '\u{2069}', use \xHH escapes help: if you meant to use the UTF-8 encoding of '\u{2069}', use \xHH escapes
| |
LL | println!("{:?}", b"/* } if isAdmin\xE2\x81\xA9 begin admins only "); LL | println!("{:?}", b"/*<EFBFBD> } <EFBFBD>if isAdmin\xE2\x81\xA9 <EFBFBD> begin admins only ");
| ~~~~~~~~~~~~ | ~~~~~~~~~~~~
error: non-ASCII character in byte string literal error: non-ASCII character in byte string literal
--> $DIR/unicode-control-codepoints.rs:16:43 --> $DIR/unicode-control-codepoints.rs:16:43
| |
LL | println!("{:?}", b"/* } if isAdmin begin admins only "); LL | println!("{:?}", b"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only ");
| ^ must be ASCII but is '\u{2066}' | ^ must be ASCII but is '\u{2066}'
| |
help: if you meant to use the UTF-8 encoding of '\u{2066}', use \xHH escapes help: if you meant to use the UTF-8 encoding of '\u{2066}', use \xHH escapes
| |
LL | println!("{:?}", b"/* } if isAdmin \xE2\x81\xA6 begin admins only "); LL | println!("{:?}", b"/*<EFBFBD> } <EFBFBD>if isAdmin<EFBFBD> \xE2\x81\xA6 begin admins only ");
| ~~~~~~~~~~~~ | ~~~~~~~~~~~~
error: non-ASCII character in raw byte string literal error: non-ASCII character in raw byte string literal
--> $DIR/unicode-control-codepoints.rs:21:29 --> $DIR/unicode-control-codepoints.rs:21:29
| |
LL | println!("{:?}", br##"/* } if isAdmin begin admins only "##); LL | println!("{:?}", br##"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only "##);
| ^ must be ASCII but is '\u{202e}' | ^ must be ASCII but is '\u{202e}'
error: non-ASCII character in raw byte string literal error: non-ASCII character in raw byte string literal
--> $DIR/unicode-control-codepoints.rs:21:33 --> $DIR/unicode-control-codepoints.rs:21:33
| |
LL | println!("{:?}", br##"/* } if isAdmin begin admins only "##); LL | println!("{:?}", br##"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only "##);
| ^ must be ASCII but is '\u{2066}' | ^ must be ASCII but is '\u{2066}'
error: non-ASCII character in raw byte string literal error: non-ASCII character in raw byte string literal
--> $DIR/unicode-control-codepoints.rs:21:44 --> $DIR/unicode-control-codepoints.rs:21:44
| |
LL | println!("{:?}", br##"/* } if isAdmin begin admins only "##); LL | println!("{:?}", br##"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only "##);
| ^ must be ASCII but is '\u{2069}' | ^ must be ASCII but is '\u{2069}'
error: non-ASCII character in raw byte string literal error: non-ASCII character in raw byte string literal
--> $DIR/unicode-control-codepoints.rs:21:46 --> $DIR/unicode-control-codepoints.rs:21:46
| |
LL | println!("{:?}", br##"/* } if isAdmin begin admins only "##); LL | println!("{:?}", br##"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only "##);
| ^ must be ASCII but is '\u{2066}' | ^ must be ASCII but is '\u{2066}'
error: unicode codepoint changing visible direction of text present in comment error: unicode codepoint changing visible direction of text present in comment
--> $DIR/unicode-control-codepoints.rs:2:5 --> $DIR/unicode-control-codepoints.rs:2:5
| |
LL | // if access_level != "user" { // Check if admin LL | // if access_level != "us<EFBFBD>e<EFBFBD>r" { // Check if admin
| ^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^-^-^^^^^^^^^^^^^^^^^^^^^^
| | | | | | | |
| | | '\u{202a}' | | | '\u{202a}'
| | '\u{202b}' | | '\u{202b}'
@ -99,8 +99,8 @@ LL | // if access_level != "user" { // Check if admin
error: unicode codepoint changing visible direction of text present in comment error: unicode codepoint changing visible direction of text present in comment
--> $DIR/unicode-control-codepoints.rs:30:1 --> $DIR/unicode-control-codepoints.rs:30:1
| |
LL | //"/* } if isAdmin begin admins only */" LL | //"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only */"
| ^^^^^-^^-^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^ | ^^^^^-^^^-^^^^^^^^^^-^-^^^^^^^^^^^^^^^^^^^^^^
| | | | | | | | | | | |
| | | | | '\u{2066}' | | | | | '\u{2066}'
| | | | '\u{2069}' | | | | '\u{2069}'
@ -114,8 +114,8 @@ LL | //"/* } if isAdmin begin admins only */"
error: unicode codepoint changing visible direction of text present in literal error: unicode codepoint changing visible direction of text present in literal
--> $DIR/unicode-control-codepoints.rs:11:22 --> $DIR/unicode-control-codepoints.rs:11:22
| |
LL | println!("{:?}", "/* } if isAdmin begin admins only "); LL | println!("{:?}", "/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only ");
| ^^^-^^-^^^^^^^^^--^^^^^^^^^^^^^^^^^^^ | ^^^-^^^-^^^^^^^^^^-^-^^^^^^^^^^^^^^^^^^^^
| | | | | | | | | | | |
| | | | | '\u{2066}' | | | | | '\u{2066}'
| | | | '\u{2069}' | | | | '\u{2069}'
@ -134,8 +134,8 @@ LL | println!("{:?}", "/*\u{202e} } \u{2066}if isAdmin\u{2069} \u{2066} begi
error: unicode codepoint changing visible direction of text present in literal error: unicode codepoint changing visible direction of text present in literal
--> $DIR/unicode-control-codepoints.rs:14:22 --> $DIR/unicode-control-codepoints.rs:14:22
| |
LL | println!("{:?}", r##"/* } if isAdmin begin admins only "##); LL | println!("{:?}", r##"/*<EFBFBD> } <20>if isAdmin<69> <20> begin admins only "##);
| ^^^^^^-^^-^^^^^^^^^--^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^-^^^-^^^^^^^^^^-^-^^^^^^^^^^^^^^^^^^^^^^
| | | | | | | | | | | |
| | | | | '\u{2066}' | | | | | '\u{2066}'
| | | | '\u{2069}' | | | | '\u{2069}'
@ -153,8 +153,8 @@ LL | println!("{:?}", r##"/*\u{202e} } \u{2066}if isAdmin\u{2069} \u{2066} b
error: unicode codepoint changing visible direction of text present in literal error: unicode codepoint changing visible direction of text present in literal
--> $DIR/unicode-control-codepoints.rs:26:22 --> $DIR/unicode-control-codepoints.rs:26:22
| |
LL | println!("{:?}", ''); LL | println!("{:?}", '<EFBFBD>');
| ^- | ^-^
| || | ||
| |'\u{202e}' | |'\u{202e}'
| this literal contains an invisible unicode text flow control codepoint | this literal contains an invisible unicode text flow control codepoint
@ -169,8 +169,8 @@ LL | println!("{:?}", '\u{202e}');
error: unicode codepoint changing visible direction of text present in doc comment error: unicode codepoint changing visible direction of text present in doc comment
--> $DIR/unicode-control-codepoints.rs:33:1 --> $DIR/unicode-control-codepoints.rs:33:1
| |
LL | /** ''); */fn foo() {} LL | /** '<EFBFBD>'); */fn foo() {}
| ^^^^^^^^^^^^ this doc comment contains an invisible unicode text flow control codepoint | ^^^^^^^^^^^^^ this doc comment contains an invisible unicode text flow control codepoint
| |
= note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen = note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen
= note: if their presence wasn't intentional, you can remove them = note: if their presence wasn't intentional, you can remove them
@ -181,8 +181,8 @@ error: unicode codepoint changing visible direction of text present in doc comme
| |
LL | / /** LL | / /**
LL | | * LL | | *
LL | | * ''); */fn bar() {} LL | | * '<EFBFBD>'); */fn bar() {}
| |___________^ this doc comment contains an invisible unicode text flow control codepoint | |____________^ this doc comment contains an invisible unicode text flow control codepoint
| |
= note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen = note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen
= note: if their presence wasn't intentional, you can remove them = note: if their presence wasn't intentional, you can remove them

View file

@ -47,6 +47,6 @@ fn main() {
} }
mod pathological { mod pathological {
pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: maybe a missing crate `bad`? pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: you might be missing crate `bad`
pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules
} }

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: maybe a missing crate `bad`? error[E0433]: failed to resolve: you might be missing crate `bad`
--> $DIR/test.rs:50:12 --> $DIR/test.rs:50:12
| |
LL | pub(in bad::path) mod m1 {} LL | pub(in bad::path) mod m1 {}
| ^^^ maybe a missing crate `bad`? | ^^^ you might be missing crate `bad`
| |
= help: consider adding `extern crate bad` to use the `bad` crate = help: consider adding `extern crate bad` to use the `bad` crate

View file

@ -2,10 +2,10 @@
mod inner { mod inner {
fn global_inner(_: ::nonexistant::Foo) { fn global_inner(_: ::nonexistant::Foo) {
//~^ ERROR failed to resolve: maybe a missing crate `nonexistant`? //~^ ERROR failed to resolve: you might be missing crate `nonexistant`
} }
fn crate_inner(_: crate::nonexistant::Foo) { fn crate_inner(_: crate::nonexistant::Foo) {
//~^ ERROR failed to resolve: maybe a missing crate `nonexistant`? //~^ ERROR failed to resolve: you might be missing crate `nonexistant`
} }
fn bare_global(_: ::nonexistant) { fn bare_global(_: ::nonexistant) {

View file

@ -1,16 +1,16 @@
error[E0433]: failed to resolve: maybe a missing crate `nonexistant`? error[E0433]: failed to resolve: you might be missing crate `nonexistant`
--> $DIR/editions-crate-root-2015.rs:4:26 --> $DIR/editions-crate-root-2015.rs:4:26
| |
LL | fn global_inner(_: ::nonexistant::Foo) { LL | fn global_inner(_: ::nonexistant::Foo) {
| ^^^^^^^^^^^ maybe a missing crate `nonexistant`? | ^^^^^^^^^^^ you might be missing crate `nonexistant`
| |
= help: consider adding `extern crate nonexistant` to use the `nonexistant` crate = help: consider adding `extern crate nonexistant` to use the `nonexistant` crate
error[E0433]: failed to resolve: maybe a missing crate `nonexistant`? error[E0433]: failed to resolve: you might be missing crate `nonexistant`
--> $DIR/editions-crate-root-2015.rs:7:30 --> $DIR/editions-crate-root-2015.rs:7:30
| |
LL | fn crate_inner(_: crate::nonexistant::Foo) { LL | fn crate_inner(_: crate::nonexistant::Foo) {
| ^^^^^^^^^^^ maybe a missing crate `nonexistant`? | ^^^^^^^^^^^ you might be missing crate `nonexistant`
| |
= help: consider adding `extern crate nonexistant` to use the `nonexistant` crate = help: consider adding `extern crate nonexistant` to use the `nonexistant` crate

View file

@ -2,15 +2,15 @@ error[E0432]: unresolved import `extern_prelude`
--> $DIR/extern-prelude-fail.rs:7:9 --> $DIR/extern-prelude-fail.rs:7:9
| |
LL | use extern_prelude::S; LL | use extern_prelude::S;
| ^^^^^^^^^^^^^^ maybe a missing crate `extern_prelude`? | ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
| |
= help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate = help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate
error[E0433]: failed to resolve: maybe a missing crate `extern_prelude`? error[E0433]: failed to resolve: you might be missing crate `extern_prelude`
--> $DIR/extern-prelude-fail.rs:8:15 --> $DIR/extern-prelude-fail.rs:8:15
| |
LL | let s = ::extern_prelude::S; LL | let s = ::extern_prelude::S;
| ^^^^^^^^^^^^^^ maybe a missing crate `extern_prelude`? | ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
| |
= help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate = help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate

View file

@ -2,7 +2,7 @@
#![feature(decl_macro)] #![feature(decl_macro)]
use x::y::z; //~ ERROR: failed to resolve: maybe a missing crate `x`? use x::y::z; //~ ERROR: failed to resolve: you might be missing crate `x`
macro mac () { macro mac () {
Box::z //~ ERROR: no function or associated item Box::z //~ ERROR: no function or associated item

View file

@ -1,8 +1,8 @@
error[E0433]: failed to resolve: maybe a missing crate `x`? error[E0433]: failed to resolve: you might be missing crate `x`
--> $DIR/issue-82865.rs:5:5 --> $DIR/issue-82865.rs:5:5
| |
LL | use x::y::z; LL | use x::y::z;
| ^ maybe a missing crate `x`? | ^ you might be missing crate `x`
| |
= help: consider adding `extern crate x` to use the `x` crate = help: consider adding `extern crate x` to use the `x` crate

View file

@ -16,19 +16,19 @@ error[E0742]: visibilities can only be restricted to ancestor modules
LL | pub(in std::vec) struct F; LL | pub(in std::vec) struct F;
| ^^^^^^^^ | ^^^^^^^^
error[E0433]: failed to resolve: maybe a missing crate `nonexistent`? error[E0433]: failed to resolve: you might be missing crate `nonexistent`
--> $DIR/resolve-bad-visibility.rs:7:8 --> $DIR/resolve-bad-visibility.rs:7:8
| |
LL | pub(in nonexistent) struct G; LL | pub(in nonexistent) struct G;
| ^^^^^^^^^^^ maybe a missing crate `nonexistent`? | ^^^^^^^^^^^ you might be missing crate `nonexistent`
| |
= help: consider adding `extern crate nonexistent` to use the `nonexistent` crate = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate
error[E0433]: failed to resolve: maybe a missing crate `too_soon`? error[E0433]: failed to resolve: you might be missing crate `too_soon`
--> $DIR/resolve-bad-visibility.rs:8:8 --> $DIR/resolve-bad-visibility.rs:8:8
| |
LL | pub(in too_soon) struct H; LL | pub(in too_soon) struct H;
| ^^^^^^^^ maybe a missing crate `too_soon`? | ^^^^^^^^ you might be missing crate `too_soon`
| |
= help: consider adding `extern crate too_soon` to use the `too_soon` crate = help: consider adding `extern crate too_soon` to use the `too_soon` crate

Some files were not shown because too many files have changed in this diff Show more