Auto merge of #65076 - tmandry:rollup-ka7nzb6, r=tmandry

Rollup of 11 pull requests

Successful merges:

 - #61879 (Stabilize todo macro)
 - #64675 (Deprecate `#![plugin]` & `#[plugin_registrar]`)
 - #64690 (proc_macro API: Expose `macro_rules` hygiene)
 - #64706 (add regression test for #60218)
 - #64741 (Prevent rustdoc feature doctests)
 - #64842 (Disallow Self in type param defaults of ADTs)
 - #65004 (Replace mentions of IRC with Discord)
 - #65018 (Set RUST_BACKTRACE=0 in tests that include a backtrace in stderr)
 - #65055 (Add long error explanation for E0556)
 - #65056 (Make visit projection iterative)
 - #65057 (typo: fix typo in E0392)

Failed merges:

r? @ghost
This commit is contained in:
bors 2019-10-03 23:29:48 +00:00
commit 31d75c4e9c
111 changed files with 1175 additions and 427 deletions

View File

@ -33,7 +33,7 @@ In the Rust community we strive to go the extra step to look out for each other.
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust, #rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
The enforcement policies listed above apply to all official Rust venues; including all communication channels (Rust Discord server, Rust Zulip server); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
*Adapted from the [Node.js Policy on Trolling](https://blog.izs.me/2012/08/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*

View File

@ -15,7 +15,7 @@ links to the major sections:
* [Helpful Links and Information](#helpful-links-and-information)
If you have questions, please make a post on [internals.rust-lang.org][internals] or
hop on the [Rust Discord server][rust-discord], [Rust Zulip server][rust-zulip] or [#rust-internals][pound-rust-internals].
hop on the [Rust Discord server][rust-discord] or [Rust Zulip server][rust-zulip].
As a reminder, all contributors are expected to follow our [Code of Conduct][coc].
@ -25,7 +25,6 @@ to contribute to it in more detail than this document.
If this is your first time contributing, the [walkthrough] chapter of the guide
can give you a good example of how a typical contribution would go.
[pound-rust-internals]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
[internals]: https://internals.rust-lang.org
[rust-discord]: http://discord.gg/rust-lang
[rust-zulip]: https://rust-lang.zulipchat.com
@ -404,7 +403,7 @@ If you're looking for somewhere to start, check out the [E-easy][eeasy] tag.
There are a number of other ways to contribute to Rust that don't deal with
this repository.
Answer questions in [#rust][pound-rust], or on [users.rust-lang.org][users],
Answer questions in the _Get Help!_ channels from the [Rust Discord server][rust-discord], on [users.rust-lang.org][users],
or on [StackOverflow][so].
Participate in the [RFC process](https://github.com/rust-lang/rfcs).
@ -413,7 +412,7 @@ Find a [requested community library][community-library], build it, and publish
it to [Crates.io](http://crates.io). Easier said than done, but very, very
valuable!
[pound-rust]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
[rust-discord]: https://discord.gg/rust-lang
[users]: https://users.rust-lang.org/
[so]: http://stackoverflow.com/questions/tagged/rust
[community-library]: https://github.com/rust-lang/rfcs/labels/A-community-library

View File

@ -244,19 +244,17 @@ The Rust community congregates in a few places:
To contribute to Rust, please see [CONTRIBUTING](CONTRIBUTING.md).
Rust has an [IRC] culture and most real-time collaboration happens in a
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
most popular channel is [#rust], a venue for general discussion about
Rust. And a good place to ask for help would be [#rust-beginners].
Most real-time collaboration happens in a variety of channels on the
[Rust Discord server][rust-discord], with channels dedicated for getting help,
community, documentation, and all major contribution areas in the Rust ecosystem.
A good place to ask for help would be the #help channel.
The [rustc guide] might be a good place to start if you want to find out how
various parts of the compiler work.
Also, you may find the [rustdocs for the compiler itself][rustdocs] useful.
[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
[#rust]: irc://irc.mozilla.org/rust
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
[rust-discord]: https://discord.gg/rust-lang
[rustc guide]: https://rust-lang.github.io/rustc-guide/about-this-guide.html
[rustdocs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/

View File

@ -328,6 +328,8 @@ are:
`Config` struct.
* Adding a sanity check? Take a look at `bootstrap/sanity.rs`.
If you have any questions feel free to reach out on `#rust-infra` on IRC or ask on
internals.rust-lang.org. When you encounter bugs, please file issues on the
rust-lang/rust issue tracker.
If you have any questions feel free to reach out on `#infra` channel in the
[Rust Discord server][rust-discord] or ask on internals.rust-lang.org. When
you encounter bugs, please file issues on the rust-lang/rust issue tracker.
[rust-discord]: https://discord.gg/rust-lang

View File

@ -465,7 +465,7 @@ macro_rules! writeln {
/// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which
/// will cause undefined behavior if the code is reached.
///
/// [`panic!`]: ../std/macro.panic.html
/// [`panic!`]: ../std/macro.panic.html
/// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
/// [`std::hint`]: ../std/hint/index.html
///
@ -474,6 +474,7 @@ macro_rules! writeln {
/// This will always [`panic!`]
///
/// [`panic!`]: ../std/macro.panic.html
///
/// # Examples
///
/// Match arms:
@ -525,6 +526,9 @@ macro_rules! unreachable {
/// code type-check, or if you're implementing a trait that requires multiple
/// methods, and you're only planning on using one of them.
///
/// There is no difference between `unimplemented!` and `todo!` apart from the
/// name.
///
/// # Panics
///
/// This will always [panic!](macro.panic.html)
@ -579,8 +583,10 @@ macro_rules! unimplemented {
/// Indicates unfinished code.
///
/// This can be useful if you are prototyping and are just looking to have your
/// code typecheck. `todo!` works exactly like `unimplemented!`. The only
/// difference between the two macros is the name.
/// code typecheck.
///
/// There is no difference between `unimplemented!` and `todo!` apart from the
/// name.
///
/// # Panics
///
@ -602,8 +608,6 @@ macro_rules! unimplemented {
/// `baz()`, so we can use `todo!`:
///
/// ```
/// #![feature(todo_macro)]
///
/// # trait Foo {
/// # fn bar(&self);
/// # fn baz(&self);
@ -629,7 +633,7 @@ macro_rules! unimplemented {
/// }
/// ```
#[macro_export]
#[unstable(feature = "todo_macro", issue = "59277")]
#[stable(feature = "todo_macro", since = "1.39.0")]
macro_rules! todo {
() => (panic!("not yet implemented"));
($($arg:tt)+) => (panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));

View File

@ -148,6 +148,7 @@ macro_rules! with_api {
fn debug($self: $S::Span) -> String;
fn def_site() -> $S::Span;
fn call_site() -> $S::Span;
fn mixed_site() -> $S::Span;
fn source_file($self: $S::Span) -> $S::SourceFile;
fn parent($self: $S::Span) -> Option<$S::Span>;
fn source($self: $S::Span) -> $S::Span;

View File

@ -271,6 +271,15 @@ impl Span {
Span(bridge::client::Span::call_site())
}
/// A span that represents `macro_rules` hygiene, and sometimes resolves at the macro
/// definition site (local variables, labels, `$crate`) and sometimes at the macro
/// call site (everything else).
/// The span location is taken from the call-site.
#[unstable(feature = "proc_macro_mixed_site", issue = "65049")]
pub fn mixed_site() -> Span {
Span(bridge::client::Span::mixed_site())
}
/// The original source file into which this span points.
#[unstable(feature = "proc_macro_span", issue = "54725")]
pub fn source_file(&self) -> SourceFile {

View File

@ -166,6 +166,15 @@ macro_rules! make_mir_visitor {
self.super_projection(base, projection, context, location);
}
fn visit_projection_elem(&mut self,
base: & $($mutability)? PlaceBase<'tcx>,
proj_base: & $($mutability)? [PlaceElem<'tcx>],
elem: & $($mutability)? PlaceElem<'tcx>,
context: PlaceContext,
location: Location) {
self.super_projection_elem(base, proj_base, elem, context, location);
}
fn visit_constant(&mut self,
constant: & $($mutability)? Constant<'tcx>,
location: Location) {
@ -725,27 +734,36 @@ macro_rules! make_mir_visitor {
projection: & $($mutability)? [PlaceElem<'tcx>],
context: PlaceContext,
location: Location) {
if let [proj_base @ .., elem] = projection {
self.visit_projection(base, proj_base, context, location);
let mut cursor = projection;
while let [proj_base @ .., elem] = cursor {
cursor = proj_base;
self.visit_projection_elem(base, cursor, elem, context, location);
}
}
match elem {
ProjectionElem::Field(_field, ty) => {
self.visit_ty(ty, TyContext::Location(location));
}
ProjectionElem::Index(local) => {
self.visit_local(
local,
PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy),
location
);
}
ProjectionElem::Deref |
ProjectionElem::Subslice { from: _, to: _ } |
ProjectionElem::ConstantIndex { offset: _,
min_length: _,
from_end: _ } |
ProjectionElem::Downcast(_, _) => {
}
fn super_projection_elem(&mut self,
_base: & $($mutability)? PlaceBase<'tcx>,
_proj_base: & $($mutability)? [PlaceElem<'tcx>],
elem: & $($mutability)? PlaceElem<'tcx>,
_context: PlaceContext,
location: Location) {
match elem {
ProjectionElem::Field(_field, ty) => {
self.visit_ty(ty, TyContext::Location(location));
}
ProjectionElem::Index(local) => {
self.visit_local(
local,
PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy),
location
);
}
ProjectionElem::Deref |
ProjectionElem::Subslice { from: _, to: _ } |
ProjectionElem::ConstantIndex { offset: _,
min_length: _,
from_end: _ } |
ProjectionElem::Downcast(_, _) => {
}
}
}

View File

@ -404,25 +404,25 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
self.super_assign(dest, rvalue, location);
}
fn visit_projection(
fn visit_projection_elem(
&mut self,
place_base: &PlaceBase<'tcx>,
proj: &[PlaceElem<'tcx>],
proj_base: &[PlaceElem<'tcx>],
elem: &PlaceElem<'tcx>,
context: PlaceContext,
location: Location,
) {
trace!(
"visit_place_projection: proj={:?} context={:?} location={:?}",
proj,
"visit_projection_elem: place_base={:?} proj_base={:?} elem={:?} \
context={:?} location={:?}",
place_base,
proj_base,
elem,
context,
location,
);
self.super_projection(place_base, proj, context, location);
let (elem, proj_base) = match proj.split_last() {
Some(x) => x,
None => return,
};
self.super_projection_elem(place_base, proj_base, elem, context, location);
match elem {
ProjectionElem::Deref => {

View File

@ -1156,82 +1156,87 @@ impl<'a, 'tcx> Visitor<'tcx> for Checker<'a, 'tcx> {
}
}
fn visit_projection(
fn visit_projection_elem(
&mut self,
place_base: &PlaceBase<'tcx>,
proj: &[PlaceElem<'tcx>],
proj_base: &[PlaceElem<'tcx>],
elem: &PlaceElem<'tcx>,
context: PlaceContext,
location: Location,
) {
debug!(
"visit_place_projection: proj={:?} context={:?} location={:?}",
proj, context, location,
"visit_projection_elem: place_base={:?} proj_base={:?} elem={:?} \
context={:?} location={:?}",
place_base,
proj_base,
elem,
context,
location,
);
self.super_projection(place_base, proj, context, location);
if let [proj_base @ .., elem] = proj {
match elem {
ProjectionElem::Deref => {
if context.is_mutating_use() {
// `not_const` errors out in const contexts
self.not_const(ops::MutDeref)
self.super_projection_elem(place_base, proj_base, elem, context, location);
match elem {
ProjectionElem::Deref => {
if context.is_mutating_use() {
// `not_const` errors out in const contexts
self.not_const(ops::MutDeref)
}
let base_ty = Place::ty_from(place_base, proj_base, self.body, self.tcx).ty;
match self.mode {
Mode::NonConstFn => {}
_ if self.suppress_errors => {}
_ => {
if let ty::RawPtr(_) = base_ty.kind {
if !self.tcx.features().const_raw_ptr_deref {
self.record_error(ops::RawPtrDeref);
emit_feature_err(
&self.tcx.sess.parse_sess, sym::const_raw_ptr_deref,
self.span, GateIssue::Language,
&format!(
"dereferencing raw pointers in {}s is unstable",
self.mode,
),
);
}
}
}
let base_ty = Place::ty_from(place_base, proj_base, self.body, self.tcx).ty;
match self.mode {
Mode::NonConstFn => {}
_ if self.suppress_errors => {}
_ => {
if let ty::RawPtr(_) = base_ty.kind {
if !self.tcx.features().const_raw_ptr_deref {
self.record_error(ops::RawPtrDeref);
}
}
ProjectionElem::ConstantIndex {..} |
ProjectionElem::Subslice {..} |
ProjectionElem::Field(..) |
ProjectionElem::Index(_) => {
let base_ty = Place::ty_from(place_base, proj_base, self.body, self.tcx).ty;
if let Some(def) = base_ty.ty_adt_def() {
if def.is_union() {
match self.mode {
Mode::ConstFn => {
if !self.tcx.features().const_fn_union
&& !self.suppress_errors
{
self.record_error(ops::UnionAccess);
emit_feature_err(
&self.tcx.sess.parse_sess, sym::const_raw_ptr_deref,
&self.tcx.sess.parse_sess, sym::const_fn_union,
self.span, GateIssue::Language,
&format!(
"dereferencing raw pointers in {}s is unstable",
self.mode,
),
"unions in const fn are unstable",
);
}
}
},
| Mode::NonConstFn
| Mode::Static
| Mode::StaticMut
| Mode::Const
=> {},
}
}
}
}
ProjectionElem::ConstantIndex {..} |
ProjectionElem::Subslice {..} |
ProjectionElem::Field(..) |
ProjectionElem::Index(_) => {
let base_ty = Place::ty_from(place_base, proj_base, self.body, self.tcx).ty;
if let Some(def) = base_ty.ty_adt_def() {
if def.is_union() {
match self.mode {
Mode::ConstFn => {
if !self.tcx.features().const_fn_union
&& !self.suppress_errors
{
self.record_error(ops::UnionAccess);
emit_feature_err(
&self.tcx.sess.parse_sess, sym::const_fn_union,
self.span, GateIssue::Language,
"unions in const fn are unstable",
);
}
},
| Mode::NonConstFn
| Mode::Static
| Mode::StaticMut
| Mode::Const
=> {},
}
}
}
}
ProjectionElem::Downcast(..) => {
self.not_const(ops::Downcast)
}
ProjectionElem::Downcast(..) => {
self.not_const(ops::Downcast)
}
}
}

View File

@ -354,6 +354,17 @@ impl<'a> Resolver<'a> {
span, "defaulted type parameters cannot be forward declared".to_string());
err
}
ResolutionError::SelfInTyParamDefault => {
let mut err = struct_span_err!(
self.session,
span,
E0735,
"type parameters cannot use `Self` in their defaults"
);
err.span_label(
span, "`Self` in type parameter default".to_string());
err
}
ResolutionError::ConstParamDependentOnTypeParam => {
let mut err = struct_span_err!(
self.session,

View File

@ -8,9 +8,9 @@ Type parameter defaults can only use parameters that occur before them.
Erroneous code example:
```compile_fail,E0128
struct Foo<T=U, U=()> {
struct Foo<T = U, U = ()> {
field1: T,
filed2: U,
field2: U,
}
// error: type parameters with a default cannot use forward declared
// identifiers
@ -20,9 +20,9 @@ Since type parameters are evaluated in-order, you may be able to fix this issue
by doing:
```
struct Foo<U=(), T=U> {
struct Foo<U = (), T = U> {
field1: T,
filed2: U,
field2: U,
}
```
@ -1705,6 +1705,21 @@ fn const_id<T, const N: T>() -> T { // error: const parameter
}
```
"##,
E0735: r##"
Type parameter defaults cannot use `Self` on structs, enums, or unions.
Erroneous code example:
```compile_fail,E0735
struct Foo<X = Box<Self>> {
field1: Option<X>,
field2: Option<X>,
}
// error: type parameters cannot use `Self` in their defaults.
```
"##,
;
// E0153, unused error code
// E0157, unused error code

View File

@ -468,6 +468,19 @@ impl<'a, 'tcx> Visitor<'tcx> for LateResolutionVisitor<'a, '_> {
}
}));
// rust-lang/rust#61631: The type `Self` is essentially
// another type parameter. For ADTs, we consider it
// well-defined only after all of the ADT type parameters have
// been provided. Therefore, we do not allow use of `Self`
// anywhere in ADT type parameter defaults.
//
// (We however cannot ban `Self` for defaults on *all* generic
// lists; e.g. trait generics can usefully refer to `Self`,
// such as in the case of `trait Add<Rhs = Self>`.)
if self.current_self_item.is_some() { // (`Some` if + only if we are in ADT's generics.)
default_ban_rib.bindings.insert(Ident::with_dummy_span(kw::SelfUpper), Res::Err);
}
// We also ban access to type parameters for use as the types of const parameters.
let mut const_ty_param_ban_rib = Rib::new(TyParamAsConstParamTy);
const_ty_param_ban_rib.bindings.extend(generics.params.iter()

View File

@ -214,6 +214,8 @@ enum ResolutionError<'a> {
BindingShadowsSomethingUnacceptable(&'a str, Name, &'a NameBinding<'a>),
/// Error E0128: type parameters with a default cannot use forward-declared identifiers.
ForwardDeclaredTyParam, // FIXME(const_generics:defaults)
/// Error E0735: type parameters with a default cannot use `Self`
SelfInTyParamDefault,
/// Error E0671: const parameter cannot depend on type parameter.
ConstParamDependentOnTypeParam,
}
@ -1536,7 +1538,7 @@ impl<'a> Resolver<'a> {
if let Some(res) = ribs[i].bindings.get(&rib_ident).cloned() {
// The ident resolves to a type parameter or local variable.
return Some(LexicalScopeBinding::Res(
self.validate_res_from_ribs(i, res, record_used, path_span, ribs),
self.validate_res_from_ribs(i, rib_ident, res, record_used, path_span, ribs),
));
}
@ -2122,6 +2124,7 @@ impl<'a> Resolver<'a> {
fn validate_res_from_ribs(
&mut self,
rib_index: usize,
rib_ident: Ident,
res: Res,
record_used: bool,
span: Span,
@ -2133,7 +2136,12 @@ impl<'a> Resolver<'a> {
// An invalid forward use of a type parameter from a previous default.
if let ForwardTyParamBanRibKind = all_ribs[rib_index].kind {
if record_used {
self.report_error(span, ResolutionError::ForwardDeclaredTyParam);
let res_error = if rib_ident.name == kw::SelfUpper {
ResolutionError::SelfInTyParamDefault
} else {
ResolutionError::ForwardDeclaredTyParam
};
self.report_error(span, res_error);
}
assert_eq!(res, Res::Err);
return Res::Err;

View File

@ -1001,12 +1001,12 @@ fn report_bivariance(tcx: TyCtxt<'_>, span: Span, param_name: ast::Name) {
// Help is available only in presence of lang items.
let msg = if let Some(def_id) = suggested_marker_id {
format!(
"consider removing `{}`, refering to it in a field, or using a marker such as `{}`",
"consider removing `{}`, referring to it in a field, or using a marker such as `{}`",
param_name,
tcx.def_path_str(def_id),
)
} else {
format!( "consider removing `{}` or refering to it in a field", param_name)
format!( "consider removing `{}` or referring to it in a field", param_name)
};
err.help(&msg);
err.emit();

View File

@ -344,7 +344,6 @@ impl Options {
.map(|s| PathBuf::from(&s))
.unwrap_or_else(|| PathBuf::from("doc"));
let mut cfgs = matches.opt_strs("cfg");
cfgs.push("rustdoc".to_string());
if should_test {
cfgs.push("doctest".to_string());
}

View File

@ -234,7 +234,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
error_format,
libs,
externs,
cfgs,
mut cfgs,
codegen_options,
debugging_options,
target,
@ -250,6 +250,9 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
..
} = options;
// Add the rustdoc cfg into the doc build.
cfgs.push("rustdoc".to_string());
let cpath = Some(input.clone());
let input = Input::File(input);

View File

@ -62,9 +62,11 @@ pub fn run(options: Options) -> i32 {
..config::Options::default()
};
let mut cfgs = options.cfgs.clone();
cfgs.push("rustdoc".to_owned());
let config = interface::Config {
opts: sessopts,
crate_cfg: config::parse_cfgspecs(options.cfgs.clone()),
crate_cfg: config::parse_cfgspecs(cfgs),
input,
input_path: None,
output_file: None,

View File

@ -305,7 +305,6 @@
#![feature(str_internals)]
#![feature(test)]
#![feature(thread_local)]
#![feature(todo_macro)]
#![feature(toowned_clone_into)]
#![feature(trace_macros)]
#![feature(try_reserve)]

View File

@ -208,6 +208,25 @@ If you need the feature, make sure to use a nightly release of the compiler
(but be warned that the feature may be removed or altered in the future).
"##,
E0556: r##"
The `feature` attribute was badly formed.
Erroneous code example:
```compile_fail,E0556
#![feature(foo_bar_baz, foo(bar), foo = "baz", foo)] // error!
#![feature] // error!
#![feature = "foo"] // error!
```
The `feature` attribute only accept a "feature flag" and can only be used on
nightly. Example:
```ignore (only works in nightly)
#![feature(flag)]
```
"##,
E0557: r##"
A feature attribute named a feature that has been removed.
@ -457,7 +476,6 @@ features in the `-Z allow_features` flag.
E0551, // incorrect meta item
E0553, // multiple rustc_const_unstable attributes
// E0555, // replaced with a generic attribute input check
E0556, // malformed feature, expected just one word
E0584, // file for module `..` found at both .. and ..
E0629, // missing 'feature' (rustc_const_unstable)
// rustc_const_unstable attribute must be paired with stable/unstable

View File

@ -953,6 +953,12 @@ impl<'a> ExtCtxt<'a> {
span.with_call_site_ctxt(self.current_expansion.id)
}
/// Equivalent of `Span::mixed_site` from the proc macro API,
/// except that the location is taken from the span passed as an argument.
pub fn with_mixed_site_ctxt(&self, span: Span) -> Span {
span.with_mixed_site_ctxt(self.current_expansion.id)
}
/// Returns span for the macro which originally caused the current expansion to happen.
///
/// Stops backtracing at include! boundary.

View File

@ -355,6 +355,7 @@ pub(crate) struct Rustc<'a> {
sess: &'a ParseSess,
def_site: Span,
call_site: Span,
mixed_site: Span,
}
impl<'a> Rustc<'a> {
@ -364,6 +365,7 @@ impl<'a> Rustc<'a> {
sess: cx.parse_sess,
def_site: cx.with_def_site_ctxt(expn_data.def_site),
call_site: cx.with_call_site_ctxt(expn_data.call_site),
mixed_site: cx.with_mixed_site_ctxt(expn_data.call_site),
}
}
@ -664,6 +666,9 @@ impl server::Span for Rustc<'_> {
fn call_site(&mut self) -> Self::Span {
self.call_site
}
fn mixed_site(&mut self) -> Self::Span {
self.mixed_site
}
fn source_file(&mut self, span: Self::Span) -> Self::SourceFile {
self.sess.source_map().lookup_char_pos(span.lo()).file
}

View File

@ -278,10 +278,23 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
),
// Plugins:
ungated!(plugin_registrar, Normal, template!(Word)),
gated!(
plugin, CrateLevel, template!(List: "name|name(args)"),
"compiler plugins are experimental and possibly buggy",
(
sym::plugin_registrar, Normal, template!(Word),
Gated(
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
sym::plugin_registrar,
"compiler plugins are deprecated",
cfg_fn!(plugin_registrar)
)
),
(
sym::plugin, CrateLevel, template!(List: "name|name(args)"),
Gated(
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29597", None),
sym::plugin,
"compiler plugins are deprecated",
cfg_fn!(plugin)
)
),
// Testing:

View File

@ -526,6 +526,12 @@ impl Span {
self.with_ctxt_from_mark(expn_id, Transparency::Transparent)
}
/// Equivalent of `Span::mixed_site` from the proc macro API,
/// except that the location is taken from the `self` span.
pub fn with_mixed_site_ctxt(&self, expn_id: ExpnId) -> Span {
self.with_ctxt_from_mark(expn_id, Transparency::SemiTransparent)
}
/// Produces a span with the same location as `self` and context produced by a macro with the
/// given ID and transparency, assuming that macro was defined directly and not produced by
/// some other macro (which is the case for built-in and procedural macros).

View File

@ -41,7 +41,7 @@ impl MetadataLoader for NoLlvmMetadataLoader {
struct TheBackend;
impl CodegenBackend for TheBackend {
fn metadata_loader(&self) -> Box<MetadataLoader + Sync> {
fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
Box::new(NoLlvmMetadataLoader)
}
@ -64,7 +64,7 @@ impl CodegenBackend for TheBackend {
tcx: TyCtxt<'tcx>,
_metadata: EncodedMetadata,
_need_metadata_module: bool,
) -> Box<Any> {
) -> Box<dyn Any> {
use rustc::hir::def_id::LOCAL_CRATE;
Box::new(tcx.crate_name(LOCAL_CRATE) as Symbol)
@ -72,7 +72,7 @@ impl CodegenBackend for TheBackend {
fn join_codegen_and_link(
&self,
ongoing_codegen: Box<Any>,
ongoing_codegen: Box<dyn Any>,
sess: &Session,
_dep_graph: &DepGraph,
outputs: &OutputFilenames,
@ -97,6 +97,6 @@ impl CodegenBackend for TheBackend {
/// This is the entrypoint for a hot plugged rustc_codegen_llvm
#[no_mangle]
pub fn __rustc_codegen_backend() -> Box<CodegenBackend> {
pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
Box::new(TheBackend)
}

View File

@ -0,0 +1,14 @@
// build-pass
// compile-flags:--test
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
#![feature(doc_cfg)]
// Make sure `cfg(rustdoc)` is set when finding doctests but not inside the doctests.
/// ```
/// #![feature(doc_cfg)]
/// assert!(!cfg!(rustdoc));
/// ```
#[cfg(rustdoc)]
pub struct Foo;

View File

@ -0,0 +1,6 @@
running 1 test
test $DIR/doc-test-rustdoc-feature.rs - Foo (line 9) ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

View File

@ -1,6 +1,7 @@
// aux-build:attr-plugin-test.rs
#![plugin(attr_plugin_test)]
//~^ ERROR compiler plugins are experimental and possibly buggy
//~^ ERROR compiler plugins are deprecated
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
fn main() {}

View File

@ -1,4 +1,4 @@
error[E0658]: compiler plugins are experimental and possibly buggy
error[E0658]: compiler plugins are deprecated
--> $DIR/gated-plugin.rs:3:1
|
LL | #![plugin(attr_plugin_test)]
@ -7,6 +7,14 @@ LL | #![plugin(attr_plugin_test)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29597
= help: add `#![feature(plugin)]` to the crate attributes to enable
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/gated-plugin.rs:3:1
|
LL | #![plugin(attr_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View File

@ -4,5 +4,6 @@
#![feature(plugin)] //~ ERROR crate is not marked with #![crate_okay]
#![plugin(lint_for_crate)]
//~^ WARN use of deprecated attribute `plugin`
pub fn main() { }

View File

@ -1,9 +1,18 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/issue-15778-fail.rs:6:1
|
LL | #![plugin(lint_for_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: crate is not marked with #![crate_okay]
--> $DIR/issue-15778-fail.rs:5:1
|
LL | / #![feature(plugin)]
LL | | #![plugin(lint_for_crate)]
LL | |
LL | |
LL | | pub fn main() { }
| |_________________^
|

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/issue-15778-pass.rs:8:1
|
LL | #![plugin(lint_for_crate_rpass)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/issue-40001.rs:6:1
|
LL | #![plugin(issue_40001_plugin)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -3,7 +3,9 @@
// compile-flags: -D lint-me
#![feature(plugin)]
#![plugin(lint_group_plugin_test)]
//~^ WARN use of deprecated attribute `plugin`
fn lintme() { } //~ ERROR item is named 'lintme'

View File

@ -1,5 +1,13 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-group-plugin-deny-cmdline.rs:7:1
|
LL | #![plugin(lint_group_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: item is named 'lintme'
--> $DIR/lint-group-plugin-deny-cmdline.rs:8:1
--> $DIR/lint-group-plugin-deny-cmdline.rs:10:1
|
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
@ -7,7 +15,7 @@ LL | fn lintme() { }
= note: `-D test-lint` implied by `-D lint-me`
error: item is named 'pleaselintme'
--> $DIR/lint-group-plugin-deny-cmdline.rs:10:1
--> $DIR/lint-group-plugin-deny-cmdline.rs:12:1
|
LL | fn pleaselintme() { }
| ^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,11 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-group-plugin.rs:6:1
|
LL | #![plugin(lint_group_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
warning: item is named 'lintme'
--> $DIR/lint-group-plugin.rs:9:1
|

View File

@ -1,3 +1,11 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-plugin-cmdline-allow.rs:8:1
|
LL | #![plugin(lint_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
warning: function is never used: `lintme`
--> $DIR/lint-plugin-cmdline-allow.rs:10:1
|

View File

@ -3,6 +3,7 @@
#![feature(plugin)]
#![plugin(lint_plugin_test)]
//~^ WARN use of deprecated attribute `plugin`
#![deny(test_lint)]
fn lintme() { } //~ ERROR item is named 'lintme'

View File

@ -1,11 +1,19 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-plugin-deny-attr.rs:5:1
|
LL | #![plugin(lint_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: item is named 'lintme'
--> $DIR/lint-plugin-deny-attr.rs:8:1
--> $DIR/lint-plugin-deny-attr.rs:9:1
|
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-plugin-deny-attr.rs:6:9
--> $DIR/lint-plugin-deny-attr.rs:7:9
|
LL | #![deny(test_lint)]
| ^^^^^^^^^

View File

@ -4,6 +4,7 @@
#![feature(plugin)]
#![plugin(lint_plugin_test)]
//~^ WARN use of deprecated attribute `plugin`
fn lintme() { } //~ ERROR item is named 'lintme'

View File

@ -1,5 +1,13 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-plugin-deny-cmdline.rs:6:1
|
LL | #![plugin(lint_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: item is named 'lintme'
--> $DIR/lint-plugin-deny-cmdline.rs:8:1
--> $DIR/lint-plugin-deny-cmdline.rs:9:1
|
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^

View File

@ -3,6 +3,7 @@
#![feature(plugin)]
#![plugin(lint_plugin_test)]
//~^ WARN use of deprecated attribute `plugin`
#![forbid(test_lint)]
fn lintme() { } //~ ERROR item is named 'lintme'

View File

@ -1,5 +1,5 @@
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-attrs.rs:10:9
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
LL | #![forbid(test_lint)]
| --------- `forbid` level set here
@ -7,14 +7,22 @@ LL | #![forbid(test_lint)]
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-plugin-forbid-attrs.rs:5:1
|
LL | #![plugin(lint_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: item is named 'lintme'
--> $DIR/lint-plugin-forbid-attrs.rs:8:1
--> $DIR/lint-plugin-forbid-attrs.rs:9:1
|
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-plugin-forbid-attrs.rs:6:11
--> $DIR/lint-plugin-forbid-attrs.rs:7:11
|
LL | #![forbid(test_lint)]
| ^^^^^^^^^

View File

@ -4,7 +4,7 @@
#![feature(plugin)]
#![plugin(lint_plugin_test)]
//~^ WARN use of deprecated attribute `plugin`
fn lintme() { } //~ ERROR item is named 'lintme'
#[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(test_lint)

View File

@ -6,6 +6,14 @@ LL | #[allow(test_lint)]
|
= note: `forbid` lint level was set on command line
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-plugin-forbid-cmdline.rs:6:1
|
LL | #![plugin(lint_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: item is named 'lintme'
--> $DIR/lint-plugin-forbid-cmdline.rs:8:1
|

View File

@ -1,3 +1,11 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-plugin.rs:5:1
|
LL | #![plugin(lint_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
warning: item is named 'lintme'
--> $DIR/lint-plugin.rs:8:1
|

View File

@ -2,6 +2,14 @@ warning: lint name `test_lint` is deprecated and does not have an effect anymore
|
= note: requested on the command line with `-A test_lint`
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-tool-cmdline-allow.rs:8:1
|
LL | #![plugin(lint_tool_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
warning: item is named 'lintme'
--> $DIR/lint-tool-cmdline-allow.rs:10:1
|

View File

@ -4,6 +4,7 @@
#![feature(plugin)]
#![plugin(lint_tool_test)]
//~^ WARN use of deprecated attribute `plugin`
#![allow(dead_code)]
#![cfg_attr(foo, warn(test_lint))]
//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future

View File

@ -1,5 +1,5 @@
warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:8:23
--> $DIR/lint-tool-test.rs:9:23
|
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
@ -7,19 +7,19 @@ LL | #![cfg_attr(foo, warn(test_lint))]
= note: `#[warn(renamed_and_removed_lints)]` on by default
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:11:9
--> $DIR/lint-tool-test.rs:12:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:25:9
--> $DIR/lint-tool-test.rs:26:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
warning: unknown lint: `this_lint_does_not_exist`
--> $DIR/lint-tool-test.rs:27:8
--> $DIR/lint-tool-test.rs:28:8
|
LL | #[deny(this_lint_does_not_exist)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -27,32 +27,40 @@ LL | #[deny(this_lint_does_not_exist)]
= note: `#[warn(unknown_lints)]` on by default
warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:8:23
--> $DIR/lint-tool-test.rs:9:23
|
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lint-tool-test.rs:6:1
|
LL | #![plugin(lint_tool_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: item is named 'lintme'
--> $DIR/lint-tool-test.rs:14:1
--> $DIR/lint-tool-test.rs:15:1
|
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-tool-test.rs:11:9
--> $DIR/lint-tool-test.rs:12:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^
= note: `#[deny(clippy::test_lint)]` implied by `#[deny(clippy::group)]`
error: item is named 'lintmetoo'
--> $DIR/lint-tool-test.rs:22:5
--> $DIR/lint-tool-test.rs:23:5
|
LL | fn lintmetoo() { }
| ^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-tool-test.rs:11:9
--> $DIR/lint-tool-test.rs:12:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/llvm-pass-plugin.rs:6:1
|
LL | #![plugin(llvm_pass_plugin)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/lto-syntax-extension.rs:9:1
|
LL | #![plugin(lto_syntax_extension_plugin)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -5,5 +5,6 @@
#![feature(plugin)]
#![plugin(rlib_crate_test)]
//~^ ERROR: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
fn main() {}

View File

@ -4,5 +4,13 @@ error[E0457]: plugin `rlib_crate_test` only found in rlib format, but must be av
LL | #![plugin(rlib_crate_test)]
| ^^^^^^^^^^^^^^^
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/macro-crate-rlib.rs:6:1
|
LL | #![plugin(rlib_crate_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: aborting due to previous error

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/outlive-expansion-phase.rs:6:1
|
LL | #![plugin(outlive_expansion_phase)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/plugin-args-1.rs:6:1
|
LL | #![plugin(plugin_args)]
| ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/plugin-args-2.rs:6:1
|
LL | #![plugin(plugin_args())]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/plugin-args-3.rs:6:1
|
LL | #![plugin(plugin_args(hello(there), how(are="you")))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -3,6 +3,7 @@
#![feature(plugin)]
#![plugin(attr_plugin_test)]
//~^ WARN use of deprecated attribute `plugin`
#![deny(unused_attributes)]
#[baz]

View File

@ -1,23 +1,31 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/plugin-attr-register-deny.rs:5:1
|
LL | #![plugin(attr_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: unused attribute
--> $DIR/plugin-attr-register-deny.rs:14:5
--> $DIR/plugin-attr-register-deny.rs:15:5
|
LL | #[bar]
| ^^^^^^
|
note: lint level defined here
--> $DIR/plugin-attr-register-deny.rs:6:9
--> $DIR/plugin-attr-register-deny.rs:7:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/plugin-attr-register-deny.rs:14:5
--> $DIR/plugin-attr-register-deny.rs:15:5
|
LL | #[bar]
| ^^^^^^
error: unused attribute
--> $DIR/plugin-attr-register-deny.rs:11:1
--> $DIR/plugin-attr-register-deny.rs:12:1
|
LL | #[foo]
| ^^^^^^

View File

@ -4,6 +4,7 @@
#![feature(plugin)]
#![plugin(attr_plugin_test)]
//~^ WARN use of deprecated attribute `plugin`
pub use mac as reexport; //~ ERROR `mac` is private, and cannot be re-exported

View File

@ -1,15 +1,23 @@
error[E0364]: `mac` is private, and cannot be re-exported
--> $DIR/plugin-reexport.rs:8:9
--> $DIR/plugin-reexport.rs:9:9
|
LL | pub use mac as reexport;
| ^^^^^^^^^^^^^^^
|
note: consider marking `mac` as `pub` in the imported module
--> $DIR/plugin-reexport.rs:8:9
--> $DIR/plugin-reexport.rs:9:9
|
LL | pub use mac as reexport;
| ^^^^^^^^^^^^^^^
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/plugin-reexport.rs:6:1
|
LL | #![plugin(attr_plugin_test)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: aborting due to previous error
For more information about this error, try `rustc --explain E0364`.

View File

@ -0,0 +1,8 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/roman-numerals-macro.rs:6:1
|
LL | #![plugin(roman_numerals)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default

View File

@ -18,7 +18,7 @@ error[E0392]: parameter `T` is never used
LL | pub struct Dependent<T, const X: T>([(); X]);
| ^ unused parameter
|
= help: consider removing `T`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `T`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error: aborting due to 2 previous errors

View File

@ -4,7 +4,7 @@ error[E0392]: parameter `T` is never used
LL | enum Foo<T> { Bar }
| ^ unused parameter
|
= help: consider removing `T`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `T`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error: aborting due to previous error

View File

@ -32,9 +32,13 @@
// check-pass
#![feature(test)]
#![feature(test, plugin_registrar)]
#![warn(unused_attributes, unknown_lints)]
// Exception, a gated and deprecated attribute.
#![plugin_registrar] //~ WARN unused attribute
// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
#![warn(x5400)] //~ WARN unknown lint: `x5400`
@ -43,7 +47,6 @@
#![deny(x5100)] //~ WARN unknown lint: `x5100`
#![macro_use] // (allowed if no argument; see issue-43160-gating-of-macro_use.rs)
#![macro_export] //~ WARN unused attribute
#![plugin_registrar] //~ WARN unused attribute
// skipping testing of cfg
// skipping testing of cfg_attr
#![main] //~ WARN unused attribute

View File

@ -1,6 +1,7 @@
// Test that `#![plugin(...)]` attribute is gated by `plugin` feature gate
#![plugin(foo)]
//~^ ERROR compiler plugins are experimental and possibly buggy
//~^ ERROR compiler plugins are deprecated
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
fn main() {}

View File

@ -1,4 +1,4 @@
error[E0658]: compiler plugins are experimental and possibly buggy
error[E0658]: compiler plugins are deprecated
--> $DIR/feature-gate-plugin.rs:3:1
|
LL | #![plugin(foo)]
@ -7,6 +7,14 @@ LL | #![plugin(foo)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29597
= help: add `#![feature(plugin)]` to the crate attributes to enable
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/feature-gate-plugin.rs:3:1
|
LL | #![plugin(foo)]
| ^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View File

@ -3,6 +3,9 @@
// the registration function isn't typechecked yet
#[plugin_registrar]
//~^ ERROR compiler plugins are deprecated
//~| WARN use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated
pub fn registrar() {}
//~^ ERROR compiler plugins are experimental
//~^ ERROR compiler plugins are experimental and possibly buggy
fn main() {}

View File

@ -1,5 +1,5 @@
error[E0658]: compiler plugins are experimental and possibly buggy
--> $DIR/feature-gate-plugin_registrar.rs:6:1
--> $DIR/feature-gate-plugin_registrar.rs:8:1
|
LL | pub fn registrar() {}
| ^^^^^^^^^^^^^^^^^^^^^
@ -7,6 +7,23 @@ LL | pub fn registrar() {}
= note: for more information, see https://github.com/rust-lang/rust/issues/29597
= help: add `#![feature(plugin_registrar)]` to the crate attributes to enable
error: aborting due to previous error
error[E0658]: compiler plugins are deprecated
--> $DIR/feature-gate-plugin_registrar.rs:5:1
|
LL | #[plugin_registrar]
| ^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29597
= help: add `#![feature(plugin_registrar)]` to the crate attributes to enable
warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/feature-gate-plugin_registrar.rs:5:1
|
LL | #[plugin_registrar]
| ^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View File

@ -30,4 +30,5 @@ LL | #![feature = "foo"]
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0557`.
Some errors have detailed explanations: E0556, E0557.
For more information about an error, try `rustc --explain E0556`.

View File

@ -0,0 +1,20 @@
#![crate_type="lib"]
// rust-lang/rust#61631: The use of `Self` in the defaults of generic
// types in a *trait* definition are allowed.
//
// It *must* be accepted; we have used this pattern extensively since
// Rust 1.0 (see e.g. `trait Add<Rhs=Self>`).
trait Tnobound<P = Self> {}
impl Tnobound for () { }
// This variant is accepted at the definition site; but it will be
// rejected at every possible usage site (such as the one immediately
// below). Maybe one day we will attempt to catch it at the definition
// site, but today this is accepted due to compiler implementation
// limitations.
trait Tsized<P: Sized = [Self]> {}
impl Tsized for () {}
//~^ ERROR the size for values of type `[()]` cannot be known at compilation time [E0277]

View File

@ -0,0 +1,12 @@
error[E0277]: the size for values of type `[()]` cannot be known at compilation time
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:19:6
|
LL | impl Tsized for () {}
| ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[()]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1,45 @@
#![crate_type="lib"]
// rust-lang/rust#61631: Uses of `Self` in the defaults of generic
// types for ADT's are not allowed. We justify this because the `Self`
// type could be considered the "final" type parameter, that is only
// well-defined after all of the other type parameters on the ADT have
// been instantiated.
//
// These were previously were ICE'ing at the usage point anyway (see
// `demo_usages` below), so there should not be any backwards
// compatibility concern.
struct Snobound<'a, P = Self> { x: Option<&'a P> }
//~^ ERROR type parameters cannot use `Self` in their defaults [E0735]
enum Enobound<'a, P = Self> { A, B(Option<&'a P>) }
//~^ ERROR type parameters cannot use `Self` in their defaults [E0735]
union Unobound<'a, P = Self> { x: i32, y: Option<&'a P> }
//~^ ERROR type parameters cannot use `Self` in their defaults [E0735]
// Disallowing `Self` in defaults sidesteps need to check the bounds
// on the defaults in cases like these.
struct Ssized<'a, P: Sized = [Self]> { x: Option<&'a P> }
//~^ ERROR type parameters cannot use `Self` in their defaults [E0735]
enum Esized<'a, P: Sized = [Self]> { A, B(Option<&'a P>) }
//~^ ERROR type parameters cannot use `Self` in their defaults [E0735]
union Usized<'a, P: Sized = [Self]> { x: i32, y: Option<&'a P> }
//~^ ERROR type parameters cannot use `Self` in their defaults [E0735]
fn demo_usages() {
// An ICE means you only get the error from the first line of the
// demo; comment each out to observe the other ICEs when trying
// this out on older versions of Rust.
let _ice: Snobound;
let _ice: Enobound;
let _ice: Unobound;
let _ice: Ssized;
let _ice: Esized;
let _ice: Usized;
}

View File

@ -0,0 +1,39 @@
error[E0735]: type parameters cannot use `Self` in their defaults
--> $DIR/issue-61631-default-type-param-cannot-reference-self.rs:13:25
|
LL | struct Snobound<'a, P = Self> { x: Option<&'a P> }
| ^^^^ `Self` in type parameter default
error[E0735]: type parameters cannot use `Self` in their defaults
--> $DIR/issue-61631-default-type-param-cannot-reference-self.rs:16:23
|
LL | enum Enobound<'a, P = Self> { A, B(Option<&'a P>) }
| ^^^^ `Self` in type parameter default
error[E0735]: type parameters cannot use `Self` in their defaults
--> $DIR/issue-61631-default-type-param-cannot-reference-self.rs:19:24
|
LL | union Unobound<'a, P = Self> { x: i32, y: Option<&'a P> }
| ^^^^ `Self` in type parameter default
error[E0735]: type parameters cannot use `Self` in their defaults
--> $DIR/issue-61631-default-type-param-cannot-reference-self.rs:25:31
|
LL | struct Ssized<'a, P: Sized = [Self]> { x: Option<&'a P> }
| ^^^^ `Self` in type parameter default
error[E0735]: type parameters cannot use `Self` in their defaults
--> $DIR/issue-61631-default-type-param-cannot-reference-self.rs:28:29
|
LL | enum Esized<'a, P: Sized = [Self]> { A, B(Option<&'a P>) }
| ^^^^ `Self` in type parameter default
error[E0735]: type parameters cannot use `Self` in their defaults
--> $DIR/issue-61631-default-type-param-cannot-reference-self.rs:31:30
|
LL | union Usized<'a, P: Sized = [Self]> { x: i32, y: Option<&'a P> }
| ^^^^ `Self` in type parameter default
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0735`.

View File

@ -14,7 +14,7 @@ error[E0392]: parameter `T` is never used
LL | enum Bar<T> { What }
| ^ unused parameter
|
= help: consider removing `T`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `T`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error: aborting due to 2 previous errors

View File

@ -3,5 +3,6 @@
#[plugin(bla)] //~ ERROR unused attribute
//~^ ERROR should be an inner attribute
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
fn main() {}

View File

@ -1,3 +1,11 @@
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/invalid-plugin-attr.rs:4:1
|
LL | #[plugin(bla)]
| ^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: unused attribute
--> $DIR/invalid-plugin-attr.rs:4:1
|

View File

@ -4,7 +4,7 @@ error[E0392]: parameter `T` is never used
LL | struct Foo<T> where T: Copy;
| ^ unused parameter
|
= help: consider removing `T`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `T`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0392]: parameter `T` is never used
LL | struct NoData<T>;
| ^ unused parameter
|
= help: consider removing `T`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `T`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Foo`
--> $DIR/issue-20413.rs:8:1

View File

@ -4,7 +4,7 @@ error[E0392]: parameter `'a` is never used
LL | struct Foo<'a, A> {}
| ^^ unused parameter
|
= help: consider removing `'a`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `'a`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error[E0392]: parameter `A` is never used
--> $DIR/issue-36299.rs:1:16
@ -12,7 +12,7 @@ error[E0392]: parameter `A` is never used
LL | struct Foo<'a, A> {}
| ^ unused parameter
|
= help: consider removing `A`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `A`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error: aborting due to 2 previous errors

View File

@ -16,7 +16,7 @@ error[E0392]: parameter `Self` is never used
LL | struct Foo<Self>(Self);
| ^^^^ unused parameter
|
= help: consider removing `Self`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `Self`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error: aborting due to 3 previous errors

View File

@ -20,7 +20,7 @@ error[E0392]: parameter `T` is never used
LL | struct Foo<T: ?Hash> { }
| ^ unused parameter
|
= help: consider removing `T`, refering to it in a field, or using a marker such as `std::marker::PhantomData`
= help: consider removing `T`, referring to it in a field, or using a marker such as `std::marker::PhantomData`
error: aborting due to 2 previous errors

View File

@ -0,0 +1,19 @@
// Regression test for #60218
//
// This was reported to cause ICEs.
use std::iter::Map;
pub trait Foo {}
pub fn trigger_error<I, F>(iterable: I, functor: F)
where
for<'t> &'t I: IntoIterator,
for<'t> Map<<&'t I as IntoIterator>::IntoIter, F>: Iterator,
for<'t> <Map<<&'t I as IntoIterator>::IntoIter, F> as Iterator>::Item: Foo,
{
}
fn main() {
trigger_error(vec![], |x: &u32| x) //~ ERROR E0277
}

View File

@ -0,0 +1,15 @@
error[E0277]: the trait bound `for<'t> <std::iter::Map<<&'t _ as std::iter::IntoIterator>::IntoIter, _> as std::iter::Iterator>::Item: Foo` is not satisfied
--> $DIR/issue-60218.rs:18:5
|
LL | pub fn trigger_error<I, F>(iterable: I, functor: F)
| -------------
...
LL | for<'t> <Map<<&'t I as IntoIterator>::IntoIter, F> as Iterator>::Item: Foo,
| --- required by this bound in `trigger_error`
...
LL | trigger_error(vec![], |x: &u32| x)
| ^^^^^^^^^^^^^ the trait `for<'t> Foo` is not implemented for `<std::iter::Map<<&'t _ as std::iter::IntoIterator>::IntoIter, _> as std::iter::Iterator>::Item`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -1,4 +1,5 @@
#![feature(plugin)]
#![plugin] //~ ERROR malformed `plugin` attribute
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
fn main() {}

View File

@ -4,5 +4,13 @@ error: malformed `plugin` attribute input
LL | #![plugin]
| ^^^^^^^^^^ help: must be of the form: `#[plugin(name|name(args))]`
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/malformed-plugin-1.rs:2:1
|
LL | #![plugin]
| ^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: aborting due to previous error

View File

@ -1,4 +1,5 @@
#![feature(plugin)]
#![plugin="bleh"] //~ ERROR malformed `plugin` attribute
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
fn main() {}

View File

@ -4,5 +4,13 @@ error: malformed `plugin` attribute input
LL | #![plugin="bleh"]
| ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[plugin(name|name(args))]`
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/malformed-plugin-2.rs:2:1
|
LL | #![plugin="bleh"]
| ^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: aborting due to previous error

View File

@ -1,4 +1,5 @@
#![feature(plugin)]
#![plugin(foo="bleh")] //~ ERROR malformed `plugin` attribute
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
fn main() {}

View File

@ -4,5 +4,13 @@ error[E0498]: malformed `plugin` attribute
LL | #![plugin(foo="bleh")]
| ^^^^^^^^^^^^^^^^^^^^^^ malformed attribute
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/malformed-plugin-3.rs:2:1
|
LL | #![plugin(foo="bleh")]
| ^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
error: aborting due to previous error

View File

@ -1,3 +1,17 @@
warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/multiple-plugin-registrars.rs:6:1
|
LL | #[plugin_registrar]
| ^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
--> $DIR/multiple-plugin-registrars.rs:9:1
|
LL | #[plugin_registrar]
| ^^^^^^^^^^^^^^^^^^^ help: remove this attribute
error: multiple plugin registration functions found
|
note: one is here

View File

@ -0,0 +1,42 @@
// force-host
// no-prefer-dynamic
#![feature(proc_macro_hygiene)]
#![feature(proc_macro_mixed_site)]
#![feature(proc_macro_quote)]
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::*;
#[proc_macro]
pub fn proc_macro_rules(input: TokenStream) -> TokenStream {
if input.is_empty() {
let id = |s| TokenTree::from(Ident::new(s, Span::mixed_site()));
let item_def = id("ItemDef");
let local_def = id("local_def");
let item_use = id("ItemUse");
let local_use = id("local_use");
let mut single_quote = Punct::new('\'', Spacing::Joint);
single_quote.set_span(Span::mixed_site());
let label_use: TokenStream = [
TokenTree::from(single_quote),
id("label_use"),
].iter().cloned().collect();
quote!(
struct $item_def;
let $local_def = 0;
$item_use; // OK
$local_use; // ERROR
break $label_use; // ERROR
)
} else {
let mut dollar_crate = input.into_iter().next().unwrap();
dollar_crate.set_span(Span::mixed_site());
quote!(
type A = $dollar_crate::ItemUse;
)
}
}

View File

@ -59,54 +59,54 @@ PRINT-ATTR RE-COLLECTED (DISPLAY): struct B (identity ! ($crate :: S)) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
Ident {
ident: "B",
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "identity",
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
Punct {
ch: '!',
spacing: Alone,
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "$crate",
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
Punct {
ch: ':',
spacing: Joint,
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
Punct {
ch: ':',
spacing: Alone,
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
Ident {
ident: "S",
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
],
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
],
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
Punct {
ch: ';',
spacing: Alone,
span: #8 bytes(LO..HI),
span: #10 bytes(LO..HI),
},
]

View File

@ -124,40 +124,40 @@ PRINT-BANG INPUT (DISPLAY): struct M ($crate :: S) ;
PRINT-BANG INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Ident {
ident: "M",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "$crate",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ':',
spacing: Joint,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ':',
spacing: Alone,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Ident {
ident: "S",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
],
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ';',
spacing: Alone,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
]
PRINT-ATTR INPUT (DISPLAY): struct A(::dollar_crate_external::S);
@ -165,40 +165,40 @@ PRINT-ATTR RE-COLLECTED (DISPLAY): struct A ($crate :: S) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Ident {
ident: "A",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "$crate",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ':',
spacing: Joint,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ':',
spacing: Alone,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Ident {
ident: "S",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
],
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ';',
spacing: Alone,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
]
PRINT-DERIVE INPUT (DISPLAY): struct D(::dollar_crate_external::S);
@ -206,39 +206,39 @@ PRINT-DERIVE RE-COLLECTED (DISPLAY): struct D ($crate :: S) ;
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Ident {
ident: "D",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "$crate",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ':',
spacing: Joint,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ':',
spacing: Alone,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Ident {
ident: "S",
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
],
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
Punct {
ch: ';',
spacing: Alone,
span: #10 bytes(LO..HI),
span: #13 bytes(LO..HI),
},
]

View File

@ -1,4 +1,5 @@
// aux-build:invalid-punct-ident.rs
// rustc-env:RUST_BACKTRACE=0
// FIXME https://github.com/rust-lang/rust/issues/59998
// normalize-stderr-test "thread.*panicked.*proc_macro_server.rs.*\n" -> ""

View File

@ -1,5 +1,5 @@
error: proc macro panicked
--> $DIR/invalid-punct-ident-1.rs:15:1
--> $DIR/invalid-punct-ident-1.rs:16:1
|
LL | invalid_punct!();
| ^^^^^^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
// aux-build:invalid-punct-ident.rs
// rustc-env:RUST_BACKTRACE=0
// FIXME https://github.com/rust-lang/rust/issues/59998
// normalize-stderr-test "thread.*panicked.*proc_macro_server.rs.*\n" -> ""

View File

@ -1,5 +1,5 @@
error: proc macro panicked
--> $DIR/invalid-punct-ident-2.rs:15:1
--> $DIR/invalid-punct-ident-2.rs:16:1
|
LL | invalid_ident!();
| ^^^^^^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
// aux-build:invalid-punct-ident.rs
// rustc-env:RUST_BACKTRACE=0
// FIXME https://github.com/rust-lang/rust/issues/59998
// normalize-stderr-test "thread.*panicked.*proc_macro_server.rs.*\n" -> ""

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