diff options
| author | bors <bors@rust-lang.org> | 2016-06-27 16:42:03 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-27 16:42:03 -0700 |
| commit | ea0dc9297283daff6486807f43e190b4eb561412 (patch) | |
| tree | d184776089de9911ae9e983cc692021498e21a25 /src/test | |
| parent | a0f572e98bacc719aa211b1fe97c61339cf6c93a (diff) | |
| parent | 360dcae4197d0bf0f59d5364470e00b589d5c549 (diff) | |
Auto merge of #34424 - jseyfried:breaking_batch, r=Manishearth
Batch up libsyntax breaking changes Batch of the following syntax-[breaking-change] changes: - #34213: Add a variant `Macro` to `TraitItemKind` - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path` - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream` - #33943: - Remove the type parameter from `visit::Visitor` - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead. - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`. - Remove the field `ctxt` of `ast::Mac_` - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead. - #34316: - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`. - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`) - Rename `ast::ExprKind::Again` to `Continue`. - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>` - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>` - Use autoderef instead of `.as_attr_slice()` - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list. - #34403: Move errors into a separate crate (unlikely to cause breakage)
Diffstat (limited to 'src/test')
23 files changed, 145 insertions, 33 deletions
diff --git a/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs b/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs index 3516f566e8a..a6bc9db199c 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs @@ -13,14 +13,16 @@ #![feature(plugin_registrar, quote, rustc_private)] extern crate syntax; +extern crate syntax_pos; extern crate rustc; extern crate rustc_plugin; -use syntax::ast::{self, TokenTree, Item, MetaItem, ImplItem, TraitItem, ItemKind}; -use syntax::codemap::Span; +use syntax::ast::{self, Item, MetaItem, ImplItem, TraitItem, ItemKind}; use syntax::ext::base::*; use syntax::parse::{self, token}; use syntax::ptr::P; +use syntax::tokenstream::TokenTree; +use syntax_pos::Span; use rustc_plugin::Registry; #[macro_export] diff --git a/src/test/compile-fail-fulldeps/gated-quote.rs b/src/test/compile-fail-fulldeps/gated-quote.rs index cd801fbcd88..dade0e946c5 100644 --- a/src/test/compile-fail-fulldeps/gated-quote.rs +++ b/src/test/compile-fail-fulldeps/gated-quote.rs @@ -22,8 +22,8 @@ extern crate syntax; use syntax::ast; -use syntax::codemap::Span; use syntax::parse; +use syntax_pos::Span; struct ParseSess; diff --git a/src/test/compile-fail-fulldeps/qquote.rs b/src/test/compile-fail-fulldeps/qquote.rs index 89a4869bd69..e29ded8a052 100644 --- a/src/test/compile-fail-fulldeps/qquote.rs +++ b/src/test/compile-fail-fulldeps/qquote.rs @@ -13,11 +13,12 @@ #![feature(quote, rustc_private)] extern crate syntax; +extern crate syntax_pos; use syntax::ast; -use syntax::codemap::{self, DUMMY_SP}; use syntax::parse; use syntax::print::pprust; +use syntax_pos::DUMMY_SP; fn main() { let ps = syntax::parse::ParseSess::new(); diff --git a/src/test/compile-fail/bad-format-args.rs b/src/test/compile-fail/bad-format-args.rs index 816c696a895..8c58c8c6062 100644 --- a/src/test/compile-fail/bad-format-args.rs +++ b/src/test/compile-fail/bad-format-args.rs @@ -9,11 +9,11 @@ // except according to those terms. // error-pattern: requires at least a format string argument -// error-pattern: bad-format-args.rs:19:5: 19:15 note: in this expansion +// error-pattern: in this expansion // error-pattern: expected token: `,` -// error-pattern: bad-format-args.rs:20:5: 20:19 note: in this expansion -// error-pattern: bad-format-args.rs:21:5: 21:22 note: in this expansion +// error-pattern: in this expansion +// error-pattern: in this expansion fn main() { format!(); diff --git a/src/test/compile-fail/issue-34418.rs b/src/test/compile-fail/issue-34418.rs new file mode 100644 index 00000000000..6bc0add2205 --- /dev/null +++ b/src/test/compile-fail/issue-34418.rs @@ -0,0 +1,31 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] +#![allow(unused)] + +macro_rules! make_item { + () => { fn f() {} } +} + +macro_rules! make_stmt { + () => { let x = 0; } +} + +fn f() { + make_item! {} +} + +fn g() { + make_stmt! {} +} + +#[rustc_error] +fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/method-resolvable-path-in-pattern.rs b/src/test/compile-fail/method-resolvable-path-in-pattern.rs index 1cba64ccf2c..3ae792f9c0f 100644 --- a/src/test/compile-fail/method-resolvable-path-in-pattern.rs +++ b/src/test/compile-fail/method-resolvable-path-in-pattern.rs @@ -19,6 +19,6 @@ impl MyTrait for Foo {} fn main() { match 0u32 { <Foo as MyTrait>::trait_bar => {} - //~^ ERROR expected associated constant, found method `trait_bar` + //~^ ERROR expected variant, struct or constant, found method `trait_bar` } } diff --git a/src/test/parse-fail/trait-non-item-macros.rs b/src/test/parse-fail/trait-non-item-macros.rs new file mode 100644 index 00000000000..fd356f4a817 --- /dev/null +++ b/src/test/parse-fail/trait-non-item-macros.rs @@ -0,0 +1,20 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +macro_rules! bah { + ($a:expr) => ($a) + //~^ ERROR expected one of `const`, `extern`, `fn`, `type`, or `unsafe`, found `2` +} + +trait bar { + bah!(2); +} + +fn main() {} diff --git a/src/test/run-fail-fulldeps/qquote.rs b/src/test/run-fail-fulldeps/qquote.rs index 560b742f8a6..e1461c7847e 100644 --- a/src/test/run-fail-fulldeps/qquote.rs +++ b/src/test/run-fail-fulldeps/qquote.rs @@ -15,11 +15,13 @@ #![feature(quote, rustc_private)] extern crate syntax; +extern crate syntax_pos; use syntax::ast; -use syntax::codemap::{self, DUMMY_SP}; +use syntax::codemap; use syntax::parse; use syntax::print::pprust; +use syntax_pos::DUMMY_SP; fn main() { let ps = syntax::parse::ParseSess::new(); diff --git a/src/test/run-make/execution-engine/test.rs b/src/test/run-make/execution-engine/test.rs index 8a7959212f5..a94b2a85c77 100644 --- a/src/test/run-make/execution-engine/test.rs +++ b/src/test/run-make/execution-engine/test.rs @@ -18,6 +18,8 @@ extern crate rustc_lint; extern crate rustc_llvm as llvm; extern crate rustc_metadata; extern crate rustc_resolve; +extern crate rustc_errors; +extern crate rustc_errors as errors; #[macro_use] extern crate syntax; use std::ffi::{CStr, CString}; @@ -38,7 +40,7 @@ use rustc_metadata::creader::read_local_crates; use rustc_metadata::cstore::CStore; use libc::c_void; -use syntax::diagnostics::registry::Registry; +use rustc_errors::registry::Registry; use syntax::parse::token; fn main() { diff --git a/src/test/run-make/issue-19371/foo.rs b/src/test/run-make/issue-19371/foo.rs index 41d250eadec..aa3495ec5ee 100644 --- a/src/test/run-make/issue-19371/foo.rs +++ b/src/test/run-make/issue-19371/foo.rs @@ -14,6 +14,7 @@ extern crate rustc; extern crate rustc_driver; extern crate rustc_lint; extern crate rustc_metadata; +extern crate rustc_errors; extern crate syntax; use rustc::dep_graph::DepGraph; @@ -21,7 +22,7 @@ use rustc::session::{build_session, Session}; use rustc::session::config::{basic_options, build_configuration, Input, OutputType}; use rustc_driver::driver::{compile_input, CompileController, anon_src}; use rustc_metadata::cstore::CStore; -use syntax::diagnostics::registry::Registry; +use rustc_errors::registry::Registry; use syntax::parse::token; use std::path::PathBuf; diff --git a/src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs b/src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs index ed971faf8c6..64747002a65 100644 --- a/src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs +++ b/src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs @@ -86,7 +86,7 @@ fn check_expr_attrs(es: &str, expected: &[&str]) { let actual = &e.attrs; str_compare(es, &expected.iter().map(|r| attr(r, &ps).unwrap()).collect::<Vec<_>>(), - actual.as_attr_slice(), + &actual, pprust::attribute_to_string); } diff --git a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs index 0132014de0a..42135703b75 100644 --- a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs +++ b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs @@ -16,17 +16,18 @@ extern crate syntax; extern crate syntax_ext; +extern crate syntax_pos; extern crate rustc; extern crate rustc_plugin; use syntax::ast; -use syntax::codemap::Span; use syntax::ext::base::{MultiDecorator, ExtCtxt, Annotatable}; use syntax::ext::build::AstBuilder; use syntax::parse::token; use syntax::ptr::P; use syntax_ext::deriving::generic::{cs_fold, TraitDef, MethodDef, combine_substructure}; use syntax_ext::deriving::generic::ty::{Literal, LifetimeBounds, Path, borrowed_explicit_self}; +use syntax_pos::Span; use rustc_plugin::Registry; #[plugin_registrar] diff --git a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs index 6fa78913839..eeecd0b24e2 100644 --- a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs +++ b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs @@ -16,12 +16,12 @@ extern crate syntax; extern crate syntax_ext; +extern crate syntax_pos; extern crate rustc; extern crate rustc_plugin; use syntax::ast; use syntax::attr::AttrMetaMethods; -use syntax::codemap::Span; use syntax::ext::base::{MultiDecorator, ExtCtxt, Annotatable}; use syntax::ext::build::AstBuilder; use syntax::parse::token; @@ -29,6 +29,7 @@ use syntax::ptr::P; use syntax_ext::deriving::generic::{cs_fold, TraitDef, MethodDef, combine_substructure}; use syntax_ext::deriving::generic::{Substructure, Struct, EnumMatching}; use syntax_ext::deriving::generic::ty::{Literal, LifetimeBounds, Path, borrowed_explicit_self}; +use syntax_pos::Span; use rustc_plugin::Registry; #[plugin_registrar] diff --git a/src/test/run-pass-fulldeps/auxiliary/issue_16723_multiple_items_syntax_ext.rs b/src/test/run-pass-fulldeps/auxiliary/issue_16723_multiple_items_syntax_ext.rs index 25a75c2d295..7f8a741465b 100644 --- a/src/test/run-pass-fulldeps/auxiliary/issue_16723_multiple_items_syntax_ext.rs +++ b/src/test/run-pass-fulldeps/auxiliary/issue_16723_multiple_items_syntax_ext.rs @@ -16,11 +16,12 @@ extern crate syntax; extern crate rustc; extern crate rustc_plugin; +extern crate syntax_pos; use syntax::ast; -use syntax::codemap; use syntax::ext::base::{ExtCtxt, MacResult, MacEager}; use syntax::util::small_vector::SmallVector; +use syntax::tokenstream; use rustc_plugin::Registry; #[plugin_registrar] @@ -28,7 +29,8 @@ pub fn plugin_registrar(reg: &mut Registry) { reg.register_macro("multiple_items", expand) } -fn expand(cx: &mut ExtCtxt, _: codemap::Span, _: &[ast::TokenTree]) -> Box<MacResult+'static> { +fn expand(cx: &mut ExtCtxt, _: syntax_pos::Span, _: &[tokenstream::TokenTree]) + -> Box<MacResult+'static> { MacEager::items(SmallVector::many(vec![ quote_item!(cx, struct Struct1;).unwrap(), quote_item!(cx, struct Struct2;).unwrap() diff --git a/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs b/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs index a22c3ba4849..11d81eda556 100644 --- a/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs +++ b/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs @@ -15,12 +15,14 @@ extern crate syntax; extern crate rustc; extern crate rustc_plugin; +extern crate syntax_pos; -use syntax::ast::{self, TokenTree, Item, MetaItem, ImplItem, TraitItem, ItemKind}; -use syntax::codemap::Span; +use syntax::ast::{self, Item, MetaItem, ImplItem, TraitItem, ItemKind}; use syntax::ext::base::*; use syntax::parse::{self, token}; use syntax::ptr::P; +use syntax::tokenstream::TokenTree; +use syntax_pos::Span; use rustc_plugin::Registry; #[macro_export] diff --git a/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs b/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs index 99321ad4241..f0edc0f2b12 100644 --- a/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs +++ b/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs @@ -14,17 +14,19 @@ #![feature(box_syntax, rustc_private)] extern crate syntax; +extern crate syntax_pos; extern crate rustc; extern crate rustc_plugin; use std::borrow::ToOwned; use syntax::ast; -use syntax::codemap::Span; use syntax::ext::build::AstBuilder; use syntax::ext::base::{TTMacroExpander, ExtCtxt, MacResult, MacEager, NormalTT}; use syntax::parse::token; use syntax::print::pprust; use syntax::ptr::P; +use syntax_pos::Span; +use syntax::tokenstream; use rustc_plugin::Registry; struct Expander { @@ -35,7 +37,7 @@ impl TTMacroExpander for Expander { fn expand<'cx>(&self, ecx: &'cx mut ExtCtxt, sp: Span, - _: &[ast::TokenTree]) -> Box<MacResult+'cx> { + _: &[tokenstream::TokenTree]) -> Box<MacResult+'cx> { let args = self.args.iter().map(|i| pprust::meta_item_to_string(&*i)) .collect::<Vec<_>>().join(", "); let interned = token::intern_and_get_ident(&args[..]); diff --git a/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs b/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs index 713a7d1e811..5b1e210b0b2 100644 --- a/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs +++ b/src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs @@ -14,17 +14,19 @@ #![feature(plugin_registrar, quote, rustc_private)] extern crate syntax; +extern crate syntax_pos; extern crate rustc; extern crate rustc_plugin; -use syntax::codemap::Span; use syntax::parse::token::{self, str_to_ident, NtExpr, NtPat}; -use syntax::ast::{TokenTree, Pat}; +use syntax::ast::{Pat}; +use syntax::tokenstream::{TokenTree}; use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager}; use syntax::ext::build::AstBuilder; use syntax::ext::tt::macro_parser::{MatchedSeq, MatchedNonterminal}; use syntax::ext::tt::macro_parser::{Success, Failure, Error}; use syntax::ptr::P; +use syntax_pos::Span; use rustc_plugin::Registry; fn expand_mbe_matches(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree]) diff --git a/src/test/run-pass-fulldeps/auxiliary/roman_numerals.rs b/src/test/run-pass-fulldeps/auxiliary/roman_numerals.rs index 839ece49c3e..0c8af013fd1 100644 --- a/src/test/run-pass-fulldeps/auxiliary/roman_numerals.rs +++ b/src/test/run-pass-fulldeps/auxiliary/roman_numerals.rs @@ -15,14 +15,15 @@ #![feature(slice_patterns)] extern crate syntax; +extern crate syntax_pos; extern crate rustc; extern crate rustc_plugin; -use syntax::codemap::Span; -use syntax::ast::TokenTree; use syntax::parse::token; +use syntax::tokenstream::TokenTree; use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager}; use syntax::ext::build::AstBuilder; // trait for expr_usize +use syntax_pos::Span; use rustc_plugin::Registry; // WARNING WARNING WARNING WARNING WARNING diff --git a/src/test/run-pass-fulldeps/auxiliary/syntax_extension_with_dll_deps_2.rs b/src/test/run-pass-fulldeps/auxiliary/syntax_extension_with_dll_deps_2.rs index 7281698a7fb..72d26285355 100644 --- a/src/test/run-pass-fulldeps/auxiliary/syntax_extension_with_dll_deps_2.rs +++ b/src/test/run-pass-fulldeps/auxiliary/syntax_extension_with_dll_deps_2.rs @@ -15,12 +15,14 @@ extern crate syntax_extension_with_dll_deps_1 as other; extern crate syntax; +extern crate syntax_pos; extern crate rustc; extern crate rustc_plugin; -use syntax::ast::{TokenTree, Item, MetaItem}; -use syntax::codemap::Span; +use syntax::ast::{Item, MetaItem}; use syntax::ext::base::*; +use syntax::tokenstream::TokenTree; +use syntax_pos::Span; use rustc_plugin::Registry; #[plugin_registrar] diff --git a/src/test/run-pass-fulldeps/compiler-calls.rs b/src/test/run-pass-fulldeps/compiler-calls.rs index af641d717ed..ff57e9d6b73 100644 --- a/src/test/run-pass-fulldeps/compiler-calls.rs +++ b/src/test/run-pass-fulldeps/compiler-calls.rs @@ -19,11 +19,11 @@ extern crate getopts; extern crate rustc; extern crate rustc_driver; extern crate syntax; +extern crate rustc_errors as errors; use rustc::session::Session; use rustc::session::config::{self, Input}; use rustc_driver::{driver, CompilerCalls, Compilation}; -use syntax::{diagnostics, errors}; use std::path::PathBuf; @@ -35,7 +35,7 @@ impl<'a> CompilerCalls<'a> for TestCalls { fn early_callback(&mut self, _: &getopts::Matches, _: &config::Options, - _: &diagnostics::registry::Registry, + _: &errors::registry::Registry, _: config::ErrorOutputType) -> Compilation { self.count *= 2; @@ -64,7 +64,7 @@ impl<'a> CompilerCalls<'a> for TestCalls { _: &config::Options, _: &Option<PathBuf>, _: &Option<PathBuf>, - _: &diagnostics::registry::Registry) + _: &errors::registry::Registry) -> Option<(Input, Option<PathBuf>)> { panic!("This shouldn't happen"); } diff --git a/src/test/run-pass-fulldeps/qquote.rs b/src/test/run-pass-fulldeps/qquote.rs index 65c642a1eca..a4f0e35cc5a 100644 --- a/src/test/run-pass-fulldeps/qquote.rs +++ b/src/test/run-pass-fulldeps/qquote.rs @@ -13,10 +13,11 @@ #![feature(quote, rustc_private)] extern crate syntax; +extern crate syntax_pos; -use syntax::codemap::DUMMY_SP; use syntax::print::pprust::*; use syntax::parse::token::intern; +use syntax_pos::DUMMY_SP; fn main() { let ps = syntax::parse::ParseSess::new(); diff --git a/src/test/run-pass-fulldeps/quote-tokens.rs b/src/test/run-pass-fulldeps/quote-tokens.rs index 4397da35d7a..710e2fd1d07 100644 --- a/src/test/run-pass-fulldeps/quote-tokens.rs +++ b/src/test/run-pass-fulldeps/quote-tokens.rs @@ -20,8 +20,8 @@ use syntax::ptr::P; use syntax::parse::PResult; fn syntax_extension(cx: &ExtCtxt) { - let e_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, 1 + 2); - let p_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, (x, 1 .. 4, *)); + let e_toks : Vec<syntax::tokenstream::TokenTree> = quote_tokens!(cx, 1 + 2); + let p_toks : Vec<syntax::tokenstream::TokenTree> = quote_tokens!(cx, (x, 1 .. 4, *)); let a: P<syntax::ast::Expr> = quote_expr!(cx, 1 + 2); let _b: Option<P<syntax::ast::Item>> = quote_item!(cx, static foo : isize = $e_toks; ); @@ -39,7 +39,7 @@ fn syntax_extension(cx: &ExtCtxt) { let _l: P<syntax::ast::Ty> = quote_ty!(cx, &isize); - let _m: Vec<syntax::ast::TokenTree> = quote_matcher!(cx, $($foo:tt,)* bar); + let _m: Vec<syntax::tokenstream::TokenTree> = quote_matcher!(cx, $($foo:tt,)* bar); let _n: syntax::ast::Attribute = quote_attr!(cx, #![cfg(foo, bar = "baz")]); let _o: Option<P<syntax::ast::Item>> = quote_item!(cx, fn foo<T: ?Sized>() {}); diff --git a/src/test/run-pass/trait-item-inside-macro.rs b/src/test/run-pass/trait-item-inside-macro.rs new file mode 100644 index 00000000000..7c13576120b --- /dev/null +++ b/src/test/run-pass/trait-item-inside-macro.rs @@ -0,0 +1,39 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Issue #34183 + +macro_rules! foo { + () => { + fn foo() { } + } +} + +macro_rules! bar { + () => { + fn bar(); + } +} + +trait Bleh { + foo!(); + bar!(); +} + +struct Test; + +impl Bleh for Test { + fn bar() {} +} + +fn main() { + Test::bar(); + Test::foo(); +} |
