Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement tool_attributes feature (RFC 2103) #50030

Merged
merged 9 commits into from
May 3, 2018
Merged

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Apr 17, 2018

cc #44690

This is currently just a rebased and compiling (hopefully) version of #47773.

Let's see if travis likes this. I will add the implementation for tool_lints this week.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 17, 2018
@rust-highfive
Copy link
Collaborator

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Resolving deltas: 100% (616678/616678), completed with 4917 local objects.
---
[00:00:55] configure: rust.quiet-tests     := True
---
[00:05:13] tidy error: /checkout/src/libsyntax/attr.rs:1125: line longer than 100 chars
[00:05:13] tidy error: /checkout/src/libsyntax/attr.rs:1128: line longer than 100 chars
[00:05:15] some tidy checks failed
[00:05:15]
[00:05:15]
[00:05:15] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:05:15] expected success, got: exit code: 1
[00:05:15]
[00:05:15]
[00:05:15] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:05:15] Build completed unsuccessfully in 0:01:45
[00:05:15] make: *** [tidy] Error 1
[00:05:15] Makefile:79: recipe for target 'tidy' failed
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:16ad2bee:start=1523978430524380980,finish=1523978430531534202,duration=7153222
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:2435d030
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:2435d030:start=1523978430537857351,finish=1523978430544687599,duration=6830248
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:2a0706b6
$ dmesg | grep -i kill
[   10.757959] init: failsafe main process (1093) killed by TERM signal
[   42.095280] init: plymouth-upstart-bridge main process (510) killed by TERM signal

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@petrochenkov
Copy link
Contributor

I'll likely leave reviewing this until the next weekend.
Also there are a lot of failing tests.

I will add the implementation for tool_lints this week.

Could you leave this for a separate PR?
We need to land at least tool attributes for a start.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2018
@petrochenkov
Copy link
Contributor

Marking as waiting-on-author until tests are fixed and Travis is green.

@bors
Copy link
Contributor

bors commented Apr 21, 2018

☔ The latest upstream changes (presumably #50120) made this pull request unmergeable. Please resolve the merge conflicts.

@flip1995
Copy link
Member Author

Could you leave this for a separate PR?

Yeah sure!

Also there are a lot of failing tests.

Somehow the Spans of the MetaItems are wrong. I haven't figured out what's causing this yet.

let span = span.with_hi(segments.last().unwrap().ident.span.hi());
ast::Path { span, segments }
} else {
ident.span = span;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hack I would like to change before this PR lands, but I'm not sure what the right thing to do here would be. Apparently Token::Ident(ident, _) idents have the DUMMY_SP as their Span (Is this intended?). To create the Paths correctly we need the correct Span, which is the Span of TokenTree::Token(span, _).

But the Path(Segment)::from_ident() function only takes an Ident since the recent changes. Should I add a function Path(Segment)::from_ident_span()? Or what would be the right thing to do here?

@@ -714,6 +714,22 @@ pub trait PrintState<'a> {
Ok(())
}

