-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Sidestep link error from rustfix'ed code by using a *defined* static. #55719
Sidestep link error from rustfix'ed code by using a *defined* static. #55719
Conversation
As a drive-by, added `-g` to the compile-flags so that the test more reliably fails to compile when the extern static in question is *not* provided. (I.e. this is making the test more robust in the face of potential future revisions.) Fix rust-lang#54388.
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ rollup |
📌 Commit e7f8c0d has been approved by |
@bors r- Failed in the rollup #55746 (comment) for Error message---- [ui] ui/extern/extern-const.rs stdout ----
diff of stderr:
4 LL | const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`
5 | ^^^^^ help: try using a static value: `static`
6
- error: aborting due to previous error
+ error[E0412]: cannot find type `c_int` in module `libc`
+ --> $DIR/extern-const.rs:15:38
+ |
+ LL | const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`
+ | ^^^^^ not found in `libc`
+ help: possible candidate is found in another module, you can import it into scope
+ |
+ LL | use std::os::raw::c_int;
+ |
8
+ error: aborting due to 2 previous errors
+
+ For more information about this error, try `rustc --explain E0412`.
9
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/extern/extern-const/extern-const.stderr
diff of fixed:
10 #![feature(libc)]
11 extern crate libc;
12
+ use std::os::raw::c_int;
+
13 #[link(name = "rust_test_helpers", kind = "static")]
14 extern "C" {
15 static rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`
The actual fixed differed from the expected fixed. |
Probably not. But I'm pretty sure So I think I'll just add a |
(marking as Work-In-Progress while dafd2e8 gets tested...) |
dafd2e8
to
34ffbdb
Compare
@bors r=alexcrichton rollup |
📌 Commit 34ffbdb has been approved by |
…error-from-rustfixed-code, r=alexcrichton Sidestep link error from rustfix'ed code by using a *defined* static. As a drive-by, added `-g` to the compile-flags so that the test more reliably fails to compile when the extern static in question is *not* provided. (I.e. this is making the test more robust in the face of potential future revisions.) Fix rust-lang#54388.
…error-from-rustfixed-code, r=alexcrichton Sidestep link error from rustfix'ed code by using a *defined* static. As a drive-by, added `-g` to the compile-flags so that the test more reliably fails to compile when the extern static in question is *not* provided. (I.e. this is making the test more robust in the face of potential future revisions.) Fix rust-lang#54388.
Rollup of 17 pull requests Successful merges: - #55576 (Clarify error message for -C opt-level) - #55633 (Support memcpy/memmove with differing src/dst alignment) - #55638 (Fix ICE in msg_span_from_free_region on ReEmpty) - #55659 (rustc: Delete grouping logic from the musl target) - #55719 (Sidestep link error from rustfix'ed code by using a *defined* static.) - #55736 (Elide anon lifetimes in conflicting impl note) - #55739 (Consume optimization fuel from the MIR inliner) - #55742 (Avoid panic when matching function call) - #55753 (borrow_set: remove a helper function and a clone it uses) - #55755 (Improve creation of 3 IndexVecs) - #55758 ([regression - rust2018]: unused_mut lint false positives on nightly) - #55760 (Remove intermediate font specs) - #55761 (mir: remove a hacky recursive helper function) - #55774 (wasm32-unknown-emscripten expects the rust_eh_personality symbol) - #55777 (Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.) - #55783 (Deprecate mpsc channel selection) - #55788 (rustc: Request ansi colors if stderr isn't a tty) Failed merges: r? @ghost
As a drive-by, added
-g
to the compile-flags so that the test morereliably fails to compile when the extern static in question is not
provided. (I.e. this is making the test more robust in the face of
potential future revisions.)
Fix #54388.