From ישיבה:
יש אומרים שאם המלאכה לא שינתה דבר בגוף החפץ, כגון שהעביר חפץ מרשות הרבים לרשות היחיד, אין על החפץ איסור, ומותר ליהנות ממנו בשבת ברשות היחיד (רבנו יונה וריטב"א). וכן הדין לגבי מאכלים שהובאו ברכב בשבת, כיוון שלא נעשה שינוי במאכלים, אין עליהם איסור. ויש אומרים (תוס', רמב"ן ורשב"א), שאין הבדל בין סוגי המלאכות, וגם אם המלאכה לא שינתה דבר במאכלים, אסור ליהנות מהמאכלים שהובאו באיסור. למעשה, לכתחילה יש להחמיר, ובשעת הדחק אפשר לסמוך על המקילים, ובמיוחד כשהדבר נעשה בשגגה.[6]
6.. לרבנו יונה וריטב"א, אם לא נעשה שינוי בגוף החפץ, אין עליו איסור 'מעשה שבת'. וכן דעת קרבן נתנאל. ולתוס', רמב"ן ורשב"א, אין להקל בזה, וכ"כ בהר צבי. ולמעשה, בשעת הצורך, כאשר המלאכה נעשתה בשגגה אפשר להקל (כך עולה מח"א ט, יא, ומ"ב שיח, ז, ובאו"ה שיח, א, 'אחת'). ובשעת הדחק, אפשר להקל גם כשהמלאכה נעשתה במזיד, הואיל ואיסור מעשה שבת דרבנן. ועיין ביבי"א י, כה. וכן הדין כאשר הביאו לחיילים אוכל על גבי רכב, שבשעת הדחק מותר לאוכלו. ואם אכילתם תגרום שימשיכו לחלל שבתות בעתיד, אין לאכלו (הצבא כהלכה לה, י). ולכל הדעות, אם הביאו במזיד פירות מחוץ לתחום (בגובה של פחות מי' טפחים), אסורים בהנאה, כמבואר בעירובין מא, ב, ושו"ע תה, ט. והטעם לרבנו יונה, משום שעשו חכמים חיזוק לדבריהם.
ובדין מלאכת גוי לכל הדעות מלאכת הוצאה חמורה כשאר המלאכות, שאם הגוי הביא עבור יהודי דבר באיסור תורה, אסור לכל ישראל ליהנות ממנו עד בכדי שיעשה במוצ"ש, כדי שלא יבואו לבקש ממנו לעשות מלאכה. ואם המלאכה אסורה מדרבנן: לאותו יהודי שעבורו נעשתה המלאכה, אסור ליהנות ממנה עד מוצ"ש בכדי שיעשו, ולשאר ישראל מותר ליהנות בשבת (שו"ע שכה, י), וכפי שמבואר לעיל כה, א.
In my own, loose translation:
Some (Rabenu Yona, Ritva) say that if the labor (m'lacha) did not change anything in the body of the object — such as if he transferred an object from the public domain to a private domain — then no prohibition attaches to the object, and he can benefit from it on Shabas, [which in the example would include benefiting] in the private domain. The same rule applies to food brought by vehicle on Shabas: since no change in the food was effected, no prohibition attaches to it. Others (Tosafos, Ramban, Rashba) say that there's no difference between the types of labor: even if the labor effected no change in the food, benefiting from the food that was brought in a forbidden way is forbidden. In practice, one should l'chat'chila be stringent, but can in a pressured situation rely on those who are lenient, especially when the labor was done accidentally (b'shogeg).[6]
[6] According to Rabenu Yona and Ritva, if no change was effected to the body of the object, no prohibition of "action of Shabas" (maase Shabas) attaches to it, and that's the view of the Korban N'san'el also. According to Tosafos, Ramban, and Rashba, one cannot be lenient with this, and likewise is written in the Har Tz'vi. In practice, in a situation of need, one can be lenient if the labor was done accidentally (b'shogeg): this is what we learn from Chaye Adam 9:11, Mishna B'rura 318:7, and Beur Halacha 318 s.v. "Achas". Even if the labor was done on purpose (b'mezid), one can be lenient in a pressured case, since the entire prohibition of "action of Shabas" is rabbinic. See Yabia Omer 10:25. This is the rule, likewise, when they've brought food via vehicle for soldiers: in a pressured case, they may eat it. But if their eating it will cause the suppliers to continue to violate future Shabasos, they shouldn't eat it (Hatzava Kahalacha 35:10). And, according to all views, if they brought, on purpose, fruits from outside the t'chum, one cannot use those fruits, as explained in Eruvin 41:2 and Shulchan Aruch 405:9.…