fn print_attribute_path(&mut self, path: &ast::Path) -> io::Result<()> {
Copy link
Member Author

@flip1995 flip1995 Apr 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty much a copy of State::print_path, as already mentioned here comment.

Should I move the print_path method to the PrintState trait? Or use self.writer().word(&path_to_string(path))?

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:start:test_run-pass-fulldeps
Check compiletest suite=run-pass-fulldeps mode=run-pass (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:59:38] 
[00:59:38] running 88 tests
[01:01:08] ................................F.F.FF......FF....................................test [run-pass] run-pass-fulldeps/myriad-closures.rs has been running for over 60 seconds
[01:03:21] failures:
[01:03:21] 
[01:03:21] ---- [run-pass] run-pass-fulldeps/macro-crate-does-hygiene-work.rs stdout ----
[01:03:21]  
[01:03:21]  
[01:03:21] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" failed to compile: 
[01:03:21] status: exit code: 101
[01:03:21] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/macro-crate-does-hygiene-work.stage2-x86_64-unknown-linux-gnu.aux" "-Crpath" "-O" "-Zunstable-options" "--crate-type" "dylib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/macro-crate-does-hygiene-work.stage2-x86_64-unknown-linux-gnu.aux"
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] stderr:
[01:03:21] stderr:
[01:03:21] ------------------------------------------
[01:03:21] warning: unused macro definition
[01:03:21]   --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:33:1
[01:03:21]    |
[01:03:21] 33 | macro_rules! unexported_macro { () => (3) }
[01:03:21]    |
[01:03:21]    = note: #[warn(unused_macros)] on by default
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:132:28
[01:03:21]     |
[01:03:21] 132 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:138:28
[01:03:21]     |
[01:03:21] 138 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:144:28
[01:03:21]     |
[01:03:21] 144 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
---
[01:03:21] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:03:21] 
[01:03:21] ---- [run-pass] run-pass-fulldeps/macro-crate-multi-decorator-literals.rs stdout ----
[01:03:21]  
[01:03:21] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" failed to compile: 
[01:03:21] status: exit code: 101
[01:03:21] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/macro-crate-multi-decorator-literals.stage2-x86_64-unknown-linux-gnu.aux" "-Crpath" "-O" "-Zunstable-options" "--crate-type" "dylib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/macro-crate-multi-decorator-literals.stage2-x86_64-unknown-linux-gnu.aux"
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] stderr:
[01:03:21] stderr:
[01:03:21] ------------------------------------------
[01:03:21] warning: unused macro definition
[01:03:21]   --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:33:1
[01:03:21]    |
[01:03:21] 33 | macro_rules! unexported_macro { () => (3) }
[01:03:21]    |
[01:03:21]    = note: #[warn(unused_macros)] on by default
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:132:28
[01:03:21]     |
[01:03:21] 132 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:138:28
[01:03:21]     |
[01:03:21] 138 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:144:28
[01:03:21]     |
[01:03:21] 144 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error: aborting due to 3 previous errors
[01:03:21] 
[01:03:21] For more information about this error, try `rustc --explain E0308`.
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] thread '[run-pass] run-pass-fulldeps/macro-crate-multi-decorator-literals.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2956:9
[01:03:21] ---- [run-pass] run-pass-fulldeps/macro-crate-multi-decorator.rs stdout ----
[01:03:21]  
[01:03:21]  
[01:03:21] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" failed to compile: 
[01:03:21] status: exit code: 101
[01:03:21] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/macro-crate-multi-decorator.stage2-x86_64-unknown-linux-gnu.aux" "-Crpath" "-O" "-Zunstable-options" "--crate-type" "dylib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/macro-crate-multi-decorator.stage2-x86_64-unknown-linux-gnu.aux"
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] stderr:
[01:03:21] stderr:
[01:03:21] ------------------------------------------
[01:03:21] warning: unused macro definition
[01:03:21]   --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:33:1
[01:03:21]    |
[01:03:21] 33 | macro_rules! unexported_macro { () => (3) }
[01:03:21]    |
[01:03:21]    = note: #[warn(unused_macros)] on by default
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:132:28
[01:03:21]     |
[01:03:21] 132 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:138:28
[01:03:21]     |
[01:03:21] 138 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:144:28
[01:03:21]     |
[01:03:21] 144 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error: aborting due to 3 previous errors
[01:03:21] 
[01:03:21] For more information about this error, try `rustc --explain E0308`.
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] thread '[run-pass] run-pass-fulldeps/macro-crate-multi-decorator.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2956:9
[01:03:21] ---- [run-pass] run-pass-fulldeps/macro-crate.rs stdout ----
[01:03:21]  
[01:03:21]  
[01:03:21] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" failed to compile: 
[01:03:21] status: exit code: 101
[01:03:21] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/macro-crate.stage2-x86_64-unknown-linux-gnu.aux" "-Crpath" "-O" "-Zunstable-options" "--crate-type" "dylib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/macro-crate.stage2-x86_64-unknown-linux-gnu.aux"
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] stderr:
[01:03:21] stderr:
[01:03:21] ------------------------------------------
[01:03:21] warning: unused macro definition
[01:03:21]   --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:33:1
[01:03:21]    |
[01:03:21] 33 | macro_rules! unexported_macro { () => (3) }
[01:03:21]    |
[01:03:21]    = note: #[warn(unused_macros)] on by default
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:132:28
[01:03:21]     |
[01:03:21] 132 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:138:28
[01:03:21]     |
[01:03:21] 138 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:144:28
[01:03:21]     |
[01:03:21] 144 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
---
[01:03:21] thread '[run-pass] run-pass-fulldeps/macro-crate.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2956:9
[01:03:21] 
[01:03:21] ---- [run-pass] run-pass-fulldeps/plugin-lib-ok-in-plugin.rs stdout ----
[01:03:21]  
[01:03:21] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" failed to compile: 
[01:03:21] status: exit code: 101
[01:03:21] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/plugin-lib-ok-in-plugin.stage2-x86_64-unknown-linux-gnu.aux" "-Crpath" "-O" "-Zunstable-options" "--crate-type" "dylib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/plugin-lib-ok-in-plugin.stage2-x86_64-unknown-linux-gnu.aux"
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] stderr:
[01:03:21] stderr:
[01:03:21] ------------------------------------------
[01:03:21] warning: unused macro definition
[01:03:21]   --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:33:1
[01:03:21]    |
[01:03:21] 33 | macro_rules! unexported_macro { () => (3) }
[01:03:21]    |
[01:03:21]    = note: #[warn(unused_macros)] on by default
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:132:28
[01:03:21]     |
[01:03:21] 132 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:138:28
[01:03:21]     |
[01:03:21] 138 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:144:28
[01:03:21]     |
[01:03:21] 144 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error: aborting due to 3 previous errors
[01:03:21] 
[01:03:21] For more information about this error, try `rustc --explain E0308`.
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] thread '[run-pass] run-pass-fulldeps/plugin-lib-ok-in-plugin.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:2956:9
[01:03:21] ---- [run-pass] run-pass-fulldeps/plugin-plus-extern-crate.rs stdout ----
[01:03:21]  
[01:03:21]  
[01:03:21] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" failed to compile: 
[01:03:21] status: exit code: 101
[01:03:21] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--target=x86_64-unknown-linux-gnu" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/plugin-plus-extern-crate.stage2-x86_64-unknown-linux-gnu.aux" "-Crpath" "-O" "-Zunstable-options" "--crate-type" "dylib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/plugin-plus-extern-crate.stage2-x86_64-unknown-linux-gnu.aux"
[01:03:21] ------------------------------------------
[01:03:21] 
[01:03:21] ------------------------------------------
[01:03:21] stderr:
[01:03:21] stderr:
[01:03:21] ------------------------------------------
[01:03:21] warning: unused macro definition
[01:03:21]   --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:33:1
[01:03:21]    |
[01:03:21] 33 | macro_rules! unexported_macro { () => (3) }
[01:03:21]    |
[01:03:21]    = note: #[warn(unused_macros)] on by default
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:132:28
[01:03:21]     |
[01:03:21] 132 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:138:28
[01:03:21]     |
[01:03:21] 138 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
[01:03:21] 
[01:03:21] error[E0308]: mismatched types
[01:03:21]    --> /checkout/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs:144:28
[01:03:21]     |
[01:03:21] 144 |             new_it.ident = copy_name;
[01:03:21]     |
[01:03:21]     = note: expected type `syntax::ast::Ident`
[01:03:21]                found type `syntax::ast::Path`
[01:03:21] 
---
[01:03:21] test result: FAILED. 82 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out
[01:03:21] 
[01:03:21] 
[01:03:21] 
[01:03:21] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/run-pass-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-pass" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:03:21] 
[01:03:21] 
[01:03:21] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:488:22
[01:03:21] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:03:21] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:03:21] Build completed unsuccessfully in 0:22:27
[01:03:21] make: *** [check] Error 1
[01:03:21] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:032e7c58
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@flip1995
Copy link
Member Author

