diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index f6b18bdea51ab..c803c8a83b15c 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -8,7 +8,7 @@ use rustc_feature::{Features, GateIssue}; use rustc_session::parse::{feature_err, feature_err_issue}; use rustc_session::Session; use rustc_span::source_map::Spanned; -use rustc_span::symbol::{sym, Symbol}; +use rustc_span::symbol::sym; use rustc_span::Span; use tracing::debug; @@ -328,17 +328,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } } - fn visit_name(&mut self, sp: Span, name: Symbol) { - if !name.as_str().is_ascii() { - gate_feature_post!( - &self, - non_ascii_idents, - self.sess.parse_sess.source_map().guess_head_span(sp), - "non-ascii idents are not fully supported" - ); - } - } - fn visit_item(&mut self, i: &'a ast::Item) { match i.kind { ast::ItemKind::ForeignMod(ref foreign_module) => { diff --git a/compiler/rustc_error_codes/src/error_codes/E0554.md b/compiler/rustc_error_codes/src/error_codes/E0554.md index e55fa4c6ede8b..3178bf21919e8 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0554.md +++ b/compiler/rustc_error_codes/src/error_codes/E0554.md @@ -4,8 +4,8 @@ beta compilers will not comply. Erroneous code example: ```ignore (depends on release channel) -#![feature(non_ascii_idents)] // error: `#![feature]` may not be used on the - // stable release channel +#![feature(lang_items)] // error: `#![feature]` may not be used on the + // stable release channel ``` If you need the feature, make sure to use a nightly release of the compiler diff --git a/compiler/rustc_error_codes/src/error_codes/E0754.md b/compiler/rustc_error_codes/src/error_codes/E0754.md index 9f4b19cfda6b4..acddb69aaba56 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0754.md +++ b/compiler/rustc_error_codes/src/error_codes/E0754.md @@ -3,7 +3,6 @@ A non-ASCII identifier was used in an invalid context. Erroneous code examples: ```compile_fail,E0754 -# #![feature(non_ascii_idents)] mod řųśť; // error! @@ -17,8 +16,6 @@ Non-ASCII can be used as module names if it is inlined or if a `#[path]` attribute is specified. For example: ``` -# #![feature(non_ascii_idents)] - mod řųśť { // ok! const IS_GREAT: bool = true; } diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index f006351647e40..e8642a52749c4 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -279,6 +279,8 @@ declare_features! ( (accepted, unsafe_block_in_unsafe_fn, "1.52.0", Some(71668), None), /// Allows the use of or-patterns (e.g., `0 | 1`). (accepted, or_patterns, "1.53.0", Some(54883), None), + /// Allows defining identifiers beyond ASCII. + (accepted, non_ascii_idents, "1.53.0", Some(55467), None), // ------------------------------------------------------------------------- // feature-group-end: accepted features diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 6fd1af60fe2d8..a410826d3fda6 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -255,9 +255,6 @@ declare_features! ( // feature-group-start: actual feature gates // ------------------------------------------------------------------------- - /// Allows defining identifiers beyond ASCII. - (active, non_ascii_idents, "1.0.0", Some(55467), None), - /// Allows using `#[plugin_registrar]` on functions. (active, plugin_registrar, "1.0.0", Some(29597), None), diff --git a/compiler/rustc_lint/src/non_ascii_idents.rs b/compiler/rustc_lint/src/non_ascii_idents.rs index a1c7e47e749ad..301e607fc58ad 100644 --- a/compiler/rustc_lint/src/non_ascii_idents.rs +++ b/compiler/rustc_lint/src/non_ascii_idents.rs @@ -10,7 +10,6 @@ declare_lint! { /// /// ```rust,compile_fail /// # #![allow(unused)] - /// #![feature(non_ascii_idents)] /// #![deny(non_ascii_idents)] /// fn main() { /// let föö = 1; @@ -21,14 +20,11 @@ declare_lint! { /// /// ### Explanation /// - /// Currently on stable Rust, identifiers must contain ASCII characters. - /// The [`non_ascii_idents`] nightly-only feature allows identifiers to - /// contain non-ASCII characters. This lint allows projects that wish to - /// retain the limit of only using ASCII characters to switch this lint to - /// "forbid" (for example to ease collaboration or for security reasons). + /// This lint allows projects that wish to retain the limit of only using + /// ASCII characters to switch this lint to "forbid" (for example to ease + /// collaboration or for security reasons). /// See [RFC 2457] for more details. /// - /// [`non_ascii_idents`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/non-ascii-idents.html /// [RFC 2457]: https://github.com/rust-lang/rfcs/blob/master/text/2457-non-ascii-idents.md pub NON_ASCII_IDENTS, Allow, @@ -44,7 +40,6 @@ declare_lint! { /// /// ```rust /// # #![allow(unused)] - /// #![feature(non_ascii_idents)] /// const µ: f64 = 0.000001; /// ``` /// @@ -52,10 +47,8 @@ declare_lint! { /// /// ### Explanation /// - /// With the [`non_ascii_idents`] nightly-only feature enabled, - /// identifiers are allowed to use non-ASCII characters. This lint warns - /// about using characters which are not commonly used, and may cause - /// visual confusion. + /// This lint warns about using characters which are not commonly used, and may + /// cause visual confusion. /// /// This lint is triggered by identifiers that contain a codepoint that is /// not part of the set of "Allowed" codepoints as described by [Unicode® @@ -66,7 +59,6 @@ declare_lint! { /// that if you "forbid" this lint that existing code may fail in the /// future. /// - /// [`non_ascii_idents`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/non-ascii-idents.html /// [TR39Allowed]: https://www.unicode.org/reports/tr39/#General_Security_Profile pub UNCOMMON_CODEPOINTS, Warn, @@ -81,8 +73,6 @@ declare_lint! { /// ### Example /// /// ```rust - /// #![feature(non_ascii_idents)] - /// /// // Latin Capital Letter E With Caron /// pub const Ě: i32 = 1; /// // Latin Capital Letter E With Breve @@ -93,10 +83,8 @@ declare_lint! { /// /// ### Explanation /// - /// With the [`non_ascii_idents`] nightly-only feature enabled, - /// identifiers are allowed to use non-ASCII characters. This lint warns - /// when different identifiers may appear visually similar, which can - /// cause confusion. + /// This lint warns when different identifiers may appear visually similar, + /// which can cause confusion. /// /// The confusable detection algorithm is based on [Unicode® Technical /// Standard #39 Unicode Security Mechanisms Section 4 Confusable @@ -110,7 +98,6 @@ declare_lint! { /// Beware that if you "forbid" this lint that existing code may fail in /// the future. /// - /// [`non_ascii_idents`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/non-ascii-idents.html /// [TR39Confusable]: https://www.unicode.org/reports/tr39/#Confusable_Detection pub CONFUSABLE_IDENTS, Warn, @@ -127,8 +114,6 @@ declare_lint! { /// ### Example /// /// ```rust - /// #![feature(non_ascii_idents)] - /// /// // The Japanese katakana character エ can be confused with the Han character 工. /// const エ: &'static str = "アイウ"; /// ``` @@ -137,10 +122,8 @@ declare_lint! { /// /// ### Explanation /// - /// With the [`non_ascii_idents`] nightly-only feature enabled, - /// identifiers are allowed to use non-ASCII characters. This lint warns - /// when characters between different scripts may appear visually similar, - /// which can cause confusion. + /// This lint warns when characters between different scripts may appear + /// visually similar, which can cause confusion. /// /// If the crate contains other identifiers in the same script that have /// non-confusable characters, then this lint will *not* be issued. For @@ -152,8 +135,6 @@ declare_lint! { /// Note that the set of confusable characters may change over time. /// Beware that if you "forbid" this lint that existing code may fail in /// the future. - /// - /// [`non_ascii_idents`]: https://doc.rust-lang.org/nightly/unstable-book/language-features/non-ascii-idents.html pub MIXED_SCRIPT_CONFUSABLES, Warn, "detects Unicode scripts whose mixed script confusables codepoints are solely used", diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 15a3d3ddd8d85..c3bb3fffb82fb 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -503,14 +503,14 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { let unit_obligation = obligation.with(predicate.without_const().to_predicate(tcx)); if self.predicate_may_hold(&unit_obligation) { + err.note("this trait is implemented for `()`."); err.note( - "the trait is implemented for `()`. \ - Possibly this error has been caused by changes to \ - Rust's type-inference algorithm (see issue #48950 \ - \ - for more information). Consider whether you meant to use \ - the type `()` here instead.", + "this error might have been caused by changes to \ + Rust's type-inference algorithm (see issue #48950 \ + \ + for more information).", ); + err.help("did you intend to use the type `()` here instead?"); } } diff --git a/compiler/rustc_typeck/src/check/gather_locals.rs b/compiler/rustc_typeck/src/check/gather_locals.rs index 4c5d16d0b70c0..2683e886eeb0f 100644 --- a/compiler/rustc_typeck/src/check/gather_locals.rs +++ b/compiler/rustc_typeck/src/check/gather_locals.rs @@ -6,7 +6,6 @@ use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKi use rustc_middle::ty::Ty; use rustc_span::{sym, Span}; use rustc_trait_selection::traits; -use std::mem; pub(super) struct GatherLocalsVisitor<'a, 'tcx> { fcx: &'a FnCtxt<'a, 'tcx>, @@ -14,12 +13,12 @@ pub(super) struct GatherLocalsVisitor<'a, 'tcx> { // parameters are special cases of patterns, but we want to handle them as // *distinct* cases. so track when we are hitting a pattern *within* an fn // parameter. - outermost_fn_param_pat: bool, + outermost_fn_param_pat: Option, } impl<'a, 'tcx> GatherLocalsVisitor<'a, 'tcx> { pub(super) fn new(fcx: &'a FnCtxt<'a, 'tcx>, parent_id: hir::HirId) -> Self { - Self { fcx, parent_id, outermost_fn_param_pat: false } + Self { fcx, parent_id, outermost_fn_param_pat: None } } fn assign(&mut self, span: Span, nid: hir::HirId, ty_opt: Option>) -> Ty<'tcx> { @@ -92,7 +91,7 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> { } fn visit_param(&mut self, param: &'tcx hir::Param<'tcx>) { - let old_outermost_fn_param_pat = mem::replace(&mut self.outermost_fn_param_pat, true); + let old_outermost_fn_param_pat = self.outermost_fn_param_pat.replace(param.ty_span); intravisit::walk_param(self, param); self.outermost_fn_param_pat = old_outermost_fn_param_pat; } @@ -102,12 +101,12 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> { if let PatKind::Binding(_, _, ident, _) = p.kind { let var_ty = self.assign(p.span, p.hir_id, None); - if self.outermost_fn_param_pat { + if let Some(ty_span) = self.outermost_fn_param_pat { if !self.fcx.tcx.features().unsized_fn_params { self.fcx.require_type_is_sized( var_ty, p.span, - traits::SizedArgumentType(Some(p.span)), + traits::SizedArgumentType(Some(ty_span)), ); } } else { @@ -123,7 +122,7 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> { var_ty ); } - let old_outermost_fn_param_pat = mem::replace(&mut self.outermost_fn_param_pat, false); + let old_outermost_fn_param_pat = self.outermost_fn_param_pat.take(); intravisit::walk_pat(self, p); self.outermost_fn_param_pat = old_outermost_fn_param_pat; } diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 0dab0358d6e3d..1b78356fde5bc 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2041,7 +2041,7 @@ impl Vec { /// Safety: changing returned .2 (&mut usize) is considered the same as calling `.set_len(_)`. /// - /// This method is used to have unique access to all vec parts at once in `extend_from_within`. + /// This method provides unique access to all vec parts at once in `extend_from_within`. unsafe fn split_at_spare_mut_with_len( &mut self, ) -> (&mut [T], &mut [MaybeUninit], &mut usize) { @@ -2279,7 +2279,7 @@ impl ExtendFromWithinSpec for Vec { iter::zip(to_clone, spare) .map(|(src, dst)| dst.write(src.clone())) // Note: - // - Element was just initialized with `MaybeUninit::write`, so it's ok to increace len + // - Element was just initialized with `MaybeUninit::write`, so it's ok to increase len // - len is increased after each element to prevent leaks (see issue #82533) .for_each(|_| *len += 1); } diff --git a/src/doc/unstable-book/src/language-features/non-ascii-idents.md b/src/doc/unstable-book/src/language-features/non-ascii-idents.md deleted file mode 100644 index 847f25ecab132..0000000000000 --- a/src/doc/unstable-book/src/language-features/non-ascii-idents.md +++ /dev/null @@ -1,48 +0,0 @@ -# `non_ascii_idents` - -The tracking issue for this feature is: [#55467] - -[#55467]: https://github.com/rust-lang/rust/issues/55467 - ------------------------- - -The `non_ascii_idents` feature adds support for non-ASCII identifiers. - -## Examples - -```rust -#![feature(non_ascii_idents)] - -const ε: f64 = 0.00001f64; -const Π: f64 = 3.14f64; -``` - -## Changes to the language reference - -> **Lexer:**\ -> IDENTIFIER :\ ->       XID_start XID_continue\*\ ->    | `_` XID_continue+ - -An identifier is any nonempty Unicode string of the following form: - -Either - - * The first character has property [`XID_start`] - * The remaining characters have property [`XID_continue`] - -Or - - * The first character is `_` - * The identifier is more than one character, `_` alone is not an identifier - * The remaining characters have property [`XID_continue`] - -that does _not_ occur in the set of [strict keywords]. - -> **Note**: [`XID_start`] and [`XID_continue`] as character properties cover the -> character ranges used to form the more familiar C and Java language-family -> identifiers. - -[`XID_start`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Start%3A%5D&abb=on&g=&i= -[`XID_continue`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Continue%3A%5D&abb=on&g=&i= -[strict keywords]: ../../reference/keywords.md#strict-keywords diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index ca364b9f10365..e39652c6dd5de 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -7,6 +7,7 @@ use std::cell::Cell; use std::fmt; +use std::iter; use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::FxHashSet; @@ -16,12 +17,10 @@ use rustc_span::def_id::{DefId, CRATE_DEF_INDEX}; use rustc_target::spec::abi::Abi; use crate::clean::{self, utils::find_nearest_parent_module, PrimitiveType}; -use crate::formats::cache::Cache; use crate::formats::item_type::ItemType; use crate::html::escape::Escape; use crate::html::render::cache::ExternalLocation; use crate::html::render::Context; -use crate::html::render::CURRENT_DEPTH; crate trait Print { fn print(self, buffer: &mut Buffer); @@ -497,7 +496,7 @@ crate fn href_relative_parts<'a>(fqp: &'a [String], relative_to_fqp: &'a [String if f != r { let dissimilar_part_count = relative_to_fqp.len() - i; let fqp_module = fqp[i..fqp.len()].iter().map(String::as_str); - return std::iter::repeat("..").take(dissimilar_part_count).chain(fqp_module).collect(); + return iter::repeat("..").take(dissimilar_part_count).chain(fqp_module).collect(); } } // e.g. linking to std::sync::atomic from std::sync @@ -506,7 +505,7 @@ crate fn href_relative_parts<'a>(fqp: &'a [String], relative_to_fqp: &'a [String // e.g. linking to std::sync from std::sync::atomic } else if fqp.len() < relative_to_fqp.len() { let dissimilar_part_count = relative_to_fqp.len() - fqp.len(); - std::iter::repeat("..").take(dissimilar_part_count).collect() + iter::repeat("..").take(dissimilar_part_count).collect() // linking to the same module } else { Vec::new() @@ -555,13 +554,14 @@ fn primitive_link( f: &mut fmt::Formatter<'_>, prim: clean::PrimitiveType, name: &str, - m: &Cache, + cx: &Context<'_>, ) -> fmt::Result { + let m = &cx.cache(); let mut needs_termination = false; if !f.alternate() { match m.primitive_locations.get(&prim) { Some(&def_id) if def_id.is_local() => { - let len = CURRENT_DEPTH.with(|s| s.get()); + let len = cx.current.len(); let len = if len == 0 { 0 } else { len - 1 }; write!( f, @@ -572,20 +572,28 @@ fn primitive_link( needs_termination = true; } Some(&def_id) => { + let cname_str; let loc = match m.extern_locations[&def_id.krate] { - (ref cname, _, ExternalLocation::Remote(ref s)) => Some((cname, s.to_string())), + (ref cname, _, ExternalLocation::Remote(ref s)) => { + cname_str = cname.as_str(); + Some(vec![s.trim_end_matches('/'), &cname_str[..]]) + } (ref cname, _, ExternalLocation::Local) => { - let len = CURRENT_DEPTH.with(|s| s.get()); - Some((cname, "../".repeat(len))) + cname_str = cname.as_str(); + Some(if cx.current.first().map(|x| &x[..]) == Some(&cname_str[..]) { + iter::repeat("..").take(cx.current.len() - 1).collect() + } else { + let cname = iter::once(&cname_str[..]); + iter::repeat("..").take(cx.current.len()).chain(cname).collect() + }) } (.., ExternalLocation::Unknown) => None, }; - if let Some((cname, root)) = loc { + if let Some(loc) = loc { write!( f, - "", - root, - cname, + "", + loc.join("/"), prim.to_url_str() )?; needs_termination = true; @@ -660,7 +668,7 @@ fn fmt_type<'cx>( fmt::Display::fmt(&tybounds(param_names, cx), f) } clean::Infer => write!(f, "_"), - clean::Primitive(prim) => primitive_link(f, prim, prim.as_str(), &cx.cache()), + clean::Primitive(prim) => primitive_link(f, prim, prim.as_str(), cx), clean::BareFunction(ref decl) => { if f.alternate() { write!( @@ -679,46 +687,46 @@ fn fmt_type<'cx>( decl.unsafety.print_with_space(), print_abi_with_space(decl.abi) )?; - primitive_link(f, PrimitiveType::Fn, "fn", &cx.cache())?; + primitive_link(f, PrimitiveType::Fn, "fn", cx)?; write!(f, "{}", decl.decl.print(cx)) } } clean::Tuple(ref typs) => { match &typs[..] { - &[] => primitive_link(f, PrimitiveType::Unit, "()", &cx.cache()), + &[] => primitive_link(f, PrimitiveType::Unit, "()", cx), &[ref one] => { - primitive_link(f, PrimitiveType::Tuple, "(", &cx.cache())?; + primitive_link(f, PrimitiveType::Tuple, "(", cx)?; // Carry `f.alternate()` into this display w/o branching manually. fmt::Display::fmt(&one.print(cx), f)?; - primitive_link(f, PrimitiveType::Tuple, ",)", &cx.cache()) + primitive_link(f, PrimitiveType::Tuple, ",)", cx) } many => { - primitive_link(f, PrimitiveType::Tuple, "(", &cx.cache())?; + primitive_link(f, PrimitiveType::Tuple, "(", cx)?; for (i, item) in many.iter().enumerate() { if i != 0 { write!(f, ", ")?; } fmt::Display::fmt(&item.print(cx), f)?; } - primitive_link(f, PrimitiveType::Tuple, ")", &cx.cache()) + primitive_link(f, PrimitiveType::Tuple, ")", cx) } } } clean::Slice(ref t) => { - primitive_link(f, PrimitiveType::Slice, "[", &cx.cache())?; + primitive_link(f, PrimitiveType::Slice, "[", cx)?; fmt::Display::fmt(&t.print(cx), f)?; - primitive_link(f, PrimitiveType::Slice, "]", &cx.cache()) + primitive_link(f, PrimitiveType::Slice, "]", cx) } clean::Array(ref t, ref n) => { - primitive_link(f, PrimitiveType::Array, "[", &cx.cache())?; + primitive_link(f, PrimitiveType::Array, "[", cx)?; fmt::Display::fmt(&t.print(cx), f)?; if f.alternate() { - primitive_link(f, PrimitiveType::Array, &format!("; {}]", n), &cx.cache()) + primitive_link(f, PrimitiveType::Array, &format!("; {}]", n), cx) } else { - primitive_link(f, PrimitiveType::Array, &format!("; {}]", Escape(n)), &cx.cache()) + primitive_link(f, PrimitiveType::Array, &format!("; {}]", Escape(n)), cx) } } - clean::Never => primitive_link(f, PrimitiveType::Never, "!", &cx.cache()), + clean::Never => primitive_link(f, PrimitiveType::Never, "!", cx), clean::RawPointer(m, ref t) => { let m = match m { hir::Mutability::Mut => "mut", @@ -731,24 +739,19 @@ fn fmt_type<'cx>( f, clean::PrimitiveType::RawPointer, &format!("*{} {:#}", m, t.print(cx)), - &cx.cache(), + cx, ) } else { primitive_link( f, clean::PrimitiveType::RawPointer, &format!("*{} {}", m, t.print(cx)), - &cx.cache(), + cx, ) } } _ => { - primitive_link( - f, - clean::PrimitiveType::RawPointer, - &format!("*{} ", m), - &cx.cache(), - )?; + primitive_link(f, clean::PrimitiveType::RawPointer, &format!("*{} ", m), cx)?; fmt::Display::fmt(&t.print(cx), f) } } @@ -770,14 +773,14 @@ fn fmt_type<'cx>( f, PrimitiveType::Slice, &format!("{}{}{}[{:#}]", amp, lt, m, bt.print(cx)), - &cx.cache(), + cx, ) } else { primitive_link( f, PrimitiveType::Slice, &format!("{}{}{}[{}]", amp, lt, m, bt.print(cx)), - &cx.cache(), + cx, ) } } @@ -786,14 +789,14 @@ fn fmt_type<'cx>( f, PrimitiveType::Slice, &format!("{}{}{}[", amp, lt, m), - &cx.cache(), + cx, )?; if f.alternate() { write!(f, "{:#}", bt.print(cx))?; } else { write!(f, "{}", bt.print(cx))?; } - primitive_link(f, PrimitiveType::Slice, "]", &cx.cache()) + primitive_link(f, PrimitiveType::Slice, "]", cx) } } } @@ -807,7 +810,7 @@ fn fmt_type<'cx>( f, PrimitiveType::Reference, &format!("{}{}{}", amp, lt, m), - &cx.cache(), + cx, )?; fmt_type(&ty, f, use_absolute, cx) } @@ -1292,7 +1295,7 @@ impl clean::ImportSource { } let name = self.path.last_name(); if let hir::def::Res::PrimTy(p) = self.path.res { - primitive_link(f, PrimitiveType::from(p), &*name, &cx.cache())?; + primitive_link(f, PrimitiveType::from(p), &*name, cx)?; } else { write!(f, "{}", name)?; } diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index d866cf4f4cf04..05d2001385929 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -16,7 +16,7 @@ use rustc_span::{symbol::sym, Symbol}; use super::cache::{build_index, ExternalLocation}; use super::print_item::{full_path, item_path, print_item}; use super::write_shared::write_shared; -use super::{print_sidebar, settings, AllTypes, NameDoc, StylePath, BASIC_KEYWORDS, CURRENT_DEPTH}; +use super::{print_sidebar, settings, AllTypes, NameDoc, StylePath, BASIC_KEYWORDS}; use crate::clean::{self, AttributesExt}; use crate::config::RenderOptions; @@ -168,12 +168,6 @@ impl<'tcx> Context<'tcx> { } fn render_item(&self, it: &clean::Item, pushname: bool) -> String { - // A little unfortunate that this is done like this, but it sure - // does make formatting *a lot* nicer. - CURRENT_DEPTH.with(|slot| { - slot.set(self.current.len()); - }); - let mut title = if it.is_primitive() || it.is_keyword() { // No need to include the namespace for primitive types and keywords String::new() @@ -482,8 +476,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> { cache: Rc::new(cache), }; - CURRENT_DEPTH.with(|s| s.set(0)); - // Write shared runs within a flock; disable thread dispatching of IO temporarily. Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(true); write_shared(&cx, &krate, index, &md_opts)?; diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index d10b612a73799..7cb6466817c45 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -35,7 +35,6 @@ mod write_shared; crate use context::*; crate use write_shared::FILES_UNVERSIONED; -use std::cell::Cell; use std::collections::VecDeque; use std::default::Default; use std::fmt; @@ -209,8 +208,6 @@ crate struct StylePath { crate disabled: bool, } -thread_local!(crate static CURRENT_DEPTH: Cell = Cell::new(0)); - fn write_srclink(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer) { if let Some(l) = cx.src_href(item) { write!(buf, "[src]", l) @@ -989,7 +986,6 @@ fn render_assoc_item( const ALLOWED_ATTRIBUTES: &[Symbol] = &[ sym::export_name, - sym::lang, sym::link_section, sym::must_use, sym::no_mangle, diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 427564cd7794a..570dabbd36105 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -967,6 +967,10 @@ a.test-arrow:hover{ color: inherit; } +.code-attribute { + font-weight: 300; +} + .collapse-toggle { font-weight: 300; position: absolute; diff --git a/src/librustdoc/html/static/themes/ayu.css b/src/librustdoc/html/static/themes/ayu.css index 5f6f3d66e5757..b0a8c41fb08d5 100644 --- a/src/librustdoc/html/static/themes/ayu.css +++ b/src/librustdoc/html/static/themes/ayu.css @@ -329,7 +329,8 @@ a.test-arrow:hover { color: #c5c5c5; } -.toggle-label { +.toggle-label, +.code-attribute { color: #999; } diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css index 2ce6cf4cc45ca..b702dc4a937f8 100644 --- a/src/librustdoc/html/static/themes/dark.css +++ b/src/librustdoc/html/static/themes/dark.css @@ -274,7 +274,8 @@ a.test-arrow:hover{ background-color: #4e8bca; } -.toggle-label { +.toggle-label, +.code-attribute { color: #999; } diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/themes/light.css index 31b3562cfcb06..566ed62a62861 100644 --- a/src/librustdoc/html/static/themes/light.css +++ b/src/librustdoc/html/static/themes/light.css @@ -267,7 +267,8 @@ a.test-arrow:hover{ background-color: #4e8bca; } -.toggle-label { +.toggle-label, +.code-attribute { color: #999; } diff --git a/src/test/debuginfo/multi-byte-chars.rs b/src/test/debuginfo/multi-byte-chars.rs index 5382dd1a3234b..5c68a88f2fb1b 100644 --- a/src/test/debuginfo/multi-byte-chars.rs +++ b/src/test/debuginfo/multi-byte-chars.rs @@ -2,8 +2,6 @@ // compile-flags:-g -#![feature(non_ascii_idents)] - // This test checks whether debuginfo generation can handle multi-byte UTF-8 // characters at the end of a block. There's no need to do anything in the // debugger -- just make sure that the compiler doesn't crash. diff --git a/src/test/ui/codemap_tests/unicode_2.rs b/src/test/ui/codemap_tests/unicode_2.rs index fa69115b2daaf..3301e7a18d11a 100644 --- a/src/test/ui/codemap_tests/unicode_2.rs +++ b/src/test/ui/codemap_tests/unicode_2.rs @@ -1,5 +1,3 @@ -#![feature(non_ascii_idents)] - fn main() { let _ = ("a̐éö̲", 0u7); //~ ERROR invalid width let _ = ("아あ", 1i42); //~ ERROR invalid width diff --git a/src/test/ui/codemap_tests/unicode_2.stderr b/src/test/ui/codemap_tests/unicode_2.stderr index c01942712d4f3..a776a4a1e7e13 100644 --- a/src/test/ui/codemap_tests/unicode_2.stderr +++ b/src/test/ui/codemap_tests/unicode_2.stderr @@ -1,5 +1,5 @@ error: invalid width `7` for integer literal - --> $DIR/unicode_2.rs:4:25 + --> $DIR/unicode_2.rs:2:25 | LL | let _ = ("a̐éö̲", 0u7); | ^^^ @@ -7,7 +7,7 @@ LL | let _ = ("a̐éö̲", 0u7); = help: valid widths are 8, 16, 32, 64 and 128 error: invalid width `42` for integer literal - --> $DIR/unicode_2.rs:5:20 + --> $DIR/unicode_2.rs:3:20 | LL | let _ = ("아あ", 1i42); | ^^^^ @@ -15,7 +15,7 @@ LL | let _ = ("아あ", 1i42); = help: valid widths are 8, 16, 32, 64 and 128 error[E0425]: cannot find value `a̐é` in this scope - --> $DIR/unicode_2.rs:6:13 + --> $DIR/unicode_2.rs:4:13 | LL | let _ = a̐é; | ^^ not found in this scope diff --git a/src/test/ui/error-codes/E0277.stderr b/src/test/ui/error-codes/E0277.stderr index 1f54af4d154e4..dea0bb259f506 100644 --- a/src/test/ui/error-codes/E0277.stderr +++ b/src/test/ui/error-codes/E0277.stderr @@ -9,8 +9,8 @@ LL | fn f(p: Path) { } = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn f(&p: Path) { } - | ^ +LL | fn f(p: &Path) { } + | ^ error[E0277]: the trait bound `i32: Foo` is not satisfied --> $DIR/E0277.rs:15:15 diff --git a/src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs b/src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs deleted file mode 100644 index 524ad3c83fcbc..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs +++ /dev/null @@ -1,34 +0,0 @@ -extern crate core as bäz; //~ ERROR non-ascii idents - -use föö::bar; //~ ERROR non-ascii idents - -mod föö { //~ ERROR non-ascii idents - pub fn bar() {} -} - -fn bär( //~ ERROR non-ascii idents - bäz: isize //~ ERROR non-ascii idents - ) { - let _ö: isize; //~ ERROR non-ascii idents - - match (1, 2) { - (_ä, _) => {} //~ ERROR non-ascii idents - } -} - -struct Föö { //~ ERROR non-ascii idents - föö: isize //~ ERROR non-ascii idents -} - -enum Bär { //~ ERROR non-ascii idents - Bäz { //~ ERROR non-ascii idents - qüx: isize //~ ERROR non-ascii idents - } -} - -extern "C" { - fn qüx(); //~ ERROR non-ascii idents - //~^ ERROR items in `extern` blocks -} - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr b/src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr deleted file mode 100644 index c712acee37f94..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr +++ /dev/null @@ -1,130 +0,0 @@ -error: items in `extern` blocks cannot use non-ascii identifiers - --> $DIR/feature-gate-non_ascii_idents.rs:30:8 - | -LL | extern "C" { - | ---------- in this `extern` block -LL | fn qüx(); - | ^^^ - | - = note: This limitation may be lifted in the future; see issue #83942 for more information - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:1:22 - | -LL | extern crate core as bäz; - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:3:5 - | -LL | use föö::bar; - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:5:5 - | -LL | mod föö { - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:9:4 - | -LL | fn bär( - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:10:5 - | -LL | bäz: isize - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:12:9 - | -LL | let _ö: isize; - | ^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:15:10 - | -LL | (_ä, _) => {} - | ^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:19:8 - | -LL | struct Föö { - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:20:5 - | -LL | föö: isize - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:23:6 - | -LL | enum Bär { - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:24:5 - | -LL | Bäz { - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:25:9 - | -LL | qüx: isize - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/feature-gate-non_ascii_idents.rs:30:8 - | -LL | fn qüx(); - | ^^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error: aborting due to 14 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-unsized_fn_params.stderr b/src/test/ui/feature-gates/feature-gate-unsized_fn_params.stderr index 71acbb174ac66..3631a03938a65 100644 --- a/src/test/ui/feature-gates/feature-gate-unsized_fn_params.stderr +++ b/src/test/ui/feature-gates/feature-gate-unsized_fn_params.stderr @@ -8,8 +8,8 @@ LL | fn foo(x: dyn Foo) { = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn foo(&x: dyn Foo) { - | ^ +LL | fn foo(x: &dyn Foo) { + | ^ error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time --> $DIR/feature-gate-unsized_fn_params.rs:24:5 diff --git a/src/test/ui/feature-gates/feature-gate-unsized_locals.stderr b/src/test/ui/feature-gates/feature-gate-unsized_locals.stderr index 522542208724b..0919c2f3a1e0e 100644 --- a/src/test/ui/feature-gates/feature-gate-unsized_locals.stderr +++ b/src/test/ui/feature-gates/feature-gate-unsized_locals.stderr @@ -8,8 +8,8 @@ LL | fn f(f: dyn FnOnce()) {} = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn f(&f: dyn FnOnce()) {} - | ^ +LL | fn f(f: &dyn FnOnce()) {} + | ^ error: aborting due to previous error diff --git a/src/test/ui/imports/local-modularized-tricky-fail-2.rs b/src/test/ui/imports/local-modularized-tricky-fail-2.rs index e637edadb0074..386de88bc3d62 100644 --- a/src/test/ui/imports/local-modularized-tricky-fail-2.rs +++ b/src/test/ui/imports/local-modularized-tricky-fail-2.rs @@ -1,48 +1,22 @@ -// `#[macro_export] macro_rules` that doesn't originate from macro expansions can be placed -// into the root module soon enough to act as usual items and shadow globs and preludes. +// Crate-local macro expanded `macro_export` macros cannot be accessed with module-relative paths. -#![feature(decl_macro)] - -// `macro_export` shadows globs -use inner1::*; - -mod inner1 { - pub macro exported() {} -} - -exported!(); - -mod deep { - fn deep() { - type Deeper = [u8; { - #[macro_export] - macro_rules! exported { - () => ( struct Б; ) //~ ERROR non-ascii idents are not fully supported - } - - 0 - }]; +macro_rules! define_exported { () => { + #[macro_export] + macro_rules! exported { + () => () } -} +}} -// `macro_export` shadows std prelude -fn main() { - panic!(); -} +define_exported!(); -mod inner3 { - #[macro_export] - macro_rules! panic { - () => ( struct Г; ) //~ ERROR non-ascii idents are not fully supported - } +mod m { + use exported; + //~^ ERROR macro-expanded `macro_export` macros from the current crate cannot + //~| WARN this was previously accepted } -// `macro_export` shadows builtin macros -include!(); - -mod inner4 { - #[macro_export] - macro_rules! include { - () => ( struct Д; ) //~ ERROR non-ascii idents are not fully supported - } +fn main() { + ::exported!(); + //~^ ERROR macro-expanded `macro_export` macros from the current crate cannot + //~| WARN this was previously accepted } diff --git a/src/test/ui/imports/local-modularized-tricky-fail-2.stderr b/src/test/ui/imports/local-modularized-tricky-fail-2.stderr index 714c04add5f79..5cc6fa1e40a88 100644 --- a/src/test/ui/imports/local-modularized-tricky-fail-2.stderr +++ b/src/test/ui/imports/local-modularized-tricky-fail-2.stderr @@ -1,42 +1,43 @@ -error[E0658]: non-ascii idents are not fully supported - --> $DIR/local-modularized-tricky-fail-2.rs:20:32 +error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths + --> $DIR/local-modularized-tricky-fail-2.rs:13:9 | -LL | exported!(); - | ------------ in this macro invocation -... -LL | () => ( struct Б; ) - | ^ +LL | use exported; + | ^^^^^^^^ | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/local-modularized-tricky-fail-2.rs:36:24 + = note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #52234 +note: the macro is defined here + --> $DIR/local-modularized-tricky-fail-2.rs:5:5 | -LL | panic!(); - | --------- in this macro invocation +LL | / macro_rules! exported { +LL | | () => () +LL | | } + | |_____^ ... -LL | () => ( struct Г; ) - | ^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable +LL | define_exported!(); + | ------------------- in this macro invocation = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0658]: non-ascii idents are not fully supported - --> $DIR/local-modularized-tricky-fail-2.rs:46:24 +error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths + --> $DIR/local-modularized-tricky-fail-2.rs:19:5 | -LL | include!(); - | ----------- in this macro invocation -... -LL | () => ( struct Д; ) - | ^ +LL | ::exported!(); + | ^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #52234 +note: the macro is defined here + --> $DIR/local-modularized-tricky-fail-2.rs:5:5 | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable +LL | / macro_rules! exported { +LL | | () => () +LL | | } + | |_____^ +... +LL | define_exported!(); + | ------------------- in this macro invocation = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/imports/local-modularized-tricky-fail-3.rs b/src/test/ui/imports/local-modularized-tricky-fail-3.rs deleted file mode 100644 index 386de88bc3d62..0000000000000 --- a/src/test/ui/imports/local-modularized-tricky-fail-3.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Crate-local macro expanded `macro_export` macros cannot be accessed with module-relative paths. - -macro_rules! define_exported { () => { - #[macro_export] - macro_rules! exported { - () => () - } -}} - -define_exported!(); - -mod m { - use exported; - //~^ ERROR macro-expanded `macro_export` macros from the current crate cannot - //~| WARN this was previously accepted -} - -fn main() { - ::exported!(); - //~^ ERROR macro-expanded `macro_export` macros from the current crate cannot - //~| WARN this was previously accepted -} diff --git a/src/test/ui/imports/local-modularized-tricky-fail-3.stderr b/src/test/ui/imports/local-modularized-tricky-fail-3.stderr deleted file mode 100644 index 4494a88a5cf95..0000000000000 --- a/src/test/ui/imports/local-modularized-tricky-fail-3.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths - --> $DIR/local-modularized-tricky-fail-3.rs:13:9 - | -LL | use exported; - | ^^^^^^^^ - | - = note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #52234 -note: the macro is defined here - --> $DIR/local-modularized-tricky-fail-3.rs:5:5 - | -LL | / macro_rules! exported { -LL | | () => () -LL | | } - | |_____^ -... -LL | define_exported!(); - | ------------------- in this macro invocation - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - -error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths - --> $DIR/local-modularized-tricky-fail-3.rs:19:5 - | -LL | ::exported!(); - | ^^^^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #52234 -note: the macro is defined here - --> $DIR/local-modularized-tricky-fail-3.rs:5:5 - | -LL | / macro_rules! exported { -LL | | () => () -LL | | } - | |_____^ -... -LL | define_exported!(); - | ------------------- in this macro invocation - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/imports/local-modularized-tricky-pass.rs b/src/test/ui/imports/local-modularized-tricky-pass-1.rs similarity index 100% rename from src/test/ui/imports/local-modularized-tricky-pass.rs rename to src/test/ui/imports/local-modularized-tricky-pass-1.rs diff --git a/src/test/ui/imports/local-modularized-tricky-pass-2.rs b/src/test/ui/imports/local-modularized-tricky-pass-2.rs new file mode 100644 index 0000000000000..d5efbdf78af0f --- /dev/null +++ b/src/test/ui/imports/local-modularized-tricky-pass-2.rs @@ -0,0 +1,50 @@ +// check-pass +// +// `#[macro_export] macro_rules` that doesn't originate from macro expansions can be placed +// into the root module soon enough to act as usual items and shadow globs and preludes. + +#![feature(decl_macro)] + +// `macro_export` shadows globs +use inner1::*; + +mod inner1 { + pub macro exported() {} +} + +exported!(); + +mod deep { + fn deep() { + type Deeper = [u8; { + #[macro_export] + macro_rules! exported { + () => ( struct Б; ) + } + + 0 + }]; + } +} + +// `macro_export` shadows std prelude +fn main() { + panic!(); +} + +mod inner3 { + #[macro_export] + macro_rules! panic { + () => ( struct Г; ) + } +} + +// `macro_export` shadows builtin macros +include!(); + +mod inner4 { + #[macro_export] + macro_rules! include { + () => ( struct Д; ) + } +} diff --git a/src/test/ui/issues/issue-44023.rs b/src/test/ui/issues/issue-44023.rs index 4c38ddfcdf189..e4320b7dac592 100644 --- a/src/test/ui/issues/issue-44023.rs +++ b/src/test/ui/issues/issue-44023.rs @@ -1,5 +1,3 @@ -#![feature(non_ascii_idents)] - pub fn main () {} fn საჭმელად_გემრიელი_სადილი ( ) -> isize { //~ ERROR mismatched types diff --git a/src/test/ui/issues/issue-44023.stderr b/src/test/ui/issues/issue-44023.stderr index fc54e7c62bb24..9e97012416a94 100644 --- a/src/test/ui/issues/issue-44023.stderr +++ b/src/test/ui/issues/issue-44023.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-44023.rs:5:36 + --> $DIR/issue-44023.rs:3:36 | LL | fn საჭმელად_გემრიელი_სადილი ( ) -> isize { | ------------------------ ^^^^^ expected `isize`, found `()` diff --git a/src/test/ui/issues/issue-5883.rs b/src/test/ui/issues/issue-5883.rs index 0de535023972e..82866b355573c 100644 --- a/src/test/ui/issues/issue-5883.rs +++ b/src/test/ui/issues/issue-5883.rs @@ -4,9 +4,9 @@ struct Struct { r: dyn A + 'static } -fn new_struct(r: dyn A + 'static) - -> Struct { //~^ ERROR the size for values of type - //~^ ERROR the size for values of type +fn new_struct( + r: dyn A + 'static //~ ERROR the size for values of type +) -> Struct { //~ ERROR the size for values of type Struct { r: r } } diff --git a/src/test/ui/issues/issue-5883.stderr b/src/test/ui/issues/issue-5883.stderr index 48879eb798f06..de598a70ee06a 100644 --- a/src/test/ui/issues/issue-5883.stderr +++ b/src/test/ui/issues/issue-5883.stderr @@ -1,22 +1,21 @@ error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time - --> $DIR/issue-5883.rs:7:15 + --> $DIR/issue-5883.rs:8:5 | -LL | fn new_struct(r: dyn A + 'static) - | ^ doesn't have a size known at compile-time +LL | r: dyn A + 'static + | ^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `(dyn A + 'static)` = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn new_struct(&r: dyn A + 'static) - | ^ +LL | r: &dyn A + 'static + | ^ error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time - --> $DIR/issue-5883.rs:8:8 + --> $DIR/issue-5883.rs:9:6 | -LL | -> Struct { - | ^^^^^^ doesn't have a size known at compile-time -LL | +LL | ) -> Struct { + | ^^^^^^ doesn't have a size known at compile-time LL | Struct { r: r } | --------------- this returned value is of type `Struct` | diff --git a/src/test/ui/lint/lint-non-snake-case-no-lowercase-equivalent.rs b/src/test/ui/lint/lint-non-snake-case-no-lowercase-equivalent.rs index 710eebe4b6525..9f0c87dcaa61c 100644 --- a/src/test/ui/lint/lint-non-snake-case-no-lowercase-equivalent.rs +++ b/src/test/ui/lint/lint-non-snake-case-no-lowercase-equivalent.rs @@ -3,7 +3,6 @@ #![allow(dead_code)] // pretty-expanded FIXME #23616 -#![feature(non_ascii_idents)] #![deny(non_snake_case)] // This name is neither upper nor lower case diff --git a/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs b/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs index 034499145b780..527d0ea943285 100644 --- a/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs +++ b/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs @@ -1,7 +1,6 @@ #![allow(dead_code)] #![forbid(non_camel_case_types)] -#![feature(non_ascii_idents)] // Some scripts (e.g., hiragana) don't have a concept of // upper/lowercase diff --git a/src/test/ui/lint/lint-nonstandard-style-unicode-1.stderr b/src/test/ui/lint/lint-nonstandard-style-unicode-1.stderr index 371002656591c..6c2aa225e602e 100644 --- a/src/test/ui/lint/lint-nonstandard-style-unicode-1.stderr +++ b/src/test/ui/lint/lint-nonstandard-style-unicode-1.stderr @@ -1,5 +1,5 @@ error: type `χa` should have an upper camel case name - --> $DIR/lint-nonstandard-style-unicode-1.rs:15:8 + --> $DIR/lint-nonstandard-style-unicode-1.rs:14:8 | LL | struct χa; | ^^ help: convert the identifier to upper camel case: `Χa` @@ -11,37 +11,37 @@ LL | #![forbid(non_camel_case_types)] | ^^^^^^^^^^^^^^^^^^^^ error: type `__χa` should have an upper camel case name - --> $DIR/lint-nonstandard-style-unicode-1.rs:23:8 + --> $DIR/lint-nonstandard-style-unicode-1.rs:22:8 | LL | struct __χa; | ^^^^ help: convert the identifier to upper camel case: `Χa` error: type `对__否` should have an upper camel case name - --> $DIR/lint-nonstandard-style-unicode-1.rs:28:8 + --> $DIR/lint-nonstandard-style-unicode-1.rs:27:8 | LL | struct 对__否; | ^^^^^^ help: convert the identifier to upper camel case: `对_否` error: type `ヒ__χ` should have an upper camel case name - --> $DIR/lint-nonstandard-style-unicode-1.rs:31:8 + --> $DIR/lint-nonstandard-style-unicode-1.rs:30:8 | LL | struct ヒ__χ; | ^^^^^ help: convert the identifier to upper camel case: `ヒΧ` error: type `Hello_你好` should have an upper camel case name - --> $DIR/lint-nonstandard-style-unicode-1.rs:37:8 + --> $DIR/lint-nonstandard-style-unicode-1.rs:36:8 | LL | struct Hello_你好; | ^^^^^^^^^^ help: convert the identifier to upper camel case: `Hello你好` error: type `Hello_World` should have an upper camel case name - --> $DIR/lint-nonstandard-style-unicode-1.rs:40:8 + --> $DIR/lint-nonstandard-style-unicode-1.rs:39:8 | LL | struct Hello_World; | ^^^^^^^^^^^ help: convert the identifier to upper camel case: `HelloWorld` error: type `你_ӟ` should have an upper camel case name - --> $DIR/lint-nonstandard-style-unicode-1.rs:43:8 + --> $DIR/lint-nonstandard-style-unicode-1.rs:42:8 | LL | struct 你_ӟ; | ^^^^ help: convert the identifier to upper camel case: `你Ӟ` diff --git a/src/test/ui/lint/lint-nonstandard-style-unicode-2.rs b/src/test/ui/lint/lint-nonstandard-style-unicode-2.rs index 0b52a5fde35dc..9690be5908b73 100644 --- a/src/test/ui/lint/lint-nonstandard-style-unicode-2.rs +++ b/src/test/ui/lint/lint-nonstandard-style-unicode-2.rs @@ -1,7 +1,6 @@ #![allow(dead_code)] #![forbid(non_snake_case)] -#![feature(non_ascii_idents)] // Some scripts (e.g., hiragana) don't have a concept of // upper/lowercase diff --git a/src/test/ui/lint/lint-nonstandard-style-unicode-2.stderr b/src/test/ui/lint/lint-nonstandard-style-unicode-2.stderr index 0b309e315a411..8eb0654e0a193 100644 --- a/src/test/ui/lint/lint-nonstandard-style-unicode-2.stderr +++ b/src/test/ui/lint/lint-nonstandard-style-unicode-2.stderr @@ -1,5 +1,5 @@ error: function `Ц` should have a snake case name - --> $DIR/lint-nonstandard-style-unicode-2.rs:18:4 + --> $DIR/lint-nonstandard-style-unicode-2.rs:17:4 | LL | fn Ц() {} | ^ help: convert the identifier to snake case: `ц` @@ -11,7 +11,7 @@ LL | #![forbid(non_snake_case)] | ^^^^^^^^^^^^^^ error: function `分__隔` should have a snake case name - --> $DIR/lint-nonstandard-style-unicode-2.rs:23:4 + --> $DIR/lint-nonstandard-style-unicode-2.rs:22:4 | LL | fn 分__隔() {} | ^^^^^^ help: convert the identifier to snake case: `分_隔` diff --git a/src/test/ui/lint/lint-nonstandard-style-unicode-3.rs b/src/test/ui/lint/lint-nonstandard-style-unicode-3.rs index b17c2de39a0c0..9175be7a0f49d 100644 --- a/src/test/ui/lint/lint-nonstandard-style-unicode-3.rs +++ b/src/test/ui/lint/lint-nonstandard-style-unicode-3.rs @@ -1,7 +1,6 @@ #![allow(dead_code)] #![forbid(non_upper_case_globals)] -#![feature(non_ascii_idents)] // Some scripts (e.g., hiragana) don't have a concept of // upper/lowercase diff --git a/src/test/ui/lint/lint-nonstandard-style-unicode-3.stderr b/src/test/ui/lint/lint-nonstandard-style-unicode-3.stderr index 44bd5ad55ff5c..970e6b838ada0 100644 --- a/src/test/ui/lint/lint-nonstandard-style-unicode-3.stderr +++ b/src/test/ui/lint/lint-nonstandard-style-unicode-3.stderr @@ -1,5 +1,5 @@ error: static variable `τεχ` should have an upper case name - --> $DIR/lint-nonstandard-style-unicode-3.rs:18:8 + --> $DIR/lint-nonstandard-style-unicode-3.rs:17:8 | LL | static τεχ: f32 = 3.14159265; | ^^^ help: convert the identifier to upper case: `ΤΕΧ` diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs index 2c711f994043f..e7da825ae36d1 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs @@ -1,4 +1,3 @@ -#![feature(non_ascii_idents)] #![deny(confusable_idents)] #![allow(uncommon_codepoints, non_upper_case_globals)] diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.stderr b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.stderr index b9af60963adf6..e9906c83d126c 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.stderr +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.stderr @@ -1,5 +1,5 @@ error: identifier pair considered confusable between `s` and `s` - --> $DIR/lint-confusable-idents.rs:9:9 + --> $DIR/lint-confusable-idents.rs:8:9 | LL | const s: usize = 42; | -- this is where the previous identifier occurred @@ -8,13 +8,13 @@ LL | let s = "rust"; | ^ | note: the lint level is defined here - --> $DIR/lint-confusable-idents.rs:2:9 + --> $DIR/lint-confusable-idents.rs:1:9 | LL | #![deny(confusable_idents)] | ^^^^^^^^^^^^^^^^^ error: identifier pair considered confusable between `s_s` and `s_s` - --> $DIR/lint-confusable-idents.rs:10:9 + --> $DIR/lint-confusable-idents.rs:9:9 | LL | const s_s: usize = 42; | --- this is where the previous identifier occurred diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables-2.rs b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables-2.rs index a5b45466da5ca..f62c8a19031dc 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables-2.rs +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables-2.rs @@ -1,5 +1,4 @@ // check-pass -#![feature(non_ascii_idents)] #![deny(mixed_script_confusables)] struct ΑctuallyNotLatin; diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.rs b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.rs index 4637b03f250de..7ee9c41f6a091 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.rs +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.rs @@ -1,4 +1,3 @@ -#![feature(non_ascii_idents)] #![deny(mixed_script_confusables)] struct ΑctuallyNotLatin; diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr index 6f75a1ece3766..4018b381fb8c5 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr @@ -1,11 +1,11 @@ error: The usage of Script Group `Greek` in this crate consists solely of mixed script confusables - --> $DIR/lint-mixed-script-confusables.rs:4:8 + --> $DIR/lint-mixed-script-confusables.rs:3:8 | LL | struct ΑctuallyNotLatin; | ^^^^^^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/lint-mixed-script-confusables.rs:2:9 + --> $DIR/lint-mixed-script-confusables.rs:1:9 | LL | #![deny(mixed_script_confusables)] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | #![deny(mixed_script_confusables)] = note: Please recheck to make sure their usages are indeed what you want. error: The usage of Script Group `Cyrillic` in this crate consists solely of mixed script confusables - --> $DIR/lint-mixed-script-confusables.rs:11:5 + --> $DIR/lint-mixed-script-confusables.rs:10:5 | LL | mod роре { | ^^^^ @@ -22,7 +22,7 @@ LL | mod роре { = note: Please recheck to make sure their usages are indeed what you want. error: The usage of Script Group `Japanese, Katakana` in this crate consists solely of mixed script confusables - --> $DIR/lint-mixed-script-confusables.rs:13:11 + --> $DIR/lint-mixed-script-confusables.rs:12:11 | LL | const エ: &'static str = "アイウ"; | ^^ diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-non-ascii-idents.rs b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-non-ascii-idents.rs index 20d00cf701a15..8ae1744096dde 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-non-ascii-idents.rs +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-non-ascii-idents.rs @@ -1,4 +1,3 @@ -#![feature(non_ascii_idents)] #![deny(non_ascii_idents)] const חלודה: usize = 2; //~ ERROR identifier contains non-ASCII characters diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-non-ascii-idents.stderr b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-non-ascii-idents.stderr index 048b6ff5d687f..8ed7f093ce340 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-non-ascii-idents.stderr +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-non-ascii-idents.stderr @@ -1,23 +1,23 @@ error: identifier contains non-ASCII characters - --> $DIR/lint-non-ascii-idents.rs:4:7 + --> $DIR/lint-non-ascii-idents.rs:3:7 | LL | const חלודה: usize = 2; | ^^^^^ | note: the lint level is defined here - --> $DIR/lint-non-ascii-idents.rs:2:9 + --> $DIR/lint-non-ascii-idents.rs:1:9 | LL | #![deny(non_ascii_idents)] | ^^^^^^^^^^^^^^^^ error: identifier contains non-ASCII characters - --> $DIR/lint-non-ascii-idents.rs:6:4 + --> $DIR/lint-non-ascii-idents.rs:5:4 | LL | fn coöperation() {} | ^^^^^^^^^^^ error: identifier contains non-ASCII characters - --> $DIR/lint-non-ascii-idents.rs:9:9 + --> $DIR/lint-non-ascii-idents.rs:8:9 | LL | let naïveté = 2; | ^^^^^^^ diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs index b5e251e047b5a..81a3427a10274 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.rs @@ -1,4 +1,3 @@ -#![feature(non_ascii_idents)] #![deny(uncommon_codepoints)] const µ: f64 = 0.000001; //~ ERROR identifier contains uncommon Unicode codepoints diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr index 05ea3d5de7dbc..d435282a6e855 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-uncommon-codepoints.stderr @@ -1,23 +1,23 @@ error: identifier contains uncommon Unicode codepoints - --> $DIR/lint-uncommon-codepoints.rs:4:7 + --> $DIR/lint-uncommon-codepoints.rs:3:7 | LL | const µ: f64 = 0.000001; | ^ | note: the lint level is defined here - --> $DIR/lint-uncommon-codepoints.rs:2:9 + --> $DIR/lint-uncommon-codepoints.rs:1:9 | LL | #![deny(uncommon_codepoints)] | ^^^^^^^^^^^^^^^^^^^ error: identifier contains uncommon Unicode codepoints - --> $DIR/lint-uncommon-codepoints.rs:6:4 + --> $DIR/lint-uncommon-codepoints.rs:5:4 | LL | fn dijkstra() {} | ^^^^^^^ error: identifier contains uncommon Unicode codepoints - --> $DIR/lint-uncommon-codepoints.rs:9:9 + --> $DIR/lint-uncommon-codepoints.rs:8:9 | LL | let ㇻㇲㇳ = "rust"; | ^^^^^^ diff --git a/src/test/ui/lint/special-upper-lower-cases.rs b/src/test/ui/lint/special-upper-lower-cases.rs index 71ebf05dd31ab..761be61fa07f6 100644 --- a/src/test/ui/lint/special-upper-lower-cases.rs +++ b/src/test/ui/lint/special-upper-lower-cases.rs @@ -5,7 +5,6 @@ // check-pass -#![feature(non_ascii_idents)] #![allow(uncommon_codepoints, unused)] struct 𝕟𝕠𝕥𝕒𝕔𝕒𝕞𝕖𝕝; diff --git a/src/test/ui/lint/special-upper-lower-cases.stderr b/src/test/ui/lint/special-upper-lower-cases.stderr index e3b451a15a2cc..2aa13c33be3a6 100644 --- a/src/test/ui/lint/special-upper-lower-cases.stderr +++ b/src/test/ui/lint/special-upper-lower-cases.stderr @@ -1,5 +1,5 @@ warning: type `𝕟𝕠𝕥𝕒𝕔𝕒𝕞𝕖𝕝` should have an upper camel case name - --> $DIR/special-upper-lower-cases.rs:11:8 + --> $DIR/special-upper-lower-cases.rs:10:8 | LL | struct 𝕟𝕠𝕥𝕒𝕔𝕒𝕞𝕖𝕝; | ^^^^^^^^^ should have an UpperCamelCase name @@ -7,13 +7,13 @@ LL | struct 𝕟𝕠𝕥𝕒𝕔𝕒𝕞𝕖𝕝; = note: `#[warn(non_camel_case_types)]` on by default warning: type `𝕟𝕠𝕥_𝕒_𝕔𝕒𝕞𝕖𝕝` should have an upper camel case name - --> $DIR/special-upper-lower-cases.rs:15:8 + --> $DIR/special-upper-lower-cases.rs:14:8 | LL | struct 𝕟𝕠𝕥_𝕒_𝕔𝕒𝕞𝕖𝕝; | ^^^^^^^^^^^ should have an UpperCamelCase name warning: static variable `𝗻𝗼𝗻𝘂𝗽𝗽𝗲𝗿𝗰𝗮𝘀𝗲` should have an upper case name - --> $DIR/special-upper-lower-cases.rs:18:8 + --> $DIR/special-upper-lower-cases.rs:17:8 | LL | static 𝗻𝗼𝗻𝘂𝗽𝗽𝗲𝗿𝗰𝗮𝘀𝗲: i32 = 1; | ^^^^^^^^^^^^ should have an UPPER_CASE name @@ -21,7 +21,7 @@ LL | static 𝗻𝗼𝗻𝘂𝗽𝗽𝗲𝗿𝗰𝗮𝘀𝗲: i32 = 1; = note: `#[warn(non_upper_case_globals)]` on by default warning: variable `𝓢𝓝𝓐𝓐𝓐𝓐𝓚𝓔𝓢` should have a snake case name - --> $DIR/special-upper-lower-cases.rs:22:9 + --> $DIR/special-upper-lower-cases.rs:21:9 | LL | let 𝓢𝓝𝓐𝓐𝓐𝓐𝓚𝓔𝓢 = 1; | ^^^^^^^^^ should have a snake_case name diff --git a/src/test/ui/never_type/defaulted-never-note.rs b/src/test/ui/never_type/defaulted-never-note.rs index c96c4784dcf32..6979c3ec44318 100644 --- a/src/test/ui/never_type/defaulted-never-note.rs +++ b/src/test/ui/never_type/defaulted-never-note.rs @@ -26,7 +26,9 @@ fn smeg() { foo(_x); //~^ ERROR the trait bound //~| NOTE the trait `ImplementedForUnitButNotNever` is not implemented - //~| NOTE the trait is implemented for `()` + //~| NOTE this trait is implemented for `()` + //~| NOTE this error might have been caused + //~| HELP did you intend } fn main() { diff --git a/src/test/ui/never_type/defaulted-never-note.stderr b/src/test/ui/never_type/defaulted-never-note.stderr index 69691883de1e3..99738375022f9 100644 --- a/src/test/ui/never_type/defaulted-never-note.stderr +++ b/src/test/ui/never_type/defaulted-never-note.stderr @@ -7,7 +7,9 @@ LL | fn foo(_t: T) {} LL | foo(_x); | ^^^ the trait `ImplementedForUnitButNotNever` is not implemented for `!` | - = note: the trait is implemented for `()`. Possibly this error has been caused by changes to Rust's type-inference algorithm (see issue #48950 for more information). Consider whether you meant to use the type `()` here instead. + = note: this trait is implemented for `()`. + = note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 for more information). + = help: did you intend to use the type `()` here instead? error: aborting due to previous error diff --git a/src/test/ui/parser/issue-48508.rs b/src/test/ui/parser/issue-48508.rs index 8dc9351260ebc..37d04c5d65f06 100644 --- a/src/test/ui/parser/issue-48508.rs +++ b/src/test/ui/parser/issue-48508.rs @@ -10,7 +10,6 @@ // ignore-pretty issue #37195 // ignore-asmjs wasm2js does not support source maps yet -#![feature(non_ascii_idents)] #![allow(uncommon_codepoints)] #[path = "issue-48508-aux.rs"] diff --git a/src/test/ui/parser/multibyte-char-use-seperator-issue-80134.rs b/src/test/ui/parser/multibyte-char-use-seperator-issue-80134.rs index f3ae3aba9b9e6..7e7995d6724eb 100644 --- a/src/test/ui/parser/multibyte-char-use-seperator-issue-80134.rs +++ b/src/test/ui/parser/multibyte-char-use-seperator-issue-80134.rs @@ -4,9 +4,7 @@ fn main() { (()é); //~^ ERROR: expected one of `)`, `,`, `.`, `?`, or an operator //~| ERROR: cannot find value `é` in this scope - //~| ERROR: non-ascii idents are not fully supported (()氷); //~^ ERROR: expected one of `)`, `,`, `.`, `?`, or an operator //~| ERROR: cannot find value `氷` in this scope - //~| ERROR: non-ascii idents are not fully supported } diff --git a/src/test/ui/parser/multibyte-char-use-seperator-issue-80134.stderr b/src/test/ui/parser/multibyte-char-use-seperator-issue-80134.stderr index 892cc92b1bdeb..21e71aa121560 100644 --- a/src/test/ui/parser/multibyte-char-use-seperator-issue-80134.stderr +++ b/src/test/ui/parser/multibyte-char-use-seperator-issue-80134.stderr @@ -8,7 +8,7 @@ LL | (()é); | help: missing `,` error: expected one of `)`, `,`, `.`, `?`, or an operator, found `氷` - --> $DIR/multibyte-char-use-seperator-issue-80134.rs:8:8 + --> $DIR/multibyte-char-use-seperator-issue-80134.rs:7:8 | LL | (()氷); | -^ @@ -23,30 +23,11 @@ LL | (()é); | ^ not found in this scope error[E0425]: cannot find value `氷` in this scope - --> $DIR/multibyte-char-use-seperator-issue-80134.rs:8:8 + --> $DIR/multibyte-char-use-seperator-issue-80134.rs:7:8 | LL | (()氷); | ^^ not found in this scope -error[E0658]: non-ascii idents are not fully supported - --> $DIR/multibyte-char-use-seperator-issue-80134.rs:4:8 - | -LL | (()é); - | ^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/multibyte-char-use-seperator-issue-80134.rs:8:8 - | -LL | (()氷); - | ^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error: aborting due to 6 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0425, E0658. -For more information about an error, try `rustc --explain E0425`. +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-5035-2.stderr b/src/test/ui/resolve/issue-5035-2.stderr index b2084a7a426a6..e94877fded784 100644 --- a/src/test/ui/resolve/issue-5035-2.stderr +++ b/src/test/ui/resolve/issue-5035-2.stderr @@ -8,8 +8,8 @@ LL | fn foo(_x: K) {} = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn foo(&_x: K) {} - | ^ +LL | fn foo(_x: &K) {} + | ^ error: aborting due to previous error diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs index 310545b92d549..c07ba54af4032 100644 --- a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs +++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs @@ -1,5 +1,3 @@ -#![feature(non_ascii_idents)] - extern crate ьаг; //~ ERROR cannot load a crate with a non-ascii name `ьаг` fn main() {} diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr index 11108f2fb8678..a8f3abe599eb2 100644 --- a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr +++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr @@ -1,5 +1,5 @@ error: cannot load a crate with a non-ascii name `ьаг` - --> $DIR/crate_name_nonascii_forbidden-1.rs:3:1 + --> $DIR/crate_name_nonascii_forbidden-1.rs:1:1 | LL | extern crate ьаг; | ^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs index 0249848b35ac0..f8e033937c607 100644 --- a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs +++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs @@ -1,6 +1,5 @@ // compile-flags:--extern му_сгате // edition:2018 -#![feature(non_ascii_idents)] use му_сгате::baz; //~ ERROR cannot load a crate with a non-ascii name `му_сгате` diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr index 8d3548ed33dcf..05fc4fb22ad1e 100644 --- a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr +++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr @@ -1,5 +1,5 @@ error: cannot load a crate with a non-ascii name `му_сгате` - --> $DIR/crate_name_nonascii_forbidden-2.rs:5:5 + --> $DIR/crate_name_nonascii_forbidden-2.rs:4:5 | LL | use му_сгате::baz; | ^^^^^^^^ diff --git a/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.rs b/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.rs index c70ced731d54d..ad6825404306a 100644 --- a/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.rs +++ b/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.rs @@ -1,5 +1,4 @@ #![feature(extern_types)] -#![feature(non_ascii_idents)] extern "C" { type 一; //~ items in `extern` blocks cannot use non-ascii identifiers diff --git a/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr b/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr index 3b18c06ec5c4c..ab8832e916315 100644 --- a/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr +++ b/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr @@ -1,5 +1,5 @@ error: items in `extern` blocks cannot use non-ascii identifiers - --> $DIR/extern_block_nonascii_forbidden.rs:5:10 + --> $DIR/extern_block_nonascii_forbidden.rs:4:10 | LL | extern "C" { | ---------- in this `extern` block @@ -9,7 +9,7 @@ LL | type 一; = note: This limitation may be lifted in the future; see issue #83942 for more information error: items in `extern` blocks cannot use non-ascii identifiers - --> $DIR/extern_block_nonascii_forbidden.rs:6:8 + --> $DIR/extern_block_nonascii_forbidden.rs:5:8 | LL | extern "C" { | ---------- in this `extern` block @@ -20,7 +20,7 @@ LL | fn 二(); = note: This limitation may be lifted in the future; see issue #83942 for more information error: items in `extern` blocks cannot use non-ascii identifiers - --> $DIR/extern_block_nonascii_forbidden.rs:7:12 + --> $DIR/extern_block_nonascii_forbidden.rs:6:12 | LL | extern "C" { | ---------- in this `extern` block diff --git a/src/test/ui/rfc-2457/idents-normalized.rs b/src/test/ui/rfc-2457/idents-normalized.rs index 109cec7548e2f..1023fee37d5dd 100644 --- a/src/test/ui/rfc-2457/idents-normalized.rs +++ b/src/test/ui/rfc-2457/idents-normalized.rs @@ -1,5 +1,4 @@ // check-pass -#![feature(non_ascii_idents)] struct Résumé; // ['LATIN SMALL LETTER E WITH ACUTE'] diff --git a/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.rs b/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.rs index efd2932f15294..e949e2319c1c4 100644 --- a/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.rs +++ b/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.rs @@ -1,5 +1,3 @@ -#![feature(non_ascii_idents)] - mod řųśť; //~ trying to load file for //~^ file not found for diff --git a/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr b/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr index 6e06ab737c215..e857a1e60e5fe 100644 --- a/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr +++ b/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr @@ -1,5 +1,5 @@ error[E0583]: file not found for module `řųśť` - --> $DIR/mod_file_nonascii_forbidden.rs:3:1 + --> $DIR/mod_file_nonascii_forbidden.rs:1:1 | LL | mod řųśť; | ^^^^^^^^^ @@ -7,7 +7,7 @@ LL | mod řųśť; = help: to create the module `řųśť`, create file "$DIR/řųśť.rs" error[E0754]: trying to load file for module `řųśť` with non-ascii identifier name - --> $DIR/mod_file_nonascii_forbidden.rs:3:5 + --> $DIR/mod_file_nonascii_forbidden.rs:1:5 | LL | mod řųśť; | ^^^^ diff --git a/src/test/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs b/src/test/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs index e9f3fba2fb01e..94327846d6169 100644 --- a/src/test/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs +++ b/src/test/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs @@ -1,5 +1,4 @@ // check-pass -#![feature(non_ascii_idents)] #[path="auxiliary/mod_file_nonascii_with_path_allowed-aux.rs"] mod řųśť; diff --git a/src/test/ui/rfc-2457/mod_inline_nonascii_allowed.rs b/src/test/ui/rfc-2457/mod_inline_nonascii_allowed.rs index dd27da432ba65..e1d836b7c3e34 100644 --- a/src/test/ui/rfc-2457/mod_inline_nonascii_allowed.rs +++ b/src/test/ui/rfc-2457/mod_inline_nonascii_allowed.rs @@ -1,5 +1,4 @@ // check-pass -#![feature(non_ascii_idents)] mod řųśť { const IS_GREAT: bool = true; diff --git a/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.rs b/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.rs index a408c9757165c..0325d6436abcb 100644 --- a/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.rs +++ b/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.rs @@ -1,5 +1,3 @@ -#![feature(non_ascii_idents)] - #[no_mangle] pub fn řųśť() {} //~ `#[no_mangle]` requires ASCII identifier diff --git a/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr b/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr index 4ca83e4103208..b4b2b0c7ee001 100644 --- a/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr +++ b/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr @@ -1,5 +1,5 @@ error[E0754]: `#[no_mangle]` requires ASCII identifier - --> $DIR/no_mangle_nonascii_forbidden.rs:4:1 + --> $DIR/no_mangle_nonascii_forbidden.rs:2:1 | LL | pub fn řųśť() {} | ^^^^^^^^^^^^^ diff --git a/src/test/ui/suggestions/path-by-value.stderr b/src/test/ui/suggestions/path-by-value.stderr index 19fc3406ccfe4..5919a6f749205 100644 --- a/src/test/ui/suggestions/path-by-value.stderr +++ b/src/test/ui/suggestions/path-by-value.stderr @@ -9,8 +9,8 @@ LL | fn f(p: Path) { } = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn f(&p: Path) { } - | ^ +LL | fn f(p: &Path) { } + | ^ error: aborting due to previous error diff --git a/src/test/ui/traits/bound/not-on-bare-trait.stderr b/src/test/ui/traits/bound/not-on-bare-trait.stderr index e7fc0fa5ec0ec..b8ae88ace02dd 100644 --- a/src/test/ui/traits/bound/not-on-bare-trait.stderr +++ b/src/test/ui/traits/bound/not-on-bare-trait.stderr @@ -16,8 +16,8 @@ LL | fn foo(_x: Foo + Send) { = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn foo(&_x: Foo + Send) { - | ^ +LL | fn foo(_x: &Foo + Send) { + | ^ error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/unsized/unsized-fn-arg.fixed b/src/test/ui/unsized/unsized-fn-arg.fixed new file mode 100644 index 0000000000000..2c686c6c2b271 --- /dev/null +++ b/src/test/ui/unsized/unsized-fn-arg.fixed @@ -0,0 +1,6 @@ +// run-rustfix +#![crate_type="lib"] +#![allow(unused)] + +fn f(t: &T) {} +//~^ ERROR the size for values of type `T` cannot be known at compilation time diff --git a/src/test/ui/unsized/unsized-fn-arg.rs b/src/test/ui/unsized/unsized-fn-arg.rs new file mode 100644 index 0000000000000..9fc08bd6d3e75 --- /dev/null +++ b/src/test/ui/unsized/unsized-fn-arg.rs @@ -0,0 +1,6 @@ +// run-rustfix +#![crate_type="lib"] +#![allow(unused)] + +fn f(t: T) {} +//~^ ERROR the size for values of type `T` cannot be known at compilation time diff --git a/src/test/ui/unsized/unsized-fn-arg.stderr b/src/test/ui/unsized/unsized-fn-arg.stderr new file mode 100644 index 0000000000000..6b802ddf542d5 --- /dev/null +++ b/src/test/ui/unsized/unsized-fn-arg.stderr @@ -0,0 +1,17 @@ +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/unsized-fn-arg.rs:5:17 + | +LL | fn f(t: T) {} + | - ^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | + = help: unsized fn params are gated as an unstable feature +help: function arguments must have a statically known size, borrowed types always have a known size + | +LL | fn f(t: &T) {} + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/unsized-tuple-impls.rs b/src/test/ui/unsized/unsized-tuple-impls.rs similarity index 100% rename from src/test/ui/unsized-tuple-impls.rs rename to src/test/ui/unsized/unsized-tuple-impls.rs diff --git a/src/test/ui/unsized.rs b/src/test/ui/unsized/unsized.rs similarity index 100% rename from src/test/ui/unsized.rs rename to src/test/ui/unsized/unsized.rs diff --git a/src/test/ui/unsized2.rs b/src/test/ui/unsized/unsized2.rs similarity index 100% rename from src/test/ui/unsized2.rs rename to src/test/ui/unsized/unsized2.rs diff --git a/src/test/ui/unsized3-rpass.rs b/src/test/ui/unsized/unsized3-rpass.rs similarity index 100% rename from src/test/ui/unsized3-rpass.rs rename to src/test/ui/unsized/unsized3-rpass.rs diff --git a/src/test/ui/unsized3.rs b/src/test/ui/unsized/unsized3.rs similarity index 100% rename from src/test/ui/unsized3.rs rename to src/test/ui/unsized/unsized3.rs diff --git a/src/test/ui/unsized3.stderr b/src/test/ui/unsized/unsized3.stderr similarity index 100% rename from src/test/ui/unsized3.stderr rename to src/test/ui/unsized/unsized3.stderr diff --git a/src/test/ui/unsized5.rs b/src/test/ui/unsized/unsized5.rs similarity index 100% rename from src/test/ui/unsized5.rs rename to src/test/ui/unsized/unsized5.rs diff --git a/src/test/ui/unsized5.stderr b/src/test/ui/unsized/unsized5.stderr similarity index 100% rename from src/test/ui/unsized5.stderr rename to src/test/ui/unsized/unsized5.stderr diff --git a/src/test/ui/unsized6.rs b/src/test/ui/unsized/unsized6.rs similarity index 100% rename from src/test/ui/unsized6.rs rename to src/test/ui/unsized/unsized6.rs diff --git a/src/test/ui/unsized6.stderr b/src/test/ui/unsized/unsized6.stderr similarity index 97% rename from src/test/ui/unsized6.stderr rename to src/test/ui/unsized/unsized6.stderr index f9f7877d5426a..8e5734dffb145 100644 --- a/src/test/ui/unsized6.stderr +++ b/src/test/ui/unsized/unsized6.stderr @@ -135,8 +135,8 @@ LL | fn g1(x: X) {} = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn g1(&x: X) {} - | ^ +LL | fn g1(x: &X) {} + | ^ error[E0277]: the size for values of type `X` cannot be known at compilation time --> $DIR/unsized6.rs:40:22 @@ -149,8 +149,8 @@ LL | fn g2(x: X) {} = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | fn g2(&x: X) {} - | ^ +LL | fn g2(x: &X) {} + | ^ error: aborting due to 13 previous errors diff --git a/src/test/ui/unsized7.rs b/src/test/ui/unsized/unsized7.rs similarity index 100% rename from src/test/ui/unsized7.rs rename to src/test/ui/unsized/unsized7.rs diff --git a/src/test/ui/unsized7.stderr b/src/test/ui/unsized/unsized7.stderr similarity index 100% rename from src/test/ui/unsized7.stderr rename to src/test/ui/unsized/unsized7.stderr diff --git a/src/test/ui/utf8_idents-rpass.rs b/src/test/ui/utf8_idents-rpass.rs index 582b67bc29924..206744a58fde4 100644 --- a/src/test/ui/utf8_idents-rpass.rs +++ b/src/test/ui/utf8_idents-rpass.rs @@ -2,8 +2,6 @@ // #![allow(non_snake_case)] -#![feature(non_ascii_idents)] - pub fn main() { let ε = 0.00001f64; let Π = 3.14f64; diff --git a/src/test/ui/utf8_idents.rs b/src/test/ui/utf8_idents.rs index 6c54086cc2009..1f6326dd94b5c 100644 --- a/src/test/ui/utf8_idents.rs +++ b/src/test/ui/utf8_idents.rs @@ -1,15 +1,16 @@ -#![allow(mixed_script_confusables)] +// check-pass +// +#![allow(mixed_script_confusables, non_camel_case_types)] fn foo< - 'β, //~ ERROR non-ascii idents are not fully supported - γ //~ ERROR non-ascii idents are not fully supported - //~^ WARN type parameter `γ` should have an upper camel case name + 'β, + γ >() {} struct X { - δ: usize //~ ERROR non-ascii idents are not fully supported + δ: usize } pub fn main() { - let α = 0.00001f64; //~ ERROR non-ascii idents are not fully supported + let α = 0.00001f64; } diff --git a/src/test/ui/utf8_idents.stderr b/src/test/ui/utf8_idents.stderr deleted file mode 100644 index 2fc0b1c39effb..0000000000000 --- a/src/test/ui/utf8_idents.stderr +++ /dev/null @@ -1,47 +0,0 @@ -error[E0658]: non-ascii idents are not fully supported - --> $DIR/utf8_idents.rs:4:5 - | -LL | 'β, - | ^^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/utf8_idents.rs:5:5 - | -LL | γ - | ^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/utf8_idents.rs:10:5 - | -LL | δ: usize - | ^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -error[E0658]: non-ascii idents are not fully supported - --> $DIR/utf8_idents.rs:14:9 - | -LL | let α = 0.00001f64; - | ^ - | - = note: see issue #55467 for more information - = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable - -warning: type parameter `γ` should have an upper camel case name - --> $DIR/utf8_idents.rs:5:5 - | -LL | γ - | ^ help: convert the identifier to upper camel case: `Γ` - | - = note: `#[warn(non_camel_case_types)]` on by default - -error: aborting due to 4 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0658`.