Travis is green now 👍
Should I squash the last 4 commits?

@petrochenkov
Copy link
Contributor

@flip1995
Could you check whether the pretty-printed test from #47773 (comment) pass now?
Pretty-printing tests are not run on CI when PR is update (they are only run on merge).

Should I squash the last 4 commits?

That's not urgent, but we'll need to squash at least before merging.

@flip1995
Copy link
Member Author

Running ./x.py test src/test/run-pass-fulldeps/pretty gives me no errors.

@petrochenkov
Copy link
Contributor

@flip1995

Apparently Token::Ident(ident, _) idents have the DUMMY_SP as their Span (Is this intended?). To create the Paths correctly we need the correct Span, which is the Span of TokenTree::Token(span, _).

What do you mean by "to create the Paths correctly"?
If paths are created with dummy spans, then nothing bad should happen except for possibly mislocated diagnostics.

If ident.span from Token::Ident doesn't have a useful location and span from TokenTree::Token has useful location, then we need to create paths using ident.with_span_pos(span) as Path(Segment)::from_ident() argument.
Thus we keep the original hygienic context from ident while possibly gaining more useful location for diagnostics from span.

@petrochenkov
Copy link
Contributor

Tentatively r=me after replacing Ident::new with ident.with_span_pos and squashing.

@bors
Copy link
Contributor

bors commented Apr 30, 2018

☔ The latest upstream changes (presumably #50317) made this pull request unmergeable. Please resolve the merge conflicts.

@flip1995
Copy link
Member Author

What do you mean by "to create the Paths correctly"?

The Paths were created with the DUMMY_SPs, which lead to errors in almost every ui test with attributes.

then we need to create paths using ident.with_span_pos(span) as Path(Segment)::from_ident() argument.

Thanks! I missed this method!

@flip1995
Copy link
Member Author

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Apr 30, 2018

@flip1995: 🔑 Insufficient privileges: Not in reviewers

@petrochenkov petrochenkov changed the title WIP: Implement tool_attributes feature (RFC 2103) Implement tool_attributes feature (RFC 2103) Apr 30, 2018
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 30, 2018

📌 Commit 28bbd40 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 30, 2018
@bors
Copy link
Contributor

bors commented May 1, 2018

⌛ Testing commit 28bbd404b2fe4f0374f6c2cf50d9250494e1e1ca with merge 1ca0804c053742f49b8a8fd270d9c64261963e9f...

@bors
Copy link
Contributor

bors commented May 2, 2018

📌 Commit 84f4508 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 2, 2018
@bors
Copy link
Contributor

bors commented May 2, 2018

⌛ Testing commit 84f4508 with merge e487a7ca907bcc41eca1a810515c75ab458196cc...

@bors
Copy link
Contributor

bors commented May 3, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 3, 2018
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@kennytm
Copy link
Member

kennytm commented May 3, 2018

@bors retry p=34 #43283

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2018
@bors
Copy link
Contributor

bors commented May 3, 2018

⌛ Testing commit 84f4508 with merge d68b0ec...

bors added a commit that referenced this pull request May 3, 2018
Implement tool_attributes feature (RFC 2103)

cc #44690

This is currently just a rebased and compiling (hopefully) version of #47773.

Let's see if travis likes this. I will add the implementation for `tool_lints` this week.
@bors
Copy link
Contributor

bors commented May 3, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing d68b0ec to master...

@bors bors merged commit 84f4508 into rust-lang:master May 3, 2018
@flip1995 flip1995 deleted the rfc2103 branch May 6, 2018 13:04
bradjc added a commit to tock/tock that referenced this pull request Jun 24, 2018
bradjc added a commit to tock/tock that referenced this pull request Jul 6, 2018
Centril added a commit to Centril/rust that referenced this pull request Mar 10, 2019
Do not accidentally treat multi-segment meta-items as single-segment

Fixes rust-lang#55168 and many other regressions from rust-lang#50030

Basically, attributes like `#[any::prefix::foo]` were commonly interpreted as `#[foo]` due to `name()` successfully returning the last segment (this applies to nested things as well `#[attr(any::prefix::foo)]`).
Centril added a commit to Centril/rust that referenced this pull request Mar 13, 2019
Do not accidentally treat multi-segment meta-items as single-segment

Fixes rust-lang#55168 and many other regressions from rust-lang#50030

Basically, attributes like `#[any::prefix::foo]` were commonly interpreted as `#[foo]` due to `name()` successfully returning the last segment (this applies to nested things as well `#[attr(any::prefix::foo)]`).
bors added a commit that referenced this pull request Mar 16, 2019
Do not accidentally treat multi-segment meta-items as single-segment

Fixes #55168 and many other regressions from #50030

Basically, attributes like `#[any::prefix::foo]` were commonly interpreted as `#[foo]` due to `name()` successfully returning the last segment (this applies to nested things as well `#[attr(any::prefix::foo)]`